diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ff15ed391..15128bdcd 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -28,7 +28,8 @@ plugins { alias(libs.plugins.meshtastic.android.application.flavors) alias(libs.plugins.meshtastic.android.application.compose) alias(libs.plugins.meshtastic.android.application.firebase) - alias(libs.plugins.meshtastic.detekt) + alias(libs.plugins.meshtastic.hilt) + alias(libs.plugins.meshtastic.android.room) alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.kotlin.serialization) alias(libs.plugins.protobuf) @@ -77,11 +78,8 @@ android { ?: System.getenv("VERSION_NAME") ?: Configs.VERSION_NAME_BASE // Restored Configs.VERSION_NAME_BASE fallback ) - testInstrumentationRunner = "com.geeksville.mesh.TestRunner" buildConfigField("String", "MIN_FW_VERSION", "\"${Configs.MIN_FW_VERSION}\"") // Used Configs buildConfigField("String", "ABS_MIN_FW_VERSION", "\"${Configs.ABS_MIN_FW_VERSION}\"") // Used Configs - // per https://developer.android.com/studio/write/vector-asset-studio - vectorDrawables.useSupportLibrary = true // We have to list all translated languages here, // because some of our libs have bogus languages that google play // doesn't like and we need to strip them (gr) @@ -144,17 +142,10 @@ android { if (keystoreProperties["storeFile"] != null) { signingConfig = signingConfigs.named("release").get() } - isMinifyEnabled = true - isShrinkResources = true - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } } bundle { language { enableSplit = false } } - buildFeatures { - aidl = true - compose = true // compose setup is likely in com.meshtastic.android.application.compose - buildConfig = true - } + buildFeatures { aidl = true } sourceSets { named("main") { proto { srcDir("src/main/proto") } } // Adds exported schema location as test app assets. @@ -211,7 +202,6 @@ project.afterEvaluate { logger.lifecycle("Version code is set to: ${android.defa dependencies { implementation(project(":network")) // Bundles - implementation(libs.bundles.androidx) implementation(libs.bundles.markdown) implementation(libs.bundles.coroutines) implementation(libs.bundles.datastore) @@ -235,12 +225,6 @@ dependencies { implementation(libs.accompanist.permissions) implementation(libs.timber) - testImplementation(libs.bundles.testing) - androidTestImplementation(libs.bundles.testing.android) - androidTestImplementation(libs.bundles.testing.hilt) - androidTestImplementation(libs.bundles.testing.navigation) - androidTestImplementation(libs.bundles.testing.room) - dokkaPlugin(libs.dokka.android.documentation.plugin) } diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 64e17768c..81754164d 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -20,6 +20,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { `kotlin-dsl` alias(libs.plugins.android.lint) + alias(libs.plugins.dependency.analysis) } group = "com.geeksville.mesh.buildlogic" @@ -89,11 +90,11 @@ gradlePlugin { id = libs.plugins.meshtastic.android.application.compose.get().pluginId implementationClass = "AndroidApplicationComposeConventionPlugin" } - register("hilt") { + register("meshtasticHilt") { id = libs.plugins.meshtastic.hilt.get().pluginId implementationClass = "HiltConventionPlugin" } - register("detekt") { + register("meshtasticDetekt") { id = libs.plugins.meshtastic.detekt.get().pluginId implementationClass = "DetektConventionPlugin" } @@ -102,5 +103,10 @@ gradlePlugin { implementationClass = "AndroidRoomConventionPlugin" } + register("meshtasticSpotless") { + id = libs.plugins.meshtastic.spotless.get().pluginId + implementationClass = "SpotlessConventionPlugin" + } + } } diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt index 7dcfa811e..3b7856523 100644 --- a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt @@ -16,17 +16,13 @@ */ import com.android.build.api.dsl.ApplicationExtension -import com.diffplug.gradle.spotless.SpotlessExtension import com.geeksville.mesh.buildlogic.configureKotlinAndroid -import com.geeksville.mesh.buildlogic.configureSpotless +import com.geeksville.mesh.buildlogic.libs import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.plugins.JavaPluginExtension -import org.gradle.jvm.toolchain.JavaLanguageVersion import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.withType -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.gradle.kotlin.dsl.dependencies class AndroidApplicationConventionPlugin : Plugin { override fun apply(target: Project) { @@ -35,9 +31,8 @@ class AndroidApplicationConventionPlugin : Plugin { apply(plugin = "com.android.application") apply(plugin = "org.jetbrains.kotlin.android") apply(plugin = "meshtastic.android.lint") - apply(plugin = "meshtastic.android.room") - apply(plugin = "meshtastic.hilt") - apply(plugin = "com.diffplug.spotless") + apply(plugin = "meshtastic.detekt") + apply(plugin = "meshtastic.spotless") apply(plugin = "com.autonomousapps.dependency-analysis") extensions.configure { @@ -70,27 +65,11 @@ class AndroidApplicationConventionPlugin : Plugin { buildConfig = true } - } - - extensions.configure { - configureSpotless(this) - } - - extensions.configure { - toolchain { - languageVersion.set(JavaLanguageVersion.of(21)) + dependencies { + "testImplementation"(libs.findBundle("testing").get()) + "androidTestImplementation"(libs.findBundle("testing.android").get()) } - } - tasks.withType().configureEach { - compilerOptions { - freeCompilerArgs.addAll( - "-opt-in=kotlin.RequiresOptIn", - "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", - "-Xcontext-receivers", - "-Xannotation-default-target=param-property", - ) - } } } } diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt index 3e2fa8d55..04edc00f9 100644 --- a/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt @@ -16,6 +16,7 @@ */ import com.android.build.api.dsl.ApplicationExtension +import com.geeksville.mesh.buildlogic.MeshtasticFlavor import com.geeksville.mesh.buildlogic.libs import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension import org.gradle.api.Plugin @@ -24,6 +25,7 @@ import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.exclude +import org.gradle.language.nativeplatform.internal.Dimensions.applicationVariants class AndroidApplicationFirebaseConventionPlugin : Plugin { override fun apply(target: Project) { @@ -32,23 +34,22 @@ class AndroidApplicationFirebaseConventionPlugin : Plugin { apply(plugin = "com.google.firebase.firebase-perf") apply(plugin = "com.google.firebase.crashlytics") - dependencies { - val bom = libs.findLibrary("firebase-bom").get() - "implementation"(platform(bom)) - "implementation"(libs.findBundle("firebase").get()){ - /* - Exclusion of protobuf / protolite dependencies is necessary as the - datastore-proto brings in protobuf dependencies. These are the source of truth - for Now in Android. - That's why the duplicate classes from below dependencies are excluded. - */ - exclude(group = "com.google.protobuf", module = "protobuf-java") - exclude(group = "com.google.protobuf", module = "protobuf-kotlin") - exclude(group = "com.google.protobuf", module = "protobuf-javalite") - exclude(group = "com.google.firebase", module = "protolite-well-known-types") + dependencies { + val bom = libs.findLibrary("firebase-bom").get() + "implementation"(platform(bom)) + "implementation"(libs.findBundle("firebase").get()) { + /* + Exclusion of protobuf / protolite dependencies is necessary as the + datastore-proto brings in protobuf dependencies. These are the source of truth + for Now in Android. + That's why the duplicate classes from below dependencies are excluded. + */ + exclude(group = "com.google.protobuf", module = "protobuf-java") + exclude(group = "com.google.protobuf", module = "protobuf-kotlin") + exclude(group = "com.google.protobuf", module = "protobuf-javalite") + exclude(group = "com.google.firebase", module = "protolite-well-known-types") + } } - "implementation"(libs.findLibrary("firebase.crashlytics").get()) - } extensions.configure { buildTypes.configureEach { diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationFlavorsConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationFlavorsConventionPlugin.kt index b805a805f..36945f951 100644 --- a/build-logic/convention/src/main/kotlin/AndroidApplicationFlavorsConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidApplicationFlavorsConventionPlugin.kt @@ -39,7 +39,6 @@ class AndroidApplicationFlavorsConventionPlugin : Plugin { // Google specific dependencies "googleImplementation"(libs.findBundle("maps-compose").get()) "googleImplementation"(libs.findLibrary("awesome-app-rating").get()) - "googleImplementation"(platform(libs.findLibrary("firebase-bom").get())) "googleImplementation"(libs.findBundle("datadog").get()) } } diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt index c3d700ff9..1b668c5c0 100644 --- a/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt @@ -27,7 +27,6 @@ class AndroidLibraryComposeConventionPlugin : Plugin { with(target) { apply(plugin = "com.android.library") apply(plugin = "org.jetbrains.kotlin.plugin.compose") - apply(plugin = "com.autonomousapps.dependency-analysis") val extension = extensions.getByType() configureAndroidCompose(extension) diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt index adc8e8761..bddb25481 100644 --- a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt @@ -35,7 +35,9 @@ class AndroidLibraryConventionPlugin : Plugin { apply(plugin = "com.android.library") apply(plugin = "org.jetbrains.kotlin.android") apply(plugin = "meshtastic.android.lint") - apply(plugin = "com.diffplug.spotless") + apply(plugin = "meshtastic.detekt") + apply(plugin = "meshtastic.spotless") + apply(plugin = "com.autonomousapps.dependency-analysis") extensions.configure { configureKotlinAndroid(this) @@ -57,10 +59,6 @@ class AndroidLibraryConventionPlugin : Plugin { "androidTestImplementation"(libs.findLibrary("kotlin.test").get()) "testImplementation"(libs.findLibrary("kotlin.test").get()) - "implementation"(libs.findLibrary("androidx.tracing.ktx").get()) - } - extensions.configure { - configureSpotless(this) } } } diff --git a/build-logic/convention/src/main/kotlin/AndroidLintConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLintConventionPlugin.kt index d2cc0b95f..04fe442f2 100644 --- a/build-logic/convention/src/main/kotlin/AndroidLintConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidLintConventionPlugin.kt @@ -22,30 +22,33 @@ import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure +import java.io.File class AndroidLintConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { when { pluginManager.hasPlugin("com.android.application") -> - configure { lint(Lint::configure) } + configure { lint { configure(project) } } pluginManager.hasPlugin("com.android.library") -> - configure { lint(Lint::configure) } + configure { lint { configure(project) } } else -> { apply(plugin = "com.android.lint") - configure(Lint::configure) + configure { configure(project) } } } } } } -private fun Lint.configure() { +private fun Lint.configure(project: Project) { xmlReport = true sarifReport = true checkDependencies = true abortOnError = false disable += "GradleDependency" + sarifOutput = File("${project.layout.buildDirectory}/reports/lint/lint-results.sarif") + xmlOutput = File("${project.layout.buildDirectory}/reports/lint/lint-results.xml") } diff --git a/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt index 7ad2c59ec..746443e0e 100644 --- a/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt @@ -46,6 +46,7 @@ class AndroidRoomConventionPlugin : Plugin { "implementation"(libs.findLibrary("room.runtime").get()) "implementation"(libs.findLibrary("room.ktx").get()) "ksp"(libs.findLibrary("room.compiler").get()) + "androidTestImplementation"(libs.findBundle("testing.room").get()) } } } diff --git a/build-logic/convention/src/main/kotlin/DetektConventionPlugin.kt b/build-logic/convention/src/main/kotlin/DetektConventionPlugin.kt index d2fd3d85d..9d2eb952c 100644 --- a/build-logic/convention/src/main/kotlin/DetektConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/DetektConventionPlugin.kt @@ -14,4 +14,4 @@ class DetektConventionPlugin : Plugin { configureDetekt(extension) } } -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/HiltConventionPlugin.kt b/build-logic/convention/src/main/kotlin/HiltConventionPlugin.kt index 008476935..b6757aa4c 100644 --- a/build-logic/convention/src/main/kotlin/HiltConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/HiltConventionPlugin.kt @@ -29,6 +29,7 @@ class HiltConventionPlugin : Plugin { dependencies { "ksp"(libs.findLibrary("hilt.compiler").get()) "implementation"(libs.findBundle("hilt").get()) + "androidTestImplementation"(libs.findBundle("testing.hilt").get()) } // Add support for Jvm Module, base on org.jetbrains.kotlin.jvm diff --git a/build-logic/convention/src/main/kotlin/SpotlessConventionPlugin.kt b/build-logic/convention/src/main/kotlin/SpotlessConventionPlugin.kt new file mode 100644 index 000000000..c10c3c277 --- /dev/null +++ b/build-logic/convention/src/main/kotlin/SpotlessConventionPlugin.kt @@ -0,0 +1,17 @@ +import com.diffplug.gradle.spotless.SpotlessExtension +import com.geeksville.mesh.buildlogic.configureSpotless +import com.geeksville.mesh.buildlogic.libs +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.getByType + +class SpotlessConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + apply(plugin = libs.findPlugin("spotless").get().get().pluginId) + val extension = extensions.getByType() + configureSpotless(extension) + } + } +} diff --git a/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/AndroidCompose.kt b/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/AndroidCompose.kt index 5b1847eec..3c99115ad 100644 --- a/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/AndroidCompose.kt +++ b/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/AndroidCompose.kt @@ -22,11 +22,6 @@ import org.gradle.api.provider.Provider import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension -import kotlin.apply -import kotlin.io.toRelativeString -import kotlin.let -import kotlin.takeIf -import kotlin.text.toBoolean /** * Configure Compose-specific options @@ -47,9 +42,12 @@ internal fun Project.configureAndroidCompose( "implementation"(libs.findBundle("adaptive").get()) "implementation"(libs.findBundle("lifecycle").get()) "implementation"(libs.findBundle("navigation").get()) + "androidTestImplementation"(libs.findBundle("testing.navigation").get()) "implementation"(libs.findBundle("navigation3").get()) "implementation"(libs.findBundle("ui-tooling").get()) "implementation"(libs.findLibrary("androidx-compose-ui-tooling-preview").get()) + "implementation"(libs.findLibrary("androidx-compose-runtime").get()) + "implementation"(libs.findLibrary("androidx-compose-runtime-tracing").get()) "debugImplementation"(libs.findLibrary("androidx-compose-ui-tooling").get()) "debugImplementation"(libs.findLibrary("androidx-compose-ui-testManifest").get()) } diff --git a/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/Detekt.kt b/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/Detekt.kt index 9c29222ef..1431185d2 100644 --- a/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/Detekt.kt +++ b/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/Detekt.kt @@ -22,6 +22,7 @@ import io.gitlab.arturbosch.detekt.extensions.DetektExtension import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.named +import java.io.File internal fun Project.configureDetekt(extension: DetektExtension) = extension.apply { extension.apply { @@ -45,9 +46,14 @@ internal fun Project.configureDetekt(extension: DetektExtension) = extension.app sarif.required.set(true) md.required.set(true) } + reports.xml.outputLocation.set(File("$rootDir/build/reports/detekt/detekt.xml")) + reports.html.outputLocation.set(File("$rootDir/build/reports/detekt/detekt.html")) + reports.txt.outputLocation.set(File("$rootDir/build/reports/detekt/detekt.txt")) + reports.sarif.outputLocation.set(File("$rootDir/build/reports/detekt/detekt.sarif")) + reports.md.outputLocation.set(File("$rootDir/build/reports/detekt/detekt.md")) } dependencies { "detektPlugins"(libs.findLibrary("detekt-formatting").get()) "detektPlugins"(libs.findLibrary("detekt-compose").get()) } -} \ No newline at end of file +} diff --git a/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/KotlinAndroid.kt b/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/KotlinAndroid.kt index 94e8cb516..aa32fd18b 100644 --- a/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/KotlinAndroid.kt +++ b/build-logic/convention/src/main/kotlin/com/geeksville/mesh/buildlogic/KotlinAndroid.kt @@ -21,15 +21,15 @@ import com.android.build.api.dsl.CommonExtension import org.gradle.api.JavaVersion import org.gradle.api.Project import org.gradle.api.plugins.JavaPluginExtension -import org.gradle.kotlin.dsl.assign +import org.gradle.jvm.toolchain.JavaLanguageVersion import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension import org.jetbrains.kotlin.gradle.dsl.KotlinBaseExtension import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension -import kotlin.apply -import kotlin.text.toBoolean +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile /** * Configure base Kotlin with Android options @@ -65,6 +65,9 @@ internal fun Project.configureKotlinJvm() { extensions.configure { sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21 + toolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } } configureKotlin() @@ -73,36 +76,17 @@ internal fun Project.configureKotlinJvm() { /** * Configure base Kotlin options */ -private inline fun Project.configureKotlin() = configure { - // Treat all Kotlin warnings as errors (disabled by default) - // Override by setting warningsAsErrors=true in your ~/.gradle/gradle.properties - val warningsAsErrors = providers.gradleProperty("warningsAsErrors").map { - it.toBoolean() - }.orElse(false) - when (this) { - is KotlinAndroidProjectExtension -> compilerOptions - is KotlinJvmProjectExtension -> compilerOptions - else -> TODO("Unsupported project extension $this ${T::class}") - }.apply { - jvmTarget.assign(JvmTarget.JVM_21) - allWarningsAsErrors.assign(warningsAsErrors) - freeCompilerArgs.add( - // Enable experimental coroutines APIs, including Flow - "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", - ) - freeCompilerArgs.add( - /** - * Remove this args after Phase 3. - * https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-consistent-copy-visibility/#deprecation-timeline - * - * Deprecation timeline - * Phase 3. (Supposedly Kotlin 2.2 or Kotlin 2.3). - * The default changes. - * Unless ExposedCopyVisibility is used, the generated 'copy' method has the same visibility as the primary constructor. - * The binary signature changes. The error on the declaration is no longer reported. - * '-Xconsistent-data-class-copy-visibility' compiler flag and ConsistentCopyVisibility annotation are now unnecessary. - */ - "-Xconsistent-data-class-copy-visibility" - ) +private inline fun Project.configureKotlin() { + tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_21) + allWarningsAsErrors.set(false) + freeCompilerArgs.addAll( + // Enable experimental coroutines APIs, including Flow + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + "-Xcontext-parameters", + "-Xannotation-default-target=param-property" + ) + } } } diff --git a/build.gradle.kts b/build.gradle.kts index 8678f2325..7eae6be01 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ plugins { alias(libs.plugins.kotlin.serialization) apply false alias(libs.plugins.protobuf) apply false alias(libs.plugins.secrets) apply false - alias(libs.plugins.dependency.analysis) apply false + alias(libs.plugins.dependency.analysis) alias(libs.plugins.detekt) apply false alias(libs.plugins.meshtastic.detekt) apply false alias(libs.plugins.kover) diff --git a/compose_compiler_config.conf b/compose_compiler_config.conf new file mode 100644 index 000000000..bb81c2725 --- /dev/null +++ b/compose_compiler_config.conf @@ -0,0 +1,5 @@ +// This file contains classes (with possible wildcards) that the Compose Compiler will treat as stable. +// It allows us to define classes that are not part of our codebase without wrapping them in a stable class. +// For more information, check https://developer.android.com/jetpack/compose/performance/stability/fix#configuration-file + + diff --git a/gradle.properties b/gradle.properties index 28614960a..a86ebf600 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Ensure important default jvmargs aren't overwritten. See https://github.com/gradle/gradle/issues/19750 -org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g +org.gradle.jvmargs=-Xmx4g -XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit @@ -57,4 +57,7 @@ android.nonTransitiveRClass=true org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true -dependency.analysis.print.build.health=true \ No newline at end of file +dependency.analysis.print.build.health=true + +ksp.incremental=true +ksp.incremental.classpath=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3d4d457c8..035c32102 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,36 +1,77 @@ -#[allow(unused)] [versions] +# Android agp = "8.13.0" -androidxComposeMaterial3Adaptive = "1.2.0-beta02" appcompat = "1.7.1" -coil = "3.3.0" +accompanist = "0.37.3" + +# androidx +androidxComposeMaterial3Adaptive = "1.2.0-beta02" +androidxTracing = "1.3.0" datastore = "1.1.7" +lifecycle = "2.9.3" +navigation = "2.9.4" +navigation3 = "1.0.0-alpha09" +room = "2.8.0" + +# Kotlin +kotlin = "2.2.20" +kotlinx-coroutines-android = "1.10.2" + +# Google +hilt = "2.57.1" +maps-compose = "6.10.0" + +# Networking +okhttp = "5.1.0" +retrofit = "3.0.0" + +# Other +coil = "3.3.0" dd-sdk-android = "3.0.0" detekt = "1.23.8" devtools-ksp = "2.2.20-2.0.2" -hilt = "2.57.1" -kotlin = "2.2.20" -kotlinx-coroutines-android = "1.10.2" -lifecycle = "2.9.3" -maps-compose = "6.10.0" markdownRenderer = "0.37.0" -navigation = "2.9.4" -navigation3 = "1.0.0-alpha09" -okhttp = "5.1.0" osmdroid-android = "6.1.20" protobuf = "4.32.1" -retrofit = "3.0.0" -room = "2.8.0" + [libraries] -accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version = "0.37.3" } +# AndroidX activity = { module = "androidx.activity:activity" } -actvity-ktx = { module = "androidx.activity:activity-ktx" } activity-compose = { module = "androidx.activity:activity-compose" } -android-desugarJdkLibs = { module = "com.android.tools:desugar_jdk_libs", version = "2.1.5" } -androidx-tracing-ktx = { module = "androidx.tracing:tracing-ktx", version = "1.3.0" } +actvity-ktx = { module = "androidx.activity:activity-ktx" } +appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } +appcompat-resources = { module = "androidx.appcompat:appcompat-resources", version.ref = "appcompat" } +constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version = "2.2.1" } +core-ktx = { module = "androidx.core:core-ktx", version = "1.17.0" } +core-location-altitude = { module = "androidx.core:core-location-altitude", version = "1.0.0-alpha03" } +core-splashscreen = { module = "androidx.core:core-splashscreen", version = "1.0.1" } +datastore = { module = "androidx.datastore:datastore", version.ref = "datastore" } +datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore" } +emoji2-emojipicker = { module = "androidx.emoji2:emoji2-emojipicker", version = "1.6.0" } +hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version = "1.3.0" } +lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "lifecycle" } +lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycle" } +lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle" } +lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycle" } +lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" } +lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" } +lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" } +navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigation" } +navigation-testing = { module = "androidx.navigation:navigation-testing", version.ref = "navigation" } +navigation3-runtime = { module = "androidx.navigation3:navigation3-runtime", version.ref = "navigation3" } +navigation3-ui = { module = "androidx.navigation3:navigation3-ui", version.ref = "navigation3" } +room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } +room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" } +room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" } +room-testing = { module = "androidx.room:room-testing", version.ref = "room" } +tracing-ktx = { module = "androidx.tracing:tracing-ktx", version.ref = "androidxTracing" } +work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version = "2.10.4" } + +# Compose +accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" } androidx-compose-bom = { module = "androidx.compose:compose-bom-alpha", version = "2025.09.00" } -androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version = "1.9.1" } +androidx-compose-foundation = { module = "androidx.compose.foundation:foundation" } androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" } androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" } androidx-compose-material3 = { module = "androidx.compose.material3:material3" } @@ -40,25 +81,56 @@ androidx-compose-material3-adaptive-layout = { module = "androidx.compose.materi androidx-compose-material3-adaptive-navigation = { module = "androidx.compose.material3.adaptive:adaptive-navigation", version.ref = "androidxComposeMaterial3Adaptive" } androidx-compose-material3-windowSizeClass = { module = "androidx.compose.material3:material3-window-size-class" } androidx-compose-runtime = { module = "androidx.compose.runtime:runtime" } -androidx-compose-runtime-tracing = { module = "androidx.compose.runtime:runtime-tracing", version = "1.9.1" } +androidx-compose-runtime-tracing = { module = "androidx.compose.runtime:runtime-tracing", version.ref = "androidxTracing" } androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test-junit4" } androidx-compose-ui-testManifest = { module = "androidx.compose.ui:ui-test-manifest" } androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } -appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } -appcompat-resources = { module = "androidx.appcompat:appcompat-resources", version.ref = "appcompat" } +compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata" } + +# Google +android-desugarJdkLibs = { module = "com.android.tools:desugar_jdk_libs", version = "2.1.5" } +firebase-analytics = { module = "com.google.firebase:firebase-analytics" } +firebase-bom = { module = "com.google.firebase:firebase-bom", version = "34.2.0" } +firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" } +firebase-performance = { module = "com.google.firebase:firebase-perf" } +hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } +hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" } +hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" } +location-services = { module = "com.google.android.gms:play-services-location", version = "21.3.0" } +maps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" } +maps-compose-utils = { module = "com.google.maps.android:maps-compose-utils", version.ref = "maps-compose" } +maps-compose-widgets = { module = "com.google.maps.android:maps-compose-widgets", version.ref = "maps-compose" } +protobuf-kotlin = { module = "com.google.protobuf:protobuf-kotlin", version.ref = "protobuf" } +protoc = { module = "com.google.protobuf:protoc", version.ref = "protobuf" } +zxing-core = { module = "com.google.zxing:core", version = "3.5.3" } +truth = { module = "com.google.truth:truth", version = "1.4.5" } + +# Kotlin +kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } +kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version = "0.4.0" } +kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines-android" } +kotlinx-coroutines-guava = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-guava", version.ref = "kotlinx-coroutines-android" } +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.9.0" } + +# Networking +okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } +okhttp3-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" } +retrofit2 = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } +retrofit2-kotlin-serialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization", version.ref = "retrofit" } + +# Testing +espresso-core = { module = "androidx.test.espresso:espresso-core", version = "3.7.0" } +ext-junit = { module = "androidx.test.ext:junit", version = "1.3.0" } +junit = { module = "junit:junit", version = "4.13.2" } + +# Other awesome-app-rating = { module = "com.suddenh4x.ratingdialog:awesome-app-rating", version = "2.8.0" } coil = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" } coil-network-core = { module = "io.coil-kt.coil3:coil-network-core", version.ref = "coil" } coil-network-okhttp = { module = "io.coil-kt.coil3:coil-network-okhttp", version.ref = "coil" } coil-svg = { module = "io.coil-kt.coil3:coil-svg", version.ref = "coil" } -compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata" } -constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version = "2.2.1" } -core-ktx = { module = "androidx.core:core-ktx", version = "1.17.0" } -core-location-altitude = { module = "androidx.core:core-location-altitude", version = "1.0.0-alpha03" } -core-splashscreen = { module = "androidx.core:core-splashscreen", version = "1.0.1" } -datastore = { module = "androidx.datastore:datastore", version.ref = "datastore" } -datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore" } dd-sdk-android-compose = { module = "com.datadoghq:dd-sdk-android-compose", version.ref = "dd-sdk-android" } dd-sdk-android-logs = { module = "com.datadoghq:dd-sdk-android-logs", version.ref = "dd-sdk-android" } dd-sdk-android-okhttp = { module = "com.datadoghq:dd-sdk-android-okhttp", version.ref = "dd-sdk-android" } @@ -69,109 +141,63 @@ dd-sdk-android-timber = { module = "com.datadoghq:dd-sdk-android-timber", versio dd-sdk-android-trace = { module = "com.datadoghq:dd-sdk-android-trace", version.ref = "dd-sdk-android" } dd-sdk-android-trace-otel = { module = "com.datadoghq:dd-sdk-android-trace-otel", version.ref = "dd-sdk-android" } dokka-android-documentation-plugin = { module = "org.jetbrains.dokka:android-documentation-plugin", version = "2.0.0" } -emoji2-emojipicker = { module = "androidx.emoji2:emoji2-emojipicker", version = "1.6.0" } -espresso-core = { module = "androidx.test.espresso:espresso-core", version = "3.7.0" } -ext-junit = { module = "androidx.test.ext:junit", version = "1.3.0" } -firebase-analytics = { module = "com.google.firebase:firebase-analytics" } -firebase-bom = { module = "com.google.firebase:firebase-bom", version = "34.2.0" } -firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" } -firebase-performance = { module = "com.google.firebase:firebase-perf" } -hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } -hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" } -hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" } -hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version = "1.3.0" } -junit = { module = "junit:junit", version = "4.13.2" } -kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } -kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version = "0.4.0" } -kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines-android" } -kotlinx-coroutines-guava = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-guava", version.ref = "kotlinx-coroutines-android" } -kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.9.0" } -kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } -lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "lifecycle" } -lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycle" } -lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifecycle" } -lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycle" } -lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" } -lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycle" } -lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" } -location-services = { module = "com.google.android.gms:play-services-location", version = "21.3.0" } -maps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" } -maps-compose-utils = { module = "com.google.maps.android:maps-compose-utils", version.ref = "maps-compose" } -maps-compose-widgets = { module = "com.google.maps.android:maps-compose-widgets", version.ref = "maps-compose" } markdown-renderer = { module = "com.mikepenz:multiplatform-markdown-renderer", version.ref = "markdownRenderer" } markdown-renderer-m3 = { module = "com.mikepenz:multiplatform-markdown-renderer-m3", version.ref = "markdownRenderer" } markdown-renderer-android = { module = "com.mikepenz:multiplatform-markdown-renderer-android", version.ref = "markdownRenderer" } material = { module = "com.google.android.material:material", version = "1.13.0" } mgrs = { module = "mil.nga:mgrs", version = "2.1.3" } -navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigation" } -navigation-testing = { module = "androidx.navigation:navigation-testing", version.ref = "navigation" } -navigation3-runtime = { module = "androidx.navigation3:navigation3-runtime", version.ref = "navigation3" } -navigation3-ui = { module = "androidx.navigation3:navigation3-ui", version.ref = "navigation3" } -okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } -okhttp3-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" } org-eclipse-paho-client-mqttv3 = { module = "org.eclipse.paho:org.eclipse.paho.client.mqttv3", version = "1.2.5" } osmbonuspack = { module = "com.github.MKergall:osmbonuspack", version = "6.9.0" } osmdroid-android = { module = "org.osmdroid:osmdroid-android", version.ref = "osmdroid-android" } osmdroid-geopackage = { module = "org.osmdroid:osmdroid-geopackage", version.ref = "osmdroid-android" } -protobuf-kotlin = { module = "com.google.protobuf:protobuf-kotlin", version.ref = "protobuf" } -protoc = { module = "com.google.protobuf:protoc", version.ref = "protobuf" } -retrofit2 = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } -retrofit2-kotlin-serialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization", version.ref = "retrofit" } -room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } -room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" } -room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" } -room-testing = { module = "androidx.room:room-testing", version.ref = "room" } streamsupport-minifuture = { module = "net.sourceforge.streamsupport:streamsupport-minifuture", version = "1.7.4" } timber = { module = "com.jakewharton.timber:timber", version = "5.0.1" } usb-serial-android = { module = "com.github.mik3y:usb-serial-for-android", version = "3.9.0" } -work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version = "2.10.4" } zxing-android-embedded = { module = "com.journeyapps:zxing-android-embedded", version = "4.3.0" } -zxing-core = { module = "com.google.zxing:core", version = "3.5.3" } -truth = { module = "com.google.truth:truth", version = "1.4.5" } -# Dependencies of the included build-logic +# Build Logic android-gradleApiPlugin = { module = "com.android.tools.build:gradle-api", version.ref = "agp" } android-tools-common = { module = "com.android.tools:common", version = "31.13.0" } +androidx-lint-gradle = { module = "androidx.lint:lint-gradle", version = "1.0.0-alpha05" } compose-gradlePlugin = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" } +detekt-compose = { module = "io.nlopez.compose.rules:detekt", version = "0.4.27" } +detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } +detekt-gradle = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" } firebase-crashlytics-gradlePlugin = { module = "com.google.firebase:firebase-crashlytics-gradle", version = "3.0.6" } firebase-performance-gradlePlugin = { module = "com.google.firebase:perf-plugin", version = "2.0.1" } ksp-gradlePlugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "devtools-ksp" } room-gradlePlugin = { module = "androidx.room:room-gradle-plugin", version.ref = "room" } spotless-gradlePlugin = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "7.2.1" } -androidx-lint-gradle = { module = "androidx.lint:lint-gradle", version = "1.0.0-alpha05" } -detekt-gradle = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" } -detekt-compose = { module = "io.nlopez.compose.rules:detekt", version = "0.4.27" } -detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } [bundles] -# Core AndroidX +# AndroidX androidx = ["core-ktx", "appcompat", "appcompat-resources", "actvity-ktx", "activity-compose"] - -# UI -ui = ["material", "constraintlayout", "androidx-compose-material3", "androidx-compose-material-iconsExtended", "androidx-compose-ui-tooling-preview", "compose-runtime-livedata"] -adaptive = ["androidx-compose-material3-adaptive", "androidx-compose-material3-adaptive-layout", "androidx-compose-material3-adaptive-navigation", "androidx-compose-material3-navigationSuite"] -ui-tooling = ["androidx-compose-ui-tooling"] #Separate for debugImplementation -markdown = ["markdown-renderer", "markdown-renderer-m3", "markdown-renderer-android"] - -# Lifecycle +datastore = ["datastore", "datastore-preferences"] lifecycle = ["lifecycle-runtime-ktx", "lifecycle-livedata-ktx", "lifecycle-viewmodel-ktx", "lifecycle-common-java8", "lifecycle-process", "lifecycle-viewmodel-compose", "lifecycle-runtime-compose"] - -# Navigation navigation = ["navigation-compose"] - -# Navigation 3 navigation3 = ["navigation3-runtime", "navigation3-ui"] +room = ["room-runtime", "room-ktx"] # Coroutines coroutines = ["kotlinx-coroutines-android", "kotlinx-coroutines-guava"] -# Data Storage -datastore = ["datastore", "datastore-preferences"] -room = ["room-runtime", "room-ktx"] - # Dependency Injection hilt = ["hilt-android", "hilt-navigation-compose"] +# Google +firebase = ["firebase-analytics", "firebase-crashlytics", "firebase-performance"] +maps-compose = ["location-services", "maps-compose", "maps-compose-utils", "maps-compose-widgets"] + +# Networking +retrofit = ["retrofit2", "retrofit2-kotlin-serialization", "okhttp3", "okhttp3-logging-interceptor"] + +# Other +coil = ["coil", "coil-network-core", "coil-network-okhttp", "coil-svg"] +datadog = ["dd-sdk-android-compose", "dd-sdk-android-logs", "dd-sdk-android-okhttp", "dd-sdk-android-rum", "dd-sdk-android-session-replay", "dd-sdk-android-session-replay-compose", "dd-sdk-android-timber", "dd-sdk-android-trace", "dd-sdk-android-trace-otel"] +markdown = ["markdown-renderer", "markdown-renderer-m3", "markdown-renderer-android"] +osm = ["osmdroid-android", "osmbonuspack", "mgrs"] +protobuf = ["protobuf-kotlin"] + # Testing testing = ["junit", "ext-junit"] testing-android = ["espresso-core", "androidx-compose-ui-test"] @@ -180,59 +206,54 @@ testing-hilt = ["hilt-android-testing"] testing-navigation = ["navigation-testing"] testing-room = ["room-testing"] -# OSM -osm = ["osmdroid-android", "osmbonuspack", "mgrs"] - -# Google Maps (Compose) -maps-compose = ["location-services", "maps-compose", "maps-compose-utils", "maps-compose-widgets"] - -# Firebase -firebase = ["firebase-analytics", "firebase-crashlytics", "firebase-performance"] -# Datadog -datadog = ["dd-sdk-android-compose", "dd-sdk-android-logs", "dd-sdk-android-okhttp", "dd-sdk-android-rum", "dd-sdk-android-session-replay", "dd-sdk-android-session-replay-compose", "dd-sdk-android-timber", "dd-sdk-android-trace", "dd-sdk-android-trace-otel"] - -# Protobuf -protobuf = ["protobuf-kotlin"] - -# retrofit -retrofit = ["retrofit2", "retrofit2-kotlin-serialization", "okhttp3", "okhttp3-logging-interceptor"] - -# coil -coil = ["coil", "coil-network-core", "coil-network-okhttp", "coil-svg"] +# UI +adaptive = ["androidx-compose-material3-adaptive", "androidx-compose-material3-adaptive-layout", "androidx-compose-material3-adaptive-navigation", "androidx-compose-material3-navigationSuite"] +ui = ["material", "constraintlayout", "androidx-compose-material3", "androidx-compose-material-iconsExtended", "androidx-compose-ui-tooling-preview", "compose-runtime-livedata"] +ui-tooling = ["androidx-compose-ui-tooling"] #Separate for debugImplementation [plugins] +# Android android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } android-lint = { id = "com.android.lint", version.ref = "agp" } + +# Kotlin compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } -datadog = { id = "com.datadoghq.dd-sdk-android-gradle-plugin", version = "1.20.0" } -detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } -dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version = "3.0.3" } -dokka = { id = "org.jetbrains.dokka", version = "2.0.0" } -devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "devtools-ksp" } -firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "3.0.6" } -firebase-perf = { id = "com.google.firebase.firebase-perf", version = "2.0.1" } -google-services = { id = "com.google.gms.google-services", version = "4.4.3" } -hilt = { id = "com.google.dagger.hilt.android" , version.ref = "hilt" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } kover = { id = "org.jetbrains.kotlinx.kover", version = "0.9.1" } + +# Google +devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "devtools-ksp" } +google-services = { id = "com.google.gms.google-services", version = "4.4.3" } +hilt = { id = "com.google.dagger.hilt.android" , version.ref = "hilt" } +secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version = "2.0.1" } + +# Firebase +firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "3.0.6" } +firebase-perf = { id = "com.google.firebase.firebase-perf", version = "2.0.1" } + +# Other +datadog = { id = "com.datadoghq.dd-sdk-android-gradle-plugin", version = "1.20.0" } +dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version = "3.0.2" } +detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } +dokka = { id = "org.jetbrains.dokka", version = "2.0.0" } protobuf = { id = "com.google.protobuf", version = "0.9.5" } room = { id = "androidx.room", version.ref = "room" } -secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version = "2.0.1" } spotless = { id = "com.diffplug.spotless", version = "7.2.1" } -# Plugins defined by this project +# Meshtastic meshtastic-android-application = { id = "meshtastic.android.application" } -meshtastic-android-library = { id = "meshtastic.android.library" } -meshtastic-android-application-flavors = { id = "meshtastic.android.application.flavors" } -meshtastic-android-lint = { id = "meshtastic.android.lint" } meshtastic-android-application-compose = { id = "meshtastic.android.application.compose" } meshtastic-android-application-firebase = { id = "meshtastic.android.application.firebase" } +meshtastic-android-application-flavors = { id = "meshtastic.android.application.flavors" } +meshtastic-android-library = { id = "meshtastic.android.library" } meshtastic-android-library-compose = { id = "meshtastic.android.library.compose" } +meshtastic-android-lint = { id = "meshtastic.android.lint" } meshtastic-android-room = { id = "meshtastic.android.room" } meshtastic-android-test = { id = "meshtastic.android.test" } -meshtastic-hilt = { id = "meshtastic.hilt" } meshtastic-detekt = { id = "meshtastic.detekt" } +meshtastic-hilt = { id = "meshtastic.hilt" } +meshtastic-spotless = { id = "meshtastic.spotless" } diff --git a/mesh_service_example/build.gradle.kts b/mesh_service_example/build.gradle.kts index e305ea127..3fa4ba691 100644 --- a/mesh_service_example/build.gradle.kts +++ b/mesh_service_example/build.gradle.kts @@ -1,21 +1,3 @@ -/* - * Copyright (c) 2025 Meshtastic LLC - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -import org.gradle.kotlin.dsl.androidTestImplementation - /* * Copyright (c) 2025 Meshtastic LLC * @@ -36,11 +18,9 @@ import org.gradle.kotlin.dsl.androidTestImplementation plugins { alias(libs.plugins.meshtastic.android.application) alias(libs.plugins.meshtastic.android.application.compose) - alias(libs.plugins.meshtastic.android.lint) alias(libs.plugins.kotlin.parcelize) alias(libs.plugins.kotlin.serialization) alias(libs.plugins.protobuf) - alias(libs.plugins.spotless) alias(libs.plugins.kover) } @@ -49,8 +29,6 @@ android { buildFeatures { aidl = true } } -kotlin { jvmToolchain(21) } - // per protobuf-gradle-plugin docs, this is recommended for android protobuf { protoc { protoc { artifact = "com.google.protobuf:protoc:4.32.1" } } @@ -69,9 +47,6 @@ dependencies { implementation(libs.material) implementation(libs.activity) implementation(libs.constraintlayout) - testImplementation(libs.junit) - androidTestImplementation(libs.ext.junit) - androidTestImplementation(libs.espresso.core) implementation(libs.bundles.protobuf) diff --git a/network/build.gradle.kts b/network/build.gradle.kts index 42434013c..9b99d2a66 100644 --- a/network/build.gradle.kts +++ b/network/build.gradle.kts @@ -17,10 +17,8 @@ plugins { alias(libs.plugins.meshtastic.android.library) - alias(libs.plugins.meshtastic.android.lint) alias(libs.plugins.meshtastic.hilt) alias(libs.plugins.kotlin.serialization) - alias(libs.plugins.spotless) alias(libs.plugins.dokka) alias(libs.plugins.kover) alias(libs.plugins.protobuf) @@ -28,14 +26,9 @@ plugins { android { buildFeatures { buildConfig = true } - compileSdk = 36 - defaultConfig { minSdk = 26 } - namespace = "com.geeksville.mesh.network" } -kotlin { jvmToolchain(21) } - dependencies { implementation(libs.bundles.retrofit) implementation(libs.bundles.coil)