Just to clarify...
Ideally I think it would be best if Gradle itself just transparently
handled project(':hibernate-core') as a configuration dependency to mean
"use the sourceSet as dep" but still generated the upload poms
correctly.
But it does not do that currently. Mainly I did this to get (imo)
better compilation plans. Currently, say you define the dep as just the
project. When you compile, gradle will need to not only comp[ile the
dep, but also run its jar task to generate the jar to be the target of
the dep. The strategy below gets around the need to jar.
On Thu, 2010-02-04 at 09:58 -0600, Steve Ebersole wrote:
> I have not tried this yet in terms of building a release (so I do not
> know how it plays out in the generated poms). But here is an example of
> how I specify it in my Hibernate-gradle prototype (props to Hans, Jason,
> and Adam for helping me discover this):
>
> dependencies {
> compile (
>
> this.project(':hibernate-core').sourceSets.main.runtimeClasspath,
> [group: 'junit', name: 'junit', version: junitVersion]
> )
> }
>
> On Thu, 2010-02-04 at 07:06 -0800, merscwog wrote:
> >
> > MartyMcFly wrote:
> > >
> > > It directly converts dependencies in your workspace to project
> > > dependencies if these projects exists. If the project does not exists, it
> > > uses the jar from the repo.
> > >
> > > I was wondering if this behaviour is cloneable in gradle with the concept
> > > of configurations.
> > >
> >
> > This is a very powerful concept, and I've wondered whether gradle would
> > support it eventually.
> >
> > There are some issues to consider, but if it really is an accepted idiom,
> > then it is worthy of consideration. Ideally there would be some way to
> > specify a dependency as a regular project() like now that says, I need it
> > available locally for things to work, and a remotableProject() that tries to
> > find it locally, but digs up things in a repository otherwise.
> >
> > Along a similar vein, I was hoping at some point for there to be
> > optionalProject() or optionalDependency() that says to include it in the
> > dependencies it if it can find it, and set some variable that can be used to
> > determine things like conditional compilation (exclusion usually) or other
> > behavior.
> >
> > -Spencer
> >
> > -Spencer
--
Steve Ebersole <[email protected]>
Hibernate.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email