Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ jobs:
GOOGLE_SERVICES_ENCODED: ${{ secrets.GOOGLE_SERVICES_BASE_64 }}
run: |
# Create the directory structure
mkdir -p "composeApp/src/release/"
mkdir -p "androidApp/src/release/"

# Decode the env variable into the file
echo "$GOOGLE_SERVICES_ENCODED" | openssl base64 -d -A \
-out "composeApp/src/release/google-services.json"
-out "androidApp/src/release/google-services.json"

- name: Build App
run: ./gradlew assembleRelease
16 changes: 8 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
GOOGLE_SERVICES_ENCODED: ${{ secrets.GOOGLE_SERVICES_BASE_64 }}
run: |
# Create the directory structure
mkdir -p "composeApp/src/release/"
mkdir -p "androidApp/src/release/"

# Decode the env variable into the file
echo "$GOOGLE_SERVICES_ENCODED" | openssl base64 -d -A \
-out "composeApp/src/release/google-services.json"
-out "androidApp/src/release/google-services.json"

- name: Build Unsigned AAB
env:
Expand All @@ -49,7 +49,7 @@ jobs:
uses: r0adkll/sign-android-release@v1
id: sign_app
with:
releaseDirectory: composeApp/build/outputs/bundle/release
releaseDirectory: androidApp/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY_BASE_64 }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
Expand All @@ -70,26 +70,26 @@ jobs:
packageName: com.tunjid.heron
releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}}
track: internal
mappingFile: composeApp/build/outputs/mapping/release/mapping.txt
debugSymbols: composeApp/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib
mappingFile: androidApp/build/outputs/mapping/release/mapping.txt
debugSymbols: androidApp/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib


- name: Extract signed APKs
run: |
curl -L -o bundletool.jar https://github.com/google/bundletool/releases/download/1.18.3/bundletool-all-1.18.3.jar
java -jar bundletool.jar build-apks \
--bundle=${{ steps.sign_app.outputs.signedReleaseFile }} \
--output=composeApp/build/outputs/apk/release/heron.apks \
--output=androidApp/build/outputs/apk/release/heron.apks \
--mode=universal

unzip -o composeApp/build/outputs/apk/release/heron.apks -d composeApp/build/outputs/apk/release/
unzip -o androidApp/build/outputs/apk/release/heron.apks -d androidApp/build/outputs/apk/release/

- name: Upload to GitHub releases
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ github.run_number }}
name: Heron v${{ github.run_number }}
files: composeApp/build/outputs/apk/release/universal.apk
files: androidApp/build/outputs/apk/release/universal.apk
draft: true
allow_updates: true

Expand Down
96 changes: 96 additions & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* Copyright 2024 Adetunji Dahunsi
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import java.util.Properties

plugins {
id("android-application-convention")
id("release-convention")
alias(libs.plugins.composeCompiler)
alias(libs.plugins.googleServices)
}

android {
namespace = "com.tunjid.heron"

defaultConfig {
applicationId = "com.tunjid.heron"
versionCode = providers.gradleProperty("heron.versionCode")
.get()
.toInt()
versionName = scmVersion.version
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
val releaseSigning = when {
// Do not sign the build output, it will be signed on CI
providers.gradleProperty("heron.isRelease").orNull.toBoolean() -> null
file("debugKeystore.properties").exists() -> signingConfigs.create("release") {
val props = Properties()
file("debugKeystore.properties")
.inputStream()
.use(props::load)
storeFile = file(props.getProperty("keystore"))
storePassword = props.getProperty("keystore.password")
keyAlias = props.getProperty("keyAlias")
keyPassword = props.getProperty("keyPassword")
}
else -> signingConfigs["debug"]
}
buildTypes {
all {
signingConfig = releaseSigning
}
debug {
applicationIdSuffix = ".debug"
}
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
}

dependencies {
implementation(project(":composeApp"))
implementation(project(":data:models"))
implementation(project(":data:database"))
implementation(project(":data:core"))
implementation(project(":data:logging"))
implementation(project(":data:platform"))
implementation(project(":scaffold"))

implementation(libs.compose.multiplatform.components.resources)
implementation(libs.compose.multiplatform.runtime)
implementation(libs.compose.multiplatform.foundation.foundation)
implementation(libs.compose.multiplatform.material)
implementation(libs.compose.multiplatform.ui.ui)
implementation(libs.compose.multiplatform.ui.tooling.preview)

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.core.splashscreen)

implementation(platform(libs.firebase.bom))
implementation(libs.firebase.messaging)

debugImplementation(libs.compose.multiplatform.ui.tooling.preview)
}
Binary file added androidApp/debug.jks
Binary file not shown.
File renamed without changes.
1 change: 1 addition & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
implementation(libs.kotlin.serializationPlugin)
implementation(libs.google.devtools.kspPlugin)
implementation(libs.metro.gradlePlugin)
implementation(libs.axion.release.gradlePlugin)

// TODO: https://github.com/gradle/gradle/issues/15383
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,29 @@
* limitations under the License.
*/

import ext.ProjectJavaVersion
import ext.configureKotlinJvm
import ext.libs

plugins {
id("com.android.application")
}

android {
commonConfiguration(this)
compileSdk = 36

defaultConfig {
// The app uses Modifier.blur which is Android 12 and up
minSdk = 31
targetSdk = 35
}

compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = ProjectJavaVersion
targetCompatibility = ProjectJavaVersion
}

buildTypes {
create("staging") {
initWith(getByName("release"))
Expand All @@ -28,9 +45,12 @@ android {
}
}

defaultConfig {
targetSdk = 35
}
configureKotlinJvm()
}

addDesugarDependencies()
dependencies {
add(
configurationName = "coreLibraryDesugaring",
dependencyNotation = libs.android.desugarJdkLibs,
)
}
51 changes: 0 additions & 51 deletions build-logic/convention/src/main/kotlin/ext/AndroidExt.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ fun Project.configureKotlinMultiplatform(
kotlinMultiplatformExtension: KotlinMultiplatformExtension,
) {
kotlinMultiplatformExtension.apply {
androidTarget()
jvm("desktop")
iosArm64()
iosSimulatorArm64()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@
*/

plugins {
id("com.android.kotlin.multiplatform.library")
kotlin("multiplatform")
id("com.google.devtools.ksp")
}

kotlin {
configureKotlinMultiplatform(this)
androidLibrary {
compileSdk = 36
minSdk = 31

androidResources.enable = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,25 @@
*/

plugins {
id("com.android.library")
id("pl.allegro.tech.build.axion-release")
}

android {
commonConfiguration(this)

defaultConfig {
lint.targetSdk = 35
scmVersion {
tag {
// Use an empty string for prefix
prefix.set("")
}
buildTypes {
create("staging") {
initWith(getByName("release"))
isMinifyEnabled = false
}
repository {
pushTagsOnly.set(true)
}
sourceSets {
named("main") {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
res.srcDirs("src/androidMain/res")
providers.gradleProperty("heron.releaseBranch")
.orNull
?.let { releaseBranch ->
when {
releaseBranch.contains("bugfix/") -> versionIncrementer("incrementPatch")
releaseBranch.contains("feature/") -> versionIncrementer("incrementMinor")
releaseBranch.contains("release/") -> versionIncrementer("incrementMajor")
else -> throw IllegalArgumentException("Unknown release type")
}
}
}
}

addDesugarDependencies()
Loading
Loading