Ok, my company is currently using ant as our primary build tool. Yes, ant,
not maven... lol. Anyway, I'm working on some prototyping work to try to
get us up to a more modern standard, Gradle being the recommendation I've
gotten.
So - We've got a particular use case that seems to be somewhat unusual, and
I haven't been able to find anything similar in the user guide or by
searching this forum.
Basically, for one of our projects, we have some classes that are split out
into separate jars and NOT included in the main jar file for the project;
these excluded classes are then included in separate sub-jars for deployment
to clients who have purchased the use of each sub-module. There are about
40 sub-modules to go along with the main core.jar file... I've truncated the
following for brevity.
The ant equivalent of what I'm trying to do is as follows:
<target name="jar" depends="compile">
<jar jarfile="${dist.dir}/core.jar" manifest="manifest">
<fileset dir="${classes.dir}">
<exclude name="**/*Impl.class" />
</fileset>
</jar>
<jar jarfile="${dist.dir}/ccs.jar" manifest="manifest">
<fileset dir="${classes.dir}">
<include name="**/CCSFamilyUtilImpl.class" />
<include name="**/CCSQueryUtilImpl.class" />
</fileset>
</jar>
</target>
A direct example of how to do this in Gradle would be greatly appreciated;
nearly as greatly appreciated would be a link to a similar example somewhere
online. Note: I did see how to create jars that include specific classes,
but I'm not having any luck a primary jar that excludes some classes.
What I've got (this doesn't work because a task with name 'jar' already
exists... apparently you can't override):
project(':api:core') {
version = 1.0
configurations {
core
}
dependencies {
compile project(':api:schema')
compile project(':api:util')
}
task jar(type: Jar) {
baseName = 'core'
dependsOn classes
from sourceSets.main.classes
exclude('net/intellidata/core/**/*Impl*')
}
}
I appreciate any help I can get on this,
Brian Trezise
Staff Software Engineer
IntelliData, Inc
--
View this message in context:
http://gradle.1045684.n5.nabble.com/How-to-exclude-some-classes-from-jar-tp3315811p3315811.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