0
내 Gradle을 파일의 DefaultConfig에 versionName과 변수를 사용할 수있는 경우 궁금 : 내 gitlab-CI 파일에서내 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
}
}
:
stages:
- build
release:
stage: build
only:
- release
script:
- ./gradlew assembleRelease
# Here I need to use the value of versionName in my gradle file.
수행하는 간단한 방법이 있나요 이?
export VERSION = $(grep -E "versionName " app/build.gradle | cut -d "\"" -f2)
내가 파일 내에서 $ VERSION으로 versionName을 액세스 할 수있는이 방법 :