On Oct 21, 2008, at 4:40 PM, mvlcek wrote:

Now for the jar task:

Thanks to Hans I found two ways to do it, one of them is:

dists { jar(appendix: 'client') { dependsOn 'clientCompile' fileSet (dir: new File(buildDir, 'client-classes')) } }
Disadvantages, however, are:

there seems to be a hidden dependency to war (I'm using the War- Plugin), so compile, test and war tasks are performed, even if I just wanted to rebuild the client jar (gradle archive_client_jar)

The Bundle task (dists) has a 'childrenDependOn' property. This is added by default to the archive tasks created for this bundle. Saying:

jar() {
   dependsOn 'x'
}

adds 'x' to the set of dependsOn tasks of the jar tasks. Using dependsOn = ['x'] would override the childrenDependOn property.

I can't set a custom jar name like myClient-<version>.jar, it will always be <archiveBaseName>-<appendix>-<version>.jar

The task name is fixed, as you have described. And the jar created by this task uses the task name settings as default. But you can override this:

jar() {
   baseName = 'a'
   version = 'b'
   extension = 'myext'
   // alternatively you can set customName = "the_complete_jar_name"
}

Some of our Javadoc is really good. Some other is completely missing. One reason for this is that we still use some Groovy classes in our core. And the Groovydoc tool does not the job yet properly. Basically you have to look in the source code to learn some more about the tasks. I hope we can complete our javadoc rather soon.

the task is based on the jar name - as I have multiple projects, I always want to have the same call, e.g. "gradle client" independent of the actual name of the client jar

You could do:

jar(baseName: 'client') {

}

This should create a jar task with the name client_jar.

Or you could have a wrapper task in each project called 'client' which depends on the actual jar task.

I'm not saying that the above is an perfect API. One of our big tasks before a 1.0 is to optimize the API. So any improvement proposals are very much appreciated.

- Hans

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





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

   http://xircles.codehaus.org/manage_email


Reply via email to