Skip to content

Commit 89b7796

Browse files
committed
Rework Gradle scripts to use KTS, convention plugins and version catalogs
1 parent 467dfec commit 89b7796

Some content is hidden

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

64 files changed

+1702
-1341
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
.idea/assetWizardSettings.xml
7575
.idea/navEditor.xml
7676
.idea/.name
77+
.idea/deploymentTargetSelector.xml
78+
.idea/migrations.xml
79+
.idea/other.xml
7780

7881
# mpeltonen/sbt-idea plugin
7982
.idea_modules/

.idea/kotlinc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
<!--
78
## [Unreleased]
89
### Added
910
- No new features!
@@ -17,6 +18,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1718
- No fixed issues!
1819
### Security
1920
- No security issues fixed!
21+
-->
22+
23+
## [Unreleased]
24+
### Added
25+
- No new features!
26+
### Changed
27+
- Update the project to use KTS scripts, convention plugins, version catalogs and other modern Gradle and Android features.
28+
### Deprecated
29+
- No deprecated features!
30+
### Removed
31+
- No removed features!
32+
### Fixed
33+
- No fixed issues!
34+
### Security
35+
- No security issues fixed!
2036

2137
## [4.0.0] - 2023-10-31
2238
## 🎃🎃 Happy Halloween! 🎃🎃

app/build.gradle

-111
This file was deleted.

app/build.gradle.kts

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.android)
4+
alias(libs.plugins.kotlin.kapt)
5+
alias(libs.plugins.kotlin.ksp)
6+
alias(libs.plugins.convention.androidApp)
7+
}
8+
9+
android {
10+
namespace = "mini.android.sample"
11+
12+
compileSdk = libs.versions.android.compileSdk.get().toInt()
13+
buildToolsVersion = libs.versions.android.buildTools.get()
14+
15+
defaultConfig {
16+
applicationId = "mini.android.sample"
17+
minSdk = libs.versions.android.minSdk.get().toInt()
18+
targetSdk = libs.versions.android.targetSdk.get().toInt()
19+
multiDexEnabled = true
20+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
21+
}
22+
23+
buildFeatures {
24+
compose = true
25+
viewBinding = true
26+
}
27+
28+
composeOptions {
29+
kotlinCompilerExtensionVersion = "1.5.11"
30+
}
31+
32+
buildTypes {
33+
release {
34+
isMinifyEnabled = false
35+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
36+
}
37+
}
38+
39+
compileOptions {
40+
sourceCompatibility = JavaVersion.toVersion(libs.versions.java.sdk.get())
41+
targetCompatibility = JavaVersion.toVersion(libs.versions.java.sdk.get())
42+
}
43+
44+
kotlinOptions {
45+
jvmTarget = libs.versions.java.sdk.get()
46+
}
47+
48+
lint {
49+
abortOnError = false
50+
}
51+
52+
configurations.configureEach {
53+
// This library is included with two different versions
54+
resolutionStrategy.force("com.google.code.findbugs:jsr305:3.0.1")
55+
}
56+
}
57+
58+
dependencies {
59+
implementation(project(":mini-android"))
60+
implementation(project(":mini-kodein-android"))
61+
62+
kapt(project(":mini-processor"))
63+
//ksp(project(":mini-processor"))
64+
65+
// Kotlin
66+
implementation(libs.kotlin.stdlib)
67+
implementation(libs.kotlin.reflect)
68+
69+
// Coroutines
70+
implementation(libs.kotlinx.coroutines.core)
71+
72+
// Support
73+
implementation(libs.bundles.androidx)
74+
implementation(libs.bundles.compose)
75+
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
76+
77+
implementation("com.google.android.material:material:1.6.1")
78+
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
79+
implementation(libs.androidx.activity)
80+
implementation(libs.androidx.fragment)
81+
82+
implementation(libs.bundles.androidx.lifecycle)
83+
84+
// Misc
85+
implementation("com.github.minikorp:grove:1.0.3")
86+
87+
// Test
88+
testImplementation(libs.junit)
89+
androidTestImplementation(libs.androidx.test.runner)
90+
androidTestImplementation(libs.espresso)
91+
androidTestImplementation("androidx.test.ext:junit:1.1.3")
92+
androidTestImplementation("com.agoda.kakao:kakao:2.4.0")
93+
}

app/proguard-rules.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# By default, the flags in this file are appended to flags specified
33
# in /Users/pablo/development/android-sdk/tools/proguard/proguard-android.txt
44
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
5+
# directive in build.gradle.kts.
66
#
77
# For more details, see
88
# http://developer.android.com/guide/developing/tools/proguard.html

app/src/main/AndroidManifest.xml

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<!--
1+
<?xml version="1.0" encoding="utf-8"?><!--
32
~ Copyright 2021 HyperDevs
43
~
54
~ Copyright 2020 BQ
@@ -25,22 +24,28 @@
2524
android:label="@string/app_name"
2625
android:roundIcon="@mipmap/ic_launcher_round"
2726
android:supportsRtl="true"
28-
android:theme="@style/AppTheme">
29-
<activity android:name=".MainActivity" android:exported="true">
27+
android:theme="@style/AppTheme.SplashScreen">
28+
<activity
29+
android:name=".MainActivity"
30+
android:exported="true"
31+
android:theme="@style/AppTheme">
3032
<intent-filter>
3133
<action android:name="android.intent.action.MAIN" />
32-
3334
<category android:name="android.intent.category.LAUNCHER" />
3435
</intent-filter>
3536
</activity>
37+
3638
<activity
3739
android:name=".StoreSampleActivity"
40+
android:exported="false"
3841
android:label="@string/store_sample_label"
39-
android:exported="false"/>
42+
android:theme="@style/AppTheme" />
43+
4044
<activity
4145
android:name=".ViewModelSampleActivity"
46+
android:exported="false"
4247
android:label="@string/view_model_sample_label"
43-
android:exported="false"/>
48+
android:theme="@style/AppTheme" />
4449
</application>
4550

4651
</manifest>

app/src/main/ic_launcher-web.png

-14.9 KB
Binary file not shown.

app/src/main/java/com/example/androidsample/MainActivity.kt

-45
This file was deleted.

0 commit comments

Comments
 (0)