Skip to content

Commit

Permalink
Merge pull request #53 from 2rabs/rt/android-module-to-mpp
Browse files Browse the repository at this point in the history
♻️ KMP の AndroidApplicationPlugin に変更
  • Loading branch information
tatsutakein authored Nov 23, 2023
2 parents eff0f68 + 6a2ce74 commit 7b93688
Show file tree
Hide file tree
Showing 32 changed files with 44 additions and 32 deletions.
11 changes: 5 additions & 6 deletions app/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ import java.io.FileInputStream
import java.util.Properties

plugins {
id("nito.primitive.androidapplication")
id("nito.primitive.android.kotlin")
id("nito.primitive.android.compose")
id("nito.primitive.kmp")
id("nito.primitive.kmp.androidapplication")
id("nito.primitive.kmp.compose")
id("nito.primitive.android.firebase")
id("nito.primitive.android.crashlytics")
id("nito.primitive.detekt")
id("nito.primitive.kotest")
}

val keystorePropertiesFile = project.file("keystore.properties")
val keystoreExits = keystorePropertiesFile.exists()

android {
namespace = "club.nito.app"
compileSdk = 34
defaultConfig {
minSdk = 31
targetSdk = 34
versionCode = 3
versionName = "0.2.1"
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ dependencies {
gradlePlugin {
plugins {
// Primitives
register("androidApplication") {
id = "nito.primitive.androidapplication"
implementationClass = "club.nito.primitive.AndroidApplicationPlugin"
}
register("android") {
id = "nito.primitive.android"
implementationClass = "club.nito.primitive.AndroidPlugin"
Expand Down Expand Up @@ -62,6 +58,10 @@ gradlePlugin {
id = "nito.primitive.kmp.ios"
implementationClass = "club.nito.primitive.KmpIosPlugin"
}
register("kmpAndroidApplication") {
id = "nito.primitive.kmp.androidapplication"
implementationClass = "club.nito.primitive.KmpAndroidApplicationPlugin"
}
register("kmpAndroid") {
id = "nito.primitive.kmp.android"
implementationClass = "club.nito.primitive.KmpAndroidPlugin"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ fun Project.setupAndroid() {
compileSdkVersion(34)

defaultConfig {
minSdk = 23
targetSdk = 33
minSdk = 31
targetSdk = 34
}

compileOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package club.nito.primitive

import com.google.devtools.ksp.gradle.KspTaskMetadata
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.withType

@Suppress("unused")
class KmpAndroidApplicationPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.android.application")
}
kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
}
}
}
android {
setupAndroid()
}
// https://slack-chats.kotlinlang.org/t/13166064/been-discovering-that-the-task-kspcommonmainkotlinmetadata-i#9a50fa1b-1ec5-47c2-9172-2a5780a1900e
tasks.withType<KspTaskMetadata>().configureEach {
notCompatibleWithConfigurationCache("Configuration cache not supported due to serialization")
}
}
}
}

0 comments on commit 7b93688

Please sign in to comment.