Skip to content

Commit ec7adf5

Browse files
authored
Merge pull request #1159 from tunjid/tj/agp-9
Migrate to AGP 9
2 parents cec23c1 + c5b9c02 commit ec7adf5

File tree

79 files changed

+315
-296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+315
-296
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ jobs:
8080
GOOGLE_SERVICES_ENCODED: ${{ secrets.GOOGLE_SERVICES_BASE_64 }}
8181
run: |
8282
# Create the directory structure
83-
mkdir -p "composeApp/src/release/"
83+
mkdir -p "androidApp/src/release/"
8484
8585
# Decode the env variable into the file
8686
echo "$GOOGLE_SERVICES_ENCODED" | openssl base64 -d -A \
87-
-out "composeApp/src/release/google-services.json"
87+
-out "androidApp/src/release/google-services.json"
8888
8989
- name: Build App
9090
run: ./gradlew assembleRelease

.github/workflows/publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
GOOGLE_SERVICES_ENCODED: ${{ secrets.GOOGLE_SERVICES_BASE_64 }}
3030
run: |
3131
# Create the directory structure
32-
mkdir -p "composeApp/src/release/"
32+
mkdir -p "androidApp/src/release/"
3333
3434
# Decode the env variable into the file
3535
echo "$GOOGLE_SERVICES_ENCODED" | openssl base64 -d -A \
36-
-out "composeApp/src/release/google-services.json"
36+
-out "androidApp/src/release/google-services.json"
3737
3838
- name: Build Unsigned AAB
3939
env:
@@ -49,7 +49,7 @@ jobs:
4949
uses: r0adkll/sign-android-release@v1
5050
id: sign_app
5151
with:
52-
releaseDirectory: composeApp/build/outputs/bundle/release
52+
releaseDirectory: androidApp/build/outputs/bundle/release
5353
signingKeyBase64: ${{ secrets.SIGNING_KEY_BASE_64 }}
5454
alias: ${{ secrets.ALIAS }}
5555
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
@@ -70,26 +70,26 @@ jobs:
7070
packageName: com.tunjid.heron
7171
releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}}
7272
track: internal
73-
mappingFile: composeApp/build/outputs/mapping/release/mapping.txt
74-
debugSymbols: composeApp/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib
73+
mappingFile: androidApp/build/outputs/mapping/release/mapping.txt
74+
debugSymbols: androidApp/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib
7575

7676

7777
- name: Extract signed APKs
7878
run: |
7979
curl -L -o bundletool.jar https://github.com/google/bundletool/releases/download/1.18.3/bundletool-all-1.18.3.jar
8080
java -jar bundletool.jar build-apks \
8181
--bundle=${{ steps.sign_app.outputs.signedReleaseFile }} \
82-
--output=composeApp/build/outputs/apk/release/heron.apks \
82+
--output=androidApp/build/outputs/apk/release/heron.apks \
8383
--mode=universal
8484
85-
unzip -o composeApp/build/outputs/apk/release/heron.apks -d composeApp/build/outputs/apk/release/
85+
unzip -o androidApp/build/outputs/apk/release/heron.apks -d androidApp/build/outputs/apk/release/
8686
8787
- name: Upload to GitHub releases
8888
uses: softprops/action-gh-release@v2
8989
with:
9090
tag_name: v${{ github.run_number }}
9191
name: Heron v${{ github.run_number }}
92-
files: composeApp/build/outputs/apk/release/universal.apk
92+
files: androidApp/build/outputs/apk/release/universal.apk
9393
draft: true
9494
allow_updates: true
9595

androidApp/build.gradle.kts

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/*
2+
* Copyright 2024 Adetunji Dahunsi
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import java.util.Properties
18+
19+
plugins {
20+
id("android-application-convention")
21+
id("release-convention")
22+
alias(libs.plugins.composeCompiler)
23+
alias(libs.plugins.googleServices)
24+
}
25+
26+
android {
27+
namespace = "com.tunjid.heron"
28+
29+
defaultConfig {
30+
applicationId = "com.tunjid.heron"
31+
versionCode = providers.gradleProperty("heron.versionCode")
32+
.get()
33+
.toInt()
34+
versionName = scmVersion.version
35+
}
36+
packaging {
37+
resources {
38+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
39+
}
40+
}
41+
val releaseSigning = when {
42+
// Do not sign the build output, it will be signed on CI
43+
providers.gradleProperty("heron.isRelease").orNull.toBoolean() -> null
44+
file("debugKeystore.properties").exists() -> signingConfigs.create("release") {
45+
val props = Properties()
46+
file("debugKeystore.properties")
47+
.inputStream()
48+
.use(props::load)
49+
storeFile = file(props.getProperty("keystore"))
50+
storePassword = props.getProperty("keystore.password")
51+
keyAlias = props.getProperty("keyAlias")
52+
keyPassword = props.getProperty("keyPassword")
53+
}
54+
else -> signingConfigs["debug"]
55+
}
56+
buildTypes {
57+
all {
58+
signingConfig = releaseSigning
59+
}
60+
debug {
61+
applicationIdSuffix = ".debug"
62+
}
63+
release {
64+
isMinifyEnabled = true
65+
proguardFiles(
66+
getDefaultProguardFile("proguard-android-optimize.txt"),
67+
"proguard-rules.pro",
68+
)
69+
}
70+
}
71+
}
72+
73+
dependencies {
74+
implementation(project(":composeApp"))
75+
implementation(project(":data:models"))
76+
implementation(project(":data:database"))
77+
implementation(project(":data:core"))
78+
implementation(project(":data:logging"))
79+
implementation(project(":data:platform"))
80+
implementation(project(":scaffold"))
81+
82+
implementation(libs.compose.multiplatform.components.resources)
83+
implementation(libs.compose.multiplatform.runtime)
84+
implementation(libs.compose.multiplatform.foundation.foundation)
85+
implementation(libs.compose.multiplatform.material)
86+
implementation(libs.compose.multiplatform.ui.ui)
87+
implementation(libs.compose.multiplatform.ui.tooling.preview)
88+
89+
implementation(libs.androidx.activity.compose)
90+
implementation(libs.androidx.core.splashscreen)
91+
92+
implementation(platform(libs.firebase.bom))
93+
implementation(libs.firebase.messaging)
94+
95+
debugImplementation(libs.compose.multiplatform.ui.tooling.preview)
96+
}

androidApp/debug.jks

1.23 KB
Binary file not shown.
File renamed without changes.

composeApp/src/androidMain/kotlin/com/tunjid/heron/HeronApplication.kt renamed to androidApp/src/main/kotlin/com/tunjid/heron/HeronApplication.kt

File renamed without changes.

composeApp/src/androidMain/kotlin/com/tunjid/heron/MainActivity.kt renamed to androidApp/src/main/kotlin/com/tunjid/heron/MainActivity.kt

File renamed without changes.

0 commit comments

Comments
 (0)