TheKaptain wrote:
>
> There's just a slight difference in the syntax between what you're trying
> to do (add a new Task named jar) and configuring an existing one. If you
> want to configure the one provided by default by the Java plugin, here's
> the syntax:
> jar {
> baseName = 'core'
> dependsOn classes
> from sourceSets.main.classes
> exclude('net/intellidata/core/**/*Impl*')
> }
>
> Hope that helps!
>
I hesitate to resurrect this old thread, but I'm running into troubles
trying something related to this. I'm attempting to have the standard jar
task only include Java classes, rather than also including resources
directly in the jar file.
As such, I'm trying this:
subprojects {
jar {
dependsOn classes
from sourceSets.main.classes
include '**/*.class'
}
}
We have a few subprojects, but the three that are involved in this are:
Common <- Server <- Simulator
Where the <- indicates a compile dependency. Without the declaration above,
tests work correctly. Adding that declaration, unit tests fail to see
Server/src/main/resources files on the classpath.
We've taken to using this workaround, but this seems like a major hack:
test.doFirst {
sourceSets.test.runtimeClasspath +=
files(project(':Server').sourceSets.main.resources)
}
Any idea why this is happening? Any suggestions how to handle this better?
--
View this message in context:
http://gradle.1045684.n5.nabble.com/How-to-exclude-some-classes-from-jar-tp3315811p4644414.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