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