Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Update version catalog version and add to buildSrc #30

Merged
merged 4 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

subprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += listOf(
"-opt-in=com.redmadrobot.debug.core.annotation.DebugPanelInternal"
)
compilerOptions {
freeCompilerArgs.add("-opt-in=com.redmadrobot.debug.core.annotation.DebugPanelInternal")
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
TopHlop marked this conversation as resolved.
Show resolved Hide resolved
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)
}
10 changes: 10 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
TopHlop marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
27 changes: 1 addition & 26 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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" }
2 changes: 1 addition & 1 deletion panel-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions panel-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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() }
Expand Down
4 changes: 2 additions & 2 deletions panel-core/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowContentOverlay">@null</item>;
<item name="android:backgroundDimEnabled">false</item>;
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
Expand Down
2 changes: 1 addition & 1 deletion panel-no-op/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
8 changes: 1 addition & 7 deletions plugins/plugin-accounts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -42,13 +43,6 @@ android {
}
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get()
}
namespace = "com.redmadrobot.debug.plugin.accounts"
}

Expand Down
8 changes: 1 addition & 7 deletions plugins/plugin-app-settings/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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"
}

Expand Down
8 changes: 1 addition & 7 deletions plugins/plugin-flipper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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"
}

Expand Down
8 changes: 1 addition & 7 deletions plugins/plugin-konfeature/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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"
}

Expand Down
8 changes: 1 addition & 7 deletions plugins/plugin-servers/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down Expand Up @@ -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"
}

Expand Down
7 changes: 2 additions & 5 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id(Plugins.Android.applicationPlugin)
kotlin(Plugins.Kotlin.androidPlugin)
alias(stack.plugins.kotlin.compose)
}

android {
Expand All @@ -23,12 +24,8 @@ android {

buildFeatures {
viewBinding = true
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = androidx.versions.compose.compiler.get()
}
buildTypes {
getByName("release") {
signingConfig = signingConfigs.getByName("debug")
Expand All @@ -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)
Expand Down
21 changes: 18 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down