diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index 941902952..6e850fadc 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -17,79 +17,5 @@ */ plugins { - id("maven-publish") - id("java-platform") + alias(libs.plugins.arcgismaps.kotlin.bom.convention) } - -// 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 - } - } - } - } -} - - 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..9a711b955 --- /dev/null +++ b/build-logic/convention/build.gradle.kts @@ -0,0 +1,81 @@ +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(gradleApi()) + compileOnly(libs.android.gradlePlugin) + compileOnly(libs.android.tools.common) + compileOnly(libs.kotlin.gradlePlugin) + compileOnly(libs.ksp.gradlePlugin) + compileOnly(libs.secrets.gradlePlugin) + implementation(libs.dokka.gradle.plugin) +} + +tasks { + validatePlugins { + enableStricterValidation = true + failOnWarning = true + } +} + +gradlePlugin { + plugins { + register("androidApplicationCompose") { + 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" + } + register("arcGISMapsKotlinSDK") { + id = "arcgismaps.kotlin.sdk" + implementationClass = "ArcGISMapsKotlinSDKConventionPlugin" + } + register("arcGISMapsKdoc") { + id = "arcgismaps.kotlin.kdoc.convention" + implementationClass = "ArcGISMapsKdocConventionPlugin" + } + 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/AndroidApplicationComposeConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt new file mode 100644 index 000000000..440bf6c9e --- /dev/null +++ b/build-logic/convention/src/main/java/AndroidApplicationComposeConventionPlugin.kt @@ -0,0 +1,53 @@ +/* + * + * 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 +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 +import org.gradle.kotlin.dsl.getByType + +class AndroidApplicationComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + 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()) + 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 new file mode 100644 index 000000000..45c22e74e --- /dev/null +++ b/build-logic/convention/src/main/java/AndroidApplicationConventionPlugin.kt @@ -0,0 +1,67 @@ +/* + * + * 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 +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.configure + +class AndroidApplicationConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + apply(libs.findPlugin("android-application").get().get().pluginId) + apply(libs.findPlugin("kotlin-android").get().get().pluginId) + } + + extensions.configure { + configureKotlinAndroid(this) + defaultConfig { + 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 { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } + } + } + } +} 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..e773def90 --- /dev/null +++ b/build-logic/convention/src/main/java/AndroidLibraryComposeConventionPlugin.kt @@ -0,0 +1,61 @@ +/* + * + * 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 +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 +import org.gradle.kotlin.dsl.getByType + +class AndroidLibraryComposeConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + with(pluginManager) { + 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()) + androidTestImplementation(libs.findLibrary("mockingjay").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/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt new file mode 100644 index 000000000..b5852edd2 --- /dev/null +++ b/build-logic/convention/src/main/java/AndroidLibraryConventionPlugin.kt @@ -0,0 +1,71 @@ +/* + * + * 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 +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 +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(libs.findPlugin("android-library").get().get().pluginId) + apply(libs.findPlugin("kotlin-android").get().get().pluginId) + } + + extensions.configure { + configureKotlinAndroid(this) + defaultConfig { + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } + minSdk = libs.findVersion("minSdk").get().toString().toInt() + lint.targetSdk = libs.findVersion("compileSdk").get().toString().toInt() + consumerProguardFiles("consumer-rules.pro") + } + + 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")) + } + } + } +} 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..73de9f94e --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsBomConventionPlugin.kt @@ -0,0 +1,101 @@ +/* + * + * 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.toolkitRegistryServiceProvider +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.provideDelegate + +class ArcGISMapsBomConventionPlugin : Plugin { + override fun apply(target: Project) = with(target) { + 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 + 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, publish using internal `buildnum.txt` as source + val artifactVersionProvider = VersionProvider.artifactVersionProvider(project, true) + val artifactoryArtifactId = "$artifactoryArtifactBaseId-${project.name}" + + /** + * 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 = artifactVersionProvider.get() + + from(components.getByName("javaPlatform")) + } + } + repositories { + maven { + url = uri(artifactoryUrl) + credentials { + username = artifactoryUsername + password = artifactoryPassword + } + } + } + } + + // Get the toolkit registry provider + val registryServiceProvider = toolkitRegistryServiceProvider(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 new file mode 100644 index 000000000..126ffa106 --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsKdocConventionPlugin.kt @@ -0,0 +1,79 @@ +/* + * + * 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.toolkitRegistryServiceProvider +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.withType +import org.jetbrains.dokka.gradle.DokkaExtension +import org.jetbrains.dokka.gradle.engine.plugins.DokkaVersioningPluginParameters + +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()) + } + + //./gradlew :kdoc:dokkaGenerate + // doc output will be under `kdoc/build/dokka/html` + extensions.configure { + pluginsConfiguration.withType().configureEach { + // Use centralized version provider + version.set(VersionProvider.artifactVersionProvider(project)) + } + + moduleName.set("arcgis-maps-kotlin-toolkit") + + dokkaSourceSets.named("main") { + // Get the toolkit registry provider + 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.sourceRoot(rootProject)) } + } + // 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 new file mode 100644 index 000000000..9a4639342 --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinMicroappConventionPlugin.kt @@ -0,0 +1,52 @@ +/* + * + * 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 +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.project + +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 the secrets-gradle-plugin using its dedicated extension. + extensions.configure { + defaultPropertiesFileName = "secrets.defaults.properties" + } + + dependencies { + // Configure the ArcGIS Maps SDK dependency + ArcGISMapsKotlinSDKDependency.configureArcGISMapsDependencies(target) + + // Local project common microapps library + implementation(project(":microapps-lib")) + } + } + } +} diff --git a/buildSrc/build.gradle.kts b/build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt similarity index 57% rename from buildSrc/build.gradle.kts rename to build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.kt index 23abc5a14..eb8d51d47 100644 --- a/buildSrc/build.gradle.kts +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinSDKConventionPlugin.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. @@ -16,24 +16,15 @@ * */ -repositories { - google() - mavenCentral() -} - -plugins { - `kotlin-dsl` - `maven-publish` -} - -version = "1.0" +import com.esri.arcgismaps.kotlin.build_logic.convention.ArcGISMapsKotlinSDKDependency +import org.gradle.api.Plugin +import org.gradle.api.Project -gradlePlugin { - plugins { - create("artifactDeploy") { - group = "internal" - id = "artifact-deploy" - implementationClass = "deploy.ArtifactPublisher" +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 new file mode 100644 index 000000000..5862c855a --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsKotlinToolkitConventionPlugin.kt @@ -0,0 +1,107 @@ +/* + * + * 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.toolkitRegistryServiceProvider +import org.gradle.api.Plugin +import org.gradle.api.Project +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 + +class ArcGISMapsKotlinToolkitConventionPlugin : Plugin { + override fun apply(target: Project) { + with(target) { + // Create extension with default releasable = true + 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) + } + // Push this module's configuration to the central registry service. + val registryServiceProvider = toolkitRegistryServiceProvider(this) + afterEvaluate { + 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 { + resources { + excludes += setOf( + "META-INF/LICENSE-notice.md", + "META-INF/LICENSE.md" + ) + } + } + + testOptions { + targetSdk = libs.findVersion("compileSdk").get().toString().toInt() + val connectedTestReportsPath: String by project + reportDir = "$connectedTestReportsPath/${name}" + } + + publishing { + singleVariant("release") { + // This is the default variant. + } + } + } + + // Explicit API configuration for toolkit modules + tasks.withType { + // Only toolkit modules, exclude tests + if ("Test" !in name) { + compilerOptions { + freeCompilerArgs.addAll( + listOf( + "-Xexplicit-api=strict", + "-Xcontext-parameters" + ) + ) + } + } + } + + dependencies { + // Configure the ArcGIS Maps SDK dependency + ArcGISMapsKotlinSDKDependency.configureArcGISMapsDependencies(target) + } + } + } +} 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..37fa3c743 --- /dev/null +++ b/build-logic/convention/src/main/java/ArcGISMapsRootConventionPlugin.kt @@ -0,0 +1,37 @@ +/* + * + * 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 + +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) { + // 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/AndroidCompose.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt new file mode 100644 index 000000000..80e970990 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/AndroidCompose.kt @@ -0,0 +1,56 @@ +/* + * + * 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 +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 + +/** + * Extension to use compose configurations and dependencies + */ +internal fun Project.configureAndroidCompose( + commonExtension: CommonExtension<*, *, *, *, *, *>, +) { + commonExtension.apply { + buildFeatures { + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = libs.findVersion("kotlin").get().toString() + } + + dependencies { + 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()) + } + } +} 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..7e3f4c282 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArcGISMapsKotlinSDKDependency.kt @@ -0,0 +1,53 @@ +/* + * + * 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 +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 + +/** + * 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. + * + * @param target The Gradle Project to which the dependency will be added. + */ + fun configureArcGISMapsDependencies(target: Project) { + target.dependencies { + 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 + 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. + api(target.libs.findLibrary("arcgis-maps-kotlin").get()) + } + } + } +} diff --git a/buildSrc/src/main/kotlin/deploy/ArtifactPublisher.kt b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt similarity index 65% rename from buildSrc/src/main/kotlin/deploy/ArtifactPublisher.kt rename to build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/ArtifactPublisher.kt index 72ce61f73..73446aa58 100644 --- a/buildSrc/src/main/kotlin/deploy/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. @@ -16,16 +16,14 @@ * */ -package deploy +package com.esri.arcgismaps.kotlin.build_logic.convention -import org.gradle.api.Plugin +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 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 import java.net.URI @@ -39,29 +37,29 @@ 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 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" - } - val artifactoryArtifactId: String = "$artifactoryArtifactBaseId-${project.name}" - + + // 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 { - project.extensions.configure { + // Check if this module is releasable + val registryService = toolkitRegistryServiceProvider(this).get() + val isReleasable = registryService.isModuleReleasable(this).get() + if (!isReleasable) return@afterEvaluate + + extensions.configure { repositories { - repositories.maven { + maven { url = URI.create(artifactoryUrl) credentials { username = artifactoryUsername @@ -70,20 +68,17 @@ class ArtifactPublisher : Plugin { } } publications { - publications.create( - project.name, - MavenPublication::class.java - ) { + create(name, MavenPublication::class.java) { groupId = artifactoryGroupId artifactId = artifactoryArtifactId - version = artifactVersion - - from(project.components["release"]) + version = artifactVersionProvider.get() + + from(components.getByName("release")) } } } - tasks.findByName("publish${project.name.replaceFirstChar { it.uppercase() }}PublicationToMavenRepository") + tasks.findByName("publish${name.replaceFirstChar { it.uppercase() }}PublicationToMavenRepository") ?.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 new file mode 100644 index 000000000..bb4c83eec --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/KotlinAndroid.kt @@ -0,0 +1,60 @@ +/* + * + * 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 +import com.esri.arcgismaps.kotlin.build_logic.extensions.libs +import org.gradle.api.JavaVersion +import org.gradle.api.Project +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("compileSdk").get().toString().toInt() + + defaultConfig { + 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) + } + } +} 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..0a904d918 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/convention/VersionProvider.kt @@ -0,0 +1,122 @@ +/* + * + * 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 +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 Kotlin ArcGISMapsSDK, BOM, KDoc, and artifact publication. + */ +object VersionProvider { + + /** + * Version configuration for toolkit artifacts + */ + data class VersionConfig( + val version: String, + val buildNumber: String?, + val isFinalBuild: Boolean + ) { + /** + * Returns the full version string for artifact publication + */ + val artifactVersion: String + get() = if (isFinalBuild || buildNumber.isNullOrBlank()) { + version + } else { + "$version-$buildNumber" + } + } + + private fun resolveVersionNumber( + rootProject: Project, + isInternal: Boolean + ): String { + if (isInternal) { + rootProject.getExtraProperty("versionNumber") + ?.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() + } + + private fun resolveBuildNumber(rootProject: Project, isInternal: Boolean): String? { + if (isInternal) { + rootProject.getExtraProperty("buildNumber") + ?.takeIf { it.toString().isNotBlank() } + ?.let { return it.toString() } + } + rootProject.getExtraProperty("sdkBuildNumber") + ?.takeIf { it.toString().isNotBlank() } + ?.let { return it.toString() } + return null + } + + private fun createVersionConfig( + rootProject: Project, + isInternal: Boolean + ): VersionConfig { + // Check if this is a final build + val finalBuild = rootProject.providers + .gradleProperty("finalBuild") + .orNull?.toBoolean() ?: false + + // Version resolution + val versionNumber = resolveVersionNumber(rootProject, isInternal) + val buildNumber = if (!finalBuild) resolveBuildNumber(rootProject, isInternal) else null + + return VersionConfig( + version = versionNumber, + buildNumber = buildNumber, + isFinalBuild = finalBuild + ) + } + + /** + * 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) + } + } + + /** + * 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 new file mode 100644 index 000000000..619ae5db4 --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ProjectExtensions.kt @@ -0,0 +1,50 @@ +/* + * + * 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 +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.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) + +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() + .named("libs") 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..b9576b4bf --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/extensions/ToolkitModuleExtension.kt @@ -0,0 +1,36 @@ +/* + * + * 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 +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) + } + + companion object { + const val NAME = "toolkit" + } +} 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..8f9860f5e --- /dev/null +++ b/build-logic/convention/src/main/java/com/esri/arcgismaps/kotlin/build_logic/registry/ToolkitRegistryService.kt @@ -0,0 +1,71 @@ +/* + * + * 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 +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 sourceRoot(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 toolkitRegistryServiceProvider(target: Project): Provider { + return target.gradle.sharedServices.registerIfAbsent( + /* name = */ ToolkitRegistryService.NAME, + /* implementationType = */ ToolkitRegistryService::class.java + ) +} diff --git a/build-logic/gradle.properties b/build-logic/gradle.properties new file mode 100644 index 000000000..c6cd2a7e2 --- /dev/null +++ b/build-logic/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.parallel=true +org.gradle.caching=true +org.gradle.configureondemand=true diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts new file mode 100644 index 000000000..875164f78 --- /dev/null +++ b/build-logic/settings.gradle.kts @@ -0,0 +1,15 @@ +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} + +rootProject.name = "build-logic" +include(":convention") diff --git a/build.gradle.kts b/build.gradle.kts index cd05d686a..9ec2b1c24 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,18 +28,10 @@ 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 } 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()) { @@ -47,19 +40,29 @@ 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 = providers.gradleProperty("versionNumber").orNull + ?: localProperties.getProperty("sdkVersionNumber") + ?: libs.versions.arcgisMapsKotlinVersion.get() + + val sdkBuildNumber = providers.gradleProperty("buildNumber").orNull + ?: 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) project.extra.set("toolkitTestDir", projectDir.absolutePath.removeSuffix("arcgis-maps-sdk-kotlin-toolkit") + "/kotlin/toolkit-tests") val finalBuild: Boolean = (project.properties["finalBuild"] ?: "false") @@ -85,8 +88,8 @@ 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"]}") - } catch (t: Throwable) { + 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("versionNumber", "0.0.0") @@ -97,39 +100,4 @@ 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. - * 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`. - */ -testAggregation { - getModulesExcept( - "bom", - "kdoc", - "template", - "microapps-lib", - ).forEach { - this.modules.include(project(":$it")) - } -} - -/** - * 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 - } - +project.extra.set("connectedTestReportsPath", "${rootDir}/connectedTestReports") diff --git a/gradle.properties b/gradle.properties index 61a6ce1cf..4b40805ce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -41,14 +41,5 @@ kotlin.code.style=official android.nonTransitiveRClass=true artifactoryGroupId=com.esri artifactoryArtifactBaseId=arcgis-maps-kotlin-toolkit - org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled - -# 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 +org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 74d9fb952..1ae395dc8 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 = "200.8.0" + +### Android versions androidGradlePlugin = "8.12.2" androidXBrowser = "1.9.0" -coilBOM = "2.7.0" -composeBOM = "2025.08.01" androidxCamera = "1.4.2" androidxCore = "1.17.0" androidxEspresso = "3.7.0" @@ -13,97 +15,144 @@ androidxTestExt = "1.3.0" androidXTestRunner = "1.7.0" androidXTestRules = "1.7.0" androidxWindow = "1.4.0" -mockingjay = "2.0.0" +androidTools = "31.9.1" workVersion = "2.10.3" -binaryCompatibilityValidator = "0.18.1" -compileSdk = "36" -compose-navigation = "2.9.3" -commonMark = "0.25.1" -dokka = "2.0.0" hilt = "2.57.1" -junit = "4.13.2" -kotlin = "2.2.10" -ksp = "2.2.10-2.0.2" +hiltExt = "1.2.0" media3Exoplayer = "1.8.0" -minSdk = "28" mlkitBarcodeScanning = "17.3.0" +arcore = "1.48.0" +playServicesLocation = "21.3.0" + +### Kotlin versions +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.08.01" +activityCompose = "1.10.1" +compose-navigation = "2.9.3" + +### Toolkit component verions +compileSdk = "36" +minSdk = "28" + +### Testing versions +junit = "4.13.2" +gradleSecrets = "2.0.1" mockkAndroid = "1.14.5" -room = "2.7.2" truth = "1.4.4" uiautomator = "2.3.0" -arcore = "1.50.0" -playServicesLocation = "21.3.0" -gmazzo = "2.4.6" -gradleSecrets = "2.0.1" +mockingjay = "2.0.0" + +### Third party versions +coilBOM = "2.7.0" +room = "2.7.2" +commonMark = "0.25.1" [libraries] -androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose"} -androidx-browser = { group = "androidx.browser", name = "browser", version.ref = "androidXBrowser"} -androidx-camera-core = { group = "androidx.camera", name = "camera-core", version.ref = "androidxCamera" } +### 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-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-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-material3 = { module = "androidx.compose.material3:material3" } androidx-compose-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "compose-navigation" } -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-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-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-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose"} -androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-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" } +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" } -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" } +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" } 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-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" } -junit = { group = "junit", name = "junit", version.ref = "junit" } -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" } -mockingjay = { module = "com.esri:mockingjay", version.ref = "mockingjay" } -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" } + +# 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" } 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" } +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" } [bundles] camerax = [ @@ -142,12 +191,6 @@ debug = [ "androidx-compose-ui-test-manifest" ] -unitTest = [ - "junit", - "kotlinx-coroutines-test", - "truth" -] - androidXTest = [ "androidx-test-runner", "androidx-test-rules" diff --git a/kdoc/build.gradle.kts b/kdoc/build.gradle.kts index 103b7c259..b6ff85306 100644 --- a/kdoc/build.gradle.kts +++ b/kdoc/build.gradle.kts @@ -17,67 +17,14 @@ */ plugins { - id("com.android.library") - id("org.jetbrains.kotlin.android") - alias(libs.plugins.dokka) apply true -} - -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 -} - -dokka { - moduleName.set("arcgis-maps-kotlin-toolkit") - moduleVersion.set(versionNumber) - dokkaSourceSets.main { - sourceRoots.from(releasedSourceSetPaths) - } - dokkaSourceSets.configureEach { - perPackageOption { - matchingRegex.set(".*internal.*") - suppress.set(true) - reportUndocumented = 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) - // put exposed dependencies in dokka's classpath - implementation(arcgis.mapsSdk) - implementation(platform(libs.androidx.compose.bom)) - implementation(libs.bundles.composeCore) -} - -//dokkaGenerate diff --git a/microapps/ArFlyoverApp/app/build.gradle.kts b/microapps/ArFlyoverApp/app/build.gradle.kts index cb041d2a7..fca9ddff7 100644 --- a/microapps/ArFlyoverApp/app/build.gradle.kts +++ b/microapps/ArFlyoverApp/app/build.gradle.kts @@ -17,76 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - - 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 dd5e0243c..a2a18edc0 100644 --- a/microapps/ArTabletopApp/app/build.gradle.kts +++ b/microapps/ArTabletopApp/app/build.gradle.kts @@ -17,75 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - 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 671023ab5..e9ab6c9d8 100644 --- a/microapps/ArWorldScaleApp/app/build.gradle.kts +++ b/microapps/ArWorldScaleApp/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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - 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 ce7aec595..1545f60a8 100644 --- a/microapps/AuthenticationApp/app/build.gradle.kts +++ b/microapps/AuthenticationApp/app/build.gradle.kts @@ -17,72 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - 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 26949b2a5..0ad9719fe 100644 --- a/microapps/BasemapGalleryApp/app/build.gradle.kts +++ b/microapps/BasemapGalleryApp/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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - - 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/CalloutApp/app/build.gradle.kts b/microapps/CalloutApp/app/build.gradle.kts index cb3cbb58e..a7585beb2 100644 --- a/microapps/CalloutApp/app/build.gradle.kts +++ b/microapps/CalloutApp/app/build.gradle.kts @@ -17,74 +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" -} - -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.microapp) } android { namespace = "com.arcgismaps.toolkit.calloutapp" - compileSdk = libs.versions.compileSdk.get().toInt() - + defaultConfig { - applicationId ="com.arcgismaps.toolkit.calloutapp" - 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" - } - } - 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.calloutapp" } } 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/CompassApp/app/build.gradle.kts b/microapps/CompassApp/app/build.gradle.kts index 60d7393bd..1af5b0d36 100644 --- a/microapps/CompassApp/app/build.gradle.kts +++ b/microapps/CompassApp/app/build.gradle.kts @@ -17,73 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - 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 710129714..05c0bc688 100644 --- a/microapps/FeatureFormsApp/app/build.gradle.kts +++ b/microapps/FeatureFormsApp/app/build.gradle.kts @@ -17,90 +17,36 @@ */ 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") + alias(libs.plugins.arcgismaps.kotlin.microapp) + alias(libs.plugins.hilt) + alias(libs.plugins.ksp) } -secrets { - defaultPropertiesFileName = "secrets.defaults.properties" -} - -kotlin { - jvmToolchain(17) +hilt { + enableAggregatingTask = true } 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" - } - } - 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 6dd7a497f..c1ead411c 100644 --- a/microapps/FloorFilterApp/app/build.gradle.kts +++ b/microapps/FloorFilterApp/app/build.gradle.kts @@ -1,73 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - - 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 9b369f455..631bd32cc 100644 --- a/microapps/LegendApp/app/build.gradle.kts +++ b/microapps/LegendApp/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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - - 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/MapViewGeometryEditorApp/app/build.gradle.kts b/microapps/MapViewGeometryEditorApp/app/build.gradle.kts index 0102a9318..0eb0e53fe 100644 --- a/microapps/MapViewGeometryEditorApp/app/build.gradle.kts +++ b/microapps/MapViewGeometryEditorApp/app/build.gradle.kts @@ -17,75 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - @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 0c02dc27a..7439ed816 100644 --- a/microapps/MapViewIdentifyApp/app/build.gradle.kts +++ b/microapps/MapViewIdentifyApp/app/build.gradle.kts @@ -17,75 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - @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 2006c9540..071eb6751 100644 --- a/microapps/MapViewInsetsApp/app/build.gradle.kts +++ b/microapps/MapViewInsetsApp/app/build.gradle.kts @@ -17,75 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - @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 3e5f5262d..a2abcc5bf 100644 --- a/microapps/MapViewLocationDisplayApp/app/build.gradle.kts +++ b/microapps/MapViewLocationDisplayApp/app/build.gradle.kts @@ -17,75 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - @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 14b6578df..8c8966fec 100644 --- a/microapps/MapViewSetViewpointApp/app/build.gradle.kts +++ b/microapps/MapViewSetViewpointApp/app/build.gradle.kts @@ -17,75 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - @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 c2500edef..202c7d2cd 100644 --- a/microapps/MicroappsLib/build.gradle.kts +++ b/microapps/MicroappsLib/build.gradle.kts @@ -17,49 +17,13 @@ */ plugins { - alias(libs.plugins.android.library) - alias(libs.plugins.kotlin.android) - alias(libs.plugins.compose.compiler) -} - -kotlin { - jvmToolchain(17) + 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" - ) - } - } - buildFeatures { - compose = true - } - @Suppress("UnstableApiUsage") - testOptions { - targetSdk = libs.versions.compileSdk.get().toInt() - } } dependencies { - 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) + // Module-specific dependencies go here } diff --git a/microapps/OfflineMapAreasApp/app/build.gradle.kts b/microapps/OfflineMapAreasApp/app/build.gradle.kts index 555452842..7bbb8df6f 100644 --- a/microapps/OfflineMapAreasApp/app/build.gradle.kts +++ b/microapps/OfflineMapAreasApp/app/build.gradle.kts @@ -17,74 +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" -} - -kotlin { - jvmToolchain(17) + 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 - } - } - - 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 59214233c..589b749aa 100644 --- a/microapps/OverviewMapApp/app/build.gradle.kts +++ b/microapps/OverviewMapApp/app/build.gradle.kts @@ -17,74 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - - 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 6393aa189..12312e87a 100644 --- a/microapps/PopupApp/app/build.gradle.kts +++ b/microapps/PopupApp/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") -} - -kotlin { - jvmToolchain(17) -} - -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" - ) - } - } - - 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 852e5ff1b..a1747cb57 100644 --- a/microapps/ScalebarApp/app/build.gradle.kts +++ b/microapps/ScalebarApp/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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - - 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 6682ee11a..e62a530a1 100644 --- a/microapps/SceneViewAnalysisOverlayApp/app/build.gradle.kts +++ b/microapps/SceneViewAnalysisOverlayApp/app/build.gradle.kts @@ -17,74 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - @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/SceneViewCameraControllerApp/app/build.gradle.kts b/microapps/SceneViewCameraControllerApp/app/build.gradle.kts index c38bf89c5..47dc4e22c 100644 --- a/microapps/SceneViewCameraControllerApp/app/build.gradle.kts +++ b/microapps/SceneViewCameraControllerApp/app/build.gradle.kts @@ -17,74 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - @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 f07487a4b..83dafadae 100644 --- a/microapps/SceneViewLightingOptionsApp/app/build.gradle.kts +++ b/microapps/SceneViewLightingOptionsApp/app/build.gradle.kts @@ -17,74 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - @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 d7bd09d30..a7641a566 100644 --- a/microapps/SceneViewSetViewpointApp/app/build.gradle.kts +++ b/microapps/SceneViewSetViewpointApp/app/build.gradle.kts @@ -17,75 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - @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 619e17312..1fb685b05 100644 --- a/microapps/TemplateApp/app/build.gradle.kts +++ b/microapps/TemplateApp/app/build.gradle.kts @@ -17,74 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - - 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 4d2b0207e..a5c3329aa 100644 --- a/microapps/UtilityNetworkTraceApp/app/build.gradle.kts +++ b/microapps/UtilityNetworkTraceApp/app/build.gradle.kts @@ -17,72 +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" -} - -kotlin { - jvmToolchain(17) + 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" - } - } - - 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 fadde11a7..e12d4ac41 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,6 +17,7 @@ */ pluginManagement { + includeBuild("build-logic") repositories { gradlePluginPortal() google() @@ -24,9 +25,7 @@ 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" } +rootProject.name = "arcgis-maps-sdk-kotlin-toolkit" val localProperties = java.util.Properties().apply { val localPropertiesFile = file("local.properties") @@ -35,24 +34,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. @@ -94,33 +75,14 @@ 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") - } - } } // 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")) +// gradle.startParameter.excludedTaskNames.addAll(listOf(":buildSrc:testClasses")) + +// This enables the "Type Safe Project Accessors" feature +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") include(":bom") project(":bom").projectDir = File(rootDir, "bom") @@ -203,4 +165,3 @@ 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 44862377b..c75e5ae43 100644 --- a/toolkit/ar/build.gradle.kts +++ b/toolkit/ar/build.gradle.kts @@ -16,73 +16,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 -} - -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - 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 { @@ -91,7 +30,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" ) @@ -100,17 +39,8 @@ 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.truth) - androidTestImplementation(libs.bundles.composeTest) - androidTestImplementation(libs.androidx.test.rules) - debugImplementation(libs.bundles.debug) } diff --git a/toolkit/authentication/build.gradle.kts b/toolkit/authentication/build.gradle.kts index 80bb6fa4f..0b697cb0b 100644 --- a/toolkit/authentication/build.gradle.kts +++ b/toolkit/authentication/build.gradle.kts @@ -17,74 +17,16 @@ */ 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 -} -kotlin { - jvmToolchain(17) - compilerOptions { - freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") - } + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - 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. - } - } +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 { @@ -101,19 +43,8 @@ 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 969e5579c..136b0df45 100644 --- a/toolkit/basemapgallery/build.gradle.kts +++ b/toolkit/basemapgallery/build.gradle.kts @@ -16,59 +16,12 @@ * */ - 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") -} -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - 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 { @@ -83,12 +36,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 15a475f72..2bdb8707c 100644 --- a/toolkit/compass/build.gradle.kts +++ b/toolkit/compass/build.gradle.kts @@ -17,72 +17,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 -} - -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - - 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/featureforms/build.gradle.kts b/toolkit/featureforms/build.gradle.kts index f1d492521..957ea113e 100644 --- a/toolkit/featureforms/build.gradle.kts +++ b/toolkit/featureforms/build.gradle.kts @@ -17,14 +17,8 @@ */ 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 + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.gradle.secrets) } secrets { @@ -32,16 +26,15 @@ secrets { } kotlin { - jvmToolchain(17) - compilerOptions { - freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") - } + // 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" - compileSdk = libs.versions.compileSdk.get().toInt() - + 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 @@ -51,50 +44,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 - } - } - 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. - } - } val toolkitTests = project.findProperty("toolkitTestDir") as String sourceSets.getByName("androidTest") { @@ -150,34 +99,16 @@ 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) - - // Include only if internal tests are required - if (file(project.findProperty("toolkitTestDir") as String).exists()) { - androidTestImplementation(libs.mockingjay) - } } diff --git a/toolkit/geoview-compose/build.gradle.kts b/toolkit/geoview-compose/build.gradle.kts index e365612c5..1f251e5fa 100644 --- a/toolkit/geoview-compose/build.gradle.kts +++ b/toolkit/geoview-compose/build.gradle.kts @@ -17,72 +17,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 -} -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - 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 304ce3010..072341383 100644 --- a/toolkit/indoors/build.gradle.kts +++ b/toolkit/indoors/build.gradle.kts @@ -1,61 +1,9 @@ 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 -} - -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - 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 { @@ -70,17 +18,7 @@ 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) + // Module-specific dependencies go here androidTestImplementation(project(":geoview-compose")) - debugImplementation(libs.bundles.debug) } diff --git a/toolkit/legend/build.gradle.kts b/toolkit/legend/build.gradle.kts index 26476c2be..7c814795a 100644 --- a/toolkit/legend/build.gradle.kts +++ b/toolkit/legend/build.gradle.kts @@ -16,68 +16,12 @@ * */ - 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") -} - -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - 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 { @@ -92,13 +36,6 @@ 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 + androidTestImplementation(project(":geoview-compose")) } diff --git a/toolkit/offline/build.gradle.kts b/toolkit/offline/build.gradle.kts index e76402a28..6cd63b8ca 100644 --- a/toolkit/offline/build.gradle.kts +++ b/toolkit/offline/build.gradle.kts @@ -16,70 +16,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.kotlin.serialization) apply true - alias(libs.plugins.binary.compatibility.validator) apply true -} - -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - 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 { @@ -99,16 +41,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 71722bcaf..8673ec367 100644 --- a/toolkit/popup/build.gradle.kts +++ b/toolkit/popup/build.gradle.kts @@ -17,69 +17,20 @@ */ 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.kotlin.serialization) apply true + alias(libs.plugins.arcgismaps.kotlin.toolkit) } kotlin { - jvmToolchain(17) - compilerOptions { - freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") - } + // 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" - 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 - } - } - - 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. - } - } - lint { + // remove these disables when strings.xml lint is fixed via localization disable += "MissingTranslation" } - } apiValidation { @@ -100,20 +51,11 @@ 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.compose.navigation) - implementation(libs.kotlinx.serialization.json) - 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 64c906669..7252f5f74 100644 --- a/toolkit/scalebar/build.gradle.kts +++ b/toolkit/scalebar/build.gradle.kts @@ -17,72 +17,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") -} - -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - 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 73c236ea0..4b60123a1 100644 --- a/toolkit/template/build.gradle.kts +++ b/toolkit/template/build.gradle.kts @@ -17,89 +17,17 @@ */ plugins { - alias(libs.plugins.binary.compatibility.validator) apply true - id("com.android.library") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.compose") -} - -kotlin { - jvmToolchain(17) + alias(libs.plugins.arcgismaps.kotlin.toolkit) } 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 - } - } - 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}" - } +} - /** - * Include this if any internal-only tests are required - */ - 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)) - } - } +toolkit { + releasable = false } 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) - - /** - * Include this if any internal-only test dependencies are required - */ - if (file(project.findProperty("toolkitTestDir") as String).exists()) { - androidTestImplementation(libs.mockingjay) - } + // Module-specific dependencies go here } diff --git a/toolkit/utilitynetworks/build.gradle.kts b/toolkit/utilitynetworks/build.gradle.kts index d6e471abe..08cb2e5da 100644 --- a/toolkit/utilitynetworks/build.gradle.kts +++ b/toolkit/utilitynetworks/build.gradle.kts @@ -17,12 +17,8 @@ */ 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 + alias(libs.plugins.arcgismaps.kotlin.toolkit) + alias(libs.plugins.gradle.secrets) } secrets { @@ -30,60 +26,15 @@ secrets { } kotlin { - jvmToolchain(17) - compilerOptions { - freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility") - } + // 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" - 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 - } - } 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 { @@ -108,18 +59,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) }