Skip to content

Commit 50c7b4a

Browse files
committed
refactor: Migrate to build.gradle.kts
...and rework the original "helper.gradle" into proper plugins. This also allows the signing configuration code to be shared, and now keystore.properties is no longer mandatory.
1 parent d66ed12 commit 50c7b4a

20 files changed

+384
-315
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
.cxx
1616
local.properties
1717
/libs/**/build
18+
/buildSrc/build

.idea/compiler.xml

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

.idea/gradle.xml

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

app-common/build.gradle

-48
This file was deleted.

app-common/build.gradle.kts

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
plugins {
2+
id("com.android.library")
3+
id("org.jetbrains.kotlin.android")
4+
}
5+
6+
android {
7+
namespace = "im.angry.openeuicc.common"
8+
compileSdk = 34
9+
10+
defaultConfig {
11+
minSdk = 30
12+
13+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
14+
}
15+
16+
buildTypes {
17+
release {
18+
isMinifyEnabled = false
19+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
20+
}
21+
}
22+
compileOptions {
23+
sourceCompatibility = JavaVersion.VERSION_1_8
24+
targetCompatibility = JavaVersion.VERSION_1_8
25+
}
26+
kotlinOptions {
27+
jvmTarget = "1.8"
28+
}
29+
}
30+
31+
dependencies {
32+
implementation(project(":libs:lpac-jni"))
33+
implementation("androidx.core:core-ktx:1.12.0")
34+
implementation("androidx.appcompat:appcompat:1.6.1")
35+
implementation("com.google.android.material:material:1.10.0")
36+
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
37+
//noinspection KtxExtensionAvailable
38+
implementation("androidx.preference:preference:1.2.1")
39+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
40+
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
41+
implementation("androidx.cardview:cardview:1.0.0")
42+
implementation("androidx.datastore:datastore-preferences:1.0.0")
43+
implementation("com.journeyapps:zxing-android-embedded:4.3.0")
44+
testImplementation("junit:junit:4.13.2")
45+
androidTestImplementation("androidx.test.ext:junit:1.1.5")
46+
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
47+
}

app-unpriv/build.gradle

-62
This file was deleted.

app-unpriv/build.gradle.kts

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import im.angry.openeuicc.build.*
2+
3+
plugins {
4+
id("com.android.application")
5+
id("org.jetbrains.kotlin.android")
6+
}
7+
8+
signingKeystoreProperties {
9+
keyAliasField = "unprivKeyAlias"
10+
keyPasswordField = "unprivKeyPassword"
11+
}
12+
13+
apply {
14+
plugin<MyVersioningPlugin>()
15+
plugin<MySigningPlugin>()
16+
}
17+
18+
android {
19+
namespace = "im.angry.easyeuicc"
20+
compileSdk = 34
21+
22+
defaultConfig {
23+
applicationId = "im.angry.easyeuicc"
24+
minSdk = 30
25+
targetSdk = 34
26+
}
27+
28+
buildTypes {
29+
release {
30+
isMinifyEnabled = false
31+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
32+
}
33+
}
34+
compileOptions {
35+
sourceCompatibility = JavaVersion.VERSION_1_8
36+
targetCompatibility = JavaVersion.VERSION_1_8
37+
}
38+
kotlinOptions {
39+
jvmTarget = "1.8"
40+
}
41+
}
42+
43+
dependencies {
44+
implementation(project(":app-common"))
45+
implementation("androidx.core:core-ktx:1.9.0")
46+
implementation("androidx.appcompat:appcompat:1.6.1")
47+
implementation("com.google.android.material:material:1.11.0")
48+
}

app/build.gradle

-70
This file was deleted.

app/build.gradle.kts

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import im.angry.openeuicc.build.*
2+
3+
plugins {
4+
id("com.android.application")
5+
id("org.jetbrains.kotlin.android")
6+
}
7+
8+
apply {
9+
plugin<MyVersioningPlugin>()
10+
plugin<MySigningPlugin>()
11+
}
12+
13+
android {
14+
namespace = "im.angry.openeuicc"
15+
compileSdk = 34
16+
17+
defaultConfig {
18+
applicationId = "im.angry.openeuicc"
19+
minSdk = 30
20+
targetSdk = 34
21+
22+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
23+
}
24+
25+
buildTypes {
26+
release {
27+
isMinifyEnabled = false
28+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
29+
}
30+
}
31+
compileOptions {
32+
sourceCompatibility = JavaVersion.VERSION_1_8
33+
targetCompatibility = JavaVersion.VERSION_1_8
34+
}
35+
kotlinOptions {
36+
jvmTarget = "1.8"
37+
}
38+
}
39+
40+
dependencies {
41+
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
42+
implementation("androidx.recyclerview:recyclerview:1.3.2")
43+
compileOnly(project(":libs:hidden-apis-stub"))
44+
implementation(project(":libs:hidden-apis-shim"))
45+
implementation(project(":libs:lpac-jni"))
46+
implementation(project(":app-common"))
47+
implementation("androidx.appcompat:appcompat:1.6.1")
48+
testImplementation("junit:junit:4.13.2")
49+
androidTestImplementation("androidx.test.ext:junit:1.1.3")
50+
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
51+
}

build.gradle

-11
This file was deleted.

build.gradle.kts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
plugins {
3+
// The following Android-related plugins are already depended upon by buildSrc, hence unnecessary.
4+
// id("com.android.application") version "8.1.2" apply false
5+
// id("com.android.library") version "8.1.2" apply false
6+
id("org.jetbrains.kotlin.android") version "1.9.20" apply false
7+
id("org.jetbrains.kotlin.multiplatform") version "1.9.20" apply false
8+
}
9+
10+
tasks.create<Delete>("clean") {
11+
delete = setOf(rootProject.buildDir)
12+
}

0 commit comments

Comments
 (0)