From f31cd59ac97889931e932824d704b756f9074ed4 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Wed, 13 Aug 2025 13:36:57 -0700 Subject: [PATCH 01/16] migrated sv build architecture for toolkit project --- build-logic/.gitignore | 2 + build-logic/convention/.gitignore | 1 + build-logic/convention/build.gradle.kts | 62 +++++++++ ...droidApplicationComposeConventionPlugin.kt | 19 +++ .../AndroidApplicationConventionPlugin.kt | 53 ++++++++ .../AndroidLibraryComposeConventionPlugin.kt | 19 +++ .../java/AndroidLibraryConventionPlugin.kt | 58 ++++++++ ...rcGISMapsKotlinMicroappConventionPlugin.kt | 28 ++++ ...ArcGISMapsKotlinToolkitConventionPlugin.kt | 26 ++++ .../build_logic/convention/AndroidCompose.kt | 37 +++++ .../build_logic/convention/KotlinAndroid.kt | 57 ++++++++ .../convention/ProjectExtensions.kt | 28 ++++ build-logic/gradle.properties | 3 + build-logic/settings.gradle.kts | 14 ++ buildSrc/build.gradle.kts | 39 ------ gradle-plugins/build.gradle.kts | 24 ++++ gradle-plugins/settings.gradle.kts | 13 ++ .../com/arcgismaps}/ArtifactPublisher.kt | 0 gradle/libs.versions.toml | 126 ++++++++++++------ settings.gradle.kts | 105 +++------------ 20 files changed, 549 insertions(+), 165 deletions(-) create mode 100644 build-logic/.gitignore create mode 100644 build-logic/convention/.gitignore create mode 100644 build-logic/convention/build.gradle.kts create mode 100644 build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt create mode 100644 build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt create mode 100644 build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt create mode 100644 build-logic/gradle.properties create mode 100644 build-logic/settings.gradle.kts delete mode 100644 buildSrc/build.gradle.kts create mode 100644 gradle-plugins/build.gradle.kts create mode 100644 gradle-plugins/settings.gradle.kts rename {buildSrc/src/main/kotlin/deploy => gradle-plugins/src/main/kotlin/com/arcgismaps}/ArtifactPublisher.kt (100%) diff --git a/build-logic/.gitignore b/build-logic/.gitignore new file mode 100644 index 000000000..00fd4dddb --- /dev/null +++ b/build-logic/.gitignore @@ -0,0 +1,2 @@ +/build +/.gradle \ No newline at end of file diff --git a/build-logic/convention/.gitignore b/build-logic/convention/.gitignore new file mode 100644 index 000000000..796b96d1c --- /dev/null +++ b/build-logic/convention/.gitignore @@ -0,0 +1 @@ +/build diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts new file mode 100644 index 000000000..fac128bb2 --- /dev/null +++ b/build-logic/convention/build.gradle.kts @@ -0,0 +1,62 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + `kotlin-dsl` +} + +group = "com.esri.arcgismaps.kotlin.build_logic.convention" + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} + +tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } +} + +dependencies { + compileOnly(libs.android.gradlePlugin) + compileOnly(libs.android.tools.common) + compileOnly(libs.kotlin.gradlePlugin) + compileOnly(libs.ksp.gradlePlugin) +} + +tasks { + validatePlugins { + enableStricterValidation = true + failOnWarning = true + } +} + +gradlePlugin { + plugins { + register("androidApplicationComposing") { + id = "arcgismaps.android.application.compose" + implementationClass = "AndroidApplicationComposeConventionPlugin" + } + register("androidApplication") { + id = "arcgismaps.android.application" + implementationClass = "AndroidApplicationConventionPlugin" + } + register("androidLibraryCompose") { + id = "arcgismaps.android.library.compose" + implementationClass = "AndroidLibraryComposeConventionPlugin" + } + register("androidLibrary") { + id = "arcgismaps.android.library" + implementationClass = "AndroidLibraryConventionPlugin" + } + register("arcgismapsKotlinToolkit") { + id = "arcgismaps.kotlin.toolkit" + implementationClass = "ArcGISMapsKotlinToolkitConventionPlugin" + } + register("arcgismapsKotlinMicroapp") { + id = "arcgismaps.kotlin.microapp" + implementationClass = "ArcGISMapsKotlinMicroappConventionPlugin" + } + } +} diff --git a/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt new file mode 100644 index 000000000..06dc52b38 --- /dev/null +++ b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt @@ -0,0 +1,19 @@ +import com.android.build.api.dsl.ApplicationExtension +import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.getByType + +class AndroidApplicationComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.android.application") + apply("org.jetbrains.kotlin.android") + apply("org.jetbrains.kotlin.plugin.compose") + } + val extension = extensions.getByType() + configureAndroidCompose(extension) + } + } +} diff --git a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt new file mode 100644 index 000000000..67049682e --- /dev/null +++ b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt @@ -0,0 +1,53 @@ +import com.android.build.api.dsl.ApplicationExtension +import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid +import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.get + +class AndroidApplicationConventionPlugin: Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.android.application") + apply("org.jetbrains.kotlin.android") + } + + extensions.configure { + configureKotlinAndroid(this) + compileSdk = 35 + defaultConfig { + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } + minSdk = libs.findVersion("minSdk").get().toString().toInt() + targetSdk = libs.findVersion("targetSdk").get().toString().toInt() + versionCode = libs.findVersion("versionCode").get().toString().toInt() + versionName = libs.findVersion("versionName").get().toString() + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } + + // Add the custom assets directory to the app module's assets build. + sourceSets["main"].assets.srcDirs(layout.buildDirectory.dir("sampleAssets/")) + } + } + } +} diff --git a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt new file mode 100644 index 000000000..c20d05e75 --- /dev/null +++ b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt @@ -0,0 +1,19 @@ +import com.android.build.api.dsl.LibraryExtension +import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.getByType + +class AndroidLibraryComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.android.library") + apply("org.jetbrains.kotlin.android") + apply("org.jetbrains.kotlin.plugin.compose") + } + val extension = extensions.getByType() + configureAndroidCompose(extension) + } + } +} diff --git a/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt new file mode 100644 index 000000000..53d5fc774 --- /dev/null +++ b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt @@ -0,0 +1,58 @@ +import com.android.build.gradle.LibraryExtension +import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid +import com.esri.arcgismaps.kotlin.build_logic.convention.implementation +import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import com.esri.arcgismaps.kotlin.build_logic.convention.testImplementation +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.kotlin + +class AndroidLibraryConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply("com.android.library") + apply("org.jetbrains.kotlin.android") + } + + extensions.configure { + configureKotlinAndroid(this) + compileSdk = 35 + defaultConfig { + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } + minSdk = libs.findVersion("minSdk").get().toString().toInt() + lint.targetSdk = libs.findVersion("targetSdk").get().toString().toInt() + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } + } + + dependencies { + testImplementation(kotlin("test")) + // External libraries + implementation(libs.findLibrary("androidx-constraintlayout").get()) + implementation(libs.findLibrary("androidx-appcompat").get()) + implementation(libs.findLibrary("android-material").get()) + } + } + } +} diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt new file mode 100644 index 000000000..40db7dd42 --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt @@ -0,0 +1,28 @@ +import com.esri.arcgismaps.kotlin.build_logic.convention.implementation +import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.project + +class ArcGISMapsKotlinMicroappConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + dependencies { + dependencies { + // if a "build" property is set from the command line like: "-D build=300.X.X-XXXX" + val buildVersion = System.getProperty("build") + // Override version in libs.versions.toml file + if (buildVersion != null) { + implementation("com.esri:arcgis-maps-kotlin:$buildVersion") + } else { + // Use version catalog when no build flag is provided + implementation(libs.findLibrary("arcgis-maps-kotlin").get()) + } + // Local project common microapps library + implementation(project(":microapps-lib")) + } + } + } + } +} diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt new file mode 100644 index 000000000..00a8dd343 --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -0,0 +1,26 @@ +import com.esri.arcgismaps.kotlin.build_logic.convention.implementation +import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.project + +class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + dependencies { + dependencies { + // if a "build" property is set from the command line like: "-D build=300.X.X-XXXX" + val buildVersion = System.getProperty("build") + // Override version in libs.versions.toml file + if (buildVersion != null) { + implementation("com.esri:arcgis-maps-kotlin:$buildVersion") + } else { + // Use version catalog when no build flag is provided + implementation(libs.findLibrary("arcgis-maps-kotlin").get()) + } + } + } + } + } +} diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt new file mode 100644 index 000000000..be21e4159 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt @@ -0,0 +1,37 @@ +package com.esri.arcgismaps.kotlin.build_logic.convention + +import com.android.build.api.dsl.CommonExtension +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies + +/** + * Extension to use compose configurations and dependencies + */ +internal fun Project.configureAndroidCompose( + commonExtension: CommonExtension<*, *, *, *, *, *>, +) { + commonExtension.apply { + buildFeatures { + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = libs.findVersion("kotlinVersion").get().toString() + } + + dependencies { + val composeBom = libs.findLibrary("androidx-compose-bom").get() + implementation(platform(composeBom)) + androidTestImplementation(platform(composeBom)) + implementation(libs.findLibrary("androidx-activity-compose").get()) + implementation(libs.findLibrary("androidx-compose-material3").get()) + implementation(libs.findLibrary("androidx-lifecycle-viewmodel-compose").get()) + implementation(libs.findLibrary("androidx-compose-ui-tooling-preview").get()) + debugImplementation(libs.findLibrary("androidx-compose-ui-tooling").get()) + debugImplementation(libs.findLibrary("androidx-compose-ui-test-manifest").get()) + androidTestImplementation(libs.findLibrary("androidx-compose-ui-test").get()) + androidTestImplementation(libs.findLibrary("androidx-compose-ui-test-junit4").get()) + + } + } +} diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt new file mode 100644 index 000000000..5dcdab882 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt @@ -0,0 +1,57 @@ +package com.esri.arcgismaps.kotlin.build_logic.convention + +import com.android.build.api.dsl.CommonExtension +import org.gradle.api.JavaVersion +import org.gradle.api.Project +import org.gradle.kotlin.dsl.provideDelegate +import org.gradle.kotlin.dsl.withType +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +/** + * Extension to use Android Kotlin configurations and dependencies + */ +internal fun Project.configureKotlinAndroid( + commonExtension: CommonExtension<*, *, *, *, *, *>, +) { + commonExtension.apply { + compileSdk = libs.findVersion("targetSdk").get().toString().toInt() + + defaultConfig { + buildConfigField("String", "ACCESS_TOKEN", project.properties["ACCESS_TOKEN"].toString()) + manifestPlaceholders["GOOGLE_API_KEY"] = project.properties["GOOGLE_API_KEY"].toString() + minSdk = libs.findVersion("minSdk").get().toString().toInt() + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + } + + configureKotlin() +} + +/** + * Configure base Kotlin options + */ +private fun Project.configureKotlin() { + tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + // Treat all Kotlin warnings as errors (disabled by default) + // Override by setting warningsAsErrors=true in your ~/.gradle/gradle.properties + val warningsAsErrors: String? by project + allWarningsAsErrors.set(warningsAsErrors.toBoolean()) + freeCompilerArgs.set( + listOf( + "-opt-in=kotlin.RequiresOptIn", + // Enable experimental coroutines APIs, including Flow + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + "-opt-in=kotlinx.coroutines.FlowPreview", + "-Xcontext-receivers", + ) + ) + } + } +} diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt new file mode 100644 index 000000000..26af71d39 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt @@ -0,0 +1,28 @@ +package com.esri.arcgismaps.kotlin.build_logic.convention + +import org.gradle.api.Project +import org.gradle.api.artifacts.Dependency +import org.gradle.api.artifacts.VersionCatalog +import org.gradle.api.artifacts.VersionCatalogsExtension +import org.gradle.api.artifacts.dsl.DependencyHandler +import org.gradle.kotlin.dsl.getByType + +fun DependencyHandler.testImplementation(dependencyNotation: Any): Dependency? = + add("testImplementation", dependencyNotation) + +fun DependencyHandler.testRuntimeOnly(dependencyNotation: Any): Dependency? = + add("testRuntimeOnly", dependencyNotation) + +fun DependencyHandler.implementation(dependencyNotation: Any): Dependency? = + add("implementation", dependencyNotation) + +fun DependencyHandler.androidTestImplementation(dependencyNotation: Any): Dependency? = + add("androidTestImplementation", dependencyNotation) + +fun DependencyHandler.debugImplementation(dependencyNotation: Any): Dependency? = + add("debugImplementation", dependencyNotation) + +val Project.libs + get(): VersionCatalog = extensions + .getByType() + .named("libs") diff --git a/build-logic/gradle.properties b/build-logic/gradle.properties new file mode 100644 index 000000000..6977b7191 --- /dev/null +++ b/build-logic/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.parallel=true +org.gradle.caching=true +org.gradle.configureondemand=true \ No newline at end of file diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts new file mode 100644 index 000000000..2907fbfb8 --- /dev/null +++ b/build-logic/settings.gradle.kts @@ -0,0 +1,14 @@ +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + } + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} + +rootProject.name = "build-logic" +include(":convention") diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index 23abc5a14..000000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Copyright 2023 Esri - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -repositories { - google() - mavenCentral() -} - -plugins { - `kotlin-dsl` - `maven-publish` -} - -version = "1.0" - -gradlePlugin { - plugins { - create("artifactDeploy") { - group = "internal" - id = "artifact-deploy" - implementationClass = "deploy.ArtifactPublisher" - } - } -} diff --git a/gradle-plugins/build.gradle.kts b/gradle-plugins/build.gradle.kts new file mode 100644 index 000000000..c48fdef85 --- /dev/null +++ b/gradle-plugins/build.gradle.kts @@ -0,0 +1,24 @@ +repositories { + google() + mavenCentral() +} + +plugins { + `kotlin-dsl` + `maven-publish` +} + +gradlePlugin { + plugins { + create("artifactDeploy") { + group = "internal" + id = "artifact-deploy" + version = "1.0" + implementationClass = "deploy.ArtifactPublisher" + } + } +} + +dependencies { + implementation(libs.kotlinx.serialization.json) +} diff --git a/gradle-plugins/settings.gradle.kts b/gradle-plugins/settings.gradle.kts new file mode 100644 index 000000000..b474f08dd --- /dev/null +++ b/gradle-plugins/settings.gradle.kts @@ -0,0 +1,13 @@ +rootProject.name = "gradle-plugins" + +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + } + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} diff --git a/buildSrc/src/main/kotlin/deploy/ArtifactPublisher.kt b/gradle-plugins/src/main/kotlin/com/arcgismaps/ArtifactPublisher.kt similarity index 100% rename from buildSrc/src/main/kotlin/deploy/ArtifactPublisher.kt rename to gradle-plugins/src/main/kotlin/com/arcgismaps/ArtifactPublisher.kt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 595b5d655..9b043ea7f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,9 +1,11 @@ [versions] -activityCompose = "1.10.1" + +# ArcGIS Maps SDK for Kotlin version +arcgisMapsKotlinVersion = "300.0.0-4689" + +### Android versions androidGradlePlugin = "8.9.2" androidXBrowser = "1.8.0" -coilBOM = "2.5.0" -composeBOM = "2025.04.01" androidxCamera = "1.4.2" androidxComposeCompiler = "1.5.12" androidxCore = "1.16.0" @@ -14,89 +16,121 @@ androidxTestExt = "1.2.1" androidXTestRunner = "1.6.2" androidXTestRules = "1.6.1" androidxWindow = "1.3.0" +androidTools = "31.9.1" workVersion = "2.10.0" -binaryCompatibilityValidator = "0.17.0" -compileSdk = "36" -compose-navigation = "2.8.9" -commonMark = "0.22.0" -dokka = "2.0.0" hilt = "2.55" hiltExt = "1.2.0" -junit = "4.13.2" -kotlin = "2.1.20" -ksp = "2.1.20-1.0.32" media3Exoplayer = "1.6.1" -minSdk = "28" mlkitBarcodeScanning = "17.3.0" +arcore = "1.48.0" +playServicesLocation = "21.3.0" + +### Kotlin versions +kotlin = "2.1.20" +ksp = "2.1.20-1.0.32" kotlinxCoroutinesTest = "1.8.0" kotlinxSerializationJson = "1.8.0" +binaryCompatibilityValidator = "0.17.0" +dokka = "2.0.0" + +### Compose versions +composeBOM = "2025.04.01" +activityCompose = "1.10.1" +compose-navigation = "2.8.9" + +### Toolkit component verions +compileSdk = "36" +minSdk = "28" + +### Testing versions +junit = "4.13.2" +gradleSecrets = "2.0.1" mockkAndroid = "1.14.0" -room = "2.7.0" truth = "1.4.4" uiautomator = "2.3.0" -arcore = "1.48.0" -playServicesLocation = "21.3.0" + +### Third party versions +coilBOM = "2.5.0" +room = "2.7.0" +commonMark = "0.22.0" gmazzo = "2.4.4" -gradleSecrets = "2.0.1" [libraries] -androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose"} +### ArcGIS Maps SDK for Kotlin libs +arcgis-maps-kotlin = { group = "com.esri", name = "arcgis-maps-kotlin", version.ref = "arcgisMapsKotlinVersion" } + +### Android libs +arcore = { group = "com.google.ar", name = "core", version.ref = "arcore" } androidx-browser = { group = "androidx.browser", name = "browser", version.ref = "androidXBrowser"} -androidx-camera-core = { group = "androidx.camera", name = "camera-core", version.ref = "androidxCamera" } androidx-camera-camera2 = { group = "androidx.camera", name = "camera-camera2", version.ref = "androidxCamera" } +androidx-camera-core = { group = "androidx.camera", name = "camera-core", version.ref = "androidxCamera" } androidx-camera-lifecycle = { group = "androidx.camera", name = "camera-lifecycle", version.ref = "androidxCamera" } androidx-camera-view = { group = "androidx.camera", name = "camera-view", version.ref = "androidxCamera" } androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidxCore" } +androidx-media3-exoplayer = { module = "androidx.media3:media3-exoplayer", version.ref = "media3Exoplayer" } +androidx-media3-exoplayer-dash = { module = "androidx.media3:media3-exoplayer-dash", version.ref = "media3Exoplayer" } +androidx-media3-ui = { module = "androidx.media3:media3-ui", version.ref = "media3Exoplayer" } +androidx-window = { group = "androidx.window", name = "window", version.ref = "androidxWindow" } +androidx-window-core = { group = "androidx.window", name = "window-core", version.ref = "androidxWindow" } +androidx-work-runtime-ktx = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "workVersion" } +mlkit-barcode-scanning = { module = "com.google.mlkit:barcode-scanning", version.ref = "mlkitBarcodeScanning" } +play-services-location = { group = "com.google.android.gms", name = "play-services-location", version.ref = "playServicesLocation" } + +### Kotlin libs +kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin"} +kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesTest" } +kotlinx-serialization-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "kotlinxSerializationJson" } +kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } + +### Compose libs +androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose"} androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBOM" } androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" } -androidx-compose-ui = { group = "androidx.compose.ui", name = "ui"} androidx-compose-material3 = { module = "androidx.compose.material3:material3"} androidx-compose-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "compose-navigation" } +androidx-compose-ui = { group = "androidx.compose.ui", name = "ui"} androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics"} androidx-compose-ui-test = { group = "androidx.compose.ui", name = "ui-test-junit4"} +androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest"} androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling"} androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview"} -androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest"} androidx-compose-ui-util = { group = "androidx.compose.ui", name = "ui-util"} androidx-hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "androidxHiltNavigationCompose" } -androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose"} androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose"} +androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose"} androidx-material-icons = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "androidxMaterialIcons"} -androidx-media3-exoplayer = { module = "androidx.media3:media3-exoplayer", version.ref = "media3Exoplayer" } -androidx-media3-ui = { module = "androidx.media3:media3-ui", version.ref = "media3Exoplayer" } -androidx-media3-exoplayer-dash = { module = "androidx.media3:media3-exoplayer-dash", version.ref = "media3Exoplayer" } -androidx-test-ext = { group = "androidx.test.ext", name = "junit-ktx", version.ref = "androidxTestExt" } + +### Testing libs androidx-test-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidxEspresso" } -androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidXTestRunner" } +androidx-test-ext = { group = "androidx.test.ext", name = "junit-ktx", version.ref = "androidxTestExt" } androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "androidXTestRules" } +androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidXTestRunner" } androidx-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "uiautomator" } -androidx-window = { group = "androidx.window", name = "window", version.ref = "androidxWindow" } -androidx-window-core = { group = "androidx.window", name = "window-core", version.ref = "androidxWindow" } -androidx-work-runtime-ktx = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "workVersion" } -mlkit-barcode-scanning = { module = "com.google.mlkit:barcode-scanning", version.ref = "mlkitBarcodeScanning" } -coil-bom = { group = "io.coil-kt", name = "coil-bom", version.ref = "coilBOM" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockkAndroid" } +truth = { group = "com.google.truth", name = "truth", version.ref = "truth" } + +### Third party libs coil = { group = "io.coil-kt", name = "coil" } coil-base = { group = "io.coil-kt", name = "coil-base" } +coil-bom = { group = "io.coil-kt", name = "coil-bom", version.ref = "coilBOM" } coil-compose = { group = "io.coil-kt", name = "coil-compose" } commonmark = { group = "org.commonmark", name = "commonmark", version.ref="commonMark" } commonmark-strikethrough = { group = "org.commonmark", name = "commonmark-ext-gfm-strikethrough", version.ref="commonMark" } +dokka-versioning = { group = "org.jetbrains.dokka", name = "versioning-plugin", version.ref = "dokka" } hilt-android-core = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" } hilt-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" } hilt-ext-compiler = { group = "androidx.hilt", name = "hilt-compiler", version.ref = "hiltExt" } hilt-ext-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hiltExt" } -junit = { group = "junit", name = "junit", version.ref = "junit" } -kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin"} -kotlinx-serialization-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "kotlinxSerializationJson" } -kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } -kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesTest" } -mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockkAndroid" } -room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" } room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" } room-ext = { group = "androidx.room", name = "room-ktx", version.ref = "room" } -truth = { group = "com.google.truth", name = "truth", version.ref = "truth" } -dokka-versioning = { group = "org.jetbrains.dokka", name = "versioning-plugin", version.ref = "dokka" } -arcore = { group = "com.google.ar", name = "core", version.ref = "arcore" } -play-services-location = { group = "com.google.android.gms", name = "play-services-location", version.ref = "playServicesLocation" } +room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" } + +# Dependencies of the included build-logic +android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" } +kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } +ksp-gradlePlugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" } +android-tools-common = { group = "com.android.tools", name = "common", version.ref = "androidTools" } [plugins] android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } @@ -111,6 +145,14 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } gmazzo-test-aggregation = { id = "io.github.gmazzo.test.aggregation.results", version.ref = "gmazzo" } +# Plugins defined by the project build-logic +arcgismaps-android-application = { id = "arcgismaps.android.application", version = "unspecified" } +arcgismaps-android-application-compose = { id = "arcgismaps.android.application.compose", version = "unspecified" } +arcgismaps-android-library-compose = { id = "arcgismaps.android.library.compose", version = "unspecified" } +arcgismaps-android-library = { id = "arcgismaps.android.library", version = "unspecified" } +arcgismaps-kotlin-microapp = { id = "arcgismaps.kotlin.microapp", version = "unspecified" } +arcgismaps-kotlin-toolkit = { id = "arcgismaps.kotlin.toolkit", version = "unspecified" } + [bundles] camerax = [ "androidx-camera-core", diff --git a/settings.gradle.kts b/settings.gradle.kts index e34e8483d..ed94651e2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,6 +17,8 @@ */ pluginManagement { + includeBuild("build-logic") + includeBuild("gradle-plugins") repositories { gradlePluginPortal() google() @@ -118,93 +120,28 @@ dependencyResolutionManagement { } } -// fixes https://devtopia.esri.com/runtime/kotlin/issues/3863#issuecomment-4715101 -// fixes https://issuetracker.google.com/issues/315023802 -gradle.startParameter.excludedTaskNames.addAll(listOf(":buildSrc:testClasses")) +// This enables the "Type Safe Project Accessors" feature +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") +// Dynamically include all toolkit components +File("toolkit").listFiles()?.filter { it.isDirectory }?.forEach { toolkitModule -> + include(":${toolkitModule.name}") + project(":${toolkitModule.name}").projectDir = file("toolkit/${toolkitModule.name}") +} + +// Dynamically include all microapp components +File("microapps").listFiles()?.filter { it.isDirectory && !it.name.contains("MicroappsLib") }?.forEach { microappFolder -> + val appDir = File(microappFolder, "app") + if (appDir.exists() && appDir.isDirectory) { + val microappName = microappFolder.name.toLowerCase().replace("app", "-app") + include(":$microappName") + project(":$microappName").projectDir = appDir + } +} + +// Add any other specific includes here include(":bom") project(":bom").projectDir = File(rootDir, "bom") include(":kdoc") include(":microapps-lib") project(":microapps-lib").projectDir = File(rootDir, "microapps/MicroappsLib") -include(":authentication-app") -project(":authentication-app").projectDir = File(rootDir, "microapps/AuthenticationApp/app") -include(":authentication") -project(":authentication").projectDir = File(rootDir, "toolkit/authentication") -include(":compass-app") -project(":compass-app").projectDir = File(rootDir, "microapps/CompassApp/app") -include(":compass") -project(":compass").projectDir = File(rootDir, "toolkit/compass") -include(":featureforms-app") -project(":featureforms-app").projectDir = File(rootDir, "microapps/FeatureFormsApp/app") -include(":featureforms") -project(":featureforms").projectDir = File(rootDir, "toolkit/featureforms") -include(":template-app") -project(":template-app").projectDir = File(rootDir, "microapps/TemplateApp/app") -include(":template") -project(":template").projectDir = File(rootDir, "toolkit/template") -include(":composable-map") -project(":composable-map").projectDir = File(rootDir, "toolkit/composable-map") -include(":indoors") -project(":indoors").projectDir = File(rootDir, "toolkit/indoors") -include(":floor-filter-app") -project(":floor-filter-app").projectDir = File(rootDir, "microapps/FloorFilterApp/app") -include(":geoview-compose") -project(":geoview-compose").projectDir = File(rootDir, "toolkit/geoview-compose") -include(":map-view-callout-app") -project(":map-view-callout-app").projectDir = File(rootDir, "microapps/MapViewCalloutApp/app") -include(":map-view-location-display-app") -project(":map-view-location-display-app").projectDir = File(rootDir, "microapps/mapviewlocationdisplayapp/app") -include(":map-view-insets-app") -project(":map-view-insets-app").projectDir = File(rootDir, "microapps/mapviewinsetsapp/app") -include(":map-view-geometry-editor-app") -project(":map-view-geometry-editor-app").projectDir = File(rootDir, "microapps/mapviewgeometryeditorapp/app") -include(":map-view-set-viewpoint-app") -project(":map-view-set-viewpoint-app").projectDir = File(rootDir, "microapps/mapviewsetviewpointapp/app") -include(":map-view-identify-app") -project(":map-view-identify-app").projectDir = File(rootDir, "microapps/mapviewidentifyapp/app") -include(":scene-view-callout-app") -project(":scene-view-callout-app").projectDir = File(rootDir, "microapps/SceneViewCalloutApp/app") -include(":scene-view-analysis-overlay-app") -project(":scene-view-analysis-overlay-app").projectDir = File(rootDir, "microapps/sceneviewanalysisoverlayapp/app") -include(":scene-view-set-viewpoint-app") -project(":scene-view-set-viewpoint-app").projectDir = File(rootDir, "microapps/sceneviewsetviewpointapp/app") -include(":scene-view-camera-controller-app") -project(":scene-view-camera-controller-app").projectDir = File(rootDir, "microapps/sceneviewcameracontrollerapp/app") -include(":scene-view-lighting-options-app") -project(":scene-view-lighting-options-app").projectDir = File(rootDir, "microapps/sceneviewlightingoptionsapp/app") -include(":popup") -project(":popup").projectDir = File(rootDir, "toolkit/popup") -include(":popup-app") -project(":popup-app").projectDir = File(rootDir, "microapps/PopupApp/app") -include(":utility-network-trace-app") -project(":utility-network-trace-app").projectDir = File(rootDir, "microapps/UtilityNetworkTraceApp/app") -include(":utilitynetworks") -project(":utilitynetworks").projectDir = File(rootDir, "toolkit/utilitynetworks") -include(":ar") -project(":ar").projectDir = File(rootDir, "toolkit/ar") -include(":ar-tabletop-app") -project(":ar-tabletop-app").projectDir = File(rootDir, "microapps/ArTabletopApp/app") -include(":ar-worldscale-app") -project(":ar-worldscale-app").projectDir = File(rootDir, "microapps/ArWorldScaleApp/app") -include(":scalebar-app") -project(":scalebar-app").projectDir = File(rootDir, "microapps/ScalebarApp/app") -include(":scalebar") -project(":scalebar").projectDir = File(rootDir, "toolkit/scalebar") -include(":legend") -project(":legend").projectDir = File(rootDir, "toolkit/legend") -include(":legend-app") -project(":legend-app").projectDir = File(rootDir, "microapps/LegendApp/app") -include(":basemapgallery-app") -project(":basemapgallery-app").projectDir = File(rootDir, "microapps/BasemapGalleryApp/app") -include(":basemapgallery") -project(":basemapgallery").projectDir = File(rootDir, "toolkit/basemapgallery") -include(":overviewmap-app") -project(":overviewmap-app").projectDir = File(rootDir, "microapps/OverviewMapApp/app") -include(":offline") -project(":offline").projectDir = File(rootDir, "toolkit/offline") -include(":offlinemapareas-app") -project(":offlinemapareas-app").projectDir = File(rootDir, "microapps/OfflineMapAreasApp/app") -include(":ar-flyover-app") -project(":ar-flyover-app").projectDir = File(rootDir, "microapps/ArFlyoverApp/app") - From 8336077135c186547c6f5d55f9a8b6bc3637b867 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Mon, 18 Aug 2025 11:38:34 -0700 Subject: [PATCH 02/16] Add all Toolkit convention migration changes --- ...droidApplicationComposeConventionPlugin.kt | 28 +++++- .../AndroidApplicationConventionPlugin.kt | 17 ++-- .../AndroidLibraryComposeConventionPlugin.kt | 32 ++++++- .../java/AndroidLibraryConventionPlugin.kt | 11 +-- ...rcGISMapsKotlinMicroappConventionPlugin.kt | 71 ++++++++++++--- ...ArcGISMapsKotlinToolkitConventionPlugin.kt | 86 +++++++++++++++++-- .../build_logic/convention/AndroidCompose.kt | 4 +- .../build_logic/convention/KotlinAndroid.kt | 13 +-- .../convention/ProjectExtensions.kt | 3 + gradle.properties | 9 -- gradle/libs.versions.toml | 14 +-- kdoc/build.gradle.kts | 28 +++++- microapps/ArFlyoverApp/app/build.gradle.kts | 69 ++------------- microapps/ArTabletopApp/app/build.gradle.kts | 68 ++------------- .../ArWorldScaleApp/app/build.gradle.kts | 68 +-------------- .../AuthenticationApp/app/build.gradle.kts | 67 +-------------- .../BasemapGalleryApp/app/build.gradle.kts | 67 +-------------- microapps/CompassApp/app/build.gradle.kts | 65 +------------- .../FeatureFormsApp/app/build.gradle.kts | 75 ++-------------- microapps/FloorFilterApp/app/build.gradle.kts | 66 +------------- microapps/LegendApp/app/build.gradle.kts | 67 +-------------- .../MapViewCalloutApp/app/build.gradle.kts | 66 +------------- .../app/build.gradle.kts | 68 +-------------- .../MapViewIdentifyApp/app/build.gradle.kts | 68 +-------------- .../MapViewInsetsApp/app/build.gradle.kts | 68 +-------------- .../app/build.gradle.kts | 68 +-------------- .../app/build.gradle.kts | 68 +-------------- microapps/MicroappsLib/build.gradle.kts | 37 +------- .../OfflineMapAreasApp/app/build.gradle.kts | 68 ++------------- microapps/OverviewMapApp/app/build.gradle.kts | 67 +-------------- microapps/PopupApp/app/build.gradle.kts | 73 ++-------------- microapps/ScalebarApp/app/build.gradle.kts | 67 +-------------- .../app/build.gradle.kts | 67 +-------------- .../SceneViewCalloutApp/app/build.gradle.kts | 66 +------------- .../app/build.gradle.kts | 67 +-------------- .../app/build.gradle.kts | 67 +-------------- .../app/build.gradle.kts | 68 +-------------- microapps/TemplateApp/app/build.gradle.kts | 67 +-------------- .../app/build.gradle.kts | 66 ++------------ settings.gradle.kts | 40 --------- toolkit/ar/build.gradle.kts | 79 ++--------------- toolkit/authentication/build.gradle.kts | 78 +---------------- toolkit/basemapgallery/build.gradle.kts | 64 +------------- toolkit/compass/build.gradle.kts | 66 +------------- toolkit/composable-map/build.gradle.kts | 65 +------------- toolkit/featureforms/build.gradle.kts | 83 +----------------- toolkit/geoview-compose/build.gradle.kts | 68 +-------------- toolkit/indoors/build.gradle.kts | 71 +-------------- toolkit/legend/build.gradle.kts | 73 +--------------- toolkit/offline/build.gradle.kts | 76 +--------------- toolkit/popup/build.gradle.kts | 69 +-------------- toolkit/scalebar/build.gradle.kts | 67 +-------------- toolkit/template/build.gradle.kts | 60 +------------ toolkit/utilitynetworks/build.gradle.kts | 80 +---------------- 54 files changed, 409 insertions(+), 2744 deletions(-) diff --git a/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt index 06dc52b38..7987c7c4e 100644 --- a/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt @@ -1,19 +1,41 @@ import com.android.build.api.dsl.ApplicationExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose +import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid +import com.esri.arcgismaps.kotlin.build_logic.convention.implementation +import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import com.esri.arcgismaps.kotlin.build_logic.convention.testImplementation +import com.esri.arcgismaps.kotlin.build_logic.convention.androidTestImplementation +import com.esri.arcgismaps.kotlin.build_logic.convention.debugImplementation import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.getByType class AndroidApplicationComposeConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { with(pluginManager) { - apply("com.android.application") - apply("org.jetbrains.kotlin.android") - apply("org.jetbrains.kotlin.plugin.compose") + apply(libs.findPlugin("android-application").get().get().pluginId) + apply(libs.findPlugin("kotlin-android").get().get().pluginId) + apply(libs.findPlugin("compose-compiler").get().get().pluginId) } val extension = extensions.getByType() + configureKotlinAndroid(extension) configureAndroidCompose(extension) + + // Add common Compose dependencies for application modules + dependencies { + implementation(platform(libs.findLibrary("androidx-compose-bom").get())) + implementation(libs.findBundle("composeCore").get()) + implementation(libs.findBundle("core").get()) + implementation(libs.findLibrary("androidx-activity-compose").get()) + implementation(libs.findLibrary("androidx-lifecycle-viewmodel-compose").get()) + + testImplementation(libs.findBundle("unitTest").get()) + androidTestImplementation(platform(libs.findLibrary("androidx-compose-bom").get())) + androidTestImplementation(libs.findBundle("composeTest").get()) + debugImplementation(libs.findBundle("debug").get()) + } } } } diff --git a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt index 67049682e..27091a447 100644 --- a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt @@ -6,27 +6,30 @@ import org.gradle.api.Project import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.get -class AndroidApplicationConventionPlugin: Plugin { +class AndroidApplicationConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { with(pluginManager) { - apply("com.android.application") - apply("org.jetbrains.kotlin.android") + apply(libs.findPlugin("android-application").get().get().pluginId) + apply(libs.findPlugin("kotlin-android").get().get().pluginId) } extensions.configure { configureKotlinAndroid(this) compileSdk = 35 defaultConfig { - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { useSupportLibrary = true } minSdk = libs.findVersion("minSdk").get().toString().toInt() - targetSdk = libs.findVersion("targetSdk").get().toString().toInt() - versionCode = libs.findVersion("versionCode").get().toString().toInt() - versionName = libs.findVersion("versionName").get().toString() + targetSdk = libs.findVersion("compileSdk").get().toString().toInt() + versionCode = 1 + versionName = "1.0" + } + + buildFeatures { + buildConfig = true } buildTypes { diff --git a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt index c20d05e75..874f92cac 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt @@ -1,19 +1,45 @@ import com.android.build.api.dsl.LibraryExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose +import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid +import com.esri.arcgismaps.kotlin.build_logic.convention.implementation +import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import com.esri.arcgismaps.kotlin.build_logic.convention.testImplementation +import com.esri.arcgismaps.kotlin.build_logic.convention.androidTestImplementation +import com.esri.arcgismaps.kotlin.build_logic.convention.debugImplementation import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.getByType class AndroidLibraryComposeConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { with(pluginManager) { - apply("com.android.library") - apply("org.jetbrains.kotlin.android") - apply("org.jetbrains.kotlin.plugin.compose") + apply(libs.findPlugin("android-library").get().get().pluginId) + apply(libs.findPlugin("kotlin-android").get().get().pluginId) + apply(libs.findPlugin("compose-compiler").get().get().pluginId) + apply(libs.findPlugin("kotlin-parcelize").get().get().pluginId) + apply(libs.findPlugin("kotlin-serialization").get().get().pluginId) } val extension = extensions.getByType() + configureKotlinAndroid(extension) configureAndroidCompose(extension) + + // Add common Compose dependencies for library modules + dependencies { + implementation(platform(libs.findLibrary("androidx-compose-bom").get())) + implementation(libs.findBundle("composeCore").get()) + implementation(libs.findBundle("core").get()) + implementation(libs.findLibrary("androidx-lifecycle-runtime-compose").get()) + implementation(libs.findLibrary("androidx-activity-compose").get()) + implementation(libs.findLibrary("androidx-material-icons").get()) + + implementation(libs.findLibrary("kotlinx-serialization-json").get()) + + testImplementation(libs.findBundle("unitTest").get()) + androidTestImplementation(libs.findBundle("composeTest").get()) + debugImplementation(libs.findBundle("debug").get()) + } } } } diff --git a/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt index 53d5fc774..f2099a718 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt @@ -13,8 +13,8 @@ class AndroidLibraryConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { with(pluginManager) { - apply("com.android.library") - apply("org.jetbrains.kotlin.android") + apply(libs.findPlugin("android-library").get().get().pluginId) + apply(libs.findPlugin("kotlin-android").get().get().pluginId) } extensions.configure { @@ -26,7 +26,8 @@ class AndroidLibraryConventionPlugin : Plugin { useSupportLibrary = true } minSdk = libs.findVersion("minSdk").get().toString().toInt() - lint.targetSdk = libs.findVersion("targetSdk").get().toString().toInt() + lint.targetSdk = libs.findVersion("compileSdk").get().toString().toInt() + consumerProguardFiles("consumer-rules.pro") } buildTypes { @@ -48,10 +49,6 @@ class AndroidLibraryConventionPlugin : Plugin { dependencies { testImplementation(kotlin("test")) - // External libraries - implementation(libs.findLibrary("androidx-constraintlayout").get()) - implementation(libs.findLibrary("androidx-appcompat").get()) - implementation(libs.findLibrary("android-material").get()) } } } diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt index 40db7dd42..4f9dc8673 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt @@ -1,27 +1,78 @@ +import com.android.build.api.dsl.ApplicationExtension import com.esri.arcgismaps.kotlin.build_logic.convention.implementation import com.esri.arcgismaps.kotlin.build_logic.convention.libs import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.tasks.testing.Test +import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.project +import org.gradle.kotlin.dsl.withType class ArcGISMapsKotlinMicroappConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { + with(pluginManager) { + apply(libs.findPlugin("arcgismaps-android-application").get().get().pluginId) + apply(libs.findPlugin("arcgismaps-android-application-compose").get().get().pluginId) + apply(libs.findPlugin("gradle-secrets").get().get().pluginId) + } + + + // Configure secrets plugin defaults and custom BuildConfig fields + extensions.configure { + val defaultPropertiesFile = rootProject.file("secrets.defaults.properties") + if (defaultPropertiesFile.exists()) { + val properties = java.util.Properties() + defaultPropertiesFile.inputStream().use { properties.load(it) } + + defaultConfig { + // Add each property as a BuildConfig field + properties.forEach { (key, value) -> + val escapedValue = value.toString().replace("\"", "\\\"") + buildConfigField("String", key.toString(), "\"${escapedValue}\"") + } + } + } + } + + // Avoids an empty test report showing up in the CI integration test report. + // Remove this if tests will be added. + tasks.withType { + enabled = false + } + dependencies { - dependencies { - // if a "build" property is set from the command line like: "-D build=300.X.X-XXXX" - val buildVersion = System.getProperty("build") - // Override version in libs.versions.toml file - if (buildVersion != null) { - implementation("com.esri:arcgis-maps-kotlin:$buildVersion") + // The version of the ArcGIS Maps SDK for Kotlin dependency. + // First look for the version number provided via command line (for CI builds), if not found, + // take the one defined in gradle.properties. + // CI builds pass -PversionNumber=${BUILDVER} + val sdkVersionNumber: String? = + providers.gradleProperty("versionNumber").orNull + ?: providers.gradleProperty("sdkVersionNumber").orNull + + // The build number of the ArcGIS Maps SDK for Kotlin dependency. + // First look for the version number provided via command line (for CI builds), if not found, + // take the one defined in local.properties. + // CI builds pass -PbuildNumber=${BUILDNUM} + val sdkBuildNumber: String = + providers.gradleProperty("buildNumber").orNull + ?: providers.gradleProperty("sdkBuildNumber").orNull + ?: "" + // ArcGIS Maps SDK dependency with build override support + if (sdkVersionNumber != null) { + if (!sdkVersionNumber.isBlank()) { + implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber-$sdkBuildNumber") } else { - // Use version catalog when no build flag is provided - implementation(libs.findLibrary("arcgis-maps-kotlin").get()) + implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber") } - // Local project common microapps library - implementation(project(":microapps-lib")) + } else { + // Use libs.versions.toml if no gradle property provided + implementation(libs.findLibrary("arcgis-maps-kotlin").get()) } + + // Local project common microapps library + implementation(project(":microapps-lib")) } } } diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt index 00a8dd343..154d8c078 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -1,24 +1,92 @@ +import com.android.build.api.dsl.LibraryExtension +import com.esri.arcgismaps.kotlin.build_logic.convention.api import com.esri.arcgismaps.kotlin.build_logic.convention.implementation import com.esri.arcgismaps.kotlin.build_logic.convention.libs import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies -import org.gradle.kotlin.dsl.project +import org.gradle.kotlin.dsl.withType +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { + with(pluginManager) { + apply(libs.findPlugin("arcgismaps-android-library").get().get().pluginId) + apply(libs.findPlugin("arcgismaps-android-library-compose").get().get().pluginId) + apply(libs.findPlugin("binary-compatibility-validator").get().get().pluginId) + } + + extensions.configure { + packaging { + resources { + excludes += setOf( + "META-INF/LICENSE-notice.md", + "META-INF/LICENSE.md" + ) + } + } + + @Suppress("UnstableApiUsage") + testOptions { + targetSdk = libs.findVersion("compileSdk").get().toString().toInt() + val connectedTestReportsPath = target.findProperty("connectedTestReportsPath") as? String + ?: "${target.rootProject.rootDir}/connectedTestReports" + reportDir = "$connectedTestReportsPath/${target.name}" + } + + publishing { + singleVariant("release") { + // This is the default variant. + } + } + } + + // Explicit API configuration for toolkit modules + tasks.withType { + if ("Test" !in name) { + compilerOptions { + freeCompilerArgs.addAll( + listOf( + // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. + "-Xconsistent-data-class-copy-visibility", + "-Xexplicit-api=strict", + "-Xcontext-receivers" + ) + ) + } + } + } + + dependencies { - dependencies { - // if a "build" property is set from the command line like: "-D build=300.X.X-XXXX" - val buildVersion = System.getProperty("build") - // Override version in libs.versions.toml file - if (buildVersion != null) { - implementation("com.esri:arcgis-maps-kotlin:$buildVersion") + // The version of the ArcGIS Maps SDK for Kotlin dependency. + // First look for the version number provided via command line (for CI builds), if not found, + // take the one defined in gradle.properties. + // CI builds pass -PversionNumber=${BUILDVER} + val sdkVersionNumber: String? = + providers.gradleProperty("versionNumber").orNull + ?: providers.gradleProperty("sdkVersionNumber").orNull + + // The build number of the ArcGIS Maps SDK for Kotlin dependency. + // First look for the version number provided via command line (for CI builds), if not found, + // take the one defined in local.properties. + // CI builds pass -PbuildNumber=${BUILDNUM} + val sdkBuildNumber: String = + providers.gradleProperty("buildNumber").orNull + ?: providers.gradleProperty("sdkBuildNumber").orNull + ?: "" + // ArcGIS Maps SDK dependency with build override support + if (sdkVersionNumber != null) { + if (!sdkVersionNumber.isBlank()) { + implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber-$sdkBuildNumber") } else { - // Use version catalog when no build flag is provided - implementation(libs.findLibrary("arcgis-maps-kotlin").get()) + implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber") } + } else { + // Use libs.versions.toml if no gradle property provided + implementation(libs.findLibrary("arcgis-maps-kotlin").get()) } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt index be21e4159..e82e9bfef 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt @@ -16,7 +16,7 @@ internal fun Project.configureAndroidCompose( } composeOptions { - kotlinCompilerExtensionVersion = libs.findVersion("kotlinVersion").get().toString() + kotlinCompilerExtensionVersion = libs.findVersion("kotlin").get().toString() } dependencies { @@ -30,8 +30,6 @@ internal fun Project.configureAndroidCompose( debugImplementation(libs.findLibrary("androidx-compose-ui-tooling").get()) debugImplementation(libs.findLibrary("androidx-compose-ui-test-manifest").get()) androidTestImplementation(libs.findLibrary("androidx-compose-ui-test").get()) - androidTestImplementation(libs.findLibrary("androidx-compose-ui-test-junit4").get()) - } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt index 5dcdab882..ae0fe7bf5 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt @@ -15,11 +15,9 @@ internal fun Project.configureKotlinAndroid( commonExtension: CommonExtension<*, *, *, *, *, *>, ) { commonExtension.apply { - compileSdk = libs.findVersion("targetSdk").get().toString().toInt() + compileSdk = libs.findVersion("compileSdk").get().toString().toInt() defaultConfig { - buildConfigField("String", "ACCESS_TOKEN", project.properties["ACCESS_TOKEN"].toString()) - manifestPlaceholders["GOOGLE_API_KEY"] = project.properties["GOOGLE_API_KEY"].toString() minSdk = libs.findVersion("minSdk").get().toString().toInt() } @@ -43,15 +41,6 @@ private fun Project.configureKotlin() { // Override by setting warningsAsErrors=true in your ~/.gradle/gradle.properties val warningsAsErrors: String? by project allWarningsAsErrors.set(warningsAsErrors.toBoolean()) - freeCompilerArgs.set( - listOf( - "-opt-in=kotlin.RequiresOptIn", - // Enable experimental coroutines APIs, including Flow - "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", - "-opt-in=kotlinx.coroutines.FlowPreview", - "-Xcontext-receivers", - ) - ) } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt index 26af71d39..4ff9fdebb 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt @@ -16,6 +16,9 @@ fun DependencyHandler.testRuntimeOnly(dependencyNotation: Any): Dependency? = fun DependencyHandler.implementation(dependencyNotation: Any): Dependency? = add("implementation", dependencyNotation) +fun DependencyHandler.api(dependencyNotation: Any): Dependency? = + add("api", dependencyNotation) + fun DependencyHandler.androidTestImplementation(dependencyNotation: Any): Dependency? = add("androidTestImplementation", dependencyNotation) diff --git a/gradle.properties b/gradle.properties index 6e4d49328..54a4ad137 100644 --- a/gradle.properties +++ b/gradle.properties @@ -41,12 +41,3 @@ kotlin.code.style=official android.nonTransitiveRClass=true artifactoryGroupId=com.esri artifactoryArtifactBaseId=arcgis-maps-kotlin-toolkit - -# These versions define the dependency of the ArcGIS Maps SDK for Kotlin dependency -# when building the toolkit locally, typically from Android Studio. -# You will need to specify the build version in local.properties. -# Example: -# sdkBuildNumber=4678 -# When building the toolkit with CI, these versions are obtained from command line provided properties, -# see sdkVersionNumber in settings.gradle.kts. -sdkVersionNumber=300.0.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9b043ea7f..567c40c1a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -139,6 +139,7 @@ binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibil dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } gradle-secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "gradleSecrets"} kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } @@ -146,12 +147,13 @@ compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = " gmazzo-test-aggregation = { id = "io.github.gmazzo.test.aggregation.results", version.ref = "gmazzo" } # Plugins defined by the project build-logic -arcgismaps-android-application = { id = "arcgismaps.android.application", version = "unspecified" } -arcgismaps-android-application-compose = { id = "arcgismaps.android.application.compose", version = "unspecified" } -arcgismaps-android-library-compose = { id = "arcgismaps.android.library.compose", version = "unspecified" } -arcgismaps-android-library = { id = "arcgismaps.android.library", version = "unspecified" } -arcgismaps-kotlin-microapp = { id = "arcgismaps.kotlin.microapp", version = "unspecified" } -arcgismaps-kotlin-toolkit = { id = "arcgismaps.kotlin.toolkit", version = "unspecified" } +arcgismaps-android-application = { id = "arcgismaps.android.application" } +arcgismaps-android-application-compose = { id = "arcgismaps.android.application.compose" } +arcgismaps-android-library-compose = { id = "arcgismaps.android.library.compose" } +arcgismaps-android-library = { id = "arcgismaps.android.library" } +arcgismaps-kotlin-microapp = { id = "arcgismaps.kotlin.microapp" } +arcgismaps-kotlin-toolkit = { id = "arcgismaps.kotlin.toolkit" } +artifact-deploy = { id = "artifact-deploy" } [bundles] camerax = [ diff --git a/kdoc/build.gradle.kts b/kdoc/build.gradle.kts index 13f34fc19..3b7073ddc 100644 --- a/kdoc/build.gradle.kts +++ b/kdoc/build.gradle.kts @@ -89,7 +89,33 @@ dependencies { // Puts the version in the KDoc dokkaPlugin(libs.dokka.versioning) // put exposed dependencies in dokka's classpath - implementation(arcgis.mapsSdk) + // The version of the ArcGIS Maps SDK for Kotlin dependency. + // First look for the version number provided via command line (for CI builds), if not found, + // take the one defined in gradle.properties. + // CI builds pass -PversionNumber=${BUILDVER} + val sdkVersionNumber: String? = + providers.gradleProperty("versionNumber").orNull + ?: providers.gradleProperty("sdkVersionNumber").orNull + + // The build number of the ArcGIS Maps SDK for Kotlin dependency. + // First look for the version number provided via command line (for CI builds), if not found, + // take the one defined in local.properties. + // CI builds pass -PbuildNumber=${BUILDNUM} + val sdkBuildNumber: String = + providers.gradleProperty("buildNumber").orNull + ?: providers.gradleProperty("sdkBuildNumber").orNull + ?: "" + // ArcGIS Maps SDK dependency with build override support + if (sdkVersionNumber != null) { + if (!sdkVersionNumber.isBlank()) { + implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber-$sdkBuildNumber") + } else { + implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber") + } + } else { + // Use libs.versions.toml if no gradle property provided + implementation(libs.arcgis.maps.kotlin) + } implementation(platform(libs.androidx.compose.bom)) implementation(libs.bundles.composeCore) } diff --git a/microapps/ArFlyoverApp/app/build.gradle.kts b/microapps/ArFlyoverApp/app/build.gradle.kts index 226721397..fca9ddff7 100644 --- a/microapps/ArFlyoverApp/app/build.gradle.kts +++ b/microapps/ArFlyoverApp/app/build.gradle.kts @@ -17,79 +17,20 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.arflyoverapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.arflyoverapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.arflyoverapp" } } dependencies { - implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) + // Module-specific dependencies go here implementation(project(":ar")) + implementation(project(":geoview-compose")) implementation(libs.arcore) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/ArTabletopApp/app/build.gradle.kts b/microapps/ArTabletopApp/app/build.gradle.kts index 48015402b..a2a18edc0 100644 --- a/microapps/ArTabletopApp/app/build.gradle.kts +++ b/microapps/ArTabletopApp/app/build.gradle.kts @@ -17,78 +17,20 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.artabletopapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.artabletopapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - buildConfig = true - } - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.artabletopapp" } } dependencies { - implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) + // Module-specific dependencies go here implementation(project(":ar")) + implementation(project(":geoview-compose")) implementation(libs.arcore) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - implementation(libs.androidx.lifecycle.runtime.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/ArWorldScaleApp/app/build.gradle.kts b/microapps/ArWorldScaleApp/app/build.gradle.kts index d9875206d..e9ab6c9d8 100644 --- a/microapps/ArWorldScaleApp/app/build.gradle.kts +++ b/microapps/ArWorldScaleApp/app/build.gradle.kts @@ -17,79 +17,19 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.arworldscaleapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.arworldscaleapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.arworldscaleapp" } } dependencies { - implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) + // Module-specific dependencies go here implementation(project(":ar")) implementation(libs.arcore) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/AuthenticationApp/app/build.gradle.kts b/microapps/AuthenticationApp/app/build.gradle.kts index 3f82e53a9..1545f60a8 100644 --- a/microapps/AuthenticationApp/app/build.gradle.kts +++ b/microapps/AuthenticationApp/app/build.gradle.kts @@ -17,77 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.authenticationapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.authenticationapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - // context receivers are used by the MapInterface for gesture events - freeCompilerArgs = freeCompilerArgs + "-Xcontext-receivers" - } - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.authenticationapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":authentication")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/BasemapGalleryApp/app/build.gradle.kts b/microapps/BasemapGalleryApp/app/build.gradle.kts index eecd7bc4c..0ad9719fe 100644 --- a/microapps/BasemapGalleryApp/app/build.gradle.kts +++ b/microapps/BasemapGalleryApp/app/build.gradle.kts @@ -17,78 +17,19 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.basemapgalleryapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.basemapgalleryapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.basemapgalleryapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":basemapgallery")) implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/CompassApp/app/build.gradle.kts b/microapps/CompassApp/app/build.gradle.kts index 956e04ef2..1af5b0d36 100644 --- a/microapps/CompassApp/app/build.gradle.kts +++ b/microapps/CompassApp/app/build.gradle.kts @@ -17,76 +17,19 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.compassapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.compassapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.compassapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":compass")) implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/FeatureFormsApp/app/build.gradle.kts b/microapps/FeatureFormsApp/app/build.gradle.kts index e8aed9eb0..66eebabf5 100644 --- a/microapps/FeatureFormsApp/app/build.gradle.kts +++ b/microapps/FeatureFormsApp/app/build.gradle.kts @@ -17,93 +17,32 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") - id("com.google.dagger.hilt.android") - id("com.google.devtools.ksp") -} - -secrets { - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) + alias(libs.plugins.hilt) + alias(libs.plugins.ksp) } android { namespace = "com.arcgismaps.toolkit.featureformsapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.featureformsapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.featureformsapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":authentication")) implementation(project(":featureforms")) implementation(project(":geoview-compose")) - // sdk - implementation(arcgis.mapsSdk) - // hilt + implementation(libs.androidx.compose.navigation) implementation(libs.hilt.android.core) implementation(libs.androidx.hilt.navigation.compose) ksp(libs.hilt.compiler) - // room implementation(libs.room.runtime) annotationProcessor(libs.room.compiler) implementation(libs.room.ext) ksp(libs.room.compiler) - // jetpack window manager implementation(libs.androidx.window) implementation(libs.androidx.window.core) - // compose - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.compose.navigation) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - testImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/FloorFilterApp/app/build.gradle.kts b/microapps/FloorFilterApp/app/build.gradle.kts index dd97b3deb..c1ead411c 100644 --- a/microapps/FloorFilterApp/app/build.gradle.kts +++ b/microapps/FloorFilterApp/app/build.gradle.kts @@ -1,75 +1,17 @@ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.floorfilterapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.floorfilterapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.floorfilterapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":indoors")) implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/LegendApp/app/build.gradle.kts b/microapps/LegendApp/app/build.gradle.kts index c6f011210..631bd32cc 100644 --- a/microapps/LegendApp/app/build.gradle.kts +++ b/microapps/LegendApp/app/build.gradle.kts @@ -17,78 +17,19 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.legendapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.legendapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.legendapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":legend")) implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/MapViewCalloutApp/app/build.gradle.kts b/microapps/MapViewCalloutApp/app/build.gradle.kts index 3dcc8938b..66c550c9e 100644 --- a/microapps/MapViewCalloutApp/app/build.gradle.kts +++ b/microapps/MapViewCalloutApp/app/build.gradle.kts @@ -17,77 +17,19 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.mapviewcalloutapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.mapviewcalloutapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.mapviewcalloutapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) implementation(libs.androidx.compose.navigation) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/MapViewGeometryEditorApp/app/build.gradle.kts b/microapps/MapViewGeometryEditorApp/app/build.gradle.kts index 67ea51616..0eb0e53fe 100644 --- a/microapps/MapViewGeometryEditorApp/app/build.gradle.kts +++ b/microapps/MapViewGeometryEditorApp/app/build.gradle.kts @@ -17,78 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.mapviewgeometryeditorapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.mapviewgeometryeditorapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - @Suppress("UnstableApiUsage") - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.mapviewgeometryeditorapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(platform(libs.androidx.compose.bom)) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/MapViewIdentifyApp/app/build.gradle.kts b/microapps/MapViewIdentifyApp/app/build.gradle.kts index 99d0184a6..7439ed816 100644 --- a/microapps/MapViewIdentifyApp/app/build.gradle.kts +++ b/microapps/MapViewIdentifyApp/app/build.gradle.kts @@ -17,78 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.mapviewidentifyapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.mapviewidentifyapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - @Suppress("UnstableApiUsage") - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.mapviewidentifyapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(platform(libs.androidx.compose.bom)) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/MapViewInsetsApp/app/build.gradle.kts b/microapps/MapViewInsetsApp/app/build.gradle.kts index 7605d6288..071eb6751 100644 --- a/microapps/MapViewInsetsApp/app/build.gradle.kts +++ b/microapps/MapViewInsetsApp/app/build.gradle.kts @@ -17,78 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.mapviewinsetsapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.mapviewinsetsapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - @Suppress("UnstableApiUsage") - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.mapviewinsetsapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(platform(libs.androidx.compose.bom)) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/MapViewLocationDisplayApp/app/build.gradle.kts b/microapps/MapViewLocationDisplayApp/app/build.gradle.kts index a571f3138..a2abcc5bf 100644 --- a/microapps/MapViewLocationDisplayApp/app/build.gradle.kts +++ b/microapps/MapViewLocationDisplayApp/app/build.gradle.kts @@ -17,78 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.mapviewlocationdisplayapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.mapviewlocationdisplayapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - @Suppress("UnstableApiUsage") - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.mapviewlocationdisplayapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(platform(libs.androidx.compose.bom)) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/MapViewSetViewpointApp/app/build.gradle.kts b/microapps/MapViewSetViewpointApp/app/build.gradle.kts index befcf9b33..8c8966fec 100644 --- a/microapps/MapViewSetViewpointApp/app/build.gradle.kts +++ b/microapps/MapViewSetViewpointApp/app/build.gradle.kts @@ -17,78 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.mapviewsetviewpointapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.mapviewsetviewpointapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - @Suppress("UnstableApiUsage") - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.mapviewsetviewpointapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(platform(libs.androidx.compose.bom)) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/MicroappsLib/build.gradle.kts b/microapps/MicroappsLib/build.gradle.kts index ab42f1e14..6813c7cd7 100644 --- a/microapps/MicroappsLib/build.gradle.kts +++ b/microapps/MicroappsLib/build.gradle.kts @@ -17,48 +17,15 @@ */ plugins { - alias(libs.plugins.android.library) - alias(libs.plugins.kotlin.android) - alias(libs.plugins.compose.compiler) + alias(libs.plugins.arcgismaps.android.library.compose) } android { namespace = "com.esri.microappslib" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - } } dependencies { + // Module-specific dependencies go here implementation(platform(libs.androidx.compose.bom)) implementation(libs.bundles.composeCore) implementation(libs.bundles.core) diff --git a/microapps/OfflineMapAreasApp/app/build.gradle.kts b/microapps/OfflineMapAreasApp/app/build.gradle.kts index 841c7bf79..7bbb8df6f 100644 --- a/microapps/OfflineMapAreasApp/app/build.gradle.kts +++ b/microapps/OfflineMapAreasApp/app/build.gradle.kts @@ -17,77 +17,19 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.offlinemapareasapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.offlinemapareasapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.offlinemapareasapp" } } dependencies { - implementation(project(":geoview-compose")) - implementation(arcgis.mapsSdk) + // Module-specific dependencies go here implementation(project(":offline")) - implementation(project(":microapps-lib")) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) + implementation(project(":geoview-compose")) } diff --git a/microapps/OverviewMapApp/app/build.gradle.kts b/microapps/OverviewMapApp/app/build.gradle.kts index 83b0f185a..589b749aa 100644 --- a/microapps/OverviewMapApp/app/build.gradle.kts +++ b/microapps/OverviewMapApp/app/build.gradle.kts @@ -17,77 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.overviewmapapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.overviewmapapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.overviewmapapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/PopupApp/app/build.gradle.kts b/microapps/PopupApp/app/build.gradle.kts index 6b828b17a..12312e87a 100644 --- a/microapps/PopupApp/app/build.gradle.kts +++ b/microapps/PopupApp/app/build.gradle.kts @@ -17,82 +17,19 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.popupapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.popupapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = true - isShrinkResources = true - - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } + applicationId = "com.arcgismaps.toolkit.popupapp" } } dependencies { - implementation(project(":geoview-compose")) - implementation(arcgis.mapsSdk) + // Module-specific dependencies go here implementation(project(":popup")) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) + implementation(project(":geoview-compose")) } diff --git a/microapps/ScalebarApp/app/build.gradle.kts b/microapps/ScalebarApp/app/build.gradle.kts index f9aee08b5..a1747cb57 100644 --- a/microapps/ScalebarApp/app/build.gradle.kts +++ b/microapps/ScalebarApp/app/build.gradle.kts @@ -17,78 +17,19 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.scalebarapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.scalebarapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.scalebarapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":scalebar")) implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/SceneViewAnalysisOverlayApp/app/build.gradle.kts b/microapps/SceneViewAnalysisOverlayApp/app/build.gradle.kts index 5276b87d1..e62a530a1 100644 --- a/microapps/SceneViewAnalysisOverlayApp/app/build.gradle.kts +++ b/microapps/SceneViewAnalysisOverlayApp/app/build.gradle.kts @@ -17,77 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.sceneviewanalysisoverlayapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.sceneviewanalysisoverlayapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - @Suppress("UnstableApiUsage") - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.sceneviewanalysisoverlayapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/SceneViewCalloutApp/app/build.gradle.kts b/microapps/SceneViewCalloutApp/app/build.gradle.kts index 530c35804..0bbcf0e1d 100644 --- a/microapps/SceneViewCalloutApp/app/build.gradle.kts +++ b/microapps/SceneViewCalloutApp/app/build.gradle.kts @@ -17,76 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.sceneviewcalloutapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.sceneviewcalloutapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.sceneviewcalloutapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/SceneViewCameraControllerApp/app/build.gradle.kts b/microapps/SceneViewCameraControllerApp/app/build.gradle.kts index 9847ab80c..47dc4e22c 100644 --- a/microapps/SceneViewCameraControllerApp/app/build.gradle.kts +++ b/microapps/SceneViewCameraControllerApp/app/build.gradle.kts @@ -17,77 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.sceneviewcameracontrollerapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.sceneviewcameracontrollerapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - @Suppress("UnstableApiUsage") - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.sceneviewcameracontrollerapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/SceneViewLightingOptionsApp/app/build.gradle.kts b/microapps/SceneViewLightingOptionsApp/app/build.gradle.kts index 2fd368ca8..83dafadae 100644 --- a/microapps/SceneViewLightingOptionsApp/app/build.gradle.kts +++ b/microapps/SceneViewLightingOptionsApp/app/build.gradle.kts @@ -17,77 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.sceneviewlightingoptionsapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.sceneviewlightingoptionsapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - @Suppress("UnstableApiUsage") - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.sceneviewlightingoptionsapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/SceneViewSetViewpointApp/app/build.gradle.kts b/microapps/SceneViewSetViewpointApp/app/build.gradle.kts index 2fcdd3a0c..a7641a566 100644 --- a/microapps/SceneViewSetViewpointApp/app/build.gradle.kts +++ b/microapps/SceneViewSetViewpointApp/app/build.gradle.kts @@ -17,78 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.sceneviewsetviewpointapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.sceneviewsetviewpointapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - @Suppress("UnstableApiUsage") - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.sceneviewsetviewpointapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(platform(libs.androidx.compose.bom)) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/TemplateApp/app/build.gradle.kts b/microapps/TemplateApp/app/build.gradle.kts index 169034b9e..1fb685b05 100644 --- a/microapps/TemplateApp/app/build.gradle.kts +++ b/microapps/TemplateApp/app/build.gradle.kts @@ -17,77 +17,18 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.templateapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.templateapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.templateapp" } } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/microapps/UtilityNetworkTraceApp/app/build.gradle.kts b/microapps/UtilityNetworkTraceApp/app/build.gradle.kts index 3997c8323..a5c3329aa 100644 --- a/microapps/UtilityNetworkTraceApp/app/build.gradle.kts +++ b/microapps/UtilityNetworkTraceApp/app/build.gradle.kts @@ -17,75 +17,19 @@ */ plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") -} - -secrets { - // this file doesn't contain secrets, it just provides defaults which can be committed into git. - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.utilitynetworktraceapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.utilitynetworktraceapp" - minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.compileSdk.get().toInt() - versionCode = 1 - versionName = "1.0" - - testInstrumentationRunner ="androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } - } - - buildTypes { - release { - isMinifyEnabled = false - //proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"),("proguard-rules.pro" - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - - buildFeatures { - compose = true - buildConfig = true - } - - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false + applicationId = "com.arcgismaps.toolkit.utilitynetworktraceapp" } } dependencies { - implementation(project(":geoview-compose")) - implementation(project(":microapps-lib")) + // Module-specific dependencies go here implementation(project(":utilitynetworks")) - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.lifecycle.viewmodel.compose) - debugImplementation(libs.bundles.debug) + implementation(project(":geoview-compose")) } diff --git a/settings.gradle.kts b/settings.gradle.kts index ed94651e2..97af18f38 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -37,24 +37,6 @@ val localProperties = java.util.Properties().apply { } } -// The version of the ArcGIS Maps SDK for Kotlin dependency. -// First look for the version number provided via command line (for CI builds), if not found, -// take the one defined in gradle.properties. -// CI builds pass -PversionNumber=${BUILDVER} -val sdkVersionNumber: String = - providers.gradleProperty("versionNumber").orNull - ?: providers.gradleProperty("sdkVersionNumber").orNull - ?: throw IllegalStateException("sdkVersionNumber must be set either via command line or in gradle.properties") - -// The build number of the ArcGIS Maps SDK for Kotlin dependency. -// First look for the version number provided via command line (for CI builds), if not found, -// take the one defined in local.properties. -// CI builds pass -PbuildNumber=${BUILDNUM} -val sdkBuildNumber: String = - providers.gradleProperty("buildNumber").orNull - ?: localProperties.getProperty("sdkBuildNumber") - ?: "" - // The Artifactory credentials for the ArcGIS Maps SDK for Kotlin repository. // First look for the credentials provided via command line (for CI builds), if not found, // take the one defined in local.properties. @@ -96,28 +78,6 @@ dependencyResolutionManagement { } } } - - versionCatalogs { - create("arcgis") { - val versionAndBuild = if (finalBuild) { - logger.warn( - "Requested release candidate for the SDK dependency $sdkVersionNumber" - ) - sdkVersionNumber - } else { - if (sdkBuildNumber.isBlank()) { - logger.warn("Maps SDK dependency: $sdkVersionNumber") - sdkVersionNumber - } else { - logger.warn("Maps SDK dependency: $sdkVersionNumber-$sdkBuildNumber") - "$sdkVersionNumber-$sdkBuildNumber" - } - } - - version("mapsSdk", versionAndBuild) - library("mapsSdk", "com.esri", "arcgis-maps-kotlin").versionRef("mapsSdk") - } - } } // This enables the "Type Safe Project Accessors" feature diff --git a/toolkit/ar/build.gradle.kts b/toolkit/ar/build.gradle.kts index 611d253fc..b416351c6 100644 --- a/toolkit/ar/build.gradle.kts +++ b/toolkit/ar/build.gradle.kts @@ -16,75 +16,13 @@ * */ - plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") - alias(libs.plugins.binary.compatibility.validator) apply true + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } + android { namespace = "com.arcgismaps.toolkit.ar" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - packaging { - resources { - excludes += setOf( - "META-INF/LICENSE-notice.md", - "META-INF/LICENSE.md" - ) - } - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } apiValidation { @@ -93,7 +31,7 @@ apiValidation { // compiler. // ComposableSingletons$WorldScaleSceneViewScopeKt is generated due to internal compose function CalibrationViewInternal(), - // we don't want to check binary compatiblity for this internal function + // we don't want to check binary compatibility for this internal function val composableSingletons = listOf( "com/arcgismaps/toolkit/ar/ComposableSingletons\$WorldScaleSceneViewScopeKt" ) @@ -102,17 +40,10 @@ apiValidation { } dependencies { + // Module-specific dependencies go here implementation(project(":geoview-compose")) implementation(libs.arcore) - api(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) implementation(libs.play.services.location) - testImplementation(libs.bundles.unitTest) androidTestImplementation(libs.androidx.test.rules) androidTestImplementation(libs.truth) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/toolkit/authentication/build.gradle.kts b/toolkit/authentication/build.gradle.kts index f9062af0b..157a8a6c6 100644 --- a/toolkit/authentication/build.gradle.kts +++ b/toolkit/authentication/build.gradle.kts @@ -17,75 +17,12 @@ */ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") - alias(libs.plugins.binary.compatibility.validator) apply true + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.authentication" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - packaging { - resources { - excludes += setOf( - "META-INF/LICENSE-notice.md", - "META-INF/LICENSE.md" - ) - } - } - - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } apiValidation { @@ -102,18 +39,9 @@ apiValidation { } dependencies { - api(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.lifecycle.runtime.compose) - implementation(libs.androidx.activity.compose) + // Module-specific dependencies go here implementation(libs.androidx.browser) implementation(libs.androidx.material.icons) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) - // uiautomator androidTestImplementation(libs.androidx.uiautomator) androidTestImplementation(libs.mockk.android) diff --git a/toolkit/basemapgallery/build.gradle.kts b/toolkit/basemapgallery/build.gradle.kts index 8fe5f689d..2aadc10a9 100644 --- a/toolkit/basemapgallery/build.gradle.kts +++ b/toolkit/basemapgallery/build.gradle.kts @@ -16,62 +16,13 @@ * */ - plugins { - alias(libs.plugins.binary.compatibility.validator) apply true - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("artifact-deploy") - id("org.jetbrains.kotlin.plugin.compose") + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } + android { namespace = "com.arcgismaps.toolkit.basemapgallery" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } apiValidation { @@ -86,12 +37,5 @@ apiValidation { } dependencies { - api(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) + // Module-specific dependencies go here } diff --git a/toolkit/compass/build.gradle.kts b/toolkit/compass/build.gradle.kts index bd7b661b9..ea4674432 100644 --- a/toolkit/compass/build.gradle.kts +++ b/toolkit/compass/build.gradle.kts @@ -17,74 +17,14 @@ */ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") - alias(libs.plugins.binary.compatibility.validator) apply true + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.compass" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } dependencies { - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) + // Module-specific dependencies go here } diff --git a/toolkit/composable-map/build.gradle.kts b/toolkit/composable-map/build.gradle.kts index 8f9e84d89..9d554e67e 100644 --- a/toolkit/composable-map/build.gradle.kts +++ b/toolkit/composable-map/build.gradle.kts @@ -19,73 +19,14 @@ logger.warn("WARNING: The module composable-map is deprecated. Please use the module geoview-compose instead.") plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.composablemap" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } -} - -//https://youtrack.jetbrains.com/issue/KTIJ-21063 -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class).all { - compilerOptions { - freeCompilerArgs.add("-Xcontext-receivers") - } } dependencies { - api(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) + // Module-specific dependencies go here } diff --git a/toolkit/featureforms/build.gradle.kts b/toolkit/featureforms/build.gradle.kts index 240711e09..c2ca1da76 100644 --- a/toolkit/featureforms/build.gradle.kts +++ b/toolkit/featureforms/build.gradle.kts @@ -17,24 +17,13 @@ */ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") - id("kotlin-parcelize") - alias(libs.plugins.binary.compatibility.validator) apply true - alias(libs.plugins.kotlin.serialization) apply true -} - -secrets { - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.featureforms" - compileSdk = libs.versions.compileSdk.get().toInt() - + // Lint crashes on the latest Android studio // (Bug with Android Studio Meerkat | 2024.3.1) // TODO: Remove this when Android Studio lint checker is fixed @@ -44,59 +33,6 @@ android { disable += "MissingTranslation" disable += "MissingQuantity" } - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. - freeCompilerArgs = freeCompilerArgs + listOf("-Xconsistent-data-class-copy-visibility") - } - buildFeatures { - compose = true - buildConfig = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } apiValidation { @@ -138,29 +74,18 @@ apiValidation { ignoredClasses.addAll(composableSingletons) } - dependencies { - api(arcgis.mapsSdk) + // Module-specific dependencies go here implementation(libs.bundles.commonmark) implementation(platform(libs.coil.bom)) implementation(libs.coil.compose) - implementation(platform(libs.androidx.compose.bom)) implementation(libs.androidx.compose.foundation) implementation(libs.androidx.window) implementation(libs.androidx.window.core) - implementation(libs.bundles.composeCore) implementation(libs.androidx.compose.ui.util) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.material.icons) implementation(libs.bundles.camerax) implementation(libs.mlkit.barcode.scanning) implementation(libs.androidx.compose.navigation) implementation(libs.kotlinx.serialization.json) - testImplementation(libs.bundles.unitTest) androidTestImplementation(libs.truth) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - androidTestImplementation(libs.bundles.androidXTest) - debugImplementation(libs.bundles.debug) } diff --git a/toolkit/geoview-compose/build.gradle.kts b/toolkit/geoview-compose/build.gradle.kts index ec4fb66c2..c73a2e74d 100644 --- a/toolkit/geoview-compose/build.gradle.kts +++ b/toolkit/geoview-compose/build.gradle.kts @@ -17,76 +17,14 @@ */ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") - alias(libs.plugins.binary.compatibility.validator) apply true + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.geoviewcompose" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } dependencies { - api(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - androidTestImplementation(libs.androidx.uiautomator) - debugImplementation(libs.bundles.debug) + // Module-specific dependencies go here } diff --git a/toolkit/indoors/build.gradle.kts b/toolkit/indoors/build.gradle.kts index 5ebdef99b..db2f3f1a8 100644 --- a/toolkit/indoors/build.gradle.kts +++ b/toolkit/indoors/build.gradle.kts @@ -1,64 +1,10 @@ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") - alias(libs.plugins.binary.compatibility.validator) apply true + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.indoors" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } apiValidation { @@ -73,17 +19,6 @@ apiValidation { ignoredClasses.addAll(composableSingletons) } - dependencies { - api(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.lifecycle.runtime.compose) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.material.icons) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - androidTestImplementation(project(mapOf("path" to ":composable-map"))) - debugImplementation(libs.bundles.debug) + // Module-specific dependencies go here } diff --git a/toolkit/legend/build.gradle.kts b/toolkit/legend/build.gradle.kts index fe9a99d38..a7adf73af 100644 --- a/toolkit/legend/build.gradle.kts +++ b/toolkit/legend/build.gradle.kts @@ -16,70 +16,13 @@ * */ - plugins { - alias(libs.plugins.binary.compatibility.validator) apply true - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } + android { namespace = "com.arcgismaps.toolkit.legend" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - lint { - targetSdk = libs.versions.compileSdk.get().toInt() - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } apiValidation { @@ -94,13 +37,5 @@ apiValidation { } dependencies { - api(arcgis.mapsSdk) - implementation(project(":geoview-compose")) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) + // Module-specific dependencies go here } diff --git a/toolkit/offline/build.gradle.kts b/toolkit/offline/build.gradle.kts index 6efcead7b..182920959 100644 --- a/toolkit/offline/build.gradle.kts +++ b/toolkit/offline/build.gradle.kts @@ -16,72 +16,13 @@ * */ - plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") - id("kotlin-parcelize") - alias(libs.plugins.kotlin.serialization) apply true - alias(libs.plugins.binary.compatibility.validator) apply true + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } + android { namespace = "com.arcgismaps.toolkit.offline" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - lint { - disable += "MissingTranslation" - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } apiValidation { @@ -101,16 +42,7 @@ apiValidation { } dependencies { - api(arcgis.mapsSdk) + // Module-specific dependency here implementation(project(":geoview-compose")) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) implementation(libs.androidx.work.runtime.ktx) - implementation(libs.androidx.material.icons) - implementation(libs.kotlinx.serialization.json) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/toolkit/popup/build.gradle.kts b/toolkit/popup/build.gradle.kts index 05489ca9a..c7f1ef324 100644 --- a/toolkit/popup/build.gradle.kts +++ b/toolkit/popup/build.gradle.kts @@ -17,65 +17,12 @@ */ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") - id("kotlin-parcelize") - alias(libs.plugins.binary.compatibility.validator) apply true + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } + android { namespace = "com.arcgismaps.toolkit.popup" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. - freeCompilerArgs = freeCompilerArgs + listOf("-Xconsistent-data-class-copy-visibility") - } - - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } - } apiValidation { @@ -92,18 +39,10 @@ apiValidation { } dependencies { - api(arcgis.mapsSdk) + // Module-specific dependencies go here implementation(platform(libs.coil.bom)) implementation(libs.coil.compose) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - implementation(libs.androidx.material.icons) implementation(libs.androidx.media3.exoplayer) implementation(libs.androidx.media3.exoplayer.dash) implementation(libs.androidx.media3.ui) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } diff --git a/toolkit/scalebar/build.gradle.kts b/toolkit/scalebar/build.gradle.kts index 70e08a20f..4549ac0b7 100644 --- a/toolkit/scalebar/build.gradle.kts +++ b/toolkit/scalebar/build.gradle.kts @@ -17,75 +17,14 @@ */ plugins { - alias(libs.plugins.binary.compatibility.validator) apply true - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.scalebar" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } dependencies { - api(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) + // Module-specific dependencies go here } diff --git a/toolkit/template/build.gradle.kts b/toolkit/template/build.gradle.kts index c5abca024..aeaad2f63 100644 --- a/toolkit/template/build.gradle.kts +++ b/toolkit/template/build.gradle.kts @@ -17,68 +17,14 @@ */ plugins { - alias(libs.plugins.binary.compatibility.validator) apply true - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.template" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures { - compose = true - } - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } } dependencies { - api(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) + // Module-specific dependencies go here } diff --git a/toolkit/utilitynetworks/build.gradle.kts b/toolkit/utilitynetworks/build.gradle.kts index ef879172e..50b804c34 100644 --- a/toolkit/utilitynetworks/build.gradle.kts +++ b/toolkit/utilitynetworks/build.gradle.kts @@ -17,75 +17,12 @@ */ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") - id("artifact-deploy") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") - alias(libs.plugins.binary.compatibility.validator) apply true -} - -secrets { - defaultPropertiesFileName = "secrets.defaults.properties" + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.utilitynetworks" - compileSdk = libs.versions.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.minSdk.get().toInt() - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") - } - - buildTypes { - release { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = "1.8" - // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. - freeCompilerArgs = freeCompilerArgs + listOf("-Xconsistent-data-class-copy-visibility") - } - buildFeatures { - compose = true - buildConfig = true - } - - // If this were not an android project, we would just write `explicitApi()` in the Kotlin scope. - // but as an android project could write `freeCompilerArgs = listOf("-Xexplicit-api=strict")` - // in the kotlinOptions above, but that would enforce api rules on the test code, which we don't want. - tasks.withType { - if ("Test" !in name) { - compilerOptions { - freeCompilerArgs.add("-Xexplicit-api=strict") - } - } - } - - /** - * Configures the test report for connected (instrumented) tests to be copied to a central - * folder in the project's root directory. - */ - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - val connectedTestReportsPath: String by project - reportDir = "$connectedTestReportsPath/${project.name}" - } - - publishing { - singleVariant("release") { - // This is the default variant. - } - } } apiValidation { @@ -110,18 +47,7 @@ apiValidation { } dependencies { - api(arcgis.mapsSdk) + // Module-specific dependencies go here implementation(project(":geoview-compose")) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.lifecycle.runtime.compose) - implementation(libs.androidx.activity.compose) implementation(libs.androidx.compose.navigation) - implementation(libs.androidx.material.icons) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.truth) - androidTestImplementation(platform(libs.androidx.compose.bom)) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } From 4d3079b7d1c0504101a0cbd2d2ec5651d648da03 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Mon, 18 Aug 2025 15:21:15 -0700 Subject: [PATCH 03/16] Abstract ArcGISMapsKotlinSDK dependency as a gradle object --- build-logic/convention/build.gradle.kts | 4 ++ .../AndroidApplicationConventionPlugin.kt | 1 - .../java/AndroidLibraryConventionPlugin.kt | 1 - ...rcGISMapsKotlinMicroappConventionPlugin.kt | 31 +--------- .../ArcGISMapsKotlinSDKConventionPlugin.kt | 12 ++++ ...ArcGISMapsKotlinToolkitConventionPlugin.kt | 32 +---------- .../ArcGISMapsKotlinSDKDependency.kt | 56 +++++++++++++++++++ gradle/libs.versions.toml | 3 +- kdoc/build.gradle.kts | 36 ++---------- 9 files changed, 86 insertions(+), 90 deletions(-) create mode 100644 build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index fac128bb2..6ed5e81ef 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -58,5 +58,9 @@ gradlePlugin { id = "arcgismaps.kotlin.microapp" implementationClass = "ArcGISMapsKotlinMicroappConventionPlugin" } + register("arcGISMapsKotlinSDK") { + id = "arcgismaps.kotlin.sdk" + implementationClass = "ArcGISMapsKotlinSDKConventionPlugin" + } } } diff --git a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt index 27091a447..6fb51bec7 100644 --- a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt @@ -16,7 +16,6 @@ class AndroidApplicationConventionPlugin : Plugin { extensions.configure { configureKotlinAndroid(this) - compileSdk = 35 defaultConfig { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt index f2099a718..8cc551f98 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt @@ -19,7 +19,6 @@ class AndroidLibraryConventionPlugin : Plugin { extensions.configure { configureKotlinAndroid(this) - compileSdk = 35 defaultConfig { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt index 4f9dc8673..c5df42227 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt @@ -1,4 +1,5 @@ import com.android.build.api.dsl.ApplicationExtension +import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency import com.esri.arcgismaps.kotlin.build_logic.convention.implementation import com.esri.arcgismaps.kotlin.build_logic.convention.libs import org.gradle.api.Plugin @@ -25,7 +26,6 @@ class ArcGISMapsKotlinMicroappConventionPlugin : Plugin { if (defaultPropertiesFile.exists()) { val properties = java.util.Properties() defaultPropertiesFile.inputStream().use { properties.load(it) } - defaultConfig { // Add each property as a BuildConfig field properties.forEach { (key, value) -> @@ -43,33 +43,8 @@ class ArcGISMapsKotlinMicroappConventionPlugin : Plugin { } dependencies { - // The version of the ArcGIS Maps SDK for Kotlin dependency. - // First look for the version number provided via command line (for CI builds), if not found, - // take the one defined in gradle.properties. - // CI builds pass -PversionNumber=${BUILDVER} - val sdkVersionNumber: String? = - providers.gradleProperty("versionNumber").orNull - ?: providers.gradleProperty("sdkVersionNumber").orNull - - // The build number of the ArcGIS Maps SDK for Kotlin dependency. - // First look for the version number provided via command line (for CI builds), if not found, - // take the one defined in local.properties. - // CI builds pass -PbuildNumber=${BUILDNUM} - val sdkBuildNumber: String = - providers.gradleProperty("buildNumber").orNull - ?: providers.gradleProperty("sdkBuildNumber").orNull - ?: "" - // ArcGIS Maps SDK dependency with build override support - if (sdkVersionNumber != null) { - if (!sdkVersionNumber.isBlank()) { - implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber-$sdkBuildNumber") - } else { - implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber") - } - } else { - // Use libs.versions.toml if no gradle property provided - implementation(libs.findLibrary("arcgis-maps-kotlin").get()) - } + // Configure the ArcGIS Maps SDK dependency + ArcGISMapsKotlinSDKDependency.configureArcGISMapsDependencies(target) // Local project common microapps library implementation(project(":microapps-lib")) diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt new file mode 100644 index 000000000..953931809 --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt @@ -0,0 +1,12 @@ +import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency +import org.gradle.api.Plugin +import org.gradle.api.Project + +class ArcGISMapsKotlinSDKConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + // Configure the ArcGIS Maps SDK dependency + ArcGISMapsKotlinSDKDependency.configureArcGISMapsDependencies(target) + } + } +} diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt index 154d8c078..fcad22de3 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -1,6 +1,5 @@ import com.android.build.api.dsl.LibraryExtension -import com.esri.arcgismaps.kotlin.build_logic.convention.api -import com.esri.arcgismaps.kotlin.build_logic.convention.implementation +import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency import com.esri.arcgismaps.kotlin.build_logic.convention.libs import org.gradle.api.Plugin import org.gradle.api.Project @@ -61,33 +60,8 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { dependencies { - // The version of the ArcGIS Maps SDK for Kotlin dependency. - // First look for the version number provided via command line (for CI builds), if not found, - // take the one defined in gradle.properties. - // CI builds pass -PversionNumber=${BUILDVER} - val sdkVersionNumber: String? = - providers.gradleProperty("versionNumber").orNull - ?: providers.gradleProperty("sdkVersionNumber").orNull - - // The build number of the ArcGIS Maps SDK for Kotlin dependency. - // First look for the version number provided via command line (for CI builds), if not found, - // take the one defined in local.properties. - // CI builds pass -PbuildNumber=${BUILDNUM} - val sdkBuildNumber: String = - providers.gradleProperty("buildNumber").orNull - ?: providers.gradleProperty("sdkBuildNumber").orNull - ?: "" - // ArcGIS Maps SDK dependency with build override support - if (sdkVersionNumber != null) { - if (!sdkVersionNumber.isBlank()) { - implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber-$sdkBuildNumber") - } else { - implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber") - } - } else { - // Use libs.versions.toml if no gradle property provided - implementation(libs.findLibrary("arcgis-maps-kotlin").get()) - } + // Configure the ArcGIS Maps SDK dependency + ArcGISMapsKotlinSDKDependency.configureArcGISMapsDependencies(target) } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt new file mode 100644 index 000000000..a814492c0 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt @@ -0,0 +1,56 @@ +package com.esri.arcgismaps.kotlin.build_logic.convention + +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies + +/** + * A helper object to configure the logic for applying the ArcGIS Maps SDK dependency, + * allowing for simple one-line calls in convention plugins or build scripts. + * It also handles dynamic versioning based on Gradle properties. + */ +object ArcGISMapsKotlinSDKDependency { + + /** + * Applies the ArcGIS Maps SDK for Kotlin dependency to the project. + * + * This function checks for Gradle properties (`versionNumber` or `sdkVersionNumber`) + * to determine the SDK version. If a version is provided, it can be combined with a + * `buildNumber` to specify a specific build. If no version property is found, + * it falls back to the version defined in `libs.versions.toml`. + * + * @param target The Gradle Project to which the dependency will be added. + */ + fun configureArcGISMapsDependencies(target: Project) { + target.dependencies { + // First look for the version number provided via command line (for CI builds), if not found, + // take the one defined in gradle.properties. + // CI builds pass -PversionNumber=${BUILDVER} + val sdkVersionNumber: String? = + target.providers.gradleProperty("versionNumber").orNull + ?: target.providers.gradleProperty("sdkVersionNumber").orNull + + // The build number of the ArcGIS Maps SDK for Kotlin dependency. + // First look for the version number provided via command line (for CI builds), if not found, + // take the one defined in local.properties. + // CI builds pass -PbuildNumber=${BUILDNUM} + val sdkBuildNumber: String? = + target.providers.gradleProperty("buildNumber").orNull + ?: target.providers.gradleProperty("sdkBuildNumber").orNull + ?: "" + + // ArcGIS Maps SDK dependency with build override support + if (sdkVersionNumber != null) { + // If a buildNumber is provided and not blank, append it to the version. + val dependencyVersion = if (!sdkBuildNumber.isNullOrBlank()) { + "$sdkVersionNumber-$sdkBuildNumber" + } else { + sdkVersionNumber + } + implementation("com.esri:arcgis-maps-kotlin:$dependencyVersion") + } else { + // Use libs.versions.toml if no gradle property is provided + implementation(target.libs.findLibrary("arcgis-maps-kotlin").get()) + } + } + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 567c40c1a..6fbaca528 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # ArcGIS Maps SDK for Kotlin version -arcgisMapsKotlinVersion = "300.0.0-4689" +arcgisMapsKotlinVersion = "300.0.0-4695" ### Android versions androidGradlePlugin = "8.9.2" @@ -151,6 +151,7 @@ arcgismaps-android-application = { id = "arcgismaps.android.application" } arcgismaps-android-application-compose = { id = "arcgismaps.android.application.compose" } arcgismaps-android-library-compose = { id = "arcgismaps.android.library.compose" } arcgismaps-android-library = { id = "arcgismaps.android.library" } +arcgismaps-kotlin-sdk = { id = "arcgismaps.kotlin.sdk"} arcgismaps-kotlin-microapp = { id = "arcgismaps.kotlin.microapp" } arcgismaps-kotlin-toolkit = { id = "arcgismaps.kotlin.toolkit" } artifact-deploy = { id = "artifact-deploy" } diff --git a/kdoc/build.gradle.kts b/kdoc/build.gradle.kts index 3b7073ddc..e4c488a50 100644 --- a/kdoc/build.gradle.kts +++ b/kdoc/build.gradle.kts @@ -17,9 +17,12 @@ */ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - alias(libs.plugins.dokka) apply true + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.dokka) + // put exposed dependencies in dokka's classpath + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.arcgismaps.kotlin.sdk) } val versionNumber: String by project @@ -89,33 +92,6 @@ dependencies { // Puts the version in the KDoc dokkaPlugin(libs.dokka.versioning) // put exposed dependencies in dokka's classpath - // The version of the ArcGIS Maps SDK for Kotlin dependency. - // First look for the version number provided via command line (for CI builds), if not found, - // take the one defined in gradle.properties. - // CI builds pass -PversionNumber=${BUILDVER} - val sdkVersionNumber: String? = - providers.gradleProperty("versionNumber").orNull - ?: providers.gradleProperty("sdkVersionNumber").orNull - - // The build number of the ArcGIS Maps SDK for Kotlin dependency. - // First look for the version number provided via command line (for CI builds), if not found, - // take the one defined in local.properties. - // CI builds pass -PbuildNumber=${BUILDNUM} - val sdkBuildNumber: String = - providers.gradleProperty("buildNumber").orNull - ?: providers.gradleProperty("sdkBuildNumber").orNull - ?: "" - // ArcGIS Maps SDK dependency with build override support - if (sdkVersionNumber != null) { - if (!sdkVersionNumber.isBlank()) { - implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber-$sdkBuildNumber") - } else { - implementation("com.esri:arcgis-maps-kotlin:$sdkVersionNumber") - } - } else { - // Use libs.versions.toml if no gradle property provided - implementation(libs.arcgis.maps.kotlin) - } implementation(platform(libs.androidx.compose.bom)) implementation(libs.bundles.composeCore) } From e6c8f6b11999722f16808ba65951015af1ed2ebf Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Tue, 19 Aug 2025 10:23:26 -0700 Subject: [PATCH 04/16] Untangle dependencies and add PR feedback --- bom/build.gradle.kts | 6 +- ...droidApplicationComposeConventionPlugin.kt | 10 +- .../AndroidLibraryComposeConventionPlugin.kt | 5 +- ...ArcGISMapsKotlinToolkitConventionPlugin.kt | 6 +- .../build_logic/convention/AndroidCompose.kt | 3 +- .../ArcGISMapsKotlinSDKDependency.kt | 21 ++-- build.gradle.kts | 18 +++- gradle-plugins/build.gradle.kts | 4 +- .../com/arcgismaps/ArtifactPublisher.kt | 9 +- gradle/libs.versions.toml | 5 - kdoc/build.gradle.kts | 12 +-- microapps/MicroappsLib/build.gradle.kts | 6 -- settings.gradle.kts | 101 ++++++++++++++---- toolkit/ar/build.gradle.kts | 2 - toolkit/authentication/api/authentication.api | 6 -- toolkit/basemapgallery/build.gradle.kts | 5 + toolkit/composable-map/build.gradle.kts | 1 - toolkit/featureforms/build.gradle.kts | 2 - toolkit/popup/build.gradle.kts | 6 ++ 19 files changed, 144 insertions(+), 84 deletions(-) diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index 941902952..1b93b6bfe 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -17,8 +17,8 @@ */ plugins { - id("maven-publish") - id("java-platform") + `maven-publish` + `java-platform` } // Find these in properties passed through command line or read from GRADLE_HOME/gradle.properties @@ -91,5 +91,3 @@ afterEvaluate { } } } - - diff --git a/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt index 7987c7c4e..072b9bb0e 100644 --- a/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt @@ -1,11 +1,9 @@ import com.android.build.api.dsl.ApplicationExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid +import com.esri.arcgismaps.kotlin.build_logic.convention.debugImplementation import com.esri.arcgismaps.kotlin.build_logic.convention.implementation import com.esri.arcgismaps.kotlin.build_logic.convention.libs -import com.esri.arcgismaps.kotlin.build_logic.convention.testImplementation -import com.esri.arcgismaps.kotlin.build_logic.convention.androidTestImplementation -import com.esri.arcgismaps.kotlin.build_logic.convention.debugImplementation import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies @@ -22,7 +20,7 @@ class AndroidApplicationComposeConventionPlugin : Plugin { val extension = extensions.getByType() configureKotlinAndroid(extension) configureAndroidCompose(extension) - + // Add common Compose dependencies for application modules dependencies { implementation(platform(libs.findLibrary("androidx-compose-bom").get())) @@ -30,10 +28,6 @@ class AndroidApplicationComposeConventionPlugin : Plugin { implementation(libs.findBundle("core").get()) implementation(libs.findLibrary("androidx-activity-compose").get()) implementation(libs.findLibrary("androidx-lifecycle-viewmodel-compose").get()) - - testImplementation(libs.findBundle("unitTest").get()) - androidTestImplementation(platform(libs.findLibrary("androidx-compose-bom").get())) - androidTestImplementation(libs.findBundle("composeTest").get()) debugImplementation(libs.findBundle("debug").get()) } } diff --git a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt index 874f92cac..2de887961 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt @@ -24,7 +24,7 @@ class AndroidLibraryComposeConventionPlugin : Plugin { val extension = extensions.getByType() configureKotlinAndroid(extension) configureAndroidCompose(extension) - + // Add common Compose dependencies for library modules dependencies { implementation(platform(libs.findLibrary("androidx-compose-bom").get())) @@ -33,11 +33,10 @@ class AndroidLibraryComposeConventionPlugin : Plugin { implementation(libs.findLibrary("androidx-lifecycle-runtime-compose").get()) implementation(libs.findLibrary("androidx-activity-compose").get()) implementation(libs.findLibrary("androidx-material-icons").get()) - implementation(libs.findLibrary("kotlinx-serialization-json").get()) - testImplementation(libs.findBundle("unitTest").get()) androidTestImplementation(libs.findBundle("composeTest").get()) + androidTestImplementation(libs.findBundle("androidXTest").get()) debugImplementation(libs.findBundle("debug").get()) } } diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt index fcad22de3..b42713166 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -14,7 +14,11 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { with(pluginManager) { apply(libs.findPlugin("arcgismaps-android-library").get().get().pluginId) apply(libs.findPlugin("arcgismaps-android-library-compose").get().get().pluginId) - apply(libs.findPlugin("binary-compatibility-validator").get().get().pluginId) + // Only apply binary compatibility validator if shouldValidateApi is true + val shouldValidateApi = target.findProperty("shouldValidateApi") as? Boolean ?: true + if (shouldValidateApi){ + apply(libs.findPlugin("binary-compatibility-validator").get().get().pluginId) + } } extensions.configure { diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt index e82e9bfef..f63ac8fb2 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt @@ -27,8 +27,7 @@ internal fun Project.configureAndroidCompose( implementation(libs.findLibrary("androidx-compose-material3").get()) implementation(libs.findLibrary("androidx-lifecycle-viewmodel-compose").get()) implementation(libs.findLibrary("androidx-compose-ui-tooling-preview").get()) - debugImplementation(libs.findLibrary("androidx-compose-ui-tooling").get()) - debugImplementation(libs.findLibrary("androidx-compose-ui-test-manifest").get()) + debugImplementation(libs.findBundle("debug").get()) androidTestImplementation(libs.findLibrary("androidx-compose-ui-test").get()) } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt index a814492c0..7bdc5a0f7 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt @@ -22,6 +22,10 @@ object ArcGISMapsKotlinSDKDependency { */ fun configureArcGISMapsDependencies(target: Project) { target.dependencies { + // For finalBuilds ignore the build number and pick up the released version of the SDK dependency + val finalBuild: Boolean = (target.providers.gradleProperty("finalBuild").orNull ?: "false") + .toBoolean() + // First look for the version number provided via command line (for CI builds), if not found, // take the one defined in gradle.properties. // CI builds pass -PversionNumber=${BUILDVER} @@ -40,16 +44,21 @@ object ArcGISMapsKotlinSDKDependency { // ArcGIS Maps SDK dependency with build override support if (sdkVersionNumber != null) { - // If a buildNumber is provided and not blank, append it to the version. - val dependencyVersion = if (!sdkBuildNumber.isNullOrBlank()) { - "$sdkVersionNumber-$sdkBuildNumber" - } else { + val dependencyVersion = if (finalBuild) { + // For a final build, use the version number directly sdkVersionNumber + } else { + // If a buildNumber is provided and not blank, append it to the version. + if (!sdkBuildNumber.isNullOrBlank()) { + "$sdkVersionNumber-$sdkBuildNumber" + } else { + sdkVersionNumber + } } - implementation("com.esri:arcgis-maps-kotlin:$dependencyVersion") + api("com.esri:arcgis-maps-kotlin:$dependencyVersion") } else { // Use libs.versions.toml if no gradle property is provided - implementation(target.libs.findLibrary("arcgis-maps-kotlin").get()) + api(target.libs.findLibrary("arcgis-maps-kotlin").get()) } } } diff --git a/build.gradle.kts b/build.gradle.kts index 87f35d3c2..76432e7a1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -120,6 +120,23 @@ testAggregation { } } +/** + * Excludes specific modules from the 'apiDump' task. + * Add all modules to be excluded to the `excludedFromApiDump` set. + */ +subprojects { + // Define the modules to be excluded from apiDump + val excludedFromApiDump = setOf( + "bom", + "kdoc", + "template", + "microapps-lib", + "composable-map" + ) + // Add this property to indicate whether this project should have API validation + ext.set("shouldValidateApi", project.name !in excludedFromApiDump) +} + /** * Returns all modules in this project, except the ones specified by [modulesToExclude]. */ @@ -132,4 +149,3 @@ fun getModulesExcept(vararg modulesToExclude: String): List = } .filter { !modulesToExclude.contains(it) } // exclude specified modules } - diff --git a/gradle-plugins/build.gradle.kts b/gradle-plugins/build.gradle.kts index c48fdef85..005a9505a 100644 --- a/gradle-plugins/build.gradle.kts +++ b/gradle-plugins/build.gradle.kts @@ -14,11 +14,11 @@ gradlePlugin { group = "internal" id = "artifact-deploy" version = "1.0" - implementationClass = "deploy.ArtifactPublisher" + implementationClass = "com.arcgismaps.ArtifactPublisher" } } } dependencies { - implementation(libs.kotlinx.serialization.json) + // Module-specific dependencies go here } diff --git a/gradle-plugins/src/main/kotlin/com/arcgismaps/ArtifactPublisher.kt b/gradle-plugins/src/main/kotlin/com/arcgismaps/ArtifactPublisher.kt index 72ce61f73..6f37022ac 100644 --- a/gradle-plugins/src/main/kotlin/com/arcgismaps/ArtifactPublisher.kt +++ b/gradle-plugins/src/main/kotlin/com/arcgismaps/ArtifactPublisher.kt @@ -16,14 +16,13 @@ * */ -package deploy +package com.arcgismaps import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.publish.maven.plugins.MavenPublishPlugin -import org.gradle.configurationcache.extensions.capitalized import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.get import org.gradle.kotlin.dsl.provideDelegate @@ -55,8 +54,8 @@ class ArtifactPublisher : Plugin { } else { "$versionNumber-$buildNumber" } - val artifactoryArtifactId: String = "$artifactoryArtifactBaseId-${project.name}" - + val artifactoryArtifactId = "$artifactoryArtifactBaseId-${project.name}" + project.pluginManager.apply(MavenPublishPlugin::class.java) project.afterEvaluate { project.extensions.configure { @@ -77,7 +76,7 @@ class ArtifactPublisher : Plugin { groupId = artifactoryGroupId artifactId = artifactoryArtifactId version = artifactVersion - + from(project.components["release"]) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6fbaca528..4f7e2034f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,6 @@ arcgisMapsKotlinVersion = "300.0.0-4695" androidGradlePlugin = "8.9.2" androidXBrowser = "1.8.0" androidxCamera = "1.4.2" -androidxComposeCompiler = "1.5.12" androidxCore = "1.16.0" androidxEspresso = "3.6.1" androidxHiltNavigationCompose = "1.2.0" @@ -79,7 +78,6 @@ play-services-location = { group = "com.google.android.gms", name = "play-servic ### Kotlin libs kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin"} kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesTest" } -kotlinx-serialization-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "kotlinxSerializationJson" } kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } ### Compose libs @@ -112,7 +110,6 @@ truth = { group = "com.google.truth", name = "truth", version.ref = "truth" } ### Third party libs coil = { group = "io.coil-kt", name = "coil" } -coil-base = { group = "io.coil-kt", name = "coil-base" } coil-bom = { group = "io.coil-kt", name = "coil-bom", version.ref = "coilBOM" } coil-compose = { group = "io.coil-kt", name = "coil-compose" } commonmark = { group = "org.commonmark", name = "commonmark", version.ref="commonMark" } @@ -120,8 +117,6 @@ commonmark-strikethrough = { group = "org.commonmark", name = "commonmark-ext-gf dokka-versioning = { group = "org.jetbrains.dokka", name = "versioning-plugin", version.ref = "dokka" } hilt-android-core = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" } hilt-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" } -hilt-ext-compiler = { group = "androidx.hilt", name = "hilt-compiler", version.ref = "hiltExt" } -hilt-ext-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hiltExt" } room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" } room-ext = { group = "androidx.room", name = "room-ktx", version.ref = "room" } room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" } diff --git a/kdoc/build.gradle.kts b/kdoc/build.gradle.kts index e4c488a50..cfa1c1e8d 100644 --- a/kdoc/build.gradle.kts +++ b/kdoc/build.gradle.kts @@ -17,11 +17,9 @@ */ plugins { - alias(libs.plugins.android.library) - alias(libs.plugins.kotlin.android) alias(libs.plugins.dokka) - // put exposed dependencies in dokka's classpath alias(libs.plugins.arcgismaps.kotlin.toolkit) + // put exposed dependencies in dokka's classpath alias(libs.plugins.arcgismaps.kotlin.sdk) } @@ -69,7 +67,7 @@ tasks { matchingRegex.set(".*internal.*") suppress.set(true) } - + perPackageOption { reportUndocumented.set(true) } @@ -81,7 +79,7 @@ tasks { android { namespace = "com.arcgismaps.toolkit.doc" compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { minSdk = libs.versions.minSdk.get().toInt() consumerProguardFiles("consumer-rules.pro") @@ -91,8 +89,4 @@ android { dependencies { // Puts the version in the KDoc dokkaPlugin(libs.dokka.versioning) - // put exposed dependencies in dokka's classpath - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) } - diff --git a/microapps/MicroappsLib/build.gradle.kts b/microapps/MicroappsLib/build.gradle.kts index 6813c7cd7..202c7d2cd 100644 --- a/microapps/MicroappsLib/build.gradle.kts +++ b/microapps/MicroappsLib/build.gradle.kts @@ -26,10 +26,4 @@ android { dependencies { // Module-specific dependencies go here - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.lifecycle.runtime.compose) - implementation(libs.androidx.activity.compose) - debugImplementation(libs.bundles.debug) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 97af18f38..e056b5d5f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,10 +26,6 @@ pluginManagement { } } -// For finalBuilds ignore the build number and pick up the released version of the SDK dependency -val finalBuild: Boolean = (providers.gradleProperty("finalBuild").orNull ?: "false") - .run { this == "true" } - val localProperties = java.util.Properties().apply { val localPropertiesFile = file("local.properties") if (localPropertiesFile.exists()) { @@ -83,25 +79,88 @@ dependencyResolutionManagement { // This enables the "Type Safe Project Accessors" feature enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") -// Dynamically include all toolkit components -File("toolkit").listFiles()?.filter { it.isDirectory }?.forEach { toolkitModule -> - include(":${toolkitModule.name}") - project(":${toolkitModule.name}").projectDir = file("toolkit/${toolkitModule.name}") -} - -// Dynamically include all microapp components -File("microapps").listFiles()?.filter { it.isDirectory && !it.name.contains("MicroappsLib") }?.forEach { microappFolder -> - val appDir = File(microappFolder, "app") - if (appDir.exists() && appDir.isDirectory) { - val microappName = microappFolder.name.toLowerCase().replace("app", "-app") - include(":$microappName") - project(":$microappName").projectDir = appDir - } -} - -// Add any other specific includes here include(":bom") project(":bom").projectDir = File(rootDir, "bom") include(":kdoc") include(":microapps-lib") project(":microapps-lib").projectDir = File(rootDir, "microapps/MicroappsLib") +include(":authentication-app") +project(":authentication-app").projectDir = File(rootDir, "microapps/AuthenticationApp/app") +include(":authentication") +project(":authentication").projectDir = File(rootDir, "toolkit/authentication") +include(":compass-app") +project(":compass-app").projectDir = File(rootDir, "microapps/CompassApp/app") +include(":compass") +project(":compass").projectDir = File(rootDir, "toolkit/compass") +include(":featureforms-app") +project(":featureforms-app").projectDir = File(rootDir, "microapps/FeatureFormsApp/app") +include(":featureforms") +project(":featureforms").projectDir = File(rootDir, "toolkit/featureforms") +include(":template-app") +project(":template-app").projectDir = File(rootDir, "microapps/TemplateApp/app") +include(":template") +project(":template").projectDir = File(rootDir, "toolkit/template") +include(":composable-map") +project(":composable-map").projectDir = File(rootDir, "toolkit/composable-map") +include(":indoors") +project(":indoors").projectDir = File(rootDir, "toolkit/indoors") +include(":floor-filter-app") +project(":floor-filter-app").projectDir = File(rootDir, "microapps/FloorFilterApp/app") +include(":geoview-compose") +project(":geoview-compose").projectDir = File(rootDir, "toolkit/geoview-compose") +include(":map-view-callout-app") +project(":map-view-callout-app").projectDir = File(rootDir, "microapps/MapViewCalloutApp/app") +include(":map-view-location-display-app") +project(":map-view-location-display-app").projectDir = File(rootDir, "microapps/mapviewlocationdisplayapp/app") +include(":map-view-insets-app") +project(":map-view-insets-app").projectDir = File(rootDir, "microapps/mapviewinsetsapp/app") +include(":map-view-geometry-editor-app") +project(":map-view-geometry-editor-app").projectDir = File(rootDir, "microapps/mapviewgeometryeditorapp/app") +include(":map-view-set-viewpoint-app") +project(":map-view-set-viewpoint-app").projectDir = File(rootDir, "microapps/mapviewsetviewpointapp/app") +include(":map-view-identify-app") +project(":map-view-identify-app").projectDir = File(rootDir, "microapps/mapviewidentifyapp/app") +include(":scene-view-callout-app") +project(":scene-view-callout-app").projectDir = File(rootDir, "microapps/SceneViewCalloutApp/app") +include(":scene-view-analysis-overlay-app") +project(":scene-view-analysis-overlay-app").projectDir = File(rootDir, "microapps/sceneviewanalysisoverlayapp/app") +include(":scene-view-set-viewpoint-app") +project(":scene-view-set-viewpoint-app").projectDir = File(rootDir, "microapps/sceneviewsetviewpointapp/app") +include(":scene-view-camera-controller-app") +project(":scene-view-camera-controller-app").projectDir = File(rootDir, "microapps/sceneviewcameracontrollerapp/app") +include(":scene-view-lighting-options-app") +project(":scene-view-lighting-options-app").projectDir = File(rootDir, "microapps/sceneviewlightingoptionsapp/app") +include(":popup") +project(":popup").projectDir = File(rootDir, "toolkit/popup") +include(":popup-app") +project(":popup-app").projectDir = File(rootDir, "microapps/PopupApp/app") +include(":utility-network-trace-app") +project(":utility-network-trace-app").projectDir = File(rootDir, "microapps/UtilityNetworkTraceApp/app") +include(":utilitynetworks") +project(":utilitynetworks").projectDir = File(rootDir, "toolkit/utilitynetworks") +include(":ar") +project(":ar").projectDir = File(rootDir, "toolkit/ar") +include(":ar-tabletop-app") +project(":ar-tabletop-app").projectDir = File(rootDir, "microapps/ArTabletopApp/app") +include(":ar-worldscale-app") +project(":ar-worldscale-app").projectDir = File(rootDir, "microapps/ArWorldScaleApp/app") +include(":scalebar-app") +project(":scalebar-app").projectDir = File(rootDir, "microapps/ScalebarApp/app") +include(":scalebar") +project(":scalebar").projectDir = File(rootDir, "toolkit/scalebar") +include(":legend") +project(":legend").projectDir = File(rootDir, "toolkit/legend") +include(":legend-app") +project(":legend-app").projectDir = File(rootDir, "microapps/LegendApp/app") +include(":basemapgallery-app") +project(":basemapgallery-app").projectDir = File(rootDir, "microapps/BasemapGalleryApp/app") +include(":basemapgallery") +project(":basemapgallery").projectDir = File(rootDir, "toolkit/basemapgallery") +include(":overviewmap-app") +project(":overviewmap-app").projectDir = File(rootDir, "microapps/OverviewMapApp/app") +include(":offline") +project(":offline").projectDir = File(rootDir, "toolkit/offline") +include(":offlinemapareas-app") +project(":offlinemapareas-app").projectDir = File(rootDir, "microapps/OfflineMapAreasApp/app") +include(":ar-flyover-app") +project(":ar-flyover-app").projectDir = File(rootDir, "microapps/ArFlyoverApp/app") diff --git a/toolkit/ar/build.gradle.kts b/toolkit/ar/build.gradle.kts index b416351c6..c10c13e94 100644 --- a/toolkit/ar/build.gradle.kts +++ b/toolkit/ar/build.gradle.kts @@ -44,6 +44,4 @@ dependencies { implementation(project(":geoview-compose")) implementation(libs.arcore) implementation(libs.play.services.location) - androidTestImplementation(libs.androidx.test.rules) - androidTestImplementation(libs.truth) } diff --git a/toolkit/authentication/api/authentication.api b/toolkit/authentication/api/authentication.api index 805374d23..6dad1b007 100644 --- a/toolkit/authentication/api/authentication.api +++ b/toolkit/authentication/api/authentication.api @@ -45,8 +45,6 @@ public abstract class com/arcgismaps/toolkit/authentication/BrowserAuthenticatio public final class com/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$IapSignIn : com/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge { public static final field $stable I public final fun component1 ()Lcom/arcgismaps/httpcore/authentication/IapSignIn; - public final fun copy (Lcom/arcgismaps/httpcore/authentication/IapSignIn;)Lcom/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$IapSignIn; - public static synthetic fun copy$default (Lcom/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$IapSignIn;Lcom/arcgismaps/httpcore/authentication/IapSignIn;ILjava/lang/Object;)Lcom/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$IapSignIn; public fun equals (Ljava/lang/Object;)Z public final fun getIapSignIn ()Lcom/arcgismaps/httpcore/authentication/IapSignIn; public fun hashCode ()I @@ -56,8 +54,6 @@ public final class com/arcgismaps/toolkit/authentication/BrowserAuthenticationCh public final class com/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$IapSignOut : com/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge { public static final field $stable I public final fun component1 ()Lcom/arcgismaps/httpcore/authentication/IapSignOut; - public final fun copy (Lcom/arcgismaps/httpcore/authentication/IapSignOut;)Lcom/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$IapSignOut; - public static synthetic fun copy$default (Lcom/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$IapSignOut;Lcom/arcgismaps/httpcore/authentication/IapSignOut;ILjava/lang/Object;)Lcom/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$IapSignOut; public fun equals (Ljava/lang/Object;)Z public final fun getIapSignOut ()Lcom/arcgismaps/httpcore/authentication/IapSignOut; public fun hashCode ()I @@ -67,8 +63,6 @@ public final class com/arcgismaps/toolkit/authentication/BrowserAuthenticationCh public final class com/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$OAuthUserSignIn : com/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge { public static final field $stable I public final fun component1 ()Lcom/arcgismaps/httpcore/authentication/OAuthUserSignIn; - public final fun copy (Lcom/arcgismaps/httpcore/authentication/OAuthUserSignIn;)Lcom/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$OAuthUserSignIn; - public static synthetic fun copy$default (Lcom/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$OAuthUserSignIn;Lcom/arcgismaps/httpcore/authentication/OAuthUserSignIn;ILjava/lang/Object;)Lcom/arcgismaps/toolkit/authentication/BrowserAuthenticationChallenge$OAuthUserSignIn; public fun equals (Ljava/lang/Object;)Z public final fun getOAuthUserSignIn ()Lcom/arcgismaps/httpcore/authentication/OAuthUserSignIn; public fun hashCode ()I diff --git a/toolkit/basemapgallery/build.gradle.kts b/toolkit/basemapgallery/build.gradle.kts index 2aadc10a9..f82a39711 100644 --- a/toolkit/basemapgallery/build.gradle.kts +++ b/toolkit/basemapgallery/build.gradle.kts @@ -23,6 +23,11 @@ plugins { android { namespace = "com.arcgismaps.toolkit.basemapgallery" + // Avoids an empty test report showing up in the CI integration test report. + // Remove this if tests will be added. + tasks.withType { + enabled = false + } } apiValidation { diff --git a/toolkit/composable-map/build.gradle.kts b/toolkit/composable-map/build.gradle.kts index 9d554e67e..97c039dcf 100644 --- a/toolkit/composable-map/build.gradle.kts +++ b/toolkit/composable-map/build.gradle.kts @@ -20,7 +20,6 @@ logger.warn("WARNING: The module composable-map is deprecated. Please use the mo plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/featureforms/build.gradle.kts b/toolkit/featureforms/build.gradle.kts index c2ca1da76..4545df434 100644 --- a/toolkit/featureforms/build.gradle.kts +++ b/toolkit/featureforms/build.gradle.kts @@ -86,6 +86,4 @@ dependencies { implementation(libs.bundles.camerax) implementation(libs.mlkit.barcode.scanning) implementation(libs.androidx.compose.navigation) - implementation(libs.kotlinx.serialization.json) - androidTestImplementation(libs.truth) } diff --git a/toolkit/popup/build.gradle.kts b/toolkit/popup/build.gradle.kts index c7f1ef324..1f8d053b1 100644 --- a/toolkit/popup/build.gradle.kts +++ b/toolkit/popup/build.gradle.kts @@ -23,6 +23,12 @@ plugins { android { namespace = "com.arcgismaps.toolkit.popup" + + // Avoids an empty test report showing up in the CI integration test report. + // Remove this if tests will be added. + tasks.withType { + enabled = false + } } apiValidation { From 4937ba9abf1d084c24aa86fdb0d91d426a312d1f Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Tue, 19 Aug 2025 12:36:57 -0700 Subject: [PATCH 05/16] vTest build fixes --- microapps/FeatureFormsApp/app/build.gradle.kts | 4 ++++ toolkit/featureforms/build.gradle.kts | 9 ++++++++- toolkit/indoors/build.gradle.kts | 1 + toolkit/legend/build.gradle.kts | 1 + toolkit/utilitynetworks/build.gradle.kts | 8 ++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/microapps/FeatureFormsApp/app/build.gradle.kts b/microapps/FeatureFormsApp/app/build.gradle.kts index 66eebabf5..05c0bc688 100644 --- a/microapps/FeatureFormsApp/app/build.gradle.kts +++ b/microapps/FeatureFormsApp/app/build.gradle.kts @@ -22,6 +22,10 @@ plugins { alias(libs.plugins.ksp) } +hilt { + enableAggregatingTask = true +} + android { namespace = "com.arcgismaps.toolkit.featureformsapp" diff --git a/toolkit/featureforms/build.gradle.kts b/toolkit/featureforms/build.gradle.kts index 4545df434..0ca4c58d4 100644 --- a/toolkit/featureforms/build.gradle.kts +++ b/toolkit/featureforms/build.gradle.kts @@ -19,11 +19,18 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) alias(libs.plugins.artifact.deploy) + alias(libs.plugins.gradle.secrets) +} + +secrets { + defaultPropertiesFileName = "secrets.defaults.properties" } android { namespace = "com.arcgismaps.toolkit.featureforms" - + buildFeatures { + buildConfig = true + } // Lint crashes on the latest Android studio // (Bug with Android Studio Meerkat | 2024.3.1) // TODO: Remove this when Android Studio lint checker is fixed diff --git a/toolkit/indoors/build.gradle.kts b/toolkit/indoors/build.gradle.kts index db2f3f1a8..829b73bbd 100644 --- a/toolkit/indoors/build.gradle.kts +++ b/toolkit/indoors/build.gradle.kts @@ -21,4 +21,5 @@ apiValidation { dependencies { // Module-specific dependencies go here + androidTestImplementation(project(":composable-map")) } diff --git a/toolkit/legend/build.gradle.kts b/toolkit/legend/build.gradle.kts index a7adf73af..4b97c5889 100644 --- a/toolkit/legend/build.gradle.kts +++ b/toolkit/legend/build.gradle.kts @@ -38,4 +38,5 @@ apiValidation { dependencies { // Module-specific dependencies go here + androidTestImplementation(project(":geoview-compose")) } diff --git a/toolkit/utilitynetworks/build.gradle.kts b/toolkit/utilitynetworks/build.gradle.kts index 50b804c34..aa2016737 100644 --- a/toolkit/utilitynetworks/build.gradle.kts +++ b/toolkit/utilitynetworks/build.gradle.kts @@ -19,10 +19,18 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) alias(libs.plugins.artifact.deploy) + alias(libs.plugins.gradle.secrets) +} + +secrets { + defaultPropertiesFileName = "secrets.defaults.properties" } android { namespace = "com.arcgismaps.toolkit.utilitynetworks" + buildFeatures { + buildConfig = true + } } apiValidation { From 95b23fcd135423ef20ab32c08c813c5632f9f4a3 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Tue, 19 Aug 2025 16:17:39 -0700 Subject: [PATCH 06/16] Add automatic detection of androidTest sources --- ...rcGISMapsKotlinMicroappConventionPlugin.kt | 6 ------ ...ArcGISMapsKotlinToolkitConventionPlugin.kt | 21 ++++++++++++++++--- secrets.defaults.properties | 1 - toolkit/basemapgallery/build.gradle.kts | 5 ----- toolkit/popup/build.gradle.kts | 6 ------ 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt index c5df42227..9b776087c 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt @@ -36,12 +36,6 @@ class ArcGISMapsKotlinMicroappConventionPlugin : Plugin { } } - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false - } - dependencies { // Configure the ArcGIS Maps SDK dependency ArcGISMapsKotlinSDKDependency.configureArcGISMapsDependencies(target) diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt index b42713166..94e8822a9 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -3,10 +3,12 @@ import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDepe import com.esri.arcgismaps.kotlin.build_logic.convention.libs import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.tasks.testing.Test import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import java.io.File class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { override fun apply(target: Project) { @@ -16,7 +18,7 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { apply(libs.findPlugin("arcgismaps-android-library-compose").get().get().pluginId) // Only apply binary compatibility validator if shouldValidateApi is true val shouldValidateApi = target.findProperty("shouldValidateApi") as? Boolean ?: true - if (shouldValidateApi){ + if (shouldValidateApi) { apply(libs.findPlugin("binary-compatibility-validator").get().get().pluginId) } } @@ -31,7 +33,6 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { } } - @Suppress("UnstableApiUsage") testOptions { targetSdk = libs.findVersion("compileSdk").get().toString().toInt() val connectedTestReportsPath = target.findProperty("connectedTestReportsPath") as? String @@ -46,6 +47,21 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { } } + // Automatic detection of androidTest sources + val androidTestDir = File(projectDir, "src/androidTest") + val hasInstrumentedTests = androidTestDir.exists() && androidTestDir.walkTopDown().any { + it.isFile && (it.extension == "kt") + } + // Filter out generating test reports for modules without tests + if (!hasInstrumentedTests) { + // Disable unit tests + tasks.withType() + .configureEach { enabled = false } + // Disable connected Android tests + tasks.matching { it.name.startsWith("connected") && it.name.endsWith("AndroidTest") } + .configureEach { enabled = false } + } + // Explicit API configuration for toolkit modules tasks.withType { if ("Test" !in name) { @@ -62,7 +78,6 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { } } - dependencies { // Configure the ArcGIS Maps SDK dependency ArcGISMapsKotlinSDKDependency.configureArcGISMapsDependencies(target) diff --git a/secrets.defaults.properties b/secrets.defaults.properties index 96a0e1ac7..3d47f693b 100644 --- a/secrets.defaults.properties +++ b/secrets.defaults.properties @@ -21,7 +21,6 @@ # This file is tracked by git; `local.properties` is not. # To obtain a new API key access token, visit: https://links.esri.com/create-an-api-key. API_KEY=XX -clientId=" " webMapUser=XX webMapPassword=XX traceToolUser=x diff --git a/toolkit/basemapgallery/build.gradle.kts b/toolkit/basemapgallery/build.gradle.kts index f82a39711..2aadc10a9 100644 --- a/toolkit/basemapgallery/build.gradle.kts +++ b/toolkit/basemapgallery/build.gradle.kts @@ -23,11 +23,6 @@ plugins { android { namespace = "com.arcgismaps.toolkit.basemapgallery" - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false - } } apiValidation { diff --git a/toolkit/popup/build.gradle.kts b/toolkit/popup/build.gradle.kts index 1f8d053b1..c7f1ef324 100644 --- a/toolkit/popup/build.gradle.kts +++ b/toolkit/popup/build.gradle.kts @@ -23,12 +23,6 @@ plugins { android { namespace = "com.arcgismaps.toolkit.popup" - - // Avoids an empty test report showing up in the CI integration test report. - // Remove this if tests will be added. - tasks.withType { - enabled = false - } } apiValidation { From 483cabbff99ecf4a074812437a08c65b1d372de4 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Sun, 14 Sep 2025 13:37:23 -0700 Subject: [PATCH 07/16] working changes --- bom/build.gradle.kts | 72 +----------------- build-logic/convention/build.gradle.kts | 14 ++++ ...droidApplicationComposeConventionPlugin.kt | 6 +- .../AndroidApplicationConventionPlugin.kt | 2 +- .../AndroidLibraryComposeConventionPlugin.kt | 10 +-- .../java/AndroidLibraryConventionPlugin.kt | 5 +- .../java/ArcGISMapsBomConventionPlugin.kt | 74 +++++++++++++++++++ .../java/ArcGISMapsKdocConventionPlugin.kt | 70 ++++++++++++++++++ ...rcGISMapsKotlinMicroappConventionPlugin.kt | 6 +- ...ArcGISMapsKotlinToolkitConventionPlugin.kt | 29 ++++++-- .../java/ArcGISMapsRootConventionPlugin.kt | 14 ++++ .../build_logic/convention/AndroidCompose.kt | 4 + .../ArcGISMapsKotlinSDKDependency.kt | 24 ++++-- .../convention}/ArtifactPublisher.kt | 24 +++--- .../build_logic/convention/KotlinAndroid.kt | 1 + .../ProjectExtensions.kt | 2 +- .../extensions/ToolkitModuleExtension.kt | 30 ++++++++ build-logic/gradle.properties | 3 +- build.gradle.kts | 62 +++------------- gradle-plugins/build.gradle.kts | 24 ------ gradle-plugins/settings.gradle.kts | 13 ---- gradle.properties | 1 + gradle/libs.versions.toml | 10 ++- kdoc/build.gradle.kts | 64 +--------------- settings.gradle.kts | 3 +- toolkit/ar/build.gradle.kts | 1 - toolkit/authentication/build.gradle.kts | 1 - toolkit/basemapgallery/build.gradle.kts | 1 - toolkit/compass/build.gradle.kts | 1 - toolkit/composable-map/build.gradle.kts | 4 + toolkit/featureforms/build.gradle.kts | 5 +- toolkit/geoview-compose/build.gradle.kts | 1 - toolkit/indoors/build.gradle.kts | 1 - toolkit/legend/build.gradle.kts | 1 - toolkit/offline/build.gradle.kts | 1 - toolkit/popup/build.gradle.kts | 5 +- toolkit/scalebar/build.gradle.kts | 1 - toolkit/template/build.gradle.kts | 5 +- toolkit/utilitynetworks/build.gradle.kts | 5 +- 39 files changed, 320 insertions(+), 280 deletions(-) create mode 100644 build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt rename {gradle-plugins/src/main/kotlin/com/arcgismaps => build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention}/ArtifactPublisher.kt (79%) rename build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/{convention => extensions}/ProjectExtensions.kt (95%) create mode 100644 build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt delete mode 100644 gradle-plugins/build.gradle.kts delete mode 100644 gradle-plugins/settings.gradle.kts diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index 1b93b6bfe..326cc2bca 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -19,75 +19,5 @@ plugins { `maven-publish` `java-platform` -} - -// Find these in properties passed through command line or read from GRADLE_HOME/gradle.properties -// or local gradle.properties -val artifactoryGroupId: String by project -val artifactoryArtifactBaseId: String by project -val artifactoryArtifactId: String = "$artifactoryArtifactBaseId-${project.name}" -val artifactoryUrl: String by project -val artifactoryUsername: String by project -val artifactoryPassword: String by project -val versionNumber: String by project -val buildNumber: String by project -val finalBuild: Boolean = (project.properties["finalBuild"] ?: "false") - .run { this == "true" } -val artifactVersion: String = if (finalBuild) { - versionNumber -} else { - "$versionNumber-$buildNumber" -} - -// ensure that the evaluation of the bom project happens after all other projects -// so that plugins are applied to all projects, and can be used to identify -// which projects should get written into the BOM's pom file. -rootProject.subprojects.filter { - it.name != project.name -}.forEach { - evaluationDependsOn(":${it.name}") -} - -// now find projects which are publishable based on their inclusion -// of the publishing plugin, and add them as api dependencies. -dependencies { - constraints { - project.rootProject.subprojects.filter { - it.plugins.findPlugin("artifact-deploy") != null - }.forEach { subproject -> - // add all the intended library projects as api dependencies. - api(subproject) - } - } -} - -afterEvaluate { - /** - * Maven publication configuration for aar and pom file. Run as follows: - * ./gradlew publishAarPublicationToMavenRepository -PartifactoryUsername= -PartifactoryPassword= - * - * More details: - * https://docs.gradle.org/current/userguide/publishing_maven.html - */ - publishing { - publications { - create("bom") { - groupId = artifactoryGroupId - artifactId = artifactoryArtifactId - version = artifactVersion - - from(components["javaPlatform"]) - } - } - - repositories { - maven { - url = uri(artifactoryUrl) - credentials { - username = artifactoryUsername - password = artifactoryPassword - } - } - } - } + alias(libs.plugins.arcgismaps.kotlin.bom.convention) } diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 6ed5e81ef..80fe41e8e 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -19,10 +19,12 @@ tasks.withType().configureEach { } dependencies { + compileOnly(gradleApi()) compileOnly(libs.android.gradlePlugin) compileOnly(libs.android.tools.common) compileOnly(libs.kotlin.gradlePlugin) compileOnly(libs.ksp.gradlePlugin) + implementation(libs.dokka.gradle.plugin) } tasks { @@ -62,5 +64,17 @@ gradlePlugin { id = "arcgismaps.kotlin.sdk" implementationClass = "ArcGISMapsKotlinSDKConventionPlugin" } + register("arcGISMapsRootConventionPlugin") { + id = "arcgismaps.kotlin.root.convention" + implementationClass = "ArcGISMapsRootConventionPlugin" + } + register("arcGISMapsKdocConventionPlugin") { + id = "arcgismaps.kotlin.kdoc.convention" + implementationClass = "ArcGISMapsKdocConventionPlugin" + } + register("arcGISMapsBomConventionPlugin") { + id = "arcgismaps.kotlin.bom.convention" + implementationClass = "ArcGISMapsBomConventionPlugin" + } } } diff --git a/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt index 072b9bb0e..ef6e46266 100644 --- a/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt @@ -1,9 +1,9 @@ import com.android.build.api.dsl.ApplicationExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid -import com.esri.arcgismaps.kotlin.build_logic.convention.debugImplementation -import com.esri.arcgismaps.kotlin.build_logic.convention.implementation -import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import com.esri.arcgismaps.kotlin.build_logic.extensions.debugImplementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies diff --git a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt index 6fb51bec7..03bdc1f2e 100644 --- a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt @@ -1,6 +1,6 @@ import com.android.build.api.dsl.ApplicationExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid -import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure diff --git a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt index 2de887961..629ccf508 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt @@ -1,11 +1,11 @@ import com.android.build.api.dsl.LibraryExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid -import com.esri.arcgismaps.kotlin.build_logic.convention.implementation -import com.esri.arcgismaps.kotlin.build_logic.convention.libs -import com.esri.arcgismaps.kotlin.build_logic.convention.testImplementation -import com.esri.arcgismaps.kotlin.build_logic.convention.androidTestImplementation -import com.esri.arcgismaps.kotlin.build_logic.convention.debugImplementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs +import com.esri.arcgismaps.kotlin.build_logic.extensions.testImplementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.androidTestImplementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.debugImplementation import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies diff --git a/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt index 8cc551f98..44514aec1 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt @@ -1,8 +1,7 @@ import com.android.build.gradle.LibraryExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid -import com.esri.arcgismaps.kotlin.build_logic.convention.implementation -import com.esri.arcgismaps.kotlin.build_logic.convention.libs -import com.esri.arcgismaps.kotlin.build_logic.convention.testImplementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs +import com.esri.arcgismaps.kotlin.build_logic.extensions.testImplementation import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure diff --git a/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt new file mode 100644 index 000000000..f99edca73 --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt @@ -0,0 +1,74 @@ +import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension +import com.esri.arcgismaps.kotlin.build_logic.extensions.api +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.publish.maven.MavenPublication +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.get +import org.gradle.kotlin.dsl.provideDelegate + +class ArcGISMapsBomConventionPlugin : Plugin { + override fun apply(target: Project) = with(target) { + // Platform publishing + pluginManager.apply("maven-publish") + pluginManager.apply("java-platform") + + // Find these in properties passed through command line or read from GRADLE_HOME/gradle.properties + // or local gradle.properties + val artifactoryGroupId: String by project + val artifactoryArtifactBaseId: String by project + val artifactoryUrl: String by project + val artifactoryUsername: String by project + val artifactoryPassword: String by project + val versionNumber: String by project + val buildNumber: String by project + val finalBuild: Boolean = (project.properties["finalBuild"] ?: "false").toString() == "true" + val artifactVersion = if (finalBuild) versionNumber else "$versionNumber-$buildNumber" + val artifactoryArtifactId = "$artifactoryArtifactBaseId-${project.name}" + + // now find projects which are publishable based on their inclusion of the toolkit plugin, + // and add them as api dependencies. + afterEvaluate { + dependencies { + constraints { + // grab the populated set + val registry = rootProject.extensions.getByType(ToolkitRegistryExtension::class.java) + registry.toolkitProjects.forEach { p -> + val moduleArtifactId = "$artifactoryArtifactBaseId-${p.name}" + // add the toolkit project as api + api("$artifactoryGroupId:$moduleArtifactId:$artifactVersion") + } + } + } + } + + /** + * Maven publication configuration for aar and pom file. Run as follows: + * ./gradlew publishAarPublicationToMavenRepository -PartifactoryUsername= -PartifactoryPassword= + * + * More details: + * https://docs.gradle.org/current/userguide/publishing_maven.html + */ + extensions.configure(PublishingExtension::class.java) { + publications { + create("bom", MavenPublication::class.java) { + groupId = artifactoryGroupId + artifactId = artifactoryArtifactId + version = artifactVersion + + from(components["javaPlatform"]) + } + } + repositories { + maven { + url = uri(artifactoryUrl) + credentials { + username = artifactoryUsername + password = artifactoryPassword + } + } + } + } + } +} diff --git a/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt new file mode 100644 index 000000000..14c6ba42a --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt @@ -0,0 +1,70 @@ +import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension +import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.invoke +import org.gradle.kotlin.dsl.provideDelegate +import org.gradle.kotlin.dsl.withType +import org.jetbrains.dokka.gradle.DokkaExtension +import org.jetbrains.dokka.gradle.engine.plugins.DokkaVersioningPluginParameters +import java.io.File + +class ArcGISMapsKdocConventionPlugin : Plugin { + override fun apply(target: Project) = with(target) { + with(pluginManager) { + apply(libs.findPlugin("arcgismaps-android-library").get().get().pluginId) + apply(libs.findPlugin("dokka").get().get().pluginId) + // Put exposed dependencies in dokka's classpath + apply(libs.findPlugin("arcgismaps.kotlin.sdk").get().get().pluginId) + } + + dependencies { + // Puts the version in the KDoc + add("dokkaPlugin", libs.findLibrary("dokka.versioning").get()) + // Put exposed dependencies in dokka's classpath + implementation(platform(libs.findLibrary("androidx-compose-bom").get())) + implementation(libs.findBundle("composeCore").get()) + } + + val versionNumber: String by project + // Create the toolkit sources provider + val registry = rootProject.extensions.getByType(ToolkitRegistryExtension::class.java) + val sourceRootsProvider = providers.provider { + registry.toolkitProjects.map { p -> + File(rootDir, "toolkit/${p.name}/src/main/java").canonicalPath + } + } + + //./gradlew :kdoc:dokkaGenerate + // doc output will be under `kdoc/build/dokka/html` + extensions.configure { + pluginsConfiguration.withType().configureEach { + version.set(versionNumber) + } + + moduleName.set("arcgis-maps-kotlin-toolkit") + + dokkaSourceSets { + if (findByName("main") == null) { + register("main") + } + + named("main") { + sourceRoots.from(files(sourceRootsProvider)) + } + configureEach { + perPackageOption { + matchingRegex.set(".*internal.*") + suppress.set(true) + } + perPackageOption { + reportUndocumented.set(true) + } + } + } + } + } +} diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt index 9b776087c..4cdd8ad4e 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt @@ -1,14 +1,12 @@ import com.android.build.api.dsl.ApplicationExtension import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency -import com.esri.arcgismaps.kotlin.build_logic.convention.implementation -import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.tasks.testing.Test import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.project -import org.gradle.kotlin.dsl.withType class ArcGISMapsKotlinMicroappConventionPlugin : Plugin { override fun apply(target: Project) { diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt index 94e8822a9..26d415e91 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -1,10 +1,14 @@ import com.android.build.api.dsl.LibraryExtension import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency -import com.esri.arcgismaps.kotlin.build_logic.convention.libs +import com.esri.arcgismaps.kotlin.build_logic.convention.ArtifactPublisher +import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitModuleExtension +import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.tasks.testing.Test import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -13,15 +17,29 @@ import java.io.File class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { + val toolkitExt = extensions.create("toolkit").apply { + applyDefaults() // releasable = true by default + } + with(pluginManager) { apply(libs.findPlugin("arcgismaps-android-library").get().get().pluginId) apply(libs.findPlugin("arcgismaps-android-library-compose").get().get().pluginId) - // Only apply binary compatibility validator if shouldValidateApi is true - val shouldValidateApi = target.findProperty("shouldValidateApi") as? Boolean ?: true - if (shouldValidateApi) { + if (toolkitExt.releasable.get()) { apply(libs.findPlugin("binary-compatibility-validator").get().get().pluginId) } } + // Provide maven publication for releasable toolkit projects + ArtifactPublisher.configureArtifactPublisher(this) + + afterEvaluate { + val registry = rootProject.extensions.getByType(ToolkitRegistryExtension::class.java) + if (toolkitExt.releasable.orNull == true) { + logger.warn("SETTING RELEASABLE: ${this.name}") + registry.toolkitProjects.add(this) + } else { + registry.toolkitProjects.remove(this) + } + } extensions.configure { packaging { @@ -64,12 +82,11 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { // Explicit API configuration for toolkit modules tasks.withType { + // Only toolkit modules, exclude tests if ("Test" !in name) { compilerOptions { freeCompilerArgs.addAll( listOf( - // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. - "-Xconsistent-data-class-copy-visibility", "-Xexplicit-api=strict", "-Xcontext-receivers" ) diff --git a/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt new file mode 100644 index 000000000..f3eb9c75e --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt @@ -0,0 +1,14 @@ +import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.create + +class ArcGISMapsRootConventionPlugin : Plugin { + override fun apply(target: Project) { + require(target == target.rootProject) { + "The ArcGISMapsRootConventionPlugin must be applied to the root project only." + } + // Create the single registry extension on the root project + target.extensions.create("toolkitRegistry") + } +} diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt index f63ac8fb2..344d27795 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt @@ -1,6 +1,10 @@ package com.esri.arcgismaps.kotlin.build_logic.convention import com.android.build.api.dsl.CommonExtension +import com.esri.arcgismaps.kotlin.build_logic.extensions.androidTestImplementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.debugImplementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt index 7bdc5a0f7..12ef0023e 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt @@ -1,7 +1,10 @@ package com.esri.arcgismaps.kotlin.build_logic.convention +import com.esri.arcgismaps.kotlin.build_logic.extensions.api +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies +import java.io.File /** * A helper object to configure the logic for applying the ArcGIS Maps SDK dependency, @@ -22,25 +25,34 @@ object ArcGISMapsKotlinSDKDependency { */ fun configureArcGISMapsDependencies(target: Project) { target.dependencies { + + val localProperties = java.util.Properties().apply { + val localPropertiesFile = File("local.properties") + if (localPropertiesFile.exists()) { + load(localPropertiesFile.inputStream()) + } + } + // For finalBuilds ignore the build number and pick up the released version of the SDK dependency - val finalBuild: Boolean = (target.providers.gradleProperty("finalBuild").orNull ?: "false") + val finalBuild: Boolean = (target.rootProject.providers.gradleProperty("finalBuild").orNull ?: "false") .toBoolean() // First look for the version number provided via command line (for CI builds), if not found, // take the one defined in gradle.properties. // CI builds pass -PversionNumber=${BUILDVER} val sdkVersionNumber: String? = - target.providers.gradleProperty("versionNumber").orNull - ?: target.providers.gradleProperty("sdkVersionNumber").orNull + target.rootProject.providers.gradleProperty("versionNumber").orNull + ?: target.rootProject.providers.gradleProperty("sdkVersionNumber").orNull + ?: localProperties["sdkVersionNumber"] as? String // The build number of the ArcGIS Maps SDK for Kotlin dependency. // First look for the version number provided via command line (for CI builds), if not found, // take the one defined in local.properties. // CI builds pass -PbuildNumber=${BUILDNUM} val sdkBuildNumber: String? = - target.providers.gradleProperty("buildNumber").orNull - ?: target.providers.gradleProperty("sdkBuildNumber").orNull - ?: "" + target.rootProject.providers.gradleProperty("buildNumber").orNull + ?: target.rootProject.providers.gradleProperty("sdkBuildNumber").orNull + ?: localProperties["sdkBuildNumber"] as? String // ArcGIS Maps SDK dependency with build override support if (sdkVersionNumber != null) { diff --git a/gradle-plugins/src/main/kotlin/com/arcgismaps/ArtifactPublisher.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt similarity index 79% rename from gradle-plugins/src/main/kotlin/com/arcgismaps/ArtifactPublisher.kt rename to build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt index 6f37022ac..a1b0b7323 100644 --- a/gradle-plugins/src/main/kotlin/com/arcgismaps/ArtifactPublisher.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt @@ -16,9 +16,9 @@ * */ -package com.arcgismaps +package com.esri.arcgismaps.kotlin.build_logic.convention -import org.gradle.api.Plugin +import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication @@ -38,8 +38,8 @@ import java.net.URI * * @since 200.2.0 */ -class ArtifactPublisher : Plugin { - override fun apply(project: Project) { +object ArtifactPublisher { + fun configureArtifactPublisher(project: Project) { val artifactoryGroupId: String by project val artifactoryArtifactBaseId: String by project val artifactoryUrl: String by project @@ -57,10 +57,15 @@ class ArtifactPublisher : Plugin { val artifactoryArtifactId = "$artifactoryArtifactBaseId-${project.name}" project.pluginManager.apply(MavenPublishPlugin::class.java) + project.afterEvaluate { + val registry = rootProject.extensions.getByType(ToolkitRegistryExtension::class.java) + if (!registry.toolkitProjects.contains(project)) return@afterEvaluate + + project.extensions.configure { repositories { - repositories.maven { + maven { url = URI.create(artifactoryUrl) credentials { username = artifactoryUsername @@ -69,10 +74,7 @@ class ArtifactPublisher : Plugin { } } publications { - publications.create( - project.name, - MavenPublication::class.java - ) { + create(project.name, MavenPublication::class.java) { groupId = artifactoryGroupId artifactId = artifactoryArtifactId version = artifactVersion @@ -82,9 +84,9 @@ class ArtifactPublisher : Plugin { } } - tasks.findByName("publish${project.name.replaceFirstChar { it.uppercase() }}PublicationToMavenRepository") + project.tasks.findByName("publish${project.name.replaceFirstChar { it.uppercase() }}PublicationToMavenRepository") ?.dependsOn("assembleRelease") - tasks.findByName("publishToMavenLocal")?.dependsOn("assembleRelease") + project.tasks.findByName("publishToMavenLocal")?.dependsOn("assembleRelease") } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt index ae0fe7bf5..f80fad946 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt @@ -1,6 +1,7 @@ package com.esri.arcgismaps.kotlin.build_logic.convention import com.android.build.api.dsl.CommonExtension +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.JavaVersion import org.gradle.api.Project import org.gradle.kotlin.dsl.provideDelegate diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt similarity index 95% rename from build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt rename to build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt index 4ff9fdebb..013572ce4 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ProjectExtensions.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt @@ -1,4 +1,4 @@ -package com.esri.arcgismaps.kotlin.build_logic.convention +package com.esri.arcgismaps.kotlin.build_logic.extensions import org.gradle.api.Project import org.gradle.api.artifacts.Dependency diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt new file mode 100644 index 000000000..0dbe36725 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt @@ -0,0 +1,30 @@ +package com.esri.arcgismaps.kotlin.build_logic.extensions + +import org.gradle.api.NamedDomainObjectSet +import org.gradle.api.Project +import org.gradle.api.model.ObjectFactory +import org.gradle.api.provider.Property +import javax.inject.Inject + + +abstract class ToolkitModuleExtension @Inject constructor(objects: ObjectFactory) { + + /** Can/should this module be published as an artifact? */ + val releasable: Property = objects.property(Boolean::class.java) + + + internal fun applyDefaults() { + releasable.convention(true) + } + +} + + +abstract class ToolkitRegistryExtension @Inject constructor(objects: ObjectFactory) { +// Live set that will receive projects as they apply the toolkit plugin + val toolkitProjects: NamedDomainObjectSet = + objects.namedDomainObjectSet(Project::class.java) + +} + + diff --git a/build-logic/gradle.properties b/build-logic/gradle.properties index 6977b7191..bf586e553 100644 --- a/build-logic/gradle.properties +++ b/build-logic/gradle.properties @@ -1,3 +1,4 @@ org.gradle.parallel=true org.gradle.caching=true -org.gradle.configureondemand=true \ No newline at end of file +org.gradle.configureondemand=true +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 76432e7a1..401b6ad52 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,6 +18,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { + alias(libs.plugins.arcgismaps.kotlin.root.convention) alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.binary.compatibility.validator) apply false @@ -32,13 +33,6 @@ plugins { } buildscript { - dependencies { - // there doesn't appear to be a better way to provide this to subprojects. - // this is what lets us put the version number dropdown list in the generated dokka. - // it is a "dokka plugin" which is not a gradle plugin, it needs to be on the classpath - // before any dependent subproject uses its symbols to configure a dokka task. - classpath(libs.dokka.versioning) - } val localProperties = java.util.Properties().apply { val localPropertiesFile = file("local.properties") if (localPropertiesFile.exists()) { @@ -57,16 +51,23 @@ buildscript { ?: localProperties.getProperty("artifactoryPassword") ?: "" + val sdkVersionNumber = project.findProperty("sdkVersionNumber") as String? + ?: localProperties.getProperty("sdkVersionNumber") + val sdkBuildNumber = project.findProperty("sdkBuildNumber") as String? + ?: localProperties.getProperty("sdkBuildNumber") + project.extra.set("artifactoryUrl", artifactoryUrl) project.extra.set("artifactoryUsername", artifactoryUsername) project.extra.set("artifactoryPassword", artifactoryPassword) + project.extra.set("sdkVersionNumber", sdkVersionNumber) + project.extra.set("sdkBuildNumber", sdkBuildNumber) val finalBuild: Boolean = (project.properties["finalBuild"] ?: "false") .run { this == "true" } if (finalBuild) { check(project.hasProperty("versionNumber")) - project.logger.info("release candidate build requested version ${project.properties["versionNumber"]}") + project.logger.warn("release candidate build requested version ${project.properties["versionNumber"]}") } else if (!project.hasProperty("versionNumber") && !project.hasProperty("buildNum")) { // both version number and build number must be set java.util.Properties().run { @@ -84,7 +85,7 @@ buildscript { } check(project.hasProperty("versionNumber")) check(project.hasProperty("buildNumber")) - project.logger.info("version and build number set from buildnum.txt to ${project.properties["versionNumber"]}-${project.properties["buildNumber"]}") + project.logger.warn("version and build number set from buildnum.txt to ${project.properties["versionNumber"]}-${project.properties["buildNumber"]}") } catch (t: Throwable) { // The buildnum file is not there. ignore it and log a warning. project.logger.warn("the buildnum.txt file is missing or not readable") @@ -95,9 +96,6 @@ buildscript { } } -// Path to the centralized folder in root directory where test reports for connected tests end up -val connectedTestReportsPath by extra("${rootDir}/connectedTestReports") - /** * Configures the [gmazzo test aggregation plugin](https://github.com/gmazzo/gradle-android-test-aggregation-plugin) * with all local tests to be aggregated into a single test report. @@ -109,43 +107,5 @@ val connectedTestReportsPath by extra("${rootDir}/connectedTestReports") * Test report to be found under `arcgis-maps-sdk-kotlin-toolkit/build/reports`. */ testAggregation { - getModulesExcept( - "bom", - "kdoc", - "template", - "microapps-lib", - "composable-map" - ).forEach { - this.modules.include(project(":$it")) - } + // TODO: getAllToolkitProjects(project).forEach { this.modules.include(project(":$it")) } } - -/** - * Excludes specific modules from the 'apiDump' task. - * Add all modules to be excluded to the `excludedFromApiDump` set. - */ -subprojects { - // Define the modules to be excluded from apiDump - val excludedFromApiDump = setOf( - "bom", - "kdoc", - "template", - "microapps-lib", - "composable-map" - ) - // Add this property to indicate whether this project should have API validation - ext.set("shouldValidateApi", project.name !in excludedFromApiDump) -} - -/** - * Returns all modules in this project, except the ones specified by [modulesToExclude]. - */ -fun getModulesExcept(vararg modulesToExclude: String): List = - with(File("$rootDir/settings.gradle.kts")) { - readLines() - .filter { it.startsWith("include") } - .map { - it.removePrefix("include(\":").removeSuffix("\")") - } - .filter { !modulesToExclude.contains(it) } // exclude specified modules - } diff --git a/gradle-plugins/build.gradle.kts b/gradle-plugins/build.gradle.kts deleted file mode 100644 index 005a9505a..000000000 --- a/gradle-plugins/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -repositories { - google() - mavenCentral() -} - -plugins { - `kotlin-dsl` - `maven-publish` -} - -gradlePlugin { - plugins { - create("artifactDeploy") { - group = "internal" - id = "artifact-deploy" - version = "1.0" - implementationClass = "com.arcgismaps.ArtifactPublisher" - } - } -} - -dependencies { - // Module-specific dependencies go here -} diff --git a/gradle-plugins/settings.gradle.kts b/gradle-plugins/settings.gradle.kts deleted file mode 100644 index b474f08dd..000000000 --- a/gradle-plugins/settings.gradle.kts +++ /dev/null @@ -1,13 +0,0 @@ -rootProject.name = "gradle-plugins" - -dependencyResolutionManagement { - repositories { - google() - mavenCentral() - } - versionCatalogs { - create("libs") { - from(files("../gradle/libs.versions.toml")) - } - } -} diff --git a/gradle.properties b/gradle.properties index 54a4ad137..001209493 100644 --- a/gradle.properties +++ b/gradle.properties @@ -41,3 +41,4 @@ kotlin.code.style=official android.nonTransitiveRClass=true artifactoryGroupId=com.esri artifactoryArtifactBaseId=arcgis-maps-kotlin-toolkit +org.jetbrains.dokka.experimental.gradle.pluginMode=V2EnabledWithHelpers diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4f7e2034f..9033c9dcd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # ArcGIS Maps SDK for Kotlin version -arcgisMapsKotlinVersion = "300.0.0-4695" +arcgisMapsKotlinVersion = "200.8.0" ### Android versions androidGradlePlugin = "8.9.2" @@ -114,7 +114,9 @@ coil-bom = { group = "io.coil-kt", name = "coil-bom", version.ref = "coilBOM" } coil-compose = { group = "io.coil-kt", name = "coil-compose" } commonmark = { group = "org.commonmark", name = "commonmark", version.ref="commonMark" } commonmark-strikethrough = { group = "org.commonmark", name = "commonmark-ext-gfm-strikethrough", version.ref="commonMark" } -dokka-versioning = { group = "org.jetbrains.dokka", name = "versioning-plugin", version.ref = "dokka" } +dokka-all-modules = { module = "org.jetbrains.dokka:all-modules-page-plugin", version.ref = "dokka" } +dokka-versioning = { module = "org.jetbrains.dokka:versioning-plugin", version.ref = "dokka" } +dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } hilt-android-core = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" } hilt-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" } room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" } @@ -146,10 +148,12 @@ arcgismaps-android-application = { id = "arcgismaps.android.application" } arcgismaps-android-application-compose = { id = "arcgismaps.android.application.compose" } arcgismaps-android-library-compose = { id = "arcgismaps.android.library.compose" } arcgismaps-android-library = { id = "arcgismaps.android.library" } +arcgismaps-kotlin-root-convention = { id = "arcgismaps.kotlin.root.convention" } +arcgismaps-kotlin-kdoc-convention = { id = "arcgismaps.kotlin.kdoc.convention" } +arcgismaps-kotlin-bom-convention = { id = "arcgismaps.kotlin.bom.convention" } arcgismaps-kotlin-sdk = { id = "arcgismaps.kotlin.sdk"} arcgismaps-kotlin-microapp = { id = "arcgismaps.kotlin.microapp" } arcgismaps-kotlin-toolkit = { id = "arcgismaps.kotlin.toolkit" } -artifact-deploy = { id = "artifact-deploy" } [bundles] camerax = [ diff --git a/kdoc/build.gradle.kts b/kdoc/build.gradle.kts index cfa1c1e8d..b6ff85306 100644 --- a/kdoc/build.gradle.kts +++ b/kdoc/build.gradle.kts @@ -17,76 +17,14 @@ */ plugins { - alias(libs.plugins.dokka) - alias(libs.plugins.arcgismaps.kotlin.toolkit) - // put exposed dependencies in dokka's classpath - alias(libs.plugins.arcgismaps.kotlin.sdk) -} - -val versionNumber: String by project - -// make this project get evaluated after all the other projects -// so that we can be sure the logic to determine released components -// below works -rootProject.subprojects.filter { - it.name != project.name && it.name != "bom" -}.forEach { - evaluationDependsOn(":${it.name}") -} - -// only run kdoc on components which are released. Only modules that apply -// the `artifact-deploy` plugin are released. -// TODO: flag released modules directly. -val releasedModules = project.rootProject.subprojects.filter { - it.plugins.findPlugin("artifact-deploy") != null -} - -// determine the released toolkit components -val releasedSourceSetPaths = releasedModules.map { subproject -> - // add all the intended library projects as sourceSets below - File(rootDir, "toolkit/${subproject.name}/src/main/java").canonicalPath -} - -tasks { - //./gradlew :kdoc:dokkaHtml - // doc output will be under `documentation/build/dokka/html`. - dokkaHtml { - pluginConfiguration { - version = versionNumber - } - - moduleName.set("arcgis-maps-kotlin-toolkit") - dokkaSourceSets { - named("main") { - sourceRoots.from(releasedSourceSetPaths) - } - - configureEach { - platform.set(org.jetbrains.dokka.Platform.jvm) - perPackageOption { - matchingRegex.set(".*internal.*") - suppress.set(true) - } - - perPackageOption { - reportUndocumented.set(true) - } - } - } - } + alias(libs.plugins.arcgismaps.kotlin.kdoc.convention) } android { namespace = "com.arcgismaps.toolkit.doc" compileSdk = libs.versions.compileSdk.get().toInt() - defaultConfig { minSdk = libs.versions.minSdk.get().toInt() consumerProguardFiles("consumer-rules.pro") } } - -dependencies { - // Puts the version in the KDoc - dokkaPlugin(libs.dokka.versioning) -} diff --git a/settings.gradle.kts b/settings.gradle.kts index e056b5d5f..dc82bc9ef 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,7 +18,6 @@ pluginManagement { includeBuild("build-logic") - includeBuild("gradle-plugins") repositories { gradlePluginPortal() google() @@ -26,6 +25,8 @@ pluginManagement { } } +rootProject.name = "arcgis-maps-sdk-kotlin-toolkit" + val localProperties = java.util.Properties().apply { val localPropertiesFile = file("local.properties") if (localPropertiesFile.exists()) { diff --git a/toolkit/ar/build.gradle.kts b/toolkit/ar/build.gradle.kts index c10c13e94..c75e5ae43 100644 --- a/toolkit/ar/build.gradle.kts +++ b/toolkit/ar/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/authentication/build.gradle.kts b/toolkit/authentication/build.gradle.kts index 157a8a6c6..ca7a598ef 100644 --- a/toolkit/authentication/build.gradle.kts +++ b/toolkit/authentication/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/basemapgallery/build.gradle.kts b/toolkit/basemapgallery/build.gradle.kts index 2aadc10a9..136b0df45 100644 --- a/toolkit/basemapgallery/build.gradle.kts +++ b/toolkit/basemapgallery/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/compass/build.gradle.kts b/toolkit/compass/build.gradle.kts index ea4674432..2bdb8707c 100644 --- a/toolkit/compass/build.gradle.kts +++ b/toolkit/compass/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/composable-map/build.gradle.kts b/toolkit/composable-map/build.gradle.kts index 97c039dcf..5e60f2cd2 100644 --- a/toolkit/composable-map/build.gradle.kts +++ b/toolkit/composable-map/build.gradle.kts @@ -26,6 +26,10 @@ android { namespace = "com.arcgismaps.toolkit.composablemap" } +toolkit { + releasable = false +} + dependencies { // Module-specific dependencies go here } diff --git a/toolkit/featureforms/build.gradle.kts b/toolkit/featureforms/build.gradle.kts index 0ca4c58d4..a2d9aed3c 100644 --- a/toolkit/featureforms/build.gradle.kts +++ b/toolkit/featureforms/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) alias(libs.plugins.gradle.secrets) } @@ -31,6 +30,10 @@ android { buildFeatures { buildConfig = true } + kotlinOptions { + // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. + freeCompilerArgs = freeCompilerArgs + listOf("-Xconsistent-data-class-copy-visibility") + } // Lint crashes on the latest Android studio // (Bug with Android Studio Meerkat | 2024.3.1) // TODO: Remove this when Android Studio lint checker is fixed diff --git a/toolkit/geoview-compose/build.gradle.kts b/toolkit/geoview-compose/build.gradle.kts index c73a2e74d..1f251e5fa 100644 --- a/toolkit/geoview-compose/build.gradle.kts +++ b/toolkit/geoview-compose/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/indoors/build.gradle.kts b/toolkit/indoors/build.gradle.kts index 829b73bbd..01d47f748 100644 --- a/toolkit/indoors/build.gradle.kts +++ b/toolkit/indoors/build.gradle.kts @@ -1,6 +1,5 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/legend/build.gradle.kts b/toolkit/legend/build.gradle.kts index 4b97c5889..7c814795a 100644 --- a/toolkit/legend/build.gradle.kts +++ b/toolkit/legend/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/offline/build.gradle.kts b/toolkit/offline/build.gradle.kts index 182920959..6cd63b8ca 100644 --- a/toolkit/offline/build.gradle.kts +++ b/toolkit/offline/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/popup/build.gradle.kts b/toolkit/popup/build.gradle.kts index c7f1ef324..cf3c1376f 100644 --- a/toolkit/popup/build.gradle.kts +++ b/toolkit/popup/build.gradle.kts @@ -18,11 +18,14 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.popup" + kotlinOptions { + // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. + freeCompilerArgs = freeCompilerArgs + listOf("-Xconsistent-data-class-copy-visibility") + } } apiValidation { diff --git a/toolkit/scalebar/build.gradle.kts b/toolkit/scalebar/build.gradle.kts index 4549ac0b7..7252f5f74 100644 --- a/toolkit/scalebar/build.gradle.kts +++ b/toolkit/scalebar/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { diff --git a/toolkit/template/build.gradle.kts b/toolkit/template/build.gradle.kts index aeaad2f63..4b60123a1 100644 --- a/toolkit/template/build.gradle.kts +++ b/toolkit/template/build.gradle.kts @@ -18,13 +18,16 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) } android { namespace = "com.arcgismaps.toolkit.template" } +toolkit { + releasable = false +} + dependencies { // Module-specific dependencies go here } diff --git a/toolkit/utilitynetworks/build.gradle.kts b/toolkit/utilitynetworks/build.gradle.kts index aa2016737..e4d03f8f7 100644 --- a/toolkit/utilitynetworks/build.gradle.kts +++ b/toolkit/utilitynetworks/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.artifact.deploy) alias(libs.plugins.gradle.secrets) } @@ -31,6 +30,10 @@ android { buildFeatures { buildConfig = true } + kotlinOptions { + // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. + freeCompilerArgs = freeCompilerArgs + listOf("-Xconsistent-data-class-copy-visibility") + } } apiValidation { From af0dde4dc639879431084b71fd96198982f1309b Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Thu, 18 Sep 2025 10:08:43 -0700 Subject: [PATCH 08/16] Add v.next build fixes --- microapps/CalloutApp/app/build.gradle.kts | 4 ++-- toolkit/indoors/build.gradle.kts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/microapps/CalloutApp/app/build.gradle.kts b/microapps/CalloutApp/app/build.gradle.kts index 66c550c9e..a7585beb2 100644 --- a/microapps/CalloutApp/app/build.gradle.kts +++ b/microapps/CalloutApp/app/build.gradle.kts @@ -21,10 +21,10 @@ plugins { } android { - namespace = "com.arcgismaps.toolkit.mapviewcalloutapp" + namespace = "com.arcgismaps.toolkit.calloutapp" defaultConfig { - applicationId = "com.arcgismaps.toolkit.mapviewcalloutapp" + applicationId = "com.arcgismaps.toolkit.calloutapp" } } diff --git a/toolkit/indoors/build.gradle.kts b/toolkit/indoors/build.gradle.kts index 01d47f748..072341383 100644 --- a/toolkit/indoors/build.gradle.kts +++ b/toolkit/indoors/build.gradle.kts @@ -20,5 +20,5 @@ apiValidation { dependencies { // Module-specific dependencies go here - androidTestImplementation(project(":composable-map")) + androidTestImplementation(project(":geoview-compose")) } From fb8710ed0a31ad61c9b519b762cd24b35eba6e87 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Tue, 23 Sep 2025 17:00:11 -0700 Subject: [PATCH 09/16] add Toolkit version provider and module registry --- build-logic/convention/build.gradle.kts | 4 - .../java/ArcGISMapsBomConventionPlugin.kt | 35 ++--- .../java/ArcGISMapsKdocConventionPlugin.kt | 29 ++--- ...ArcGISMapsKotlinToolkitConventionPlugin.kt | 24 ++-- .../java/ArcGISMapsRootConventionPlugin.kt | 14 -- .../build_logic/convention/AndroidCompose.kt | 2 +- .../ArcGISMapsKotlinSDKDependency.kt | 18 +-- .../convention/ArtifactPublisher.kt | 27 ++-- .../build_logic/convention/VersionProvider.kt | 121 ++++++++++++++++++ .../extensions/ProjectExtensions.kt | 3 - .../extensions/ToolkitModuleExtension.kt | 13 -- .../build_logic/registry/ToolkitRegistry.kt | 106 +++++++++++++++ build-logic/gradle.properties | 1 - build.gradle.kts | 4 - gradle.properties | 3 +- 15 files changed, 286 insertions(+), 118 deletions(-) delete mode 100644 build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt create mode 100644 build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt create mode 100644 build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistry.kt diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 80fe41e8e..ec4a57826 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -64,10 +64,6 @@ gradlePlugin { id = "arcgismaps.kotlin.sdk" implementationClass = "ArcGISMapsKotlinSDKConventionPlugin" } - register("arcGISMapsRootConventionPlugin") { - id = "arcgismaps.kotlin.root.convention" - implementationClass = "ArcGISMapsRootConventionPlugin" - } register("arcGISMapsKdocConventionPlugin") { id = "arcgismaps.kotlin.kdoc.convention" implementationClass = "ArcGISMapsKdocConventionPlugin" diff --git a/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt index f99edca73..37356ac35 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt @@ -1,11 +1,10 @@ -import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension -import com.esri.arcgismaps.kotlin.build_logic.extensions.api +import com.esri.arcgismaps.kotlin.build_logic.convention.VersionProvider +import com.esri.arcgismaps.kotlin.build_logic.registry.ToolkitRegistry import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication import org.gradle.kotlin.dsl.dependencies -import org.gradle.kotlin.dsl.get import org.gradle.kotlin.dsl.provideDelegate class ArcGISMapsBomConventionPlugin : Plugin { @@ -21,23 +20,25 @@ class ArcGISMapsBomConventionPlugin : Plugin { val artifactoryUrl: String by project val artifactoryUsername: String by project val artifactoryPassword: String by project - val versionNumber: String by project - val buildNumber: String by project - val finalBuild: Boolean = (project.properties["finalBuild"] ?: "false").toString() == "true" - val artifactVersion = if (finalBuild) versionNumber else "$versionNumber-$buildNumber" + + // Use centralized version provider + val versionConfig = VersionProvider.getVersionConfig(project) + val artifactVersion = versionConfig.map { it.artifactVersion } val artifactoryArtifactId = "$artifactoryArtifactBaseId-${project.name}" - // now find projects which are publishable based on their inclusion of the toolkit plugin, - // and add them as api dependencies. - afterEvaluate { + // Use toolkit registry to find projects which are releasable + // Wait until all projects are evaluated before discovering modules + gradle.projectsEvaluated { dependencies { constraints { - // grab the populated set - val registry = rootProject.extensions.getByType(ToolkitRegistryExtension::class.java) - registry.toolkitProjects.forEach { p -> - val moduleArtifactId = "$artifactoryArtifactBaseId-${p.name}" + // Get releasable modules and version after all projects are evaluated + val releasableModules = ToolkitRegistry.getReleasableModules(rootProject).get() + val resolvedVersion = artifactVersion.get() + releasableModules.forEach { moduleConfig -> + val moduleArtifactId = "$artifactoryArtifactBaseId-${moduleConfig.name}" + val dependency = "$artifactoryGroupId:$moduleArtifactId:$resolvedVersion" // add the toolkit project as api - api("$artifactoryGroupId:$moduleArtifactId:$artifactVersion") + add("api", dependency) } } } @@ -55,9 +56,9 @@ class ArcGISMapsBomConventionPlugin : Plugin { create("bom", MavenPublication::class.java) { groupId = artifactoryGroupId artifactId = artifactoryArtifactId - version = artifactVersion + version = artifactVersion.get() - from(components["javaPlatform"]) + from(components.getByName("javaPlatform")) } } repositories { diff --git a/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt index 14c6ba42a..4b6eb7fb0 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt @@ -1,16 +1,15 @@ -import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension +import com.esri.arcgismaps.kotlin.build_logic.convention.VersionProvider import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation import com.esri.arcgismaps.kotlin.build_logic.extensions.libs +import com.esri.arcgismaps.kotlin.build_logic.registry.ToolkitRegistry import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.invoke -import org.gradle.kotlin.dsl.provideDelegate import org.gradle.kotlin.dsl.withType import org.jetbrains.dokka.gradle.DokkaExtension import org.jetbrains.dokka.gradle.engine.plugins.DokkaVersioningPluginParameters -import java.io.File class ArcGISMapsKdocConventionPlugin : Plugin { override fun apply(target: Project) = with(target) { @@ -29,20 +28,12 @@ class ArcGISMapsKdocConventionPlugin : Plugin { implementation(libs.findBundle("composeCore").get()) } - val versionNumber: String by project - // Create the toolkit sources provider - val registry = rootProject.extensions.getByType(ToolkitRegistryExtension::class.java) - val sourceRootsProvider = providers.provider { - registry.toolkitProjects.map { p -> - File(rootDir, "toolkit/${p.name}/src/main/java").canonicalPath - } - } - //./gradlew :kdoc:dokkaGenerate // doc output will be under `kdoc/build/dokka/html` extensions.configure { pluginsConfiguration.withType().configureEach { - version.set(versionNumber) + // Use centralized version provider + version.set(VersionProvider.getArtifactVersion(project)) } moduleName.set("arcgis-maps-kotlin-toolkit") @@ -53,14 +44,20 @@ class ArcGISMapsKdocConventionPlugin : Plugin { } named("main") { - sourceRoots.from(files(sourceRootsProvider)) + // Get source roots directly and convert to files + val toolkitConfigProvider = ToolkitRegistry.getReleasableModules(rootProject) + sourceRoots.from( + toolkitConfigProvider.map { toolkitRegistryModuleConfigs -> + toolkitRegistryModuleConfigs.map { config -> + rootProject.file(config.sourceRoot) + } + } + ) } configureEach { perPackageOption { matchingRegex.set(".*internal.*") suppress.set(true) - } - perPackageOption { reportUndocumented.set(true) } } diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt index 26d415e91..3fd9a9987 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -2,7 +2,6 @@ import com.android.build.api.dsl.LibraryExtension import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency import com.esri.arcgismaps.kotlin.build_logic.convention.ArtifactPublisher import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitModuleExtension -import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Plugin import org.gradle.api.Project @@ -17,6 +16,7 @@ import java.io.File class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { + // Create extension with default releasable = true val toolkitExt = extensions.create("toolkit").apply { applyDefaults() // releasable = true by default } @@ -24,21 +24,16 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { with(pluginManager) { apply(libs.findPlugin("arcgismaps-android-library").get().get().pluginId) apply(libs.findPlugin("arcgismaps-android-library-compose").get().get().pluginId) - if (toolkitExt.releasable.get()) { - apply(libs.findPlugin("binary-compatibility-validator").get().get().pluginId) - } + apply(libs.findPlugin("binary-compatibility-validator").get().get().pluginId) } - // Provide maven publication for releasable toolkit projects + + // Configure artifact publishing for toolkit modules ArtifactPublisher.configureArtifactPublisher(this) + // Log configuration after evaluation afterEvaluate { - val registry = rootProject.extensions.getByType(ToolkitRegistryExtension::class.java) - if (toolkitExt.releasable.orNull == true) { - logger.warn("SETTING RELEASABLE: ${this.name}") - registry.toolkitProjects.add(this) - } else { - registry.toolkitProjects.remove(this) - } + val isReleasable = toolkitExt.releasable.getOrElse(true) + logger.info("Toolkit module '${target.name}' configured as ${if (isReleasable) "releasable" else "non-releasable"}") } extensions.configure { @@ -53,8 +48,9 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { testOptions { targetSdk = libs.findVersion("compileSdk").get().toString().toInt() - val connectedTestReportsPath = target.findProperty("connectedTestReportsPath") as? String - ?: "${target.rootProject.rootDir}/connectedTestReports" + val connectedTestReportsPath = + target.findProperty("connectedTestReportsPath") as? String + ?: "${target.rootProject.rootDir}/connectedTestReports" reportDir = "$connectedTestReportsPath/${target.name}" } diff --git a/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt deleted file mode 100644 index f3eb9c75e..000000000 --- a/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt +++ /dev/null @@ -1,14 +0,0 @@ -import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.create - -class ArcGISMapsRootConventionPlugin : Plugin { - override fun apply(target: Project) { - require(target == target.rootProject) { - "The ArcGISMapsRootConventionPlugin must be applied to the root project only." - } - // Create the single registry extension on the root project - target.extensions.create("toolkitRegistry") - } -} diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt index 344d27795..ccef560eb 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt @@ -27,12 +27,12 @@ internal fun Project.configureAndroidCompose( val composeBom = libs.findLibrary("androidx-compose-bom").get() implementation(platform(composeBom)) androidTestImplementation(platform(composeBom)) + androidTestImplementation(libs.findLibrary("androidx-compose-ui-test").get()) implementation(libs.findLibrary("androidx-activity-compose").get()) implementation(libs.findLibrary("androidx-compose-material3").get()) implementation(libs.findLibrary("androidx-lifecycle-viewmodel-compose").get()) implementation(libs.findLibrary("androidx-compose-ui-tooling-preview").get()) debugImplementation(libs.findBundle("debug").get()) - androidTestImplementation(libs.findLibrary("androidx-compose-ui-test").get()) } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt index 12ef0023e..800f235ef 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt @@ -4,7 +4,6 @@ import com.esri.arcgismaps.kotlin.build_logic.extensions.api import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies -import java.io.File /** * A helper object to configure the logic for applying the ArcGIS Maps SDK dependency, @@ -26,33 +25,26 @@ object ArcGISMapsKotlinSDKDependency { fun configureArcGISMapsDependencies(target: Project) { target.dependencies { - val localProperties = java.util.Properties().apply { - val localPropertiesFile = File("local.properties") - if (localPropertiesFile.exists()) { - load(localPropertiesFile.inputStream()) - } - } - // For finalBuilds ignore the build number and pick up the released version of the SDK dependency val finalBuild: Boolean = (target.rootProject.providers.gradleProperty("finalBuild").orNull ?: "false") .toBoolean() // First look for the version number provided via command line (for CI builds), if not found, - // take the one defined in gradle.properties. + // take the one from project extras (which includes local.properties values). // CI builds pass -PversionNumber=${BUILDVER} val sdkVersionNumber: String? = target.rootProject.providers.gradleProperty("versionNumber").orNull ?: target.rootProject.providers.gradleProperty("sdkVersionNumber").orNull - ?: localProperties["sdkVersionNumber"] as? String + ?: target.rootProject.extensions.extraProperties.get("sdkVersionNumber") as? String // The build number of the ArcGIS Maps SDK for Kotlin dependency. // First look for the version number provided via command line (for CI builds), if not found, - // take the one defined in local.properties. + // take the one from project extras (which includes local.properties values). // CI builds pass -PbuildNumber=${BUILDNUM} val sdkBuildNumber: String? = target.rootProject.providers.gradleProperty("buildNumber").orNull ?: target.rootProject.providers.gradleProperty("sdkBuildNumber").orNull - ?: localProperties["sdkBuildNumber"] as? String + ?: target.rootProject.extensions.extraProperties.get("sdkBuildNumber") as? String // ArcGIS Maps SDK dependency with build override support if (sdkVersionNumber != null) { @@ -69,7 +61,7 @@ object ArcGISMapsKotlinSDKDependency { } api("com.esri:arcgis-maps-kotlin:$dependencyVersion") } else { - // Use libs.versions.toml if no gradle property is provided + // Use libs.versions.toml if no gradle property is provided - for `main` branch. api(target.libs.findLibrary("arcgis-maps-kotlin").get()) } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt index a1b0b7323..1024d5b92 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt @@ -18,13 +18,12 @@ package com.esri.arcgismaps.kotlin.build_logic.convention -import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitRegistryExtension +import com.esri.arcgismaps.kotlin.build_logic.registry.ToolkitRegistry import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.publish.maven.plugins.MavenPublishPlugin import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.get import org.gradle.kotlin.dsl.provideDelegate import java.net.URI @@ -45,23 +44,17 @@ object ArtifactPublisher { val artifactoryUrl: String by project val artifactoryUsername: String by project val artifactoryPassword: String by project - val versionNumber: String by project - val finalBuild: Boolean = (project.properties["finalBuild"] ?: "false") - .run { this == "true" } - val buildNumber: String by project - val artifactVersion: String = if (finalBuild) { - versionNumber - } else { - "$versionNumber-$buildNumber" - } + + // Use centralized version provider + val artifactVersion = VersionProvider.getArtifactVersion(project) + // Built the artifact id for the given project val artifactoryArtifactId = "$artifactoryArtifactBaseId-${project.name}" project.pluginManager.apply(MavenPublishPlugin::class.java) - project.afterEvaluate { - val registry = rootProject.extensions.getByType(ToolkitRegistryExtension::class.java) - if (!registry.toolkitProjects.contains(project)) return@afterEvaluate - + // Check if this module is releasable + val isReleasable = ToolkitRegistry.isModuleReleasable(project).get() + if (!isReleasable) { return@afterEvaluate } project.extensions.configure { repositories { @@ -77,9 +70,9 @@ object ArtifactPublisher { create(project.name, MavenPublication::class.java) { groupId = artifactoryGroupId artifactId = artifactoryArtifactId - version = artifactVersion + version = artifactVersion.get() - from(project.components["release"]) + from(project.components.getByName("release")) } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt new file mode 100644 index 000000000..4c3eed092 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt @@ -0,0 +1,121 @@ +package com.esri.arcgismaps.kotlin.build_logic.convention + +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs +import org.gradle.api.Project +import org.gradle.api.provider.Provider + +/** + * Centralized version provider that implements the toolkit's versioning strategy. + * This provider ensures consistent versioning across BOM, KDoc, and artifact publication. + */ +object VersionProvider { + + /** + * Version configuration for toolkit artifacts + */ + data class VersionConfig( + val version: String, + val isFinalBuild: Boolean, + val buildNumber: String? + ) { + /** + * Returns the full version string for artifact publication + */ + val artifactVersion: String + get() = if (isFinalBuild || buildNumber.isNullOrBlank()) { + version + } else { + "$version-$buildNumber" + } + } + + /** + * Provides a version configuration provider for the given project. + * + * @param project The project to resolve version configuration for + * @return Provider that resolves version configuration when needed + */ + fun getVersionConfig(project: Project): Provider { + return project.providers.provider { + resolveVersionConfig(project) + } + } + + /** + * Provides the artifact version string for the given project. + * This is a convenience method for simple version string access. + * + * @param project The project to resolve version for + * @return Provider that resolves to the artifact version string + */ + fun getArtifactVersion(project: Project): Provider { + return getVersionConfig(project).map { it.artifactVersion } + } + + private fun resolveVersionConfig(project: Project): VersionConfig { + // Check if this is a final build + val finalBuild = project.rootProject.providers + .gradleProperty("finalBuild") + .orNull?.toBoolean() ?: false + + // Version resolution priority + val versionNumber = resolveVersionNumber(project) + val buildNumber = resolveBuildNumber(project) + + return VersionConfig( + version = versionNumber, + isFinalBuild = finalBuild, + buildNumber = buildNumber + ) + } + + private fun resolveVersionNumber(project: Project): String { + // 1. Command line properties (highest priority) + project.rootProject.providers.gradleProperty("versionNumber").orNull?.let { return it } + project.rootProject.providers.gradleProperty("sdkVersionNumber").orNull?.let { return it } + + // 2. Root project extra properties (includes local.properties values and buildnum.txt) + val extraSdkVersion = project.rootProject.extensions.extraProperties.get("sdkVersionNumber") as? String + if (extraSdkVersion != null) { + return extraSdkVersion + } + + val extraVersion = project.rootProject.extensions.extraProperties.get("versionNumber") as? String + if (extraVersion != null && extraVersion != "0.0.0") { + return extraVersion + } + + // 3. Fallback to libs.versions.toml + return project.libs.findVersion("arcgisMapsKotlinVersion").get().toString() + } + + private fun resolveBuildNumber(project: Project): String? { + // Don't use build number for final builds + val finalBuild = project.rootProject.providers + .gradleProperty("finalBuild") + .orNull?.toBoolean() ?: false + + if (finalBuild) return null + + // 1. Command line properties (highest priority) + project.rootProject.providers.gradleProperty("buildNumber").orNull?.let { + return it.ifBlank { null } + } + project.rootProject.providers.gradleProperty("sdkBuildNumber").orNull?.let { + return it.ifBlank { null } + } + + // 2. Root project extra properties (includes local.properties values and buildnum.txt) + val extraSdkBuildNumber = project.rootProject.extensions.extraProperties.get("sdkBuildNumber") as? String + if (extraSdkBuildNumber != null && extraSdkBuildNumber.isNotBlank()) { + return extraSdkBuildNumber + } + + val extraBuildNumber = project.rootProject.extensions.extraProperties.get("buildNumber") as? String + if (extraBuildNumber != null && extraBuildNumber != "SNAPSHOT" && extraBuildNumber.isNotBlank()) { + return extraBuildNumber + } + + return null + } +} diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt index 013572ce4..8e933d76e 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt @@ -10,9 +10,6 @@ import org.gradle.kotlin.dsl.getByType fun DependencyHandler.testImplementation(dependencyNotation: Any): Dependency? = add("testImplementation", dependencyNotation) -fun DependencyHandler.testRuntimeOnly(dependencyNotation: Any): Dependency? = - add("testRuntimeOnly", dependencyNotation) - fun DependencyHandler.implementation(dependencyNotation: Any): Dependency? = add("implementation", dependencyNotation) diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt index 0dbe36725..996337479 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt @@ -1,7 +1,5 @@ package com.esri.arcgismaps.kotlin.build_logic.extensions -import org.gradle.api.NamedDomainObjectSet -import org.gradle.api.Project import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.Property import javax.inject.Inject @@ -12,19 +10,8 @@ abstract class ToolkitModuleExtension @Inject constructor(objects: ObjectFactory /** Can/should this module be published as an artifact? */ val releasable: Property = objects.property(Boolean::class.java) - internal fun applyDefaults() { releasable.convention(true) } } - - -abstract class ToolkitRegistryExtension @Inject constructor(objects: ObjectFactory) { -// Live set that will receive projects as they apply the toolkit plugin - val toolkitProjects: NamedDomainObjectSet = - objects.namedDomainObjectSet(Project::class.java) - -} - - diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistry.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistry.kt new file mode 100644 index 000000000..f8e4a79ab --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistry.kt @@ -0,0 +1,106 @@ +/* + * + * Copyright 2023 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.esri.arcgismaps.kotlin.build_logic.registry + +import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitModuleExtension +import org.gradle.api.Project +import org.gradle.api.provider.Provider + +/** + * Dynamic registry that discovers toolkit modules at runtime by scanning all projects + * for the toolkit convention plugin and their releasable configuration. + */ +object ToolkitRegistry { + + /** + * Configuration for a discovered toolkit module + */ + data class ModuleConfig( + val project: Project, + val name: String, + val releasable: Boolean + ) { + + /** + * Returns the source root path for documentation + */ + val sourceRoot: String get() = "toolkit/$name/src/main/java" + } + + /** + * Discovers all projects that apply the toolkit convention plugin and builds + * a provider that resolves their configuration when needed. + */ + fun discoverToolkitModules(rootProject: Project): Provider> { + return rootProject.providers.provider { + val toolkitModules = mutableListOf() + // Scan all subprojects for toolkit plugin + rootProject.allprojects.forEach { project -> + if (project.plugins.hasPlugin("arcgismaps.kotlin.toolkit")) { + project.extensions.findByType(ToolkitModuleExtension::class.java) + ?.let { toolkitModuleExt -> + toolkitModules.add( + ModuleConfig( + project = project, + name = project.name, + releasable = toolkitModuleExt.releasable.getOrElse(true) + ) + ) + } + } + } + toolkitModules.sortedBy { it.name } + } + } + + /** + * Gets only releasable toolkit modules + */ + fun getReleasableModules(rootProject: Project): Provider> { + return discoverToolkitModules(rootProject).map { modules -> + modules.filter { it.releasable } + } + } + + /** + * Checks if a specific module is releasable + */ + fun isModuleReleasable(toolkitModule: Project): Provider { + return discoverToolkitModules(toolkitModule.rootProject).map { modules -> + modules.find { it.name == toolkitModule.name }?.releasable ?: false + } + } + + /** + * Creates artifact dependencies configuration for BOM + */ + fun createBomDependencies( + rootProject: Project, + artifactoryGroupId: String, + artifactoryArtifactBaseId: String, + artifactVersion: String + ): Provider> { + return getReleasableModules(rootProject).map { modules -> + modules.map { moduleConfig -> + val moduleArtifactId = "$artifactoryArtifactBaseId-${moduleConfig.name}" + "$artifactoryGroupId:$moduleArtifactId:$artifactVersion" + } + } + } +} \ No newline at end of file diff --git a/build-logic/gradle.properties b/build-logic/gradle.properties index bf586e553..c6cd2a7e2 100644 --- a/build-logic/gradle.properties +++ b/build-logic/gradle.properties @@ -1,4 +1,3 @@ org.gradle.parallel=true org.gradle.caching=true org.gradle.configureondemand=true -org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 401b6ad52..47f1af023 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - alias(libs.plugins.arcgismaps.kotlin.root.convention) alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.binary.compatibility.validator) apply false @@ -106,6 +105,3 @@ buildscript { * ``` * Test report to be found under `arcgis-maps-sdk-kotlin-toolkit/build/reports`. */ -testAggregation { - // TODO: getAllToolkitProjects(project).forEach { this.modules.include(project(":$it")) } -} diff --git a/gradle.properties b/gradle.properties index 001209493..4b40805ce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -41,4 +41,5 @@ kotlin.code.style=official android.nonTransitiveRClass=true artifactoryGroupId=com.esri artifactoryArtifactBaseId=arcgis-maps-kotlin-toolkit -org.jetbrains.dokka.experimental.gradle.pluginMode=V2EnabledWithHelpers +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled +org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true From db71c5fe7c656d2cd5749aa4dc3ec5f32f5f2bc8 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Thu, 25 Sep 2025 15:32:08 -0700 Subject: [PATCH 10/16] update toml, add root convention --- build-logic/convention/build.gradle.kts | 10 ++- .../java/ArcGISMapsRootConventionPlugin.kt | 12 +++ build-logic/settings.gradle.kts | 1 + build.gradle.kts | 13 +-- gradle/libs.versions.toml | 86 +++++++++---------- 5 files changed, 63 insertions(+), 59 deletions(-) create mode 100644 build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index ec4a57826..7a17a0039 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -36,7 +36,7 @@ tasks { gradlePlugin { plugins { - register("androidApplicationComposing") { + register("androidApplicationCompose") { id = "arcgismaps.android.application.compose" implementationClass = "AndroidApplicationComposeConventionPlugin" } @@ -64,13 +64,17 @@ gradlePlugin { id = "arcgismaps.kotlin.sdk" implementationClass = "ArcGISMapsKotlinSDKConventionPlugin" } - register("arcGISMapsKdocConventionPlugin") { + register("arcGISMapsKdoc") { id = "arcgismaps.kotlin.kdoc.convention" implementationClass = "ArcGISMapsKdocConventionPlugin" } - register("arcGISMapsBomConventionPlugin") { + register("arcGISMapsBom") { id = "arcgismaps.kotlin.bom.convention" implementationClass = "ArcGISMapsBomConventionPlugin" } + register("arcGISMapsRoot") { + id = "arcgismaps.kotlin.root.convention" + implementationClass = "ArcGISMapsRootConventionPlugin" + } } } diff --git a/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt new file mode 100644 index 000000000..8c30db914 --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt @@ -0,0 +1,12 @@ +import org.gradle.api.Plugin +import org.gradle.api.Project as GradleProject + +class ArcGISMapsRootConventionPlugin : Plugin { + override fun apply(target: GradleProject) { + with(target) { + gradle.projectsEvaluated { + // configureAndroidTestAggregation(target) + } + } + } +} diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts index 2907fbfb8..875164f78 100644 --- a/build-logic/settings.gradle.kts +++ b/build-logic/settings.gradle.kts @@ -2,6 +2,7 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + gradlePluginPortal() } versionCatalogs { create("libs") { diff --git a/build.gradle.kts b/build.gradle.kts index 47f1af023..660a6f6e0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,6 +18,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { + alias(libs.plugins.arcgismaps.kotlin.root.convention) alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.binary.compatibility.validator) apply false @@ -27,7 +28,6 @@ plugins { alias(libs.plugins.hilt) apply false alias(libs.plugins.kotlin.serialization) apply false alias(libs.plugins.dokka) apply false - alias(libs.plugins.gmazzo.test.aggregation) alias(libs.plugins.compose.compiler) apply false } @@ -94,14 +94,3 @@ buildscript { } } } - -/** - * Configures the [gmazzo test aggregation plugin](https://github.com/gmazzo/gradle-android-test-aggregation-plugin) - * with all local tests to be aggregated into a single test report. - * Note: This works only for local tests, not for connected tests. - * To run aggregated local tests, run the following at the root folder of the project: - * ``` - * ./gradlew testAggregatedReport --continue - * ``` - * Test report to be found under `arcgis-maps-sdk-kotlin-toolkit/build/reports`. - */ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9033c9dcd..4069ed0d3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,38 +4,38 @@ arcgisMapsKotlinVersion = "200.8.0" ### Android versions -androidGradlePlugin = "8.9.2" -androidXBrowser = "1.8.0" +androidGradlePlugin = "8.12.2" +androidXBrowser = "1.9.0" androidxCamera = "1.4.2" -androidxCore = "1.16.0" -androidxEspresso = "3.6.1" +androidxCore = "1.17.0" +androidxEspresso = "3.7.0" androidxHiltNavigationCompose = "1.2.0" androidxMaterialIcons = "1.7.8" -androidxTestExt = "1.2.1" -androidXTestRunner = "1.6.2" -androidXTestRules = "1.6.1" -androidxWindow = "1.3.0" +androidxTestExt = "1.3.0" +androidXTestRunner = "1.7.0" +androidXTestRules = "1.7.0" +androidxWindow = "1.4.0" androidTools = "31.9.1" -workVersion = "2.10.0" -hilt = "2.55" +workVersion = "2.10.3" +hilt = "2.57.1" hiltExt = "1.2.0" -media3Exoplayer = "1.6.1" +media3Exoplayer = "1.8.0" mlkitBarcodeScanning = "17.3.0" arcore = "1.48.0" playServicesLocation = "21.3.0" ### Kotlin versions -kotlin = "2.1.20" -ksp = "2.1.20-1.0.32" -kotlinxCoroutinesTest = "1.8.0" -kotlinxSerializationJson = "1.8.0" -binaryCompatibilityValidator = "0.17.0" +kotlin = "2.2.10" +ksp = "2.2.10-2.0.2" +kotlinxCoroutinesTest = "1.10.2" +kotlinxSerializationJson = "1.9.0" +binaryCompatibilityValidator = "0.18.1" dokka = "2.0.0" ### Compose versions -composeBOM = "2025.04.01" +composeBOM = "2025.08.01" activityCompose = "1.10.1" -compose-navigation = "2.8.9" +compose-navigation = "2.9.3" ### Toolkit component verions compileSdk = "36" @@ -44,15 +44,14 @@ minSdk = "28" ### Testing versions junit = "4.13.2" gradleSecrets = "2.0.1" -mockkAndroid = "1.14.0" +mockkAndroid = "1.14.5" truth = "1.4.4" uiautomator = "2.3.0" ### Third party versions -coilBOM = "2.5.0" -room = "2.7.0" -commonMark = "0.22.0" -gmazzo = "2.4.4" +coilBOM = "2.7.0" +room = "2.7.2" +commonMark = "0.25.1" [libraries] ### ArcGIS Maps SDK for Kotlin libs @@ -60,7 +59,7 @@ arcgis-maps-kotlin = { group = "com.esri", name = "arcgis-maps-kotlin", version. ### Android libs arcore = { group = "com.google.ar", name = "core", version.ref = "arcore" } -androidx-browser = { group = "androidx.browser", name = "browser", version.ref = "androidXBrowser"} +androidx-browser = { group = "androidx.browser", name = "browser", version.ref = "androidXBrowser" } androidx-camera-camera2 = { group = "androidx.camera", name = "camera-camera2", version.ref = "androidxCamera" } androidx-camera-core = { group = "androidx.camera", name = "camera-core", version.ref = "androidxCamera" } androidx-camera-lifecycle = { group = "androidx.camera", name = "camera-lifecycle", version.ref = "androidxCamera" } @@ -76,27 +75,27 @@ mlkit-barcode-scanning = { module = "com.google.mlkit:barcode-scanning", version play-services-location = { group = "com.google.android.gms", name = "play-services-location", version.ref = "playServicesLocation" } ### Kotlin libs -kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin"} +kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesTest" } kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } ### Compose libs -androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose"} +androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBOM" } androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" } -androidx-compose-material3 = { module = "androidx.compose.material3:material3"} +androidx-compose-material3 = { module = "androidx.compose.material3:material3" } androidx-compose-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "compose-navigation" } -androidx-compose-ui = { group = "androidx.compose.ui", name = "ui"} -androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics"} -androidx-compose-ui-test = { group = "androidx.compose.ui", name = "ui-test-junit4"} -androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest"} -androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling"} -androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview"} -androidx-compose-ui-util = { group = "androidx.compose.ui", name = "ui-util"} +androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" } +androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" } +androidx-compose-ui-test = { group = "androidx.compose.ui", name = "ui-test-junit4" } +androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" } +androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } +androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } +androidx-compose-ui-util = { group = "androidx.compose.ui", name = "ui-util" } androidx-hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "androidxHiltNavigationCompose" } -androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose"} -androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose"} -androidx-material-icons = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "androidxMaterialIcons"} +androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose" } +androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose" } +androidx-material-icons = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "androidxMaterialIcons" } ### Testing libs androidx-test-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidxEspresso" } @@ -112,10 +111,10 @@ truth = { group = "com.google.truth", name = "truth", version.ref = "truth" } coil = { group = "io.coil-kt", name = "coil" } coil-bom = { group = "io.coil-kt", name = "coil-bom", version.ref = "coilBOM" } coil-compose = { group = "io.coil-kt", name = "coil-compose" } -commonmark = { group = "org.commonmark", name = "commonmark", version.ref="commonMark" } -commonmark-strikethrough = { group = "org.commonmark", name = "commonmark-ext-gfm-strikethrough", version.ref="commonMark" } +commonmark = { group = "org.commonmark", name = "commonmark", version.ref = "commonMark" } +commonmark-strikethrough = { group = "org.commonmark", name = "commonmark-ext-gfm-strikethrough", version.ref = "commonMark" } dokka-all-modules = { module = "org.jetbrains.dokka:all-modules-page-plugin", version.ref = "dokka" } -dokka-versioning = { module = "org.jetbrains.dokka:versioning-plugin", version.ref = "dokka" } +dokka-versioning = { module = "org.jetbrains.dokka:versioning-plugin", version.ref = "dokka" } dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } hilt-android-core = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" } hilt-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" } @@ -132,16 +131,15 @@ android-tools-common = { group = "com.android.tools", name = "common", version.r [plugins] android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } -binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidator"} +binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibilityValidator" } dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } -gradle-secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "gradleSecrets"} +gradle-secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "gradleSecrets" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } -gmazzo-test-aggregation = { id = "io.github.gmazzo.test.aggregation.results", version.ref = "gmazzo" } # Plugins defined by the project build-logic arcgismaps-android-application = { id = "arcgismaps.android.application" } @@ -151,7 +149,7 @@ arcgismaps-android-library = { id = "arcgismaps.android.library" } arcgismaps-kotlin-root-convention = { id = "arcgismaps.kotlin.root.convention" } arcgismaps-kotlin-kdoc-convention = { id = "arcgismaps.kotlin.kdoc.convention" } arcgismaps-kotlin-bom-convention = { id = "arcgismaps.kotlin.bom.convention" } -arcgismaps-kotlin-sdk = { id = "arcgismaps.kotlin.sdk"} +arcgismaps-kotlin-sdk = { id = "arcgismaps.kotlin.sdk" } arcgismaps-kotlin-microapp = { id = "arcgismaps.kotlin.microapp" } arcgismaps-kotlin-toolkit = { id = "arcgismaps.kotlin.toolkit" } From 76214950b5993f1b9a3b5813954c9d1e95138e1f Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Thu, 25 Sep 2025 16:02:02 -0700 Subject: [PATCH 11/16] fix freeCompilerArgs warnings --- toolkit/authentication/build.gradle.kts | 5 +++++ toolkit/featureforms/build.gradle.kts | 9 +++++---- toolkit/popup/build.gradle.kts | 9 +++++---- toolkit/utilitynetworks/build.gradle.kts | 9 +++++---- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/toolkit/authentication/build.gradle.kts b/toolkit/authentication/build.gradle.kts index ca7a598ef..7fec8aff7 100644 --- a/toolkit/authentication/build.gradle.kts +++ b/toolkit/authentication/build.gradle.kts @@ -24,6 +24,11 @@ android { namespace = "com.arcgismaps.toolkit.authentication" } +kotlin { + // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. + compilerOptions { freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") } +} + apiValidation { ignoredClasses.add("com.arcgismaps.toolkit.featureforms.BuildConfig") // todo: remove when this is resolved https://github.com/Kotlin/binary-compatibility-validator/issues/74 diff --git a/toolkit/featureforms/build.gradle.kts b/toolkit/featureforms/build.gradle.kts index a2d9aed3c..11ae161a6 100644 --- a/toolkit/featureforms/build.gradle.kts +++ b/toolkit/featureforms/build.gradle.kts @@ -25,15 +25,16 @@ secrets { defaultPropertiesFileName = "secrets.defaults.properties" } +kotlin { + // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. + compilerOptions { freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") } +} + android { namespace = "com.arcgismaps.toolkit.featureforms" buildFeatures { buildConfig = true } - kotlinOptions { - // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. - freeCompilerArgs = freeCompilerArgs + listOf("-Xconsistent-data-class-copy-visibility") - } // Lint crashes on the latest Android studio // (Bug with Android Studio Meerkat | 2024.3.1) // TODO: Remove this when Android Studio lint checker is fixed diff --git a/toolkit/popup/build.gradle.kts b/toolkit/popup/build.gradle.kts index 7ed7305d0..0f0a58295 100644 --- a/toolkit/popup/build.gradle.kts +++ b/toolkit/popup/build.gradle.kts @@ -21,12 +21,13 @@ plugins { alias(libs.plugins.kotlin.serialization) apply true } +kotlin { + // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. + compilerOptions { freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") } +} + android { namespace = "com.arcgismaps.toolkit.popup" - kotlinOptions { - // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. - freeCompilerArgs = freeCompilerArgs + listOf("-Xconsistent-data-class-copy-visibility") - } } apiValidation { diff --git a/toolkit/utilitynetworks/build.gradle.kts b/toolkit/utilitynetworks/build.gradle.kts index e4d03f8f7..08cb2e5da 100644 --- a/toolkit/utilitynetworks/build.gradle.kts +++ b/toolkit/utilitynetworks/build.gradle.kts @@ -25,15 +25,16 @@ secrets { defaultPropertiesFileName = "secrets.defaults.properties" } +kotlin { + // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. + compilerOptions { freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") } +} + android { namespace = "com.arcgismaps.toolkit.utilitynetworks" buildFeatures { buildConfig = true } - kotlinOptions { - // This flag is the same as applying '@ConsistentCopyVisibility' annotation to all data classes in the module. - freeCompilerArgs = freeCompilerArgs + listOf("-Xconsistent-data-class-copy-visibility") - } } apiValidation { From d8eda361a66ae1303191619ed1b3e1e8d75c56a3 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Thu, 25 Sep 2025 16:17:34 -0700 Subject: [PATCH 12/16] Add MissingTranslation for popup --- toolkit/popup/build.gradle.kts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolkit/popup/build.gradle.kts b/toolkit/popup/build.gradle.kts index 0f0a58295..dd3fdecd0 100644 --- a/toolkit/popup/build.gradle.kts +++ b/toolkit/popup/build.gradle.kts @@ -28,6 +28,10 @@ kotlin { android { namespace = "com.arcgismaps.toolkit.popup" + lint { + // remove these disables when strings.xml lint is fixed via localization + disable += "MissingTranslation" + } } apiValidation { From ea471ff080fdb7262f4927d6458465aaf8a68150 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Mon, 29 Sep 2025 09:36:08 -0700 Subject: [PATCH 13/16] Migrate toolkit registry as a gradle service --- bom/build.gradle.kts | 2 - build-logic/convention/build.gradle.kts | 1 + .../AndroidApplicationConventionPlugin.kt | 10 +- .../AndroidLibraryComposeConventionPlugin.kt | 6 +- .../java/ArcGISMapsBomConventionPlugin.kt | 64 +++++---- .../java/ArcGISMapsKdocConventionPlugin.kt | 40 +++--- ...rcGISMapsKotlinMicroappConventionPlugin.kt | 20 +-- ...ArcGISMapsKotlinToolkitConventionPlugin.kt | 53 +++---- .../java/ArcGISMapsRootConventionPlugin.kt | 13 +- .../ArcGISMapsKotlinSDKDependency.kt | 44 +----- .../convention/ArtifactPublisher.kt | 23 ++-- .../build_logic/convention/KotlinAndroid.kt | 5 - .../build_logic/convention/VersionProvider.kt | 129 ++++++++---------- .../extensions/ProjectExtensions.kt | 4 + .../extensions/ToolkitModuleExtension.kt | 5 +- .../build_logic/registry/ToolkitRegistry.kt | 106 -------------- .../registry/ToolkitRegistryService.kt | 53 +++++++ build.gradle.kts | 34 +++-- gradle/libs.versions.toml | 11 +- .../SceneViewCalloutApp/app/build.gradle.kts | 34 ----- secrets.defaults.properties | 1 + settings.gradle.kts | 4 + toolkit/authentication/build.gradle.kts | 2 - toolkit/composable-map/build.gradle.kts | 35 ----- toolkit/popup/build.gradle.kts | 12 -- 25 files changed, 253 insertions(+), 458 deletions(-) delete mode 100644 build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistry.kt create mode 100644 build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistryService.kt delete mode 100644 microapps/SceneViewCalloutApp/app/build.gradle.kts delete mode 100644 toolkit/composable-map/build.gradle.kts diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index 326cc2bca..6e850fadc 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -17,7 +17,5 @@ */ plugins { - `maven-publish` - `java-platform` alias(libs.plugins.arcgismaps.kotlin.bom.convention) } diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 7a17a0039..9a711b955 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -24,6 +24,7 @@ dependencies { compileOnly(libs.android.tools.common) compileOnly(libs.kotlin.gradlePlugin) compileOnly(libs.ksp.gradlePlugin) + compileOnly(libs.secrets.gradlePlugin) implementation(libs.dokka.gradle.plugin) } diff --git a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt index 03bdc1f2e..5ca6e7058 100644 --- a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt @@ -4,7 +4,6 @@ import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.get class AndroidApplicationConventionPlugin : Plugin { override fun apply(target: Project) { @@ -17,14 +16,12 @@ class AndroidApplicationConventionPlugin : Plugin { extensions.configure { configureKotlinAndroid(this) defaultConfig { - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } minSdk = libs.findVersion("minSdk").get().toString().toInt() targetSdk = libs.findVersion("compileSdk").get().toString().toInt() versionCode = 1 versionName = "1.0" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { useSupportLibrary = true } } buildFeatures { @@ -46,9 +43,6 @@ class AndroidApplicationConventionPlugin : Plugin { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } - - // Add the custom assets directory to the app module's assets build. - sourceSets["main"].assets.srcDirs(layout.buildDirectory.dir("sampleAssets/")) } } } diff --git a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt index 629ccf508..49d9c4568 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt @@ -1,11 +1,10 @@ import com.android.build.api.dsl.LibraryExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid -import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation -import com.esri.arcgismaps.kotlin.build_logic.extensions.libs -import com.esri.arcgismaps.kotlin.build_logic.extensions.testImplementation import com.esri.arcgismaps.kotlin.build_logic.extensions.androidTestImplementation import com.esri.arcgismaps.kotlin.build_logic.extensions.debugImplementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.dependencies @@ -34,7 +33,6 @@ class AndroidLibraryComposeConventionPlugin : Plugin { implementation(libs.findLibrary("androidx-activity-compose").get()) implementation(libs.findLibrary("androidx-material-icons").get()) implementation(libs.findLibrary("kotlinx-serialization-json").get()) - testImplementation(libs.findBundle("unitTest").get()) androidTestImplementation(libs.findBundle("composeTest").get()) androidTestImplementation(libs.findBundle("androidXTest").get()) debugImplementation(libs.findBundle("debug").get()) diff --git a/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt index 37356ac35..d54dcddc2 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt @@ -1,5 +1,5 @@ import com.esri.arcgismaps.kotlin.build_logic.convention.VersionProvider -import com.esri.arcgismaps.kotlin.build_logic.registry.ToolkitRegistry +import com.esri.arcgismaps.kotlin.build_logic.registry.getToolkitRegistryServiceProvider import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension @@ -9,41 +9,24 @@ import org.gradle.kotlin.dsl.provideDelegate class ArcGISMapsBomConventionPlugin : Plugin { override fun apply(target: Project) = with(target) { - // Platform publishing - pluginManager.apply("maven-publish") - pluginManager.apply("java-platform") + with(pluginManager) { + // Platform publishing + apply("maven-publish") + apply("java-platform") + } - // Find these in properties passed through command line or read from GRADLE_HOME/gradle.properties - // or local gradle.properties + // Find these in properties passed through command line + // or read from GRADLE_HOME/gradle.properties or local gradle.properties val artifactoryGroupId: String by project val artifactoryArtifactBaseId: String by project val artifactoryUrl: String by project val artifactoryUsername: String by project val artifactoryPassword: String by project - // Use centralized version provider - val versionConfig = VersionProvider.getVersionConfig(project) - val artifactVersion = versionConfig.map { it.artifactVersion } + // Use centralized version provider, publish using internal `buildnum.txt` as source + val artifactVersionProvider = VersionProvider.artifactVersionProvider(project, true) val artifactoryArtifactId = "$artifactoryArtifactBaseId-${project.name}" - // Use toolkit registry to find projects which are releasable - // Wait until all projects are evaluated before discovering modules - gradle.projectsEvaluated { - dependencies { - constraints { - // Get releasable modules and version after all projects are evaluated - val releasableModules = ToolkitRegistry.getReleasableModules(rootProject).get() - val resolvedVersion = artifactVersion.get() - releasableModules.forEach { moduleConfig -> - val moduleArtifactId = "$artifactoryArtifactBaseId-${moduleConfig.name}" - val dependency = "$artifactoryGroupId:$moduleArtifactId:$resolvedVersion" - // add the toolkit project as api - add("api", dependency) - } - } - } - } - /** * Maven publication configuration for aar and pom file. Run as follows: * ./gradlew publishAarPublicationToMavenRepository -PartifactoryUsername= -PartifactoryPassword= @@ -56,7 +39,7 @@ class ArcGISMapsBomConventionPlugin : Plugin { create("bom", MavenPublication::class.java) { groupId = artifactoryGroupId artifactId = artifactoryArtifactId - version = artifactVersion.get() + version = artifactVersionProvider.get() from(components.getByName("javaPlatform")) } @@ -71,5 +54,30 @@ class ArcGISMapsBomConventionPlugin : Plugin { } } } + + // Get the toolkit registry provider + val registryServiceProvider = getToolkitRegistryServiceProvider(this) + // Lazily get releasable modules from the service provider + val releasableModulesProvider = registryServiceProvider.map { service -> + service.toolkitModules.get().filter { it.releasable } + } + + // Use toolkit registry to find projects which are releasable + // Wait until all projects are evaluated before discovering modules + gradle.projectsEvaluated { + // Get releasable modules and version after all projects are evaluated + val releasableModules = releasableModulesProvider.get() + val artifactVersion = artifactVersionProvider.get() + dependencies { + constraints { + releasableModules.forEach { moduleConfig -> + val moduleArtifactId = "$artifactoryArtifactBaseId-${moduleConfig.name}" + val dependency = "$artifactoryGroupId:$moduleArtifactId:$artifactVersion" + // Add the toolkit project as api dependency + add("api", dependency) + } + } + } + } } } diff --git a/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt index 4b6eb7fb0..fca370429 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt @@ -1,12 +1,11 @@ import com.esri.arcgismaps.kotlin.build_logic.convention.VersionProvider import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation import com.esri.arcgismaps.kotlin.build_logic.extensions.libs -import com.esri.arcgismaps.kotlin.build_logic.registry.ToolkitRegistry +import com.esri.arcgismaps.kotlin.build_logic.registry.getToolkitRegistryServiceProvider import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.dependencies -import org.gradle.kotlin.dsl.invoke import org.gradle.kotlin.dsl.withType import org.jetbrains.dokka.gradle.DokkaExtension import org.jetbrains.dokka.gradle.engine.plugins.DokkaVersioningPluginParameters @@ -33,34 +32,29 @@ class ArcGISMapsKdocConventionPlugin : Plugin { extensions.configure { pluginsConfiguration.withType().configureEach { // Use centralized version provider - version.set(VersionProvider.getArtifactVersion(project)) + version.set(VersionProvider.artifactVersionProvider(project)) } moduleName.set("arcgis-maps-kotlin-toolkit") - dokkaSourceSets { - if (findByName("main") == null) { - register("main") + dokkaSourceSets.named("main") { + // Get the toolkit registry provider + val registryServiceProvider = getToolkitRegistryServiceProvider(target) + // Lazily get releasable modules from the service provider + val releasableModulesProvider = registryServiceProvider.map { service -> + service.toolkitModules.get().filter { it.releasable } } - - named("main") { - // Get source roots directly and convert to files - val toolkitConfigProvider = ToolkitRegistry.getReleasableModules(rootProject) - sourceRoots.from( - toolkitConfigProvider.map { toolkitRegistryModuleConfigs -> - toolkitRegistryModuleConfigs.map { config -> - rootProject.file(config.sourceRoot) - } - } - ) + // Build the provider for source roots of all releasable modules + val sourceRootFilesProvider = releasableModulesProvider.map { configs -> + configs.map { config -> rootProject.file(config.getSourceRoot(rootProject)) } } - configureEach { - perPackageOption { - matchingRegex.set(".*internal.*") - suppress.set(true) - reportUndocumented.set(true) - } + // Add the source roots using a provider string list + sourceRoots.from(sourceRootFilesProvider) + perPackageOption { + matchingRegex.set(".*internal.*") + suppress.set(true) } + reportUndocumented.set(true) } } } diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt index 4cdd8ad4e..8403f897b 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt @@ -1,4 +1,4 @@ -import com.android.build.api.dsl.ApplicationExtension +import com.google.android.libraries.mapsplatform.secrets_gradle_plugin.SecretsPluginExtension import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation import com.esri.arcgismaps.kotlin.build_logic.extensions.libs @@ -17,21 +17,9 @@ class ArcGISMapsKotlinMicroappConventionPlugin : Plugin { apply(libs.findPlugin("gradle-secrets").get().get().pluginId) } - - // Configure secrets plugin defaults and custom BuildConfig fields - extensions.configure { - val defaultPropertiesFile = rootProject.file("secrets.defaults.properties") - if (defaultPropertiesFile.exists()) { - val properties = java.util.Properties() - defaultPropertiesFile.inputStream().use { properties.load(it) } - defaultConfig { - // Add each property as a BuildConfig field - properties.forEach { (key, value) -> - val escapedValue = value.toString().replace("\"", "\\\"") - buildConfigField("String", key.toString(), "\"${escapedValue}\"") - } - } - } + // Configure the secrets-gradle-plugin using its dedicated extension. + extensions.configure { + defaultPropertiesFileName = "secrets.defaults.properties" } dependencies { diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt index 3fd9a9987..18c63b287 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -3,38 +3,44 @@ import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDepe import com.esri.arcgismaps.kotlin.build_logic.convention.ArtifactPublisher import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitModuleExtension import com.esri.arcgismaps.kotlin.build_logic.extensions.libs +import com.esri.arcgismaps.kotlin.build_logic.registry.ModuleConfig +import com.esri.arcgismaps.kotlin.build_logic.registry.getToolkitRegistryServiceProvider import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.tasks.testing.Test import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.provideDelegate import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import java.io.File class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { // Create extension with default releasable = true - val toolkitExt = extensions.create("toolkit").apply { - applyDefaults() // releasable = true by default - } + val toolkitExt = extensions.create(ToolkitModuleExtension.NAME) + .apply { applyDefaults() } with(pluginManager) { apply(libs.findPlugin("arcgismaps-android-library").get().get().pluginId) apply(libs.findPlugin("arcgismaps-android-library-compose").get().get().pluginId) apply(libs.findPlugin("binary-compatibility-validator").get().get().pluginId) } - - // Configure artifact publishing for toolkit modules - ArtifactPublisher.configureArtifactPublisher(this) - - // Log configuration after evaluation + // Push this module's configuration to the central registry service. + val registryServiceProvider = getToolkitRegistryServiceProvider(this) afterEvaluate { - val isReleasable = toolkitExt.releasable.getOrElse(true) - logger.info("Toolkit module '${target.name}' configured as ${if (isReleasable) "releasable" else "non-releasable"}") + registryServiceProvider.get().toolkitModules.add( + provider { + ModuleConfig( + path = path, + name = name, + releasable = toolkitExt.releasable.get() + ) + } + ) } + // Configure artifact publishing for toolkit modules + ArtifactPublisher.configureArtifactPublisher(this) extensions.configure { packaging { @@ -48,10 +54,8 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { testOptions { targetSdk = libs.findVersion("compileSdk").get().toString().toInt() - val connectedTestReportsPath = - target.findProperty("connectedTestReportsPath") as? String - ?: "${target.rootProject.rootDir}/connectedTestReports" - reportDir = "$connectedTestReportsPath/${target.name}" + val connectedTestReportsPath: String by project + reportDir = "$connectedTestReportsPath/${name}" } publishing { @@ -61,21 +65,6 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { } } - // Automatic detection of androidTest sources - val androidTestDir = File(projectDir, "src/androidTest") - val hasInstrumentedTests = androidTestDir.exists() && androidTestDir.walkTopDown().any { - it.isFile && (it.extension == "kt") - } - // Filter out generating test reports for modules without tests - if (!hasInstrumentedTests) { - // Disable unit tests - tasks.withType() - .configureEach { enabled = false } - // Disable connected Android tests - tasks.matching { it.name.startsWith("connected") && it.name.endsWith("AndroidTest") } - .configureEach { enabled = false } - } - // Explicit API configuration for toolkit modules tasks.withType { // Only toolkit modules, exclude tests @@ -84,7 +73,7 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { freeCompilerArgs.addAll( listOf( "-Xexplicit-api=strict", - "-Xcontext-receivers" + "-Xcontext-parameters" ) ) } diff --git a/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt index 8c30db914..bf2f75fc7 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt @@ -1,12 +1,19 @@ +import com.esri.arcgismaps.kotlin.build_logic.registry.ToolkitRegistryService import org.gradle.api.Plugin import org.gradle.api.Project as GradleProject class ArcGISMapsRootConventionPlugin : Plugin { override fun apply(target: GradleProject) { + if (target != target.rootProject) { + throw IllegalStateException("Plugin must only be applied to the root project ") + } with(target) { - gradle.projectsEvaluated { - // configureAndroidTestAggregation(target) - } + // Initial registration of the ToolkitRegistryService, Gradle creates the provider here, + // which will be shall be used as the centralized Toolkit configuration. + target.gradle.sharedServices.registerIfAbsent( + /* name = */ ToolkitRegistryService.NAME, + /* implementationType = */ ToolkitRegistryService::class.java + ) } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt index 800f235ef..a48915c41 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt @@ -3,6 +3,7 @@ package com.esri.arcgismaps.kotlin.build_logic.convention import com.esri.arcgismaps.kotlin.build_logic.extensions.api import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Project +import org.gradle.internal.cc.base.logger import org.gradle.kotlin.dsl.dependencies /** @@ -15,50 +16,15 @@ object ArcGISMapsKotlinSDKDependency { /** * Applies the ArcGIS Maps SDK for Kotlin dependency to the project. * - * This function checks for Gradle properties (`versionNumber` or `sdkVersionNumber`) - * to determine the SDK version. If a version is provided, it can be combined with a - * `buildNumber` to specify a specific build. If no version property is found, - * it falls back to the version defined in `libs.versions.toml`. - * * @param target The Gradle Project to which the dependency will be added. */ fun configureArcGISMapsDependencies(target: Project) { target.dependencies { - - // For finalBuilds ignore the build number and pick up the released version of the SDK dependency - val finalBuild: Boolean = (target.rootProject.providers.gradleProperty("finalBuild").orNull ?: "false") - .toBoolean() - - // First look for the version number provided via command line (for CI builds), if not found, - // take the one from project extras (which includes local.properties values). - // CI builds pass -PversionNumber=${BUILDVER} - val sdkVersionNumber: String? = - target.rootProject.providers.gradleProperty("versionNumber").orNull - ?: target.rootProject.providers.gradleProperty("sdkVersionNumber").orNull - ?: target.rootProject.extensions.extraProperties.get("sdkVersionNumber") as? String - - // The build number of the ArcGIS Maps SDK for Kotlin dependency. - // First look for the version number provided via command line (for CI builds), if not found, - // take the one from project extras (which includes local.properties values). - // CI builds pass -PbuildNumber=${BUILDNUM} - val sdkBuildNumber: String? = - target.rootProject.providers.gradleProperty("buildNumber").orNull - ?: target.rootProject.providers.gradleProperty("sdkBuildNumber").orNull - ?: target.rootProject.extensions.extraProperties.get("sdkBuildNumber") as? String - + val sdkVersionNumber = target.rootProject.properties["versionNumberInternal"].toString() // ArcGIS Maps SDK dependency with build override support - if (sdkVersionNumber != null) { - val dependencyVersion = if (finalBuild) { - // For a final build, use the version number directly - sdkVersionNumber - } else { - // If a buildNumber is provided and not blank, append it to the version. - if (!sdkBuildNumber.isNullOrBlank()) { - "$sdkVersionNumber-$sdkBuildNumber" - } else { - sdkVersionNumber - } - } + if (sdkVersionNumber.isNotBlank() && sdkVersionNumber != "0.0.0") { + // Use centralized version provider + val dependencyVersion = VersionProvider.artifactVersionProvider(target).get() api("com.esri:arcgis-maps-kotlin:$dependencyVersion") } else { // Use libs.versions.toml if no gradle property is provided - for `main` branch. diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt index 1024d5b92..eaaaf19b1 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt @@ -18,7 +18,7 @@ package com.esri.arcgismaps.kotlin.build_logic.convention -import com.esri.arcgismaps.kotlin.build_logic.registry.ToolkitRegistry +import com.esri.arcgismaps.kotlin.build_logic.registry.getToolkitRegistryServiceProvider import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication @@ -45,18 +45,19 @@ object ArtifactPublisher { val artifactoryUsername: String by project val artifactoryPassword: String by project - // Use centralized version provider - val artifactVersion = VersionProvider.getArtifactVersion(project) + // Use centralized version provider, publish using internal `buildnum.txt` as source + val artifactVersionProvider = VersionProvider.artifactVersionProvider(project, true) // Built the artifact id for the given project val artifactoryArtifactId = "$artifactoryArtifactBaseId-${project.name}" project.pluginManager.apply(MavenPublishPlugin::class.java) project.afterEvaluate { // Check if this module is releasable - val isReleasable = ToolkitRegistry.isModuleReleasable(project).get() - if (!isReleasable) { return@afterEvaluate } + val registryService = getToolkitRegistryServiceProvider(this).get() + val isReleasable = registryService.isModuleReleasable(this).get() + if (!isReleasable) return@afterEvaluate - project.extensions.configure { + extensions.configure { repositories { maven { url = URI.create(artifactoryUrl) @@ -67,19 +68,19 @@ object ArtifactPublisher { } } publications { - create(project.name, MavenPublication::class.java) { + create(name, MavenPublication::class.java) { groupId = artifactoryGroupId artifactId = artifactoryArtifactId - version = artifactVersion.get() + version = artifactVersionProvider.get() - from(project.components.getByName("release")) + from(components.getByName("release")) } } } - project.tasks.findByName("publish${project.name.replaceFirstChar { it.uppercase() }}PublicationToMavenRepository") + tasks.findByName("publish${name.replaceFirstChar { it.uppercase() }}PublicationToMavenRepository") ?.dependsOn("assembleRelease") - project.tasks.findByName("publishToMavenLocal")?.dependsOn("assembleRelease") + tasks.findByName("publishToMavenLocal")?.dependsOn("assembleRelease") } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt index f80fad946..d82da08c8 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt @@ -4,7 +4,6 @@ import com.android.build.api.dsl.CommonExtension import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.JavaVersion import org.gradle.api.Project -import org.gradle.kotlin.dsl.provideDelegate import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -38,10 +37,6 @@ private fun Project.configureKotlin() { tasks.withType().configureEach { compilerOptions { jvmTarget.set(JvmTarget.JVM_17) - // Treat all Kotlin warnings as errors (disabled by default) - // Override by setting warningsAsErrors=true in your ~/.gradle/gradle.properties - val warningsAsErrors: String? by project - allWarningsAsErrors.set(warningsAsErrors.toBoolean()) } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt index 4c3eed092..264964c17 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt @@ -1,12 +1,14 @@ package com.esri.arcgismaps.kotlin.build_logic.convention +import com.esri.arcgismaps.kotlin.build_logic.extensions.getExtraProperty import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import org.gradle.api.Project import org.gradle.api.provider.Provider +import org.gradle.internal.cc.base.logger /** * Centralized version provider that implements the toolkit's versioning strategy. - * This provider ensures consistent versioning across BOM, KDoc, and artifact publication. + * This provider ensures consistent versioning across Kotlin ArcGISMapsSDK, BOM, KDoc, and artifact publication. */ object VersionProvider { @@ -15,8 +17,8 @@ object VersionProvider { */ data class VersionConfig( val version: String, - val isFinalBuild: Boolean, - val buildNumber: String? + val buildNumber: String?, + val isFinalBuild: Boolean ) { /** * Returns the full version string for artifact publication @@ -29,93 +31,74 @@ object VersionProvider { } } - /** - * Provides a version configuration provider for the given project. - * - * @param project The project to resolve version configuration for - * @return Provider that resolves version configuration when needed - */ - fun getVersionConfig(project: Project): Provider { - return project.providers.provider { - resolveVersionConfig(project) + private fun resolveVersionNumber( + rootProject: Project, + isInternal: Boolean + ): String { + if (isInternal) { + rootProject.getExtraProperty("versionNumberInternal") + ?.takeIf { it.toString().isNotBlank() } + ?.let { return it.toString() } } + rootProject.getExtraProperty("sdkVersionNumber") + ?.takeIf { it.toString().isNotBlank() } + ?.let { return it.toString() } + // Fallback to version catalog + return rootProject.libs.findVersion("arcgisMapsKotlinVersion").get().toString() } - /** - * Provides the artifact version string for the given project. - * This is a convenience method for simple version string access. - * - * @param project The project to resolve version for - * @return Provider that resolves to the artifact version string - */ - fun getArtifactVersion(project: Project): Provider { - return getVersionConfig(project).map { it.artifactVersion } + private fun resolveBuildNumber(rootProject: Project, isInternal: Boolean): String? { + if (isInternal) { + rootProject.getExtraProperty("buildNumberInternal") + ?.takeIf { it.toString().isNotBlank() } + ?.let { return it.toString() } + } + rootProject.getExtraProperty("sdkBuildNumber") + ?.takeIf { it.toString().isNotBlank() } + ?.let { return it.toString() } + return null } - private fun resolveVersionConfig(project: Project): VersionConfig { + private fun createVersionConfig( + rootProject: Project, + isInternal: Boolean + ): VersionConfig { // Check if this is a final build - val finalBuild = project.rootProject.providers + val finalBuild = rootProject.providers .gradleProperty("finalBuild") .orNull?.toBoolean() ?: false - // Version resolution priority - val versionNumber = resolveVersionNumber(project) - val buildNumber = resolveBuildNumber(project) + // Version resolution + val versionNumber = resolveVersionNumber(rootProject, isInternal) + val buildNumber = if (!finalBuild) resolveBuildNumber(rootProject, isInternal) else null return VersionConfig( version = versionNumber, - isFinalBuild = finalBuild, - buildNumber = buildNumber + buildNumber = buildNumber, + isFinalBuild = finalBuild ) } - private fun resolveVersionNumber(project: Project): String { - // 1. Command line properties (highest priority) - project.rootProject.providers.gradleProperty("versionNumber").orNull?.let { return it } - project.rootProject.providers.gradleProperty("sdkVersionNumber").orNull?.let { return it } - - // 2. Root project extra properties (includes local.properties values and buildnum.txt) - val extraSdkVersion = project.rootProject.extensions.extraProperties.get("sdkVersionNumber") as? String - if (extraSdkVersion != null) { - return extraSdkVersion - } - - val extraVersion = project.rootProject.extensions.extraProperties.get("versionNumber") as? String - if (extraVersion != null && extraVersion != "0.0.0") { - return extraVersion + /** + * Provides a version configuration provider for the given project. + */ + private fun versionConfigProvider( + rootProject: Project, + isInternal: Boolean = false + ): Provider { + return rootProject.providers.provider { + createVersionConfig(rootProject, isInternal) } - - // 3. Fallback to libs.versions.toml - return project.libs.findVersion("arcgisMapsKotlinVersion").get().toString() } - private fun resolveBuildNumber(project: Project): String? { - // Don't use build number for final builds - val finalBuild = project.rootProject.providers - .gradleProperty("finalBuild") - .orNull?.toBoolean() ?: false - - if (finalBuild) return null - - // 1. Command line properties (highest priority) - project.rootProject.providers.gradleProperty("buildNumber").orNull?.let { - return it.ifBlank { null } - } - project.rootProject.providers.gradleProperty("sdkBuildNumber").orNull?.let { - return it.ifBlank { null } - } - - // 2. Root project extra properties (includes local.properties values and buildnum.txt) - val extraSdkBuildNumber = project.rootProject.extensions.extraProperties.get("sdkBuildNumber") as? String - if (extraSdkBuildNumber != null && extraSdkBuildNumber.isNotBlank()) { - return extraSdkBuildNumber - } - - val extraBuildNumber = project.rootProject.extensions.extraProperties.get("buildNumber") as? String - if (extraBuildNumber != null && extraBuildNumber != "SNAPSHOT" && extraBuildNumber.isNotBlank()) { - return extraBuildNumber - } - - return null + /** + * Provides the artifact version string for the root project. + * This is a convenience method for simple version string access. + */ + fun artifactVersionProvider( + project: Project, + isInternal: Boolean = false + ): Provider { + return versionConfigProvider(project.rootProject, isInternal).map { it.artifactVersion } } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt index 8e933d76e..17363b294 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt @@ -22,6 +22,10 @@ fun DependencyHandler.androidTestImplementation(dependencyNotation: Any): Depend fun DependencyHandler.debugImplementation(dependencyNotation: Any): Dependency? = add("debugImplementation", dependencyNotation) +fun Project.getExtraProperty(name: String): Any? { + return this.extensions.extraProperties.get(name) +} + val Project.libs get(): VersionCatalog = extensions .getByType() diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt index 996337479..851de06dd 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt @@ -4,9 +4,7 @@ import org.gradle.api.model.ObjectFactory import org.gradle.api.provider.Property import javax.inject.Inject - abstract class ToolkitModuleExtension @Inject constructor(objects: ObjectFactory) { - /** Can/should this module be published as an artifact? */ val releasable: Property = objects.property(Boolean::class.java) @@ -14,4 +12,7 @@ abstract class ToolkitModuleExtension @Inject constructor(objects: ObjectFactory releasable.convention(true) } + companion object { + const val NAME = "toolkit" + } } diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistry.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistry.kt deleted file mode 100644 index f8e4a79ab..000000000 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistry.kt +++ /dev/null @@ -1,106 +0,0 @@ -/* - * - * Copyright 2023 Esri - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package com.esri.arcgismaps.kotlin.build_logic.registry - -import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitModuleExtension -import org.gradle.api.Project -import org.gradle.api.provider.Provider - -/** - * Dynamic registry that discovers toolkit modules at runtime by scanning all projects - * for the toolkit convention plugin and their releasable configuration. - */ -object ToolkitRegistry { - - /** - * Configuration for a discovered toolkit module - */ - data class ModuleConfig( - val project: Project, - val name: String, - val releasable: Boolean - ) { - - /** - * Returns the source root path for documentation - */ - val sourceRoot: String get() = "toolkit/$name/src/main/java" - } - - /** - * Discovers all projects that apply the toolkit convention plugin and builds - * a provider that resolves their configuration when needed. - */ - fun discoverToolkitModules(rootProject: Project): Provider> { - return rootProject.providers.provider { - val toolkitModules = mutableListOf() - // Scan all subprojects for toolkit plugin - rootProject.allprojects.forEach { project -> - if (project.plugins.hasPlugin("arcgismaps.kotlin.toolkit")) { - project.extensions.findByType(ToolkitModuleExtension::class.java) - ?.let { toolkitModuleExt -> - toolkitModules.add( - ModuleConfig( - project = project, - name = project.name, - releasable = toolkitModuleExt.releasable.getOrElse(true) - ) - ) - } - } - } - toolkitModules.sortedBy { it.name } - } - } - - /** - * Gets only releasable toolkit modules - */ - fun getReleasableModules(rootProject: Project): Provider> { - return discoverToolkitModules(rootProject).map { modules -> - modules.filter { it.releasable } - } - } - - /** - * Checks if a specific module is releasable - */ - fun isModuleReleasable(toolkitModule: Project): Provider { - return discoverToolkitModules(toolkitModule.rootProject).map { modules -> - modules.find { it.name == toolkitModule.name }?.releasable ?: false - } - } - - /** - * Creates artifact dependencies configuration for BOM - */ - fun createBomDependencies( - rootProject: Project, - artifactoryGroupId: String, - artifactoryArtifactBaseId: String, - artifactVersion: String - ): Provider> { - return getReleasableModules(rootProject).map { modules -> - modules.map { moduleConfig -> - val moduleArtifactId = "$artifactoryArtifactBaseId-${moduleConfig.name}" - "$artifactoryGroupId:$moduleArtifactId:$artifactVersion" - } - } - } -} \ No newline at end of file diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistryService.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistryService.kt new file mode 100644 index 000000000..3bb5c7285 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistryService.kt @@ -0,0 +1,53 @@ +package com.esri.arcgismaps.kotlin.build_logic.registry + +import org.gradle.api.Project +import org.gradle.api.provider.ListProperty +import org.gradle.api.provider.Provider +import org.gradle.api.services.BuildService +import org.gradle.api.services.BuildServiceParameters +import org.gradle.api.services.BuildServiceRegistry + +/** + * A shared Gradle BuildService to act as a central registry for toolkit modules. + */ +abstract class ToolkitRegistryService : BuildService { + // A ListProperty to hold the configurations as they are registered. + abstract val toolkitModules: ListProperty + + fun isModuleReleasable(toolkitModule: Project): Provider { + return toolkitModules.map { modules -> + modules.find { it.name == toolkitModule.name }?.releasable ?: false + } + } + + companion object { + const val NAME = "toolkitRegistry" + } +} + +/** + * Configuration for a toolkit module. + */ +data class ModuleConfig( + val path: String, + val name: String, + val releasable: Boolean +) { + /** + * Returns the source root path for documentation. + */ + fun getSourceRoot(rootProject: Project): String = + rootProject.project(path).projectDir.resolve("src/main/java").path +} + +/** + * + * Obtain a provider for the shared build service. [BuildServiceRegistry.registerIfAbsent] ensures + * only one instance of the service is created for the entire build. + */ +fun getToolkitRegistryServiceProvider(target: Project): Provider { + return target.gradle.sharedServices.registerIfAbsent( + /* name = */ ToolkitRegistryService.NAME, + /* implementationType = */ ToolkitRegistryService::class.java + ) +} diff --git a/build.gradle.kts b/build.gradle.kts index 660a6f6e0..e021f4bca 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -40,20 +40,23 @@ buildscript { } // Find these in properties passed through command line or read from local.properties and // set them as project properties - val artifactoryUrl: String? = project.findProperty("artifactoryUrl") as String? + val artifactoryUrl = providers.gradleProperty("artifactoryUrl").orNull ?: localProperties.getProperty("artifactoryUrl") ?: "https://esri.jfrog.io/artifactory/arcgis" - val artifactoryUsername: String? = project.findProperty("artifactoryUsername") as String? + val artifactoryUsername = providers.gradleProperty("artifactoryUsername").orNull ?: localProperties.getProperty("artifactoryUsername") ?: "" - val artifactoryPassword: String? = project.findProperty("artifactoryPassword") as String? + val artifactoryPassword = providers.gradleProperty("artifactoryPassword").orNull ?: localProperties.getProperty("artifactoryPassword") ?: "" - val sdkVersionNumber = project.findProperty("sdkVersionNumber") as String? + val sdkVersionNumber = providers.gradleProperty("versionNumber").orNull ?: localProperties.getProperty("sdkVersionNumber") - val sdkBuildNumber = project.findProperty("sdkBuildNumber") as String? + ?: libs.versions.arcgisMapsKotlinVersion.get() + + val sdkBuildNumber = providers.gradleProperty("buildNumber").orNull ?: localProperties.getProperty("sdkBuildNumber") + ?: "" project.extra.set("artifactoryUrl", artifactoryUrl) project.extra.set("artifactoryUsername", artifactoryUsername) @@ -66,7 +69,7 @@ buildscript { if (finalBuild) { check(project.hasProperty("versionNumber")) - project.logger.warn("release candidate build requested version ${project.properties["versionNumber"]}") + project.logger.info("release candidate build requested version ${project.properties["versionNumber"]}") } else if (!project.hasProperty("versionNumber") && !project.hasProperty("buildNum")) { // both version number and build number must be set java.util.Properties().run { @@ -77,20 +80,23 @@ buildscript { load(it) } this["BUILDVER"]?.let { - project.extra.set("versionNumber", it) + project.extra.set("versionNumberInternal", it) } this["BUILDNUM"]?.let { - project.extra.set("buildNumber", it) + project.extra.set("buildNumberInternal", it) } - check(project.hasProperty("versionNumber")) - check(project.hasProperty("buildNumber")) - project.logger.warn("version and build number set from buildnum.txt to ${project.properties["versionNumber"]}-${project.properties["buildNumber"]}") - } catch (t: Throwable) { + check(project.hasProperty("versionNumberInternal")) + check(project.hasProperty("buildNumberInternal")) + project.logger.warn("version and build number set from buildnum.txt to ${project.properties["versionNumberInternal"]}-${project.properties["buildNumberInternal"]}") + } catch (_: Throwable) { // The buildnum file is not there. ignore it and log a warning. project.logger.warn("the buildnum.txt file is missing or not readable") - project.extra.set("versionNumber", "0.0.0") - project.extra.set("buildNumber", "SNAPSHOT") + project.extra.set("versionNumberInternal", "0.0.0") + project.extra.set("buildNumberInternal", "SNAPSHOT") } } } } + +// Path to the centralized folder in root directory where test reports for connected tests end up +project.extra.set("connectedTestReportsPath", "${rootDir}/connectedTestReports") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4069ed0d3..61552bfa8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -76,7 +76,6 @@ play-services-location = { group = "com.google.android.gms", name = "play-servic ### Kotlin libs kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" } -kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesTest" } kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" } ### Compose libs @@ -103,7 +102,6 @@ androidx-test-ext = { group = "androidx.test.ext", name = "junit-ktx", version.r androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "androidXTestRules" } androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidXTestRunner" } androidx-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "uiautomator" } -junit = { group = "junit", name = "junit", version.ref = "junit" } mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockkAndroid" } truth = { group = "com.google.truth", name = "truth", version.ref = "truth" } @@ -122,11 +120,12 @@ room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = room-ext = { group = "androidx.room", name = "room-ktx", version.ref = "room" } room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" } -# Dependencies of the included build-logic +# Gradle Dependencies of the included build-logic android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" } kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } ksp-gradlePlugin = { group = "com.google.devtools.ksp", name = "com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" } android-tools-common = { group = "com.android.tools", name = "common", version.ref = "androidTools" } +secrets-gradlePlugin = { group = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", name = "secrets-gradle-plugin", version.ref = "gradleSecrets" } [plugins] android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } @@ -190,12 +189,6 @@ debug = [ "androidx-compose-ui-test-manifest" ] -unitTest = [ - "junit", - "kotlinx-coroutines-test", - "truth" -] - androidXTest = [ "androidx-test-runner", "androidx-test-rules" diff --git a/microapps/SceneViewCalloutApp/app/build.gradle.kts b/microapps/SceneViewCalloutApp/app/build.gradle.kts deleted file mode 100644 index 0bbcf0e1d..000000000 --- a/microapps/SceneViewCalloutApp/app/build.gradle.kts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Copyright 2024 Esri - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -plugins { - alias(libs.plugins.arcgismaps.kotlin.microapp) -} - -android { - namespace = "com.arcgismaps.toolkit.sceneviewcalloutapp" - - defaultConfig { - applicationId = "com.arcgismaps.toolkit.sceneviewcalloutapp" - } -} - -dependencies { - // Module-specific dependencies go here - implementation(project(":geoview-compose")) -} diff --git a/secrets.defaults.properties b/secrets.defaults.properties index 3d47f693b..96a0e1ac7 100644 --- a/secrets.defaults.properties +++ b/secrets.defaults.properties @@ -21,6 +21,7 @@ # This file is tracked by git; `local.properties` is not. # To obtain a new API key access token, visit: https://links.esri.com/create-an-api-key. API_KEY=XX +clientId=" " webMapUser=XX webMapPassword=XX traceToolUser=x diff --git a/settings.gradle.kts b/settings.gradle.kts index 3e6aea3c3..e12d4ac41 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -77,6 +77,10 @@ dependencyResolutionManagement { } } +// fixes https://devtopia.esri.com/runtime/kotlin/issues/3863#issuecomment-4715101 +// fixes https://issuetracker.google.com/issues/315023802 +// gradle.startParameter.excludedTaskNames.addAll(listOf(":buildSrc:testClasses")) + // This enables the "Type Safe Project Accessors" feature enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") diff --git a/toolkit/authentication/build.gradle.kts b/toolkit/authentication/build.gradle.kts index 7fec8aff7..0b697cb0b 100644 --- a/toolkit/authentication/build.gradle.kts +++ b/toolkit/authentication/build.gradle.kts @@ -45,8 +45,6 @@ apiValidation { dependencies { // Module-specific dependencies go here implementation(libs.androidx.browser) - implementation(libs.androidx.material.icons) - // uiautomator androidTestImplementation(libs.androidx.uiautomator) androidTestImplementation(libs.mockk.android) } diff --git a/toolkit/composable-map/build.gradle.kts b/toolkit/composable-map/build.gradle.kts deleted file mode 100644 index 5e60f2cd2..000000000 --- a/toolkit/composable-map/build.gradle.kts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * Copyright 2023 Esri - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -logger.warn("WARNING: The module composable-map is deprecated. Please use the module geoview-compose instead.") - -plugins { - alias(libs.plugins.arcgismaps.kotlin.toolkit) -} - -android { - namespace = "com.arcgismaps.toolkit.composablemap" -} - -toolkit { - releasable = false -} - -dependencies { - // Module-specific dependencies go here -} diff --git a/toolkit/popup/build.gradle.kts b/toolkit/popup/build.gradle.kts index dd3fdecd0..8673ec367 100644 --- a/toolkit/popup/build.gradle.kts +++ b/toolkit/popup/build.gradle.kts @@ -18,7 +18,6 @@ plugins { alias(libs.plugins.arcgismaps.kotlin.toolkit) - alias(libs.plugins.kotlin.serialization) apply true } kotlin { @@ -55,19 +54,8 @@ dependencies { // Module-specific dependencies go here implementation(platform(libs.coil.bom)) implementation(libs.coil.compose) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) - implementation(libs.bundles.core) - implementation(libs.androidx.activity.compose) implementation(libs.androidx.compose.navigation) - implementation(libs.kotlinx.serialization.json) - implementation(libs.androidx.material.icons) - implementation(libs.androidx.compose.navigation) - implementation(libs.kotlinx.serialization.json) implementation(libs.androidx.media3.exoplayer) implementation(libs.androidx.media3.exoplayer.dash) implementation(libs.androidx.media3.ui) - testImplementation(libs.bundles.unitTest) - androidTestImplementation(libs.bundles.composeTest) - debugImplementation(libs.bundles.debug) } From edb7cc78073cc73a21a800c3ba0b9e62acf17635 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Mon, 29 Sep 2025 10:02:42 -0700 Subject: [PATCH 14/16] use expected gradle properties --- .../convention/ArcGISMapsKotlinSDKDependency.kt | 2 +- .../build_logic/convention/VersionProvider.kt | 4 ++-- build.gradle.kts | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt index a48915c41..fbaf8a4f4 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt @@ -20,7 +20,7 @@ object ArcGISMapsKotlinSDKDependency { */ fun configureArcGISMapsDependencies(target: Project) { target.dependencies { - val sdkVersionNumber = target.rootProject.properties["versionNumberInternal"].toString() + val sdkVersionNumber = target.rootProject.properties["versionNumber"].toString() // ArcGIS Maps SDK dependency with build override support if (sdkVersionNumber.isNotBlank() && sdkVersionNumber != "0.0.0") { // Use centralized version provider diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt index 264964c17..5cbfba8ab 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt @@ -36,7 +36,7 @@ object VersionProvider { isInternal: Boolean ): String { if (isInternal) { - rootProject.getExtraProperty("versionNumberInternal") + rootProject.getExtraProperty("versionNumber") ?.takeIf { it.toString().isNotBlank() } ?.let { return it.toString() } } @@ -49,7 +49,7 @@ object VersionProvider { private fun resolveBuildNumber(rootProject: Project, isInternal: Boolean): String? { if (isInternal) { - rootProject.getExtraProperty("buildNumberInternal") + rootProject.getExtraProperty("buildNumber") ?.takeIf { it.toString().isNotBlank() } ?.let { return it.toString() } } diff --git a/build.gradle.kts b/build.gradle.kts index e021f4bca..4141e0509 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -80,19 +80,19 @@ buildscript { load(it) } this["BUILDVER"]?.let { - project.extra.set("versionNumberInternal", it) + project.extra.set("versionNumber", it) } this["BUILDNUM"]?.let { - project.extra.set("buildNumberInternal", it) + project.extra.set("buildNumber", it) } - check(project.hasProperty("versionNumberInternal")) - check(project.hasProperty("buildNumberInternal")) - project.logger.warn("version and build number set from buildnum.txt to ${project.properties["versionNumberInternal"]}-${project.properties["buildNumberInternal"]}") + check(project.hasProperty("versionNumber")) + check(project.hasProperty("buildNumber")) + project.logger.warn("version and build number set from buildnum.txt to ${project.properties["versionNumber"]}-${project.properties["buildNumber"]}") } catch (_: Throwable) { // The buildnum file is not there. ignore it and log a warning. project.logger.warn("the buildnum.txt file is missing or not readable") - project.extra.set("versionNumberInternal", "0.0.0") - project.extra.set("buildNumberInternal", "SNAPSHOT") + project.extra.set("versionNumber", "0.0.0") + project.extra.set("buildNumber", "SNAPSHOT") } } } From 04cacf5fafdcc521482dc56546a88b8e8f10c9dc Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Tue, 30 Sep 2025 08:26:54 -0700 Subject: [PATCH 15/16] add copyrights --- ...droidApplicationComposeConventionPlugin.kt | 18 ++++++++++++++ .../AndroidApplicationConventionPlugin.kt | 18 ++++++++++++++ .../AndroidLibraryComposeConventionPlugin.kt | 18 ++++++++++++++ .../java/AndroidLibraryConventionPlugin.kt | 18 ++++++++++++++ .../java/ArcGISMapsBomConventionPlugin.kt | 22 +++++++++++++++-- .../java/ArcGISMapsKdocConventionPlugin.kt | 24 ++++++++++++++++--- ...rcGISMapsKotlinMicroappConventionPlugin.kt | 18 ++++++++++++++ .../ArcGISMapsKotlinSDKConventionPlugin.kt | 18 ++++++++++++++ ...ArcGISMapsKotlinToolkitConventionPlugin.kt | 22 +++++++++++++++-- .../java/ArcGISMapsRootConventionPlugin.kt | 18 ++++++++++++++ .../build_logic/convention/AndroidCompose.kt | 18 ++++++++++++++ .../ArcGISMapsKotlinSDKDependency.kt | 18 ++++++++++++++ .../convention/ArtifactPublisher.kt | 6 ++--- .../build_logic/convention/KotlinAndroid.kt | 18 ++++++++++++++ .../build_logic/convention/VersionProvider.kt | 18 ++++++++++++++ .../extensions/ProjectExtensions.kt | 18 ++++++++++++++ .../extensions/ToolkitModuleExtension.kt | 18 ++++++++++++++ .../registry/ToolkitRegistryService.kt | 22 +++++++++++++++-- 18 files changed, 318 insertions(+), 12 deletions(-) diff --git a/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt index ef6e46266..440bf6c9e 100644 --- a/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.android.build.api.dsl.ApplicationExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid diff --git a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt index 5ca6e7058..45c22e74e 100644 --- a/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.android.build.api.dsl.ApplicationExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid import com.esri.arcgismaps.kotlin.build_logic.extensions.libs diff --git a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt index 49d9c4568..f9875ff13 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.android.build.api.dsl.LibraryExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureAndroidCompose import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid diff --git a/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt index 44514aec1..b5852edd2 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.android.build.gradle.LibraryExtension import com.esri.arcgismaps.kotlin.build_logic.convention.configureKotlinAndroid import com.esri.arcgismaps.kotlin.build_logic.extensions.libs diff --git a/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt index d54dcddc2..73de9f94e 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt @@ -1,5 +1,23 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.esri.arcgismaps.kotlin.build_logic.convention.VersionProvider -import com.esri.arcgismaps.kotlin.build_logic.registry.getToolkitRegistryServiceProvider +import com.esri.arcgismaps.kotlin.build_logic.registry.toolkitRegistryServiceProvider import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension @@ -56,7 +74,7 @@ class ArcGISMapsBomConventionPlugin : Plugin { } // Get the toolkit registry provider - val registryServiceProvider = getToolkitRegistryServiceProvider(this) + val registryServiceProvider = toolkitRegistryServiceProvider(this) // Lazily get releasable modules from the service provider val releasableModulesProvider = registryServiceProvider.map { service -> service.toolkitModules.get().filter { it.releasable } diff --git a/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt index fca370429..126ffa106 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt @@ -1,7 +1,25 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.esri.arcgismaps.kotlin.build_logic.convention.VersionProvider import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation import com.esri.arcgismaps.kotlin.build_logic.extensions.libs -import com.esri.arcgismaps.kotlin.build_logic.registry.getToolkitRegistryServiceProvider +import com.esri.arcgismaps.kotlin.build_logic.registry.toolkitRegistryServiceProvider import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure @@ -39,14 +57,14 @@ class ArcGISMapsKdocConventionPlugin : Plugin { dokkaSourceSets.named("main") { // Get the toolkit registry provider - val registryServiceProvider = getToolkitRegistryServiceProvider(target) + val registryServiceProvider = toolkitRegistryServiceProvider(target) // Lazily get releasable modules from the service provider val releasableModulesProvider = registryServiceProvider.map { service -> service.toolkitModules.get().filter { it.releasable } } // Build the provider for source roots of all releasable modules val sourceRootFilesProvider = releasableModulesProvider.map { configs -> - configs.map { config -> rootProject.file(config.getSourceRoot(rootProject)) } + configs.map { config -> rootProject.file(config.sourceRoot(rootProject)) } } // Add the source roots using a provider string list sourceRoots.from(sourceRootFilesProvider) diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt index 8403f897b..9a4639342 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.google.android.libraries.mapsplatform.secrets_gradle_plugin.SecretsPluginExtension import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency import com.esri.arcgismaps.kotlin.build_logic.extensions.implementation diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt index 953931809..eb8d51d47 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency import org.gradle.api.Plugin import org.gradle.api.Project diff --git a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt index 18c63b287..5862c855a 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -1,10 +1,28 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.android.build.api.dsl.LibraryExtension import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency import com.esri.arcgismaps.kotlin.build_logic.convention.ArtifactPublisher import com.esri.arcgismaps.kotlin.build_logic.extensions.ToolkitModuleExtension import com.esri.arcgismaps.kotlin.build_logic.extensions.libs import com.esri.arcgismaps.kotlin.build_logic.registry.ModuleConfig -import com.esri.arcgismaps.kotlin.build_logic.registry.getToolkitRegistryServiceProvider +import com.esri.arcgismaps.kotlin.build_logic.registry.toolkitRegistryServiceProvider import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure @@ -27,7 +45,7 @@ class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { apply(libs.findPlugin("binary-compatibility-validator").get().get().pluginId) } // Push this module's configuration to the central registry service. - val registryServiceProvider = getToolkitRegistryServiceProvider(this) + val registryServiceProvider = toolkitRegistryServiceProvider(this) afterEvaluate { registryServiceProvider.get().toolkitModules.add( provider { diff --git a/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt index bf2f75fc7..37fa3c743 100644 --- a/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt +++ b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + import com.esri.arcgismaps.kotlin.build_logic.registry.ToolkitRegistryService import org.gradle.api.Plugin import org.gradle.api.Project as GradleProject diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt index ccef560eb..80e970990 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.esri.arcgismaps.kotlin.build_logic.convention import com.android.build.api.dsl.CommonExtension diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt index fbaf8a4f4..7e3f4c282 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.esri.arcgismaps.kotlin.build_logic.convention import com.esri.arcgismaps.kotlin.build_logic.extensions.api diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt index eaaaf19b1..73446aa58 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt @@ -1,6 +1,6 @@ /* * - * Copyright 2023 Esri + * Copyright 2025 Esri * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ package com.esri.arcgismaps.kotlin.build_logic.convention -import com.esri.arcgismaps.kotlin.build_logic.registry.getToolkitRegistryServiceProvider +import com.esri.arcgismaps.kotlin.build_logic.registry.toolkitRegistryServiceProvider import org.gradle.api.Project import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication @@ -53,7 +53,7 @@ object ArtifactPublisher { project.pluginManager.apply(MavenPublishPlugin::class.java) project.afterEvaluate { // Check if this module is releasable - val registryService = getToolkitRegistryServiceProvider(this).get() + val registryService = toolkitRegistryServiceProvider(this).get() val isReleasable = registryService.isModuleReleasable(this).get() if (!isReleasable) return@afterEvaluate diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt index d82da08c8..bb4c83eec 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.esri.arcgismaps.kotlin.build_logic.convention import com.android.build.api.dsl.CommonExtension diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt index 5cbfba8ab..0a904d918 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.esri.arcgismaps.kotlin.build_logic.convention import com.esri.arcgismaps.kotlin.build_logic.extensions.getExtraProperty diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt index 17363b294..619ae5db4 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.esri.arcgismaps.kotlin.build_logic.extensions import org.gradle.api.Project diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt index 851de06dd..b9576b4bf 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.esri.arcgismaps.kotlin.build_logic.extensions import org.gradle.api.model.ObjectFactory diff --git a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistryService.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistryService.kt index 3bb5c7285..8f9860f5e 100644 --- a/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistryService.kt +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistryService.kt @@ -1,3 +1,21 @@ +/* + * + * Copyright 2025 Esri + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + package com.esri.arcgismaps.kotlin.build_logic.registry import org.gradle.api.Project @@ -36,7 +54,7 @@ data class ModuleConfig( /** * Returns the source root path for documentation. */ - fun getSourceRoot(rootProject: Project): String = + fun sourceRoot(rootProject: Project): String = rootProject.project(path).projectDir.resolve("src/main/java").path } @@ -45,7 +63,7 @@ data class ModuleConfig( * Obtain a provider for the shared build service. [BuildServiceRegistry.registerIfAbsent] ensures * only one instance of the service is created for the entire build. */ -fun getToolkitRegistryServiceProvider(target: Project): Provider { +fun toolkitRegistryServiceProvider(target: Project): Provider { return target.gradle.sharedServices.registerIfAbsent( /* name = */ ToolkitRegistryService.NAME, /* implementationType = */ ToolkitRegistryService::class.java From 6879a2c7a0d9f44ae424fabf79bc018884bff451 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Fri, 3 Oct 2025 15:39:00 -0700 Subject: [PATCH 16/16] Supply mockingjay for lib androidTestImplementation --- .../java/AndroidLibraryComposeConventionPlugin.kt | 1 + build.gradle.kts | 1 + gradle/libs.versions.toml | 2 ++ toolkit/featureforms/build.gradle.kts | 14 ++++++++++++++ 4 files changed, 18 insertions(+) diff --git a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt index f9875ff13..e773def90 100644 --- a/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt +++ b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt @@ -51,6 +51,7 @@ class AndroidLibraryComposeConventionPlugin : Plugin { implementation(libs.findLibrary("androidx-activity-compose").get()) implementation(libs.findLibrary("androidx-material-icons").get()) implementation(libs.findLibrary("kotlinx-serialization-json").get()) + androidTestImplementation(libs.findLibrary("mockingjay").get()) androidTestImplementation(libs.findBundle("composeTest").get()) androidTestImplementation(libs.findBundle("androidXTest").get()) debugImplementation(libs.findBundle("debug").get()) diff --git a/build.gradle.kts b/build.gradle.kts index 4141e0509..9ec2b1c24 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -63,6 +63,7 @@ buildscript { project.extra.set("artifactoryPassword", artifactoryPassword) project.extra.set("sdkVersionNumber", sdkVersionNumber) project.extra.set("sdkBuildNumber", sdkBuildNumber) + project.extra.set("toolkitTestDir", projectDir.absolutePath.removeSuffix("arcgis-maps-sdk-kotlin-toolkit") + "/kotlin/toolkit-tests") val finalBuild: Boolean = (project.properties["finalBuild"] ?: "false") .run { this == "true" } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 61552bfa8..1ae395dc8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -47,6 +47,7 @@ gradleSecrets = "2.0.1" mockkAndroid = "1.14.5" truth = "1.4.4" uiautomator = "2.3.0" +mockingjay = "2.0.0" ### Third party versions coilBOM = "2.7.0" @@ -104,6 +105,7 @@ androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = androidx-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "uiautomator" } mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockkAndroid" } truth = { group = "com.google.truth", name = "truth", version.ref = "truth" } +mockingjay = { module = "com.esri:mockingjay", version.ref = "mockingjay" } ### Third party libs coil = { group = "io.coil-kt", name = "coil" } diff --git a/toolkit/featureforms/build.gradle.kts b/toolkit/featureforms/build.gradle.kts index 11ae161a6..957ea113e 100644 --- a/toolkit/featureforms/build.gradle.kts +++ b/toolkit/featureforms/build.gradle.kts @@ -44,6 +44,20 @@ android { disable += "MissingTranslation" disable += "MissingQuantity" } + + val toolkitTests = project.findProperty("toolkitTestDir") as String + sourceSets.getByName("androidTest") { + var file = file("$toolkitTests/${project.name}/androidTest") + if (file.exists()) { + java.setSrcDirs(java.srcDirs.plus(file)) + } + } + sourceSets.getByName("test") { + var file = file("$toolkitTests/${project.name}/test") + if (file.exists()) { + java.setSrcDirs(java.srcDirs.plus(file)) + } + } } apiValidation {