Skip to content

Commit f3e53e5

Browse files
committed
migrate gradle dsl
1 parent 73c129f commit f3e53e5

7 files changed

Lines changed: 20 additions & 33 deletions

File tree

app/build.gradle.kts

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import com.android.build.api.dsl.ApplicationExtension
2+
13
plugins {
24
id("mkdocseditor.android.application")
35
id("mkdocseditor.android.application.compose")
@@ -8,37 +10,23 @@ plugins {
810
id("com.google.devtools.ksp")
911
}
1012

11-
android {
13+
val vName = "0.1.0"
14+
val vCode = 1
15+
16+
extensions.getByType<ApplicationExtension>().apply {
1217
namespace = "de.markusressel.mkdocseditor"
1318

1419
defaultConfig {
1520
applicationId = "de.markusressel.mkdocseditor"
1621

17-
versionCode = 1
18-
versionName = "0.1.0"
19-
}
20-
21-
androidComponents {
22-
onVariants { variant ->
23-
variant.outputs.forEach { output ->
24-
val outputImpl = output as com.android.build.api.variant.impl.VariantOutputImpl
25-
outputImpl.outputFileName.set("MkDocsEditor_v${defaultConfig.versionName}_(${defaultConfig.versionCode}).apk")
26-
}
27-
}
28-
}
29-
30-
kotlin {
31-
compilerOptions {
32-
freeCompilerArgs.addAll(
33-
"-opt-in=kotlin.RequiresOptIn",
34-
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
35-
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
36-
"-opt-in=androidx.compose.animation.ExperimentalAnimationApi"
37-
)
38-
}
22+
versionCode = vCode
23+
versionName = vName
3924
}
4025
}
4126

27+
base {
28+
archivesName.set("MkDocsEditor_v${vName}_(${vCode})")
29+
}
4230

4331
dependencies {
4432
implementation(project(":data"))

auth/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import com.android.build.api.dsl.LibraryExtension
2+
13
plugins {
24
id("mkdocseditor.android.library")
35
id("mkdocseditor.android.hilt")
46
}
57

6-
android {
8+
extensions.getByType<LibraryExtension>().apply {
79
namespace = "de.markusressel.mkdocseditor.auth"
810
}
911

build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
1212
with(target) {
1313
with(pluginManager) {
1414
apply("com.android.application")
15-
apply("org.jetbrains.kotlin.android")
1615
apply("mkdocseditor.android.logging")
1716
}
1817

build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
1515
with(target) {
1616
with(pluginManager) {
1717
apply("com.android.library")
18-
apply("org.jetbrains.kotlin.android")
1918
apply("mkdocseditor.android.logging")
2019
}
2120

build-logic/convention/src/main/kotlin/de/markusressel/mkdocseditor/KotlinAndroid.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import org.gradle.kotlin.dsl.getByType
99
import org.gradle.kotlin.dsl.provideDelegate
1010
import org.gradle.kotlin.dsl.withType
1111
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12-
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
1312
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1413

1514
const val COMPILE_SDK = 36
@@ -19,10 +18,6 @@ internal fun Project.configureKotlinAndroid(commonExtension: CommonExtension) {
1918
commonExtension.apply {
2019
compileSdk = COMPILE_SDK
2120

22-
kotlinExtension.apply {
23-
jvmToolchain(21)
24-
}
25-
2621
compileOptions.apply {
2722
// Up to Java 11 APIs are available through desugaring
2823
// https://developer.android.com/studio/write/java11-minimal-support-table

data/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import com.android.build.api.dsl.LibraryExtension
2+
13
plugins {
24
id("mkdocseditor.android.library")
35
id("mkdocseditor.android.hilt")
46
id(libs.plugins.io.objectbox.get().pluginId)
57
id("com.google.devtools.ksp")
68
}
79

8-
android {
10+
extensions.getByType<LibraryExtension>().apply {
911
namespace = "de.markusressel.mkdocseditor.data"
1012
}
1113

rest/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import com.android.build.api.dsl.LibraryExtension
2+
13
plugins {
24
id("mkdocseditor.android.library")
35
id("mkdocseditor.android.hilt")
46
id("com.google.devtools.ksp")
57
}
68

7-
android {
9+
extensions.getByType<LibraryExtension>().apply {
810
namespace = "de.markusressel.mkdocsrestclient"
911
}
1012

0 commit comments

Comments
 (0)