Application of settings.gradle to Gradle build with non-standard build name

情到浓时终转凉″ 提交于 2021-01-28 07:32:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!