Commit 440a869b authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Clean-up build types and flavors

Now only flavors describe the release channel instead of being mixed
parent da4f1b94
......@@ -6,6 +6,7 @@ local.properties
.DS_Store
!app/build/outputs/mapping/**/mapping.txt
!app/build/outputs/mapping/normalRelease/mapping.txt
!app/build/outputs/mapping/fdroidRelease/mapping.txt
!app/build/outputs/mapping/adblockerFdroid/mapping.txt
/build/**
captures/
......
......@@ -19,8 +19,8 @@ prepare_release:
lint:
stage: test
script:
- ./gradlew lintNormalRelease
- ./gradlew lintAdblockerFdroid
- ./gradlew lintStoreRelease
- ./gradlew lintFdroidRelease
except:
- master
......@@ -34,10 +34,10 @@ build_debug:
script:
- chmod +x changeVersion.sh
- ./changeVersion.sh app/build.gradle " $CI_COMMIT_REF_NAME\_$CI_PIPELINE_ID" --append
- ./gradlew assembleNormalDebug --stacktrace -x test
- ./gradlew assembleStoreDebug --stacktrace -x test
artifacts:
paths:
- app/build/outputs/apk/normal/debug/*.apk
- app/build/outputs/apk/store/debug/*.apk
expire_in: 5 days
only:
- translations
......@@ -48,7 +48,7 @@ build_fdroid:
stage: build
script:
- wget -O $KEYSTORE_FILE $KEYSTORE_URL -q
- ./gradlew clean assembleAdblockerFdroid --stacktrace -x test
- ./gradlew clean assembleFdroidRelease --stacktrace -x test
except:
- /^no_ci.*$/
- /^no_build.*$/
......@@ -56,8 +56,8 @@ build_fdroid:
- /^no_build_no_deploy.*$/
artifacts:
paths:
- app/build/outputs/apk/adblocker/fdroid/*.apk
- app/build/outputs/mapping/adblocker/fdroid/mapping.txt
- app/build/outputs/apk/fdroid/release/*.apk
- app/build/outputs/mapping/fdroid/release/mapping.txt
expire_in: 30 days
only:
- master
......@@ -67,7 +67,7 @@ build_release:
stage: build
script:
- wget -O $KEYSTORE_FILE $KEYSTORE_URL -q
- ./gradlew clean assembleNormalRelease --stacktrace -x test
- ./gradlew clean assembleStoreRelease --stacktrace -x test
except:
- /^no_ci.*$/
- /^no_build.*$/
......@@ -75,8 +75,8 @@ build_release:
- /^no_build_no_deploy.*$/
artifacts:
paths:
- app/build/outputs/apk/normal/release/*.apk
- app/build/outputs/mapping/normal/release/mapping.txt
- app/build/outputs/apk/store/release/*.apk
- app/build/outputs/mapping/store/release/mapping.txt
expire_in: 30 days
only:
- master
......@@ -85,7 +85,7 @@ build_release:
test_build_release:
stage: test
script:
- ./gradlew clean assembleNormalUnsignedRelease --stacktrace -x test
- ./gradlew clean assembleStoreUnsignedRelease --stacktrace -x test
except:
- /^no_ci.*$/
- /^no_build.*$/
......
/build/
/release/
/fdroid/
/store/
/fdroidofficial/
/adblocker/
/normal/
!/build/outputs/mapping/release/mapping.txt
!/build/outputs/mapping/fdroid/mapping.txt
!/build/outputs/mapping/**/mapping.txt
!/build/outputs/mapping/store/release/mapping.txt
!/build/outputs/mapping/fdroid/release/mapping.txt
!/build/outputs/mapping/normal/release/mapping.txt
!/build/outputs/mapping/adblocker/fdroid/mapping.txt
\ No newline at end of file
......@@ -25,6 +25,8 @@ android {
buildConfigField("Boolean", "SHOW_DOQ", 'false')
buildConfigField("Boolean", "SHOW_INTRO", 'false')
buildConfigField("Boolean", "IN_APP_UPDATES", "false")
buildConfigField("Boolean", "LEAK_DETECTION", "false")
buildConfigField("Boolean", "SHOW_ALL_SERVERS", "true")
kapt {
arguments {
......@@ -57,6 +59,7 @@ android {
sourceSets {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
debug.assets.srcDirs += files("$projectDir/schemas".toString())
fdroidofficial.res.srcDirs += "fdroid/res"
}
buildTypes {
release {
......@@ -65,48 +68,41 @@ android {
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
buildConfigField("Boolean", "LEAK_DETECTION", "false")
buildConfigField("Boolean", "SHOW_ALL_SERVERS", "false")
buildConfigField("Boolean", "IN_APP_UPDATES", "true")
}
debug {
initWith buildTypes.debug
buildConfigField("Boolean", "LEAK_DETECTION", "false")
buildConfigField("Boolean", "SHOW_ALL_SERVERS", "true")
}
leakCanary {
matchingFallbacks = ['debug']
initWith buildTypes.debug
buildConfigField("Boolean", "LEAK_DETECTION", "true")
buildConfigField("Boolean", "SHOW_ALL_SERVERS", "false")
}
fdroid {
matchingFallbacks = ['release']
initWith release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField("Boolean", "SHOW_ALL_SERVERS", "true")
buildConfigField("Boolean", "IN_APP_UPDATES", "false")
}
unsignedRelease {
minifyEnabled true
debuggable false
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField("Boolean", "LEAK_DETECTION", "false")
buildConfigField("Boolean", "SHOW_ALL_SERVERS", "false")
}
}
flavorDimensions "version"
flavorDimensions "releaseChannel"
productFlavors {
adblocker {
store {
matchingFallbacks = ['default']
dimension "version"
dimension "releaseChannel"
buildConfigField("Boolean", "IN_APP_UPDATES", "true")
buildConfigField("Boolean", "SHOW_ALL_SERVERS", "false")
}
fdroidofficial {
matchingFallbacks = ['default']
dimension "releaseChannel"
versionNameSuffix "-adblock"
versionCode 77
}
normal {
fdroid {
matchingFallbacks = ['default']
dimension "version"
dimension "releaseChannel"
versionNameSuffix "-adblock"
versionCode 77
}
}
packagingOptions {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment