diff --git a/buildSrc/src/main/kotlin/Plugins.kt b/buildSrc/src/main/kotlin/Plugins.kt deleted file mode 100644 index 3857b774..00000000 --- a/buildSrc/src/main/kotlin/Plugins.kt +++ /dev/null @@ -1,12 +0,0 @@ -object Plugins { - - object Kotlin { - const val androidPlugin = "android" - const val kapt = "kapt" - } - - object Android { - const val applicationPlugin = "com.android.application" - const val libraryPlagin = "com.android.library" - } -} diff --git a/buildSrc/src/main/kotlin/convention.debug.panel.plugin.gradle.kts b/buildSrc/src/main/kotlin/convention.debug.panel.plugin.gradle.kts new file mode 100644 index 00000000..e7944b31 --- /dev/null +++ b/buildSrc/src/main/kotlin/convention.debug.panel.plugin.gradle.kts @@ -0,0 +1,45 @@ +import internal.Versions +import internal.android +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + +plugins { + id("com.android.library") + id("convention-publish") + kotlin("android") +} + +android { + compileSdk = Versions.COMPILE_SDK + lint.targetSdk = Versions.TARGET_SDK + + defaultConfig { + minSdk = Versions.MIN_SDK + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } +} + +kotlin { + explicitApi() + compilerOptions { + jvmTarget = JvmTarget.JVM_11 + } +} + +dependencies { + implementation(project(":panel-core")) + implementation(project(":panel-common")) +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/internal/Versions.kt b/buildSrc/src/main/kotlin/internal/Versions.kt new file mode 100644 index 00000000..88286118 --- /dev/null +++ b/buildSrc/src/main/kotlin/internal/Versions.kt @@ -0,0 +1,7 @@ +package internal + +internal object Versions { + const val MIN_SDK = 21 + const val TARGET_SDK = 34 + const val COMPILE_SDK = TARGET_SDK +} diff --git a/buildSrc/src/main/kotlin/internal/accessors.kt b/buildSrc/src/main/kotlin/internal/accessors.kt index f75c1343..24b26765 100644 --- a/buildSrc/src/main/kotlin/internal/accessors.kt +++ b/buildSrc/src/main/kotlin/internal/accessors.kt @@ -1,8 +1,8 @@ package internal -import com.android.build.api.dsl.LibraryExtension -import org.gradle.api.plugins.ExtensionAware +import com.android.build.api.dsl.CommonExtension +import org.gradle.api.Project -internal fun ExtensionAware.android(configure: LibraryExtension.() -> Unit) { - extensions.configure("android", configure) +internal fun Project.android(configure: CommonExtension<*, *, *, *, *, *>.() -> Unit) { + extensions.configure("android", configure) } diff --git a/panel-common/build.gradle.kts b/panel-common/build.gradle.kts index adab7a25..924e02f1 100644 --- a/panel-common/build.gradle.kts +++ b/panel-common/build.gradle.kts @@ -1,7 +1,6 @@ plugins { - id(Plugins.Android.libraryPlagin) - kotlin(Plugins.Kotlin.androidPlugin) - kotlin(Plugins.Kotlin.kapt) + id("com.android.library") + kotlin("android") id("convention-publish") } @@ -69,7 +68,6 @@ dependencies { api(stack.kotlinx.coroutines.android) api(stack.okhttp) api(stack.timber) - kapt(androidx.room.compiler) // legacy api(androidx.appcompat) api(androidx.constraintlayout) diff --git a/panel-core/build.gradle.kts b/panel-core/build.gradle.kts index f5bfe66b..502157dd 100644 --- a/panel-core/build.gradle.kts +++ b/panel-core/build.gradle.kts @@ -1,7 +1,6 @@ plugins { - id(Plugins.Android.libraryPlagin) - kotlin(Plugins.Kotlin.androidPlugin) - kotlin(Plugins.Kotlin.kapt) + id("com.android.library") + kotlin("android") alias(stack.plugins.kotlin.compose) id("convention-publish") } @@ -51,5 +50,4 @@ kotlin { dependencies { implementation(project(":panel-common")) - kapt(androidx.room.compiler) } diff --git a/panel-no-op/build.gradle.kts b/panel-no-op/build.gradle.kts index c0992f5f..df4c17e7 100644 --- a/panel-no-op/build.gradle.kts +++ b/panel-no-op/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id(Plugins.Android.libraryPlagin) - kotlin(Plugins.Kotlin.androidPlugin) + id("com.android.library") + kotlin("android") id("convention-publish") } diff --git a/plugins/plugin-accounts/build.gradle.kts b/plugins/plugin-accounts/build.gradle.kts index 8778aed5..7fe98d50 100644 --- a/plugins/plugin-accounts/build.gradle.kts +++ b/plugins/plugin-accounts/build.gradle.kts @@ -1,58 +1,19 @@ plugins { - id(Plugins.Android.libraryPlagin) - kotlin(Plugins.Kotlin.androidPlugin) - kotlin(Plugins.Kotlin.kapt) + id("convention.debug.panel.plugin") + alias(stack.plugins.ksp) alias(stack.plugins.kotlin.compose) - id("convention-publish") } description = "Plugin for switching user accounts" android { - compileSdk = Project.COMPILE_SDK - lint.targetSdk = Project.TARGET_SDK - - defaultConfig { - minSdk = Project.MIN_SDK - - consumerProguardFile("consumer-rules.pro") - } - - buildTypes { - getByName(Project.BuildTypes.release) { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile(Project.Proguard.androidOptimizedRules), - Project.Proguard.projectRules - ) - } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } - - kapt { - arguments { - arg("room.schemaLocation", "$projectDir/schemas") - } + ksp { + arg("room.schemaLocation", "$projectDir/schemas") } namespace = "com.redmadrobot.debug.plugin.accounts" } -kotlin { - explicitApi() -} - dependencies { - implementation(kotlin("stdlib")) - implementation(project(":panel-core")) - implementation(project(":panel-common")) - kapt(androidx.room.compiler) + ksp(androidx.room.compiler) } diff --git a/plugins/plugin-accounts/consumer-rules.pro b/plugins/plugin-accounts/consumer-rules.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/plugin-app-settings/build.gradle.kts b/plugins/plugin-app-settings/build.gradle.kts index 38d64b64..830c32ca 100644 --- a/plugins/plugin-app-settings/build.gradle.kts +++ b/plugins/plugin-app-settings/build.gradle.kts @@ -1,52 +1,10 @@ plugins { - id(Plugins.Android.libraryPlagin) - kotlin(Plugins.Kotlin.androidPlugin) - kotlin(Plugins.Kotlin.kapt) + id("convention.debug.panel.plugin") alias(stack.plugins.kotlin.compose) - id("convention-publish") } description = "Plugin that helps to change the values of shared preferences" android { - compileSdk = Project.COMPILE_SDK - lint.targetSdk = Project.TARGET_SDK - - defaultConfig { - minSdk = Project.MIN_SDK - - consumerProguardFile("consumer-rules.pro") - } - - buildTypes { - getByName(Project.BuildTypes.release) { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile(Project.Proguard.androidOptimizedRules), - Project.Proguard.projectRules - ) - } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } - namespace = "com.redmadrobot.debug.plugin.appsettings" } - -kotlin { - explicitApi() -} - -dependencies { - implementation(project(":panel-core")) - implementation(project(":panel-common")) - implementation(kotlin("stdlib")) - kapt(androidx.room.compiler) -} diff --git a/plugins/plugin-app-settings/consumer-rules.pro b/plugins/plugin-app-settings/consumer-rules.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/plugin-flipper/build.gradle.kts b/plugins/plugin-flipper/build.gradle.kts index 5aadd5c8..7a5cccd9 100644 --- a/plugins/plugin-flipper/build.gradle.kts +++ b/plugins/plugin-flipper/build.gradle.kts @@ -1,48 +1,14 @@ plugins { - id(Plugins.Android.libraryPlagin) - kotlin(Plugins.Kotlin.androidPlugin) - kotlin(Plugins.Kotlin.kapt) + id("convention.debug.panel.plugin") alias(stack.plugins.kotlin.compose) - id("convention-publish") } description = "Plugin for flipper library integration" android { - compileSdk = Project.COMPILE_SDK - lint.targetSdk = Project.TARGET_SDK - - defaultConfig { - minSdk = Project.MIN_SDK - - consumerProguardFile("consumer-rules.pro") - } - - buildTypes { - getByName(Project.BuildTypes.release) { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile(Project.Proguard.androidOptimizedRules), - Project.Proguard.projectRules - ) - } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - freeCompilerArgs += "-Xexplicit-api=strict" - } - namespace = "com.redmadrobot.debug.plugin.flipper" } dependencies { - implementation(project(":panel-core")) - implementation(project(":panel-common")) implementation(androidx.lifecycle.runtime) } diff --git a/plugins/plugin-flipper/consumer-rules.pro b/plugins/plugin-flipper/consumer-rules.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/plugin-konfeature/build.gradle.kts b/plugins/plugin-konfeature/build.gradle.kts index 2c529150..4dd6358e 100644 --- a/plugins/plugin-konfeature/build.gradle.kts +++ b/plugins/plugin-konfeature/build.gradle.kts @@ -1,48 +1,14 @@ plugins { - id(Plugins.Android.libraryPlagin) - kotlin(Plugins.Kotlin.androidPlugin) - kotlin(Plugins.Kotlin.kapt) + id("convention.debug.panel.plugin") alias(stack.plugins.kotlin.compose) - id("convention-publish") } description = "Plugin for konfeature library integration" android { - compileSdk = Project.COMPILE_SDK - lint.targetSdk = Project.TARGET_SDK - - defaultConfig { - minSdk = Project.MIN_SDK - - consumerProguardFile("consumer-rules.pro") - } - - buildTypes { - getByName(Project.BuildTypes.release) { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile(Project.Proguard.androidOptimizedRules), - Project.Proguard.projectRules - ) - } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - freeCompilerArgs += "-Xexplicit-api=strict" - } - namespace = "com.redmadrobot.debug.plugin.konfeature" } dependencies { - implementation(project(":panel-core")) - implementation(project(":panel-common")) implementation(androidx.lifecycle.runtime) } diff --git a/plugins/plugin-konfeature/consumer-rules.pro b/plugins/plugin-konfeature/consumer-rules.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/plugin-servers/build.gradle.kts b/plugins/plugin-servers/build.gradle.kts index 93a3dd9b..4736158c 100644 --- a/plugins/plugin-servers/build.gradle.kts +++ b/plugins/plugin-servers/build.gradle.kts @@ -1,53 +1,16 @@ plugins { - id(Plugins.Android.libraryPlagin) - kotlin(Plugins.Kotlin.androidPlugin) - kotlin(Plugins.Kotlin.kapt) + id("convention.debug.panel.plugin") + alias(stack.plugins.ksp) alias(stack.plugins.kotlin.compose) - id("convention-publish") } description = "Plugin for switching server hosts" android { - compileSdk = Project.COMPILE_SDK - lint.targetSdk = Project.TARGET_SDK - - defaultConfig { - minSdk = Project.MIN_SDK - - consumerProguardFile("consumer-rules.pro") - } - - buildTypes { - getByName(Project.BuildTypes.release) { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile(Project.Proguard.androidOptimizedRules), - Project.Proguard.projectRules - ) - } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() - } - namespace = "com.redmadrobot.debug.plugin.servers" } -kotlin { - explicitApi() -} - dependencies { - implementation(project(":panel-core")) - implementation(project(":panel-common")) - implementation(kotlin("stdlib")) implementation(stack.kotlinx.serialization.json) - kapt(androidx.room.compiler) + ksp(androidx.room.compiler) } diff --git a/plugins/plugin-servers/consumer-rules.pro b/plugins/plugin-servers/consumer-rules.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index d25a413e..dc825623 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id(Plugins.Android.applicationPlugin) - kotlin(Plugins.Kotlin.androidPlugin) + id("com.android.application") + kotlin("android") alias(stack.plugins.kotlin.compose) }