Bit of confusion on source compile dependencies

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Bit of confusion on source compile dependencies

Sam Hokin-3
Hiyaz! I want to compile my sources (I have many) against a class that is defined in a single source under legfed-datastore, which
is here in my source tree:

./legfed-bio-sources/legfed-datastore/src/main/java/org/intermine/bio/dataconversion/DatastoreUtils.java

All my other sources are under legfed-bio-sources, for example

legfed-bio-sources/legfed-fasta/legfed-fasta.properties

Now the LegfedFastaLoaderTask defined under the above uses DatastoreUtils.isSupercontig(). I'd rather only have that class defined
in one place. I thought I could add that as a compile.dependency in legfed-fasta.properties:

compile.dependencies = legfed-datastore/main

But I can't seem to come up with the right combination of slashes and such to make it compile. How should I reference
legfed-datastore so I can get my other sources to compile against it? I've also tried:

compile.dependencies = org.intermine.bio.dataconversion.DatastoreUtils

But no go.
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Bit of confusion on source compile dependencies

joe carlson
Hi Sam,

You’re using gradle, right? Don’t you want to add the source path to sourceSets { main { java { srcDirs… in build.gradle in each source’s directory?

(Of course I haven’t tried this. That’s why it works.)

Joe

> On Aug 29, 2019, at 3:42 PM, Sam Hokin <[hidden email]> wrote:
>
> Hiyaz! I want to compile my sources (I have many) against a class that is defined in a single source under legfed-datastore, which is here in my source tree:
>
> ./legfed-bio-sources/legfed-datastore/src/main/java/org/intermine/bio/dataconversion/DatastoreUtils.java
>
> All my other sources are under legfed-bio-sources, for example
>
> legfed-bio-sources/legfed-fasta/legfed-fasta.properties
>
> Now the LegfedFastaLoaderTask defined under the above uses DatastoreUtils.isSupercontig(). I'd rather only have that class defined in one place. I thought I could add that as a compile.dependency in legfed-fasta.properties:
>
> compile.dependencies = legfed-datastore/main
>
> But I can't seem to come up with the right combination of slashes and such to make it compile. How should I reference legfed-datastore so I can get my other sources to compile against it? I've also tried:
>
> compile.dependencies = org.intermine.bio.dataconversion.DatastoreUtils
>
> But no go.
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Bit of confusion on source compile dependencies

Daniela Butano-2
Hi Sam,

I suppose that legfed-datastore and legfed-fasta are gradle projects
defined under legfed-bio-sources. This means that there is a file
legfed-bio-source/settings.gradle which contains something like that:

rootProject.name = 'bio-sources-legfed'
include ':bio-source-datastore',
':bio-source-fasta'

project(':bio-source-datastore').projectDir = new File(settingsDir,
'./legfed-datastore')
project(':bio-source-fasta').projectDir = new File(settingsDir,
'./legfed-fasta')

If so, you can simply add the dependency on the bio-source-datastore
adding in the legfed-fasta/build.gradle file:

dependencies {
     compile project(':bio-souce-datastore')

Daniela

On 30/08/2019 02:07, Joe Carlson wrote:

> Hi Sam,
>
> You’re using gradle, right? Don’t you want to add the source path to sourceSets { main { java { srcDirs… in build.gradle in each source’s directory?
>
> (Of course I haven’t tried this. That’s why it works.)
>
> Joe
>
>> On Aug 29, 2019, at 3:42 PM, Sam Hokin <[hidden email]> wrote:
>>
>> Hiyaz! I want to compile my sources (I have many) against a class that is defined in a single source under legfed-datastore, which is here in my source tree:
>>
>> ./legfed-bio-sources/legfed-datastore/src/main/java/org/intermine/bio/dataconversion/DatastoreUtils.java
>>
>> All my other sources are under legfed-bio-sources, for example
>>
>> legfed-bio-sources/legfed-fasta/legfed-fasta.properties
>>
>> Now the LegfedFastaLoaderTask defined under the above uses DatastoreUtils.isSupercontig(). I'd rather only have that class defined in one place. I thought I could add that as a compile.dependency in legfed-fasta.properties:
>>
>> compile.dependencies = legfed-datastore/main
>>
>> But I can't seem to come up with the right combination of slashes and such to make it compile. How should I reference legfed-datastore so I can get my other sources to compile against it? I've also tried:
>>
>> compile.dependencies = org.intermine.bio.dataconversion.DatastoreUtils
>>
>> But no go.
>> _______________________________________________
>> dev mailing list
>> [hidden email]
>> https://lists.intermine.org/mailman/listinfo/dev
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Bit of confusion on source compile dependencies

Daniela Butano-2
Or, even better, if all the bio-source projects depends on
bio-source-datastore, you can edit the legfed-bio-sources/build.gradle
file adding the dependency to all the projects

subprojects {
   if (it.name != 'bio-source-datastore') {
       dependencies {compile project(':bio-source-datastore')}
   }

}

On 30/08/2019 09:49, Daniela Butano wrote:

> Hi Sam,
>
> I suppose that legfed-datastore and legfed-fasta are gradle projects
> defined under legfed-bio-sources. This means that there is a file
> legfed-bio-source/settings.gradle which contains something like that:
>
> rootProject.name = 'bio-sources-legfed'
> include ':bio-source-datastore',
> ':bio-source-fasta'
>
> project(':bio-source-datastore').projectDir = new File(settingsDir,
> './legfed-datastore')
> project(':bio-source-fasta').projectDir = new File(settingsDir,
> './legfed-fasta')
>
> If so, you can simply add the dependency on the bio-source-datastore
> adding in the legfed-fasta/build.gradle file:
>
> dependencies {
>     compile project(':bio-souce-datastore')
>
> Daniela
>
> On 30/08/2019 02:07, Joe Carlson wrote:
>> Hi Sam,
>>
>> You’re using gradle, right? Don’t you want to add the source path to
>> sourceSets { main { java { srcDirs… in build.gradle in each source’s
>> directory?
>>
>> (Of course I haven’t tried this. That’s why it works.)
>>
>> Joe
>>
>>> On Aug 29, 2019, at 3:42 PM, Sam Hokin <[hidden email]> wrote:
>>>
>>> Hiyaz! I want to compile my sources (I have many) against a class
>>> that is defined in a single source under legfed-datastore, which is
>>> here in my source tree:
>>>
>>> ./legfed-bio-sources/legfed-datastore/src/main/java/org/intermine/bio/dataconversion/DatastoreUtils.java
>>>
>>>
>>> All my other sources are under legfed-bio-sources, for example
>>>
>>> legfed-bio-sources/legfed-fasta/legfed-fasta.properties
>>>
>>> Now the LegfedFastaLoaderTask defined under the above uses
>>> DatastoreUtils.isSupercontig(). I'd rather only have that class
>>> defined in one place. I thought I could add that as a
>>> compile.dependency in legfed-fasta.properties:
>>>
>>> compile.dependencies = legfed-datastore/main
>>>
>>> But I can't seem to come up with the right combination of slashes
>>> and such to make it compile. How should I reference legfed-datastore
>>> so I can get my other sources to compile against it? I've also tried:
>>>
>>> compile.dependencies = org.intermine.bio.dataconversion.DatastoreUtils
>>>
>>> But no go.
>>> _______________________________________________
>>> dev mailing list
>>> [hidden email]
>>> https://lists.intermine.org/mailman/listinfo/dev
>> _______________________________________________
>> dev mailing list
>> [hidden email]
>> https://lists.intermine.org/mailman/listinfo/dev
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Bit of confusion on source compile dependencies

Sam Hokin-3
NICE!!!!!!!!!!!!

On 8/30/19 2:57 AM, Daniela Butano wrote:
> Or, even better, if all the bio-source projects depends on bio-source-datastore, you can edit the legfed-bio-sources/build.gradle
> file adding the dependency to all the projects
>
> subprojects {
>    if (it.name != 'bio-source-datastore') {
>        dependencies {compile project(':bio-source-datastore')}
>    }
>
> }
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev