diff --git a/build.gradle.kts b/build.gradle.kts index 08473216..3f4c6818 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,9 +2,9 @@ subprojects { tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += listOf( - "-opt-in=com.redmadrobot.debug.core.annotation.DebugPanelInternal" - ) + compilerOptions { + freeCompilerArgs.add("-opt-in=com.redmadrobot.debug.core.annotation.DebugPanelInternal") + } } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index d85a2e05..f282a305 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -15,11 +15,11 @@ java { } dependencies { - implementation(libs.infrastructure.publish) - implementation(libs.infrastructure.android) + implementation(rmr.infrastructure.publish) + implementation(rmr.infrastructure.android) implementation(libs.publish.gradlePlugin) - implementation(libs.gradle.android.cacheFixGradlePlugin) - implementation(libs.kotlin.gradlePlugin) - implementation(libs.detekt.gradlePlugin) - implementation(libs.android.gradlePlugin) + implementation(stack.gradle.android.cacheFixGradlePlugin) + implementation(stack.kotlin.gradlePlugin) + implementation(stack.detekt.gradlePlugin) + implementation(stack.android.tools.build.gradle) } diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index b2f9d99e..096cda7f 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -30,6 +30,16 @@ dependencyResolutionManagement { } versionCatalogs { + val version = "2024.09.04" // Keep it in sync with root settings.gradle.kts + create("rmr") { + from("com.redmadrobot.versions:versions-redmadrobot:$version") + } + create("androidx") { + from("com.redmadrobot.versions:versions-androidx:$version") + } + create("stack") { + from("com.redmadrobot.versions:versions-stack:$version") + } create("libs") { from(files("../gradle/libs.versions.toml")) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c5a5f09d..6645e539 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,30 +1,5 @@ -# For an example of how to maintain dependencies in version catalogs, -# see https://github.com/RedMadRobot/gradle-version-catalogs. [versions] -activity = "1.9.0" -android-gradle-plugin = "8.4.2" -detekt = "1.23.6" -gradle-android-cacheFix = "3.0.1" -gradle-infrastructure = "0.18.1" -kotlin = "1.9.23" -versionsPlugin = "0.51.0" publish-plugin = "0.28.0" -poko = "0.16.0" -kotest = "5.9.1" -konfeature = "0.1.0" [libraries] -android-gradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "android-gradle-plugin" } -detekt-gradlePlugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" } -gradle-android-cacheFixGradlePlugin = { module = "gradle.plugin.org.gradle.android:android-cache-fix-gradle-plugin", version.ref = "gradle-android-cacheFix" } -infrastructure-android = { module = "com.redmadrobot.build:infrastructure-android", version.ref = "gradle-infrastructure" } -infrastructure-publish = { module = "com.redmadrobot.build:infrastructure-publish", version.ref = "gradle-infrastructure" } -publish-gradlePlugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "publish-plugin" } -kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } -kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" } -konfeature = { module = "com.redmadrobot.konfeature:konfeature", version.ref = "konfeature" } - -[plugins] -infrastructure-detekt = { id = "com.redmadrobot.detekt", version.ref = "gradle-infrastructure" } -versions = { id = "com.github.ben-manes.versions", version.ref = "versionsPlugin" } -poko = { id = "dev.drewhamilton.poko", version.ref = "poko" } +publish-gradlePlugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "publish-plugin" } \ No newline at end of file diff --git a/panel-common/build.gradle.kts b/panel-common/build.gradle.kts index 75f0e56c..adab7a25 100644 --- a/panel-common/build.gradle.kts +++ b/panel-common/build.gradle.kts @@ -63,7 +63,7 @@ dependencies { api(androidx.room.runtime) api(rmr.flipper) api(rmr.itemsadapter.viewbinding) - api(libs.konfeature) + api(rmr.konfeature) api(stack.accompanist.themeadapter.core) api(stack.accompanist.themeadapter.material) api(stack.kotlinx.coroutines.android) diff --git a/panel-core/build.gradle.kts b/panel-core/build.gradle.kts index 8435dc90..f5bfe66b 100644 --- a/panel-core/build.gradle.kts +++ b/panel-core/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id(Plugins.Android.libraryPlagin) kotlin(Plugins.Kotlin.androidPlugin) kotlin(Plugins.Kotlin.kapt) + alias(stack.plugins.kotlin.compose) id("convention-publish") } @@ -37,13 +38,10 @@ android { freeCompilerArgs += listOf("-opt-in=kotlin.RequiresOptIn") } - buildFeatures { - compose = true + lint { + disable += "CoroutineCreationDuringComposition" } - composeOptions { - kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() - } namespace = "com.redmadrobot.debug.core" } diff --git a/panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/compose/DebugBottomSheet.kt b/panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/compose/DebugBottomSheet.kt index 85ad128c..00ce16b1 100644 --- a/panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/compose/DebugBottomSheet.kt +++ b/panel-core/src/main/kotlin/com/redmadrobot/debug/core/inapp/compose/DebugBottomSheet.kt @@ -2,7 +2,6 @@ package com.redmadrobot.debug.core.inapp.compose -import androidx.appcompat.view.ContextThemeWrapper import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box @@ -26,18 +25,13 @@ import androidx.compose.material.TabRowDefaults.tabIndicatorOffset import androidx.compose.material.Text import androidx.compose.material.rememberModalBottomSheetState import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color -import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.dp -import com.google.accompanist.themeadapter.material.MdcTheme -import com.redmadrobot.debug.core.R import com.redmadrobot.debug.core.extension.getAllPlugins import com.redmadrobot.debug.core.plugin.Plugin import kotlinx.coroutines.launch @@ -53,24 +47,15 @@ public fun DebugBottomSheet(onClose: () -> Unit) { }, skipHalfExpanded = false ) - val context = LocalContext.current - val themeWrapper by remember { - mutableStateOf( - value = ContextThemeWrapper(context, R.style.DebugPanelTheme) - ) - } - MdcTheme(context = themeWrapper) { - ModalBottomSheetLayout( - sheetContent = { BottomSheetContent() }, - sheetState = state, - scrimColor = Color.Transparent, - content = {} - ) - } + ModalBottomSheetLayout( + sheetContent = { BottomSheetContent() }, + sheetState = state, + scrimColor = Color.Transparent, + content = {}, + ) } -@OptIn(ExperimentalFoundationApi::class) @Composable private fun BottomSheetContent() { val plugins = remember { getAllPlugins() } diff --git a/panel-core/src/main/res/values/styles.xml b/panel-core/src/main/res/values/styles.xml index 68809c4c..2adf35ce 100644 --- a/panel-core/src/main/res/values/styles.xml +++ b/panel-core/src/main/res/values/styles.xml @@ -14,8 +14,8 @@ @android:color/transparent true @null - @null; - false; + @null + true true true diff --git a/panel-no-op/build.gradle.kts b/panel-no-op/build.gradle.kts index c4d30cfb..c0992f5f 100644 --- a/panel-no-op/build.gradle.kts +++ b/panel-no-op/build.gradle.kts @@ -43,6 +43,6 @@ dependencies { implementation(stack.okhttp) implementation(androidx.appcompat) implementation(rmr.flipper) - implementation(libs.konfeature) + implementation(rmr.konfeature) implementation(stack.kotlinx.coroutines.android) } diff --git a/plugins/plugin-accounts/build.gradle.kts b/plugins/plugin-accounts/build.gradle.kts index be68e8f8..8778aed5 100644 --- a/plugins/plugin-accounts/build.gradle.kts +++ b/plugins/plugin-accounts/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id(Plugins.Android.libraryPlagin) kotlin(Plugins.Kotlin.androidPlugin) kotlin(Plugins.Kotlin.kapt) + alias(stack.plugins.kotlin.compose) id("convention-publish") } @@ -42,13 +43,6 @@ android { } } - buildFeatures { - compose = true - } - - composeOptions { - kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() - } namespace = "com.redmadrobot.debug.plugin.accounts" } diff --git a/plugins/plugin-app-settings/build.gradle.kts b/plugins/plugin-app-settings/build.gradle.kts index 9e47dea9..38d64b64 100644 --- a/plugins/plugin-app-settings/build.gradle.kts +++ b/plugins/plugin-app-settings/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id(Plugins.Android.libraryPlagin) kotlin(Plugins.Kotlin.androidPlugin) kotlin(Plugins.Kotlin.kapt) + alias(stack.plugins.kotlin.compose) id("convention-publish") } @@ -36,13 +37,6 @@ android { jvmTarget = JavaVersion.VERSION_11.toString() } - buildFeatures { - compose = true - } - - composeOptions { - kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() - } namespace = "com.redmadrobot.debug.plugin.appsettings" } diff --git a/plugins/plugin-flipper/build.gradle.kts b/plugins/plugin-flipper/build.gradle.kts index bd60dc82..5aadd5c8 100644 --- a/plugins/plugin-flipper/build.gradle.kts +++ b/plugins/plugin-flipper/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id(Plugins.Android.libraryPlagin) kotlin(Plugins.Kotlin.androidPlugin) kotlin(Plugins.Kotlin.kapt) + alias(stack.plugins.kotlin.compose) id("convention-publish") } @@ -37,13 +38,6 @@ android { freeCompilerArgs += "-Xexplicit-api=strict" } - buildFeatures { - compose = true - } - - composeOptions { - kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() - } namespace = "com.redmadrobot.debug.plugin.flipper" } diff --git a/plugins/plugin-konfeature/build.gradle.kts b/plugins/plugin-konfeature/build.gradle.kts index 76fa6d07..2c529150 100644 --- a/plugins/plugin-konfeature/build.gradle.kts +++ b/plugins/plugin-konfeature/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id(Plugins.Android.libraryPlagin) kotlin(Plugins.Kotlin.androidPlugin) kotlin(Plugins.Kotlin.kapt) + alias(stack.plugins.kotlin.compose) id("convention-publish") } @@ -37,13 +38,6 @@ android { freeCompilerArgs += "-Xexplicit-api=strict" } - buildFeatures { - compose = true - } - - composeOptions { - kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() - } namespace = "com.redmadrobot.debug.plugin.konfeature" } diff --git a/plugins/plugin-servers/build.gradle.kts b/plugins/plugin-servers/build.gradle.kts index 5fe6e068..93a3dd9b 100644 --- a/plugins/plugin-servers/build.gradle.kts +++ b/plugins/plugin-servers/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id(Plugins.Android.libraryPlagin) kotlin(Plugins.Kotlin.androidPlugin) kotlin(Plugins.Kotlin.kapt) + alias(stack.plugins.kotlin.compose) id("convention-publish") } @@ -36,13 +37,6 @@ android { jvmTarget = JavaVersion.VERSION_11.toString() } - buildFeatures { - compose = true - } - - composeOptions { - kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() - } namespace = "com.redmadrobot.debug.plugin.servers" } diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index 7d4dfe5a..d25a413e 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id(Plugins.Android.applicationPlugin) kotlin(Plugins.Kotlin.androidPlugin) + alias(stack.plugins.kotlin.compose) } android { @@ -23,12 +24,8 @@ android { buildFeatures { viewBinding = true - compose = true } - composeOptions { - kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get() - } buildTypes { getByName("release") { signingConfig = signingConfigs.getByName("debug") @@ -43,7 +40,7 @@ dependencies { implementation(stack.material) implementation(androidx.constraintlayout) implementation(rmr.flipper) - implementation(libs.konfeature) + implementation(rmr.konfeature) implementation(stack.timber) implementation(stack.kotlinx.coroutines.android) implementation(androidx.lifecycle.runtime) diff --git a/settings.gradle.kts b/settings.gradle.kts index 0be26cb7..656cd3da 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,20 +3,35 @@ rootProject.name = "Debug panel" pluginManagement { repositories { gradlePluginPortal() - google() + google { + content { + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + includeGroupAndSubgroups("androidx") + } + } mavenCentral() } } +@Suppress("UnstableApiUsage") dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { + google { + content { + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + includeGroupAndSubgroups("androidx") + } + } + mavenCentral() - google() + gradlePluginPortal() } versionCatalogs { - val version = "2024.04.10" + val version = "2024.09.04" // Keep it in sync with buildSrc/settings.gradle.kts create("rmr") { from("com.redmadrobot.versions:versions-redmadrobot:$version") }