Hi all,

I've just spent my first day or two using Gradle, and before I go
futher, I just want to say _Thank You_.  It is a superb tool, and I
love how groovy's elegant simplicity makes build environments
(especially multi-project environments) much more tolerable.
Thanks!!!

Now my question:

I've been racking my brain on this problem for the last few hours, and
after feeling like I've memorized the user guide, I still can't figure
out the solution.  Hopefully you can enlighten me.

I have a project with sub-projects (I call a sub-project a 'module' below):

greatProduct
| -- moduleA
| -- moduleB
...
| -- build.gradle
| -- settings.gradle

When I run 'gradle libs', what I want generated, for each module, is
the following,

moduleA/build/greatProduct-moduleA-0.1.0-SNAPSHOT.jar
moduleB/build/greatProduct-moduleB-0.1.0-SNAPSHOT.jar
...
and so on, for each module.  Currently the two sub-projects don't have
a build.gradle file.

So, right now, I can't for the life of me get it to build anything
other than the following:

moduleA/build/moduleA-0.1.0.jar
moduleB/build/moduleB-0.1.0.jar

I'm putting the logic to append the -SNAPSHOT designator, as well as
to do the artifact renaming (and manifest name changes) in the init
method.  This isn't working.  Any reason why?  Any help is _sincerely_
appreciated!

Thanks!

Here is my relevant part of the master build.gradle file:
---------------------------------------------

dependsOnChildren()

productName = "greatProduct"
majorVersion = 0
minorVersion = 1
patchVersion = 0
snapshotDesignation = "-SNAPSHOT"
version = majorVersion + "." + minorVersion + "." + patchVersion

//we use Nexus as our internal company artifact repository:
artifactRepositoryRoot = "http://ourNexusHost:8080/nexus/content/repositories";

subprojects {

 usePlugin("java")

 dependencies {
 addMavenStyleRepo("snapshots", artifactRepositoryRoot + "/snapshots")
 addMavenStyleRepo("thirdparty", artifactRepositoryRoot + "/thirdparty")
 addMavenStyleRepo("releases", artifactRepositoryRoot + "/releases")
 addMavenStyleRepo("public", artifactRepositoryRoot + "/central")
 }

 /**
 * Initialization task
 */
 createTask("init", overwrite: true) {task ->
 archivesBaseName = "$productName-$task.project.name"

 //modify the version to be a snapshot if this isn't a release build:
 if (!build.taskGraph.hasTask(":release") &&
!version.endsWith(snapshotDesignation)) {
   version += snapshotDesignation;
 }

 manifest.mainAttributes(['Implementation-Title':
"$archivesBaseName",'Implementation-Version': "$version"])
 }

 resources.excludes("**/*.java")

 sourceCompatibility = 1.5
 targetCompatibility = 1.5
 test {
 include '**/*Test.class'
 exclude '**/Abstract*'
 }
}

//project dependencies below here

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

    http://xircles.codehaus.org/manage_email


Reply via email to