For background, this is related to this discussion
http://in.relation.to/Bloggers/SimultaneouslySupportingJDBC3AndJDBC4WithMaven
So you said that inter-project dependencies use the jar file *by
default*. So it sounds like that is at least changeable in some
fashion. In the ideal world, I'd set this up such that my CORE project
is *compiled* first, then the 2 JDBC modules are compiled against the
classes just compiled from CORE; and then going back to CORE I'd do the
jar packaging including the classes from CORE as well as the 2 JDBC
projects/modules. Is something like that achievable using gradle? I
currently use maven and the trouble there is that maven performs all
"phases" on each project/module before moving on to the next
project/module.
On Tue, 2009-10-06 at 21:22 +1100, Adam Murdoch wrote:
>
> Steve Ebersole wrote:
> > I am curious whether Gradle offers a solution to the problem of
> > compiling against different JDKs but including the compiled classes into
> > a single jar.
> >
> > I assume the different JDKs would need to be isolated into different
> > modules, at least that's how I best see this operating with IDEs. So
> > then is it possible to have 2 modules that depend on a 3rd for
> > compilation but where classes are bundled into the artifact from that
> > 3rd?
> >
>
> Yes. Though, it is complicated a bit by the fact that inter-project (ie
> inter-module) dependencies use the jar file by default. So the 2
> projects would depend on the jar from the 3rd, which would in turn
> depend on the classes from the 2 projects.
>
> This isn't a big deal, you could do something like:
>
> project 1 & 2
>
> dependencies {
> compile { project('project3').sourceSets.main.classes }
> }
>
> project 3:
>
> jar {
> from { project('project1').sourceSets.main.classes }
> from { project('project2').sourceSets.main.classes }
> }
>
> You could also do a similar thing with some custom configurations.
>
> Some other options:
>
> - Add a second jar file to project 3 which contains all the classes.
> - Add a fourth project which aggregates the 3 other projects.
> - Use a single project, and use a source set for each java version.
>
--
Steve Ebersole <[email protected]>
Hibernate.org
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email