问题
I have an application that is built with a build script named linuxApp.gradle. We have specified in settings.gradle
rootProject.name = "JobThreader"
As long as the root project folder is also named "JobThreader", when we execute the installApp task from the application plugin, the application is built to
JobThreader/build/install/JobThreader
However, if the root project folder is any other name, like "workspace" in the case of Jenkins, then the application is built to
workspace/build/install/workspace
We have verified this behavior both on our Linux Jenkins server and our local Windows machine.
We have attempted the following commands with identical results
gradlew clean installApp -b linuxApp.gradle
gradlew clean installApp -b linuxApp.gradle -c settings.gradle
How can we get the application to install to workspace/build/install/JobThreader in our Jenkins example?
回答1:
When -b
is used, any settings script will be ignored. (-b
can be useful for experimentation, but isn't typically used for real builds.) When -b
is not used and a settings script is found or passed explicitly via -c
, it's up to that settings script to configure the names of build scripts. For example:
rootProject.buildFileName = "linuxApp.gradle"
来源:https://stackoverflow.com/questions/21459924/application-of-settings-gradle-to-gradle-build-with-non-standard-build-name