My sources are in a folder structure like:
mygitroot/myproj/module1/src/main/groovy/com/mypak/module1 mygitroot/myproj/module2/src/main/groovy/com/mypak/module2 mygitroot/myproj/module3/src/main/groovy/com/mypak/module3
Gradle builds the jars in a folder structure like:
mygitroot/myproj/build/libs/module1.jar mygitroot/myproj/build/libs/module2.jar mygitroot/myproj/build/libs/module3.jar
I want it to output to the default dynamic folder structure, just rooted to a different "nongitroot" folder:
mybuildroot/myproj/build/libs/module1.jar mybuildroot/myproj/build/libs/module2.jar mybuildroot/myproj/build/libs/module3.jar
my task says this:
task sourcesJar(type: Jar) {
group 'Build'
description 'An archive of the source code'
classifier 'sources'
from sourceSets.main.allSource
}
Is there an elegant way to change just the root?