Hello,
Plugin I am using generated class files that then I use in my project. What I would like to do though is to take these generated classes and package them into a Jar for distribution. So other projects don’t need to go through the same process of generating these class files.
What I tried is:
tasks.register('classJar', Jar) {
dependsOn tasks.assemble
doLast {
from layout.buildDirectory.dir("classes/java/main/api/trc/").collect {
zipTree(it)
}
}
}
But it doesn’t work, am I totally on the wrong track or there is just a minor mistake here?
Tried also this:
FileFilter fileFilter = new FileFilter() {
@Override
boolean accept(File pathname) {
return pathname.isFile()
}
}
archiveFileName = "myCustom.jar"
from file("$buildDir/classes/java/main/api/trc/").listFiles(fileFilter).sort().collect() {
zipTree(it)
}
Above, I am not entirely sure how to assign this archiveFileName
to the actual Jar I Want to make, found this in some example that in the meantime I can’t find anymore…