Re: [gradle-dev] dependency resolving

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

Re: [gradle-dev] dependency resolving

hans_d
Administrator
I reply on the user list as this topic belong there.

On Jun 2, 2008, at 8:30 PM, JerodLass wrote:

>
> I have a project (rather, a set of projects) in the structure:
> -Dprojectcategory
>   -Dproject1
>     -Dsrc
>       -Dmain
>         ..
>       ..
>     ..
>   -Dproject2
>     -Dsrc
>       -Dmain
>         ..
>       ..
>     ..
>   -Dcommon-files
>     -Dlib
>       ..
>     ..
>
> I'm trying to build these projects using gradle (just project1 for  
> now, but
> you may hear more from me later), and I need to resolve  
> dependencies on the
> jars in common-files/lib, which do not all have versioning  
> information.
> What would be the best way to go about this?
>
> Options:
> -The ClientModule resolver doesn't seem to be doing much at all
> -Default build-resolver checks [group]/[name]/[version]/[type] for  
> the jar.
> Remapping this to a specific directory or adding it to a classpath  
> somewhere
> may work.
> -The flatDirResolver can get to the directory and find a jar with a
> specified version number, but for non-versioned jars it blanks  
> because of a
> concatenated -.

dependencies {
    addFlatDirResolver('common', new File(rootDir, 'common-files/
lib')).addArtifactPattern('[artifact].[ext]')
}

This should do the job. I had no time to try this out though.

The addFlatDirResolver return an Ivy object of type  
FileSystemResolver. addArtifactPattern is a method of this type.

- Hans

>
> Any thoughts on this issue would be much appreciated.
> --
> View this message in context: http://www.nabble.com/dependency- 
> resolving-tp17607356p17607356.html
> Sent from the gradle-dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: [gradle-dev] dependency resolving

JerodLass
Got it working, thanks a lot!

Now for a lower level question...

I have built this project successfully with gradle's assumed directory structure (source in src/main/java), but eventually I want to move from that and have my source just in the source root (src) directory, and now is as good a time as any.  I cannot change srcRoot as it is read-only, so I have changed the srcDirNames property to reflect this change:

srcDirNames = ['src']

Unfortunately, it still isn't compiling anything(as I moved the src/main/java/ source to src/ and deleted main/.  I apologize if this isn't a very interesting question, but I'm new to build systems in general.  Luckily, I can now use gradle instead of drowning in xml...

Again, any help would be greatly appreciated.

-Jerod
Reply | Threaded
Open this post in threaded view
|

Re: [gradle-dev] dependency resolving

hans_d
Administrator

On Jun 3, 2008, at 6:11 PM, JerodLass wrote:

>
> Got it working, thanks a lot!
>
> Now for a lower level question...
>
> I have built this project successfully with gradle's assumed directory
> structure (source in src/main/java), but eventually I want to move  
> from that
> and have my source just in the source root (src) directory, and now  
> is as
> good a time as any.  I cannot change srcRoot as it is read-only, so  
> I have
> changed the srcDirNames property to reflect this change:
>
> srcDirNames = ['src']

The approach is exactly the right one. But as srcDirNames are  
appended to srcRoot, Gradle looks in src/src in the case of the  
settings above. Therefore srcDirNames = [''] should do the job.

- Hans

>
> Unfortunately, it still isn't compiling anything.  I apologize if  
> this isn't
> a very interesting question, but I'm new to build systems in general.
> Luckily, I can now use gradle instead of drowning in xml...
>
> Again, any help would be greatly appreciated.
>
> -Jerod
> --
> View this message in context: http://www.nabble.com/Re%3A--gradle- 
> dev--dependency-resolving-tp17624806p17627351.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: [gradle-dev] dependency resolving

JerodLass
That worked, I appreciate your help.  I could swear I tried that because it says plainly that srcDirNames is relative to srcRoot in the user guide, but I was trying all kinds of stuff without organizing any of it so I probably had another problem at the same time.  At any rate, it's finding the files now, so thanks a lot!

hdockter wrote
On Jun 3, 2008, at 6:11 PM, JerodLass wrote:

>
> Got it working, thanks a lot!
>
> Now for a lower level question...
>
> I have built this project successfully with gradle's assumed directory
> structure (source in src/main/java), but eventually I want to move  
> from that
> and have my source just in the source root (src) directory, and now  
> is as
> good a time as any.  I cannot change srcRoot as it is read-only, so  
> I have
> changed the srcDirNames property to reflect this change:
>
> srcDirNames = ['src']

The approach is exactly the right one. But as srcDirNames are  
appended to srcRoot, Gradle looks in src/src in the case of the  
settings above. Therefore srcDirNames = [''] should do the job.

- Hans

>
> Unfortunately, it still isn't compiling anything.  I apologize if  
> this isn't
> a very interesting question, but I'm new to build systems in general.
> Luckily, I can now use gradle instead of drowning in xml...
>
> Again, any help would be greatly appreciated.
>
> -Jerod
> --
> View this message in context: http://www.nabble.com/Re%3A--gradle- 
> dev--dependency-resolving-tp17624806p17627351.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: [gradle-dev] dependency resolving

Russel Winder-2
In reply to this post by hans_d
Hans,

On Tue, 2008-06-03 at 18:25 +0200, Hans Dockter wrote:

> The approach is exactly the right one. But as srcDirNames are  
> appended to srcRoot, Gradle looks in src/src in the case of the  
> settings above. Therefore srcDirNames = [''] should do the job.

So that means I cannot have my source in a directory called Source, I
have to have src?

--
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [gradle-dev] dependency resolving

JerodLass
The way I understand it, src is just the default srcRoot, and srcDirNames is a list of places under the srcRoot directory that it looks for files.  It sounds like you want to change the srcRoot directory.  I would try something like

srcRootName = 'Source'

Since the default value of srcRootName is 'src'.  Hope this helps.

-Jerod


Russel Winder-4 wrote
Hans,

On Tue, 2008-06-03 at 18:25 +0200, Hans Dockter wrote:

> The approach is exactly the right one. But as srcDirNames are  
> appended to srcRoot, Gradle looks in src/src in the case of the  
> settings above. Therefore srcDirNames = [''] should do the job.

So that means I cannot have my source in a directory called Source, I
have to have src?

--
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077