将settings.gradle应用到具有非标准构建名称的Gradle构建中 [英] Application of settings.gradle to Gradle build with non-standard build name

查看:69
本文介绍了将settings.gradle应用到具有非标准构建名称的Gradle构建中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用名为linuxApp.gradle的构建脚本构建的应用程序.我们已经在settings.gradle

I have an application that is built with a build script named linuxApp.gradle. We have specified in settings.gradle

rootProject.name ="JobThreader"

只要根项目文件夹也名为"JobThreader",当我们从应用程序插件执行installApp任务时,该应用程序将构建为

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

但是,如果根项目文件夹是其他任何名称,例如Jenkins,则为"workspace",则该应用程序将构建为

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

我们已经在Linux Jenkins服务器和本地Windows计算机上验证了此行为.

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

gradlew clean installApp -b linuxApp.gradle -c settings.gradle

gradlew clean installApp -b linuxApp.gradle -c settings.gradle

如何在Jenkins示例中将应用程序安装到工作区/build/install/JobThreader?

How can we get the application to install to workspace/build/install/JobThreader in our Jenkins example?

推荐答案

使用 -b 时,所有设置脚本都将被忽略.( -b 对于实验很有用,但通常不用于实际构建.)当未使用 -b 并通过以下方式找到或明确传递设置脚本时: -c ,由设置脚本来配置构建脚本的名称.例如:

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"

这篇关于将settings.gradle应用到具有非标准构建名称的Gradle构建中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆