Skip to content

Commit aa9695d

Browse files
committed
chore(build): make minification configurable via CI property -Pci=true
1 parent e66b80e commit aa9695d

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

.github/workflows/build-android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
uses: ./.github/actions/setup-gradle
7070

7171
- name: Build K9 application
72-
run: ./gradlew :app-k9mail:assemble
72+
run: ./gradlew :app-k9mail:assemble -Pci=true
7373

7474
- name: Check K9 Badging
7575
run: |
@@ -93,7 +93,7 @@ jobs:
9393
uses: ./.github/actions/setup-gradle
9494

9595
- name: Build Thunderbird application
96-
run: ./gradlew :app-thunderbird:assemble
96+
run: ./gradlew :app-thunderbird:assemble -Pci=true
9797

9898
- name: Check Thunderbird Badging
9999
run: |

app-k9mail/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,13 @@ android {
8585
}
8686

8787
buildTypes {
88+
val isCI = project.findProperty("ci") == "true"
8889
release {
8990
signingConfig = signingConfigs.getByType(SigningType.K9_RELEASE)
9091

91-
isMinifyEnabled = true
92+
isMinifyEnabled = !isCI
93+
isShrinkResources = !isCI
94+
9295
proguardFiles(
9396
getDefaultProguardFile("proguard-android-optimize.txt"),
9497
"proguard-rules.pro",

app-thunderbird/build.gradle.kts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,12 @@ android {
8888
}
8989

9090
buildTypes {
91-
debug {
92-
applicationIdSuffix = ".debug"
93-
versionNameSuffix = "-SNAPSHOT"
94-
95-
enableUnitTestCoverage = testCoverageEnabled
96-
enableAndroidTestCoverage = testCoverageEnabled
97-
98-
isMinifyEnabled = false
99-
isShrinkResources = false
100-
isDebuggable = true
101-
102-
buildConfigField("String", "GLEAN_RELEASE_CHANNEL", "null")
103-
}
104-
91+
val isCI = project.findProperty("ci") == "true"
10592
release {
10693
signingConfig = signingConfigs.getByType(SigningType.TB_RELEASE)
10794

108-
isMinifyEnabled = true
109-
isShrinkResources = true
95+
isMinifyEnabled = !isCI
96+
isShrinkResources = !isCI
11097
isDebuggable = false
11198

11299
proguardFiles(
@@ -123,8 +110,8 @@ android {
123110
applicationIdSuffix = ".beta"
124111
versionNameSuffix = "b1"
125112

126-
isMinifyEnabled = true
127-
isShrinkResources = true
113+
isMinifyEnabled = !isCI
114+
isShrinkResources = !isCI
128115
isDebuggable = false
129116

130117
matchingFallbacks += listOf("release")
@@ -143,8 +130,8 @@ android {
143130
applicationIdSuffix = ".daily"
144131
versionNameSuffix = "a1"
145132

146-
isMinifyEnabled = true
147-
isShrinkResources = true
133+
isMinifyEnabled = !isCI
134+
isShrinkResources = !isCI
148135
isDebuggable = false
149136

150137
matchingFallbacks += listOf("release")
@@ -157,6 +144,20 @@ android {
157144
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1918151
158145
buildConfigField("String", "GLEAN_RELEASE_CHANNEL", "\"nightly\"")
159146
}
147+
148+
debug {
149+
applicationIdSuffix = ".debug"
150+
versionNameSuffix = "-SNAPSHOT"
151+
152+
enableUnitTestCoverage = testCoverageEnabled
153+
enableAndroidTestCoverage = testCoverageEnabled
154+
155+
isMinifyEnabled = false
156+
isShrinkResources = false
157+
isDebuggable = true
158+
159+
buildConfigField("String", "GLEAN_RELEASE_CHANNEL", "null")
160+
}
160161
}
161162

162163
flavorDimensions += listOf("app")

0 commit comments

Comments
 (0)