[英]Execute shell script in android gradle
我想运行一个Shell脚本来在构建我的应用程序时更改string.xml中的值。 我应该在哪里在gradle中运行脚本,因为其中没有任务。 或者,因为我将使用Jenkins构建应用程序,所以我应该在Jenkins服务器上运行脚本吗? 请帮帮我。
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
}
defaultConfig {
.......
}
buildTypes {
release {
.......
}
}
productFlavors {
development {}
production {}
}
sourceSets {
androidTest {
setRoot('src/test')
}
}
packagingOptions {..}
dependencies {...}
您可以添加一个preBuild
步骤来运行脚本并使它依赖于构建。
task myPreBuild << {
commandLine './script.sh'
}
build.dependsOn myPreBuild
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.