0
我想知道是否有可能使用的versionName变量在我gradle这个文件的DefaultConfig:是否可以在我的gitlab-ci文件中使用Gradle配置变量?
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "app"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
在我gitlab-CI文件:
stages:
- build
release:
stage: build
only:
- release
script:
- ./gradlew assembleRelease
# Here I need to use the value of versionName in my gradle file.
是否有这样做的一个简单的方法这个?