Skip to content
Closed
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
12 changes: 6 additions & 6 deletions .github/workflows/build_and_local_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ name: Build and local test

on:
push:
branches: [ "base", "multimodule" ]
branches: [ "main", "base", "multimodule" ]
pull_request:
branches: [ "base", "multimodule" ]
branches: [ "main", "base", "multimodule" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v5
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
Expand All @@ -30,14 +30,14 @@ jobs:
run: ./gradlew testDebug --stacktrace

- name: Upload build outputs (APKs)
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: build-outputs
path: ./app/build/outputs

- name: Upload build reports
if: always()
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: build-reports
path: ./app/build/reports
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/instrumented_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: Instrumented tests

on:
push:
branches: [ "base", "multimodule" ]
branches: [ "main", "base", "multimodule" ]
pull_request:
branches: [ "base", "multimodule" ]
branches: [ "main", "base", "multimodule" ]

jobs:
androidTest:
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 60
strategy:
matrix:
api-level: [23, 26, 29]
Expand All @@ -23,13 +23,14 @@ jobs:
ls /dev/kvm

- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v5
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
cache: gradle

- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
Expand All @@ -41,7 +42,7 @@ jobs:

- name: Upload test reports
if: always()
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: test-reports-${{ matrix.api-level }}
path: ./app/build/reports/androidTests
21 changes: 7 additions & 14 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,24 @@
@Suppress("DSL_SCOPE_VIOLATION") // Remove when fixed https://youtrack.jetbrains.com/issue/KTIJ-19369
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.hilt.gradle)
alias(libs.plugins.ksp)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlin.serialization)
}

android {
namespace = "android.template"
namespace = "com.test.app"
compileSdk = 36

defaultConfig {
applicationId = "android.template"
applicationId = "com.test.app"
minSdk = 23
targetSdk = 36
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "android.template.HiltTestRunner"
testInstrumentationRunner = "com.test.app.HiltTestRunner"
vectorDrawables {
useSupportLibrary = true
}
Expand All @@ -59,19 +57,14 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
compose = true
aidl = false
buildConfig = false
renderScript = false
shaders = false
}

packagingOptions {
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
Expand All @@ -91,13 +84,13 @@ dependencies {

// Hilt Dependency Injection
implementation(libs.hilt.android)
kapt(libs.hilt.compiler)
ksp(libs.hilt.compiler)
// Hilt and instrumented tests.
androidTestImplementation(libs.hilt.android.testing)
kaptAndroidTest(libs.hilt.android.compiler)
kspAndroidTest(libs.hilt.android.compiler)
// Hilt and Robolectric tests.
testImplementation(libs.hilt.android.testing)
kaptTest(libs.hilt.android.compiler)
kspTest(libs.hilt.android.compiler)

// Arch Components
implementation(libs.androidx.lifecycle.runtime.compose)
Expand Down
4 changes: 2 additions & 2 deletions customizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ do
echo "Moving files to $n/java/$SUBDIR"
mv $n/java/android/template/* $n/java/$SUBDIR
echo "Removing old $n/java/android/template"
rm -rf mv $n/java/android
rm -rf $n/java/android
done

# Rename package and imports
Expand Down Expand Up @@ -79,7 +79,7 @@ find ./ -name "mymodel" -type d | sed "p;s/mymodel/${DATAMODEL,,}/" | tr '\n'
if [[ $APPNAME != MyApplication ]]
then
echo "Renaming app to $APPNAME"
find ./ -type f \( -name "MyApplication.kt" -or -name "settings.gradle.kts" -or -name "*.xml" \) -exec sed -i.bak "s/MyApplication/$APPNAME/g" {} \;
find ./ -type f \( -name "*.kt" -or -name "*.kts" -or -name "*.xml" \) -exec sed -i.bak "s/MyApplication/$APPNAME/g" {} \;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change makes the replacement more comprehensive, which is good. However, it also amplifies a pre-existing issue. If the optional ApplicationName argument is not provided, $APPNAME will be empty. The if condition on line 79 ([[ $APPNAME != MyApplication ]]) will evaluate to true, and this sed command will replace MyApplication with an empty string in all .kt, .kts, and .xml files, effectively breaking the project.

It's recommended to add a check to ensure $APPNAME is not empty before this block executes, for example by changing the condition on line 79 to if [[ -n "$APPNAME" && $APPNAME != "MyApplication" ]].

find ./ -name "MyApplication.kt" | sed "p;s/MyApplication/$APPNAME/" | tr '\n' '\0' | xargs -0 -n 2 mv
find . -name "*.bak" -type f -delete
fi
Expand Down
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[versions]
androidGradlePlugin = "8.13.1"
androidGradlePlugin = "9.0.1"
androidxCore = "1.17.0"
androidxLifecycle = "2.10.0"
androidxActivity = "1.12.0"
androidxComposeBom = "2025.11.01"
androidxActivity = "1.12.4"
androidxComposeBom = "2026.02.00"
androidxHilt = "1.3.0"
androidxRoom = "2.8.4"
androidxTest = "1.7.0"
androidxTestExt = "1.3.0"
androidxTestRunner = "1.7.0"
coroutines = "1.10.2"
hilt = "2.57.2"
hilt = "2.59.2"
junit = "4.13.2"
kotlin = "2.2.21"
ksp = "2.3.2"
nav3Core = "1.0.0"
kotlin = "2.3.10"
ksp = "2.3.6"
nav3Core = "1.0.1"
lifecycleViewmodelNav3 = "2.10.0"

[libraries]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading