diff --git a/.github/workflows/instrumentation-test.yml b/.github/workflows/instrumentation-test.yml index 6ac9e5902..10f2bbaea 100644 --- a/.github/workflows/instrumentation-test.yml +++ b/.github/workflows/instrumentation-test.yml @@ -63,7 +63,7 @@ jobs: - name: Jacoco Report to PR id: jacoco - uses: madrapps/jacoco-report@v1.6 + uses: madrapps/jacoco-report@v1.6.1 with: paths: | ${{ github.workspace }}/app/build/reports/coverage/androidTest/debug/connected/report.xml diff --git a/.releaserc b/.releaserc index d7cda0539..f017199c7 100644 --- a/.releaserc +++ b/.releaserc @@ -6,8 +6,8 @@ plugins: - - "@google/semantic-release-replace-plugin" - replacements: - files: - - "build.gradle" - from: "\\bversion = '.*'" + - "build.gradle.kts" + from: "\\bversion = \".*\"" to: "version = '${nextRelease.version}'" - files: - "README.md" diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 657140252..000000000 --- a/app/build.gradle +++ /dev/null @@ -1,81 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' - alias libs.plugins.compose.compiler -} - -android { - - buildTypes { - debug { - testCoverageEnabled true - } - - release { - testCoverageEnabled true - } - } - - namespace "com.google.maps.android.compose" - compileSdk 34 - - defaultConfig { - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - buildFeatures { - buildConfig true - compose true - } - - kotlinOptions { - jvmTarget = '1.8' - freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn' - } -} - -dependencies { - implementation platform(libs.androidx.compose.bom) - implementation libs.androidx.compose.activity - implementation libs.androidx.compose.foundation - implementation libs.androidx.compose.material - implementation libs.kotlin - implementation libs.material - implementation libs.androidx.compose.ui.preview.tooling - debugImplementation libs.androidx.compose.ui.tooling - - androidTestImplementation platform(libs.androidx.compose.bom) - androidTestImplementation libs.androidx.test.core - androidTestImplementation libs.androidx.test.rules - androidTestImplementation libs.androidx.test.runner - androidTestImplementation libs.androidx.test.espresso - androidTestImplementation libs.androidx.test.junit.ktx - androidTestImplementation libs.test.junit - androidTestImplementation libs.androidx.test.compose.ui - androidTestImplementation libs.coroutines - - // Instead of the lines below, regular apps would load these libraries from Maven according to - // the README installation instructions - implementation project(':maps-compose') - implementation project(':maps-compose-widgets') - implementation project(':maps-compose-utils') -} - -secrets { - // To add your Maps API key to this project: - // 1. Add this line to your local.properties file, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - defaultPropertiesFileName 'local.defaults.properties' -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 000000000..a32684e79 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,79 @@ +plugins { + id("com.android.application") + id("kotlin-android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") + alias(libs.plugins.compose.compiler) +} + +android { + buildTypes { + getByName("debug") { + enableUnitTestCoverage = true + enableAndroidTestCoverage = true + } + getByName("release") { + enableUnitTestCoverage = true + enableAndroidTestCoverage = true + } + } + + namespace = "com.google.maps.android.compose" + compileSdk = 34 + + defaultConfig { + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + buildFeatures { + buildConfig = true + compose = true + } + + kotlinOptions { + jvmTarget = "1.8" + freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + } +} + +dependencies { + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.activity) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material) + implementation(libs.kotlin) + implementation(libs.material) + implementation(libs.androidx.compose.ui.preview.tooling) + debugImplementation(libs.androidx.compose.ui.tooling) + + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.test.core) + androidTestImplementation(libs.androidx.test.rules) + androidTestImplementation(libs.androidx.test.runner) + androidTestImplementation(libs.androidx.test.espresso) + androidTestImplementation(libs.androidx.test.junit.ktx) + androidTestImplementation(libs.test.junit) + androidTestImplementation(libs.androidx.test.compose.ui) + androidTestImplementation(libs.coroutines) + + // Instead of the lines below, regular apps would load these libraries from Maven according to + // the README installation instructions + implementation(project(":maps-compose")) + implementation(project(":maps-compose-widgets")) + implementation(project(":maps-compose-utils")) +} + +secrets { + // To add your Maps API key to this project: + // 1. Add this line to your local.properties file, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + defaultPropertiesFileName = "local.defaults.properties" +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb4348..ff59496d8 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,6 +1,6 @@ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# proguardFiles setting in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/build-logic/.gitignore b/build-logic/.gitignore new file mode 100644 index 000000000..256f6d78c --- /dev/null +++ b/build-logic/.gitignore @@ -0,0 +1,2 @@ +*/build +.gradle \ No newline at end of file diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts new file mode 100644 index 000000000..fa0ccec5d --- /dev/null +++ b/build-logic/convention/build.gradle.kts @@ -0,0 +1,26 @@ +plugins { + `kotlin-dsl` +} + +repositories { + google() + mavenCentral() + gradlePluginPortal() +} + + +dependencies { + implementation(libs.kotlin.gradle.plugin) + implementation(libs.android.gradle.plugin) + implementation(libs.dokka.plugin) + implementation(libs.org.jacoco.core) +} + +gradlePlugin { + plugins { + register("publishingConventionPlugin") { + id = "android.maps.compose.PublishingConventionPlugin" + implementationClass = "PublishingConventionPlugin" + } + } +} \ No newline at end of file diff --git a/build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt b/build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt new file mode 100644 index 000000000..2dcb9e37a --- /dev/null +++ b/build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt @@ -0,0 +1,108 @@ +// buildSrc/src/main/kotlin/PublishingConventionPlugin.kt +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.* +import org.gradle.testing.jacoco.plugins.JacocoPluginExtension +import org.gradle.api.tasks.testing.Test +import org.gradle.testing.jacoco.plugins.JacocoTaskExtension +import org.gradle.plugins.signing.SigningExtension +import org.gradle.api.publish.maven.* + +class PublishingConventionPlugin : Plugin { + override fun apply(project: Project) { + project.run { + + applyPlugins() + configureJacoco() + configurePublishing() + configureSigning() + } + } + + private fun Project.applyPlugins() { + apply(plugin = "com.android.library") + apply(plugin = "com.mxalbert.gradle.jacoco-android") + apply(plugin = "maven-publish") + apply(plugin = "org.jetbrains.dokka") + apply(plugin = "signing") + } + + private fun Project.configureJacoco() { + configure { + toolVersion = "0.8.7" + + } + + tasks.withType().configureEach { + extensions.configure(JacocoTaskExtension::class.java) { + isIncludeNoLocationClasses = true + excludes = listOf("jdk.internal.*") + } + } + } + + private fun Project.configurePublishing() { + extensions.configure { + publishing { + singleVariant("release") { + withSourcesJar() + withJavadocJar() + } + } + } + extensions.configure { + publications { + create("aar") { + afterEvaluate { + from(components["release"]) + } + pom { + name.set(project.name) + description.set("Jetpack Compose components for the Maps SDK for Android") + url.set("https://github.com/googlemaps/android-maps-compose") + scm { + connection.set("scm:git@github.com:googlemaps/android-maps-compose.git") + developerConnection.set("scm:git@github.com:googlemaps/android-maps-compose.git") + url.set("https://github.com/googlemaps/android-maps-compose") + } + licenses { + license { + name.set("The Apache Software License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + distribution.set("repo") + } + } + organization { + name.set("Google Inc") + url.set("http://developers.google.com/maps") + } + developers { + developer { + name.set("Google Inc.") + } + } + } + } + } + repositories { + maven { + val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") + val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/") + url = if (project.version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl + credentials { + username = project.findProperty("sonatypeUsername") as String? + password = project.findProperty("sonatypePassword") as String? + } + } + } + } + } + + private fun Project.configureSigning() { + configure { + sign(extensions.getByType().publications["aar"]) + } + } +} diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts new file mode 100644 index 000000000..2907fbfb8 --- /dev/null +++ b/build-logic/settings.gradle.kts @@ -0,0 +1,14 @@ +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + } + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} + +rootProject.name = "build-logic" +include(":convention") diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 93798f68f..000000000 --- a/build.gradle +++ /dev/null @@ -1,128 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - ext.kotlin_version = libs.versions.kotlin.get() - ext.androidx_test_version = libs.versions.androidxtest.get() - repositories { - google() - mavenCentral() - } - dependencies { - classpath libs.android.gradle.plugin - classpath libs.maps.secrets.plugin - classpath libs.kotlin.gradle.plugin - classpath libs.dokka.plugin - classpath libs.jacoco.android.plugin - } -} - -plugins { - alias libs.plugins.dokka apply true - alias libs.plugins.compose.compiler apply false -} - -ext.projectArtifactId = { project -> - if (project.name in ['maps-compose', 'maps-compose-widgets', 'maps-compose-utils']) { - return project.name - } else { - return null - } -} - -allprojects { - group = 'com.google.maps.android' - version = '5.0.3' - project.ext.artifactId = rootProject.ext.projectArtifactId(project) -} - -/** - * Publishing and signing info - */ -subprojects { project -> - if (project.ext.artifactId == null) return - - apply plugin: 'com.android.library' - apply plugin: 'com.mxalbert.gradle.jacoco-android' - apply plugin: 'maven-publish' - apply plugin: 'org.jetbrains.dokka' - apply plugin: 'signing' - - // Code coverage - jacoco { - toolVersion = libs.versions.jacoco.tool.plugin.get() - } - - tasks.withType(Test).configureEach { - jacoco.includeNoLocationClasses = true - jacoco.excludes = ['jdk.internal.*'] - } - - android { - publishing { - singleVariant("release") { - withSourcesJar() - withJavadocJar() - } - } - } - - publishing { - publications { - aar(MavenPublication) { - afterEvaluate { - from components.release - } - - pom { - name = project.name - description = "Jetpack Compose components for the Maps SDK for Android" - url = "https://github.com/googlemaps/android-maps-compose" - scm { - connection = 'scm:git@github.com:googlemaps/android-maps-compose.git' - developerConnection = 'scm:git@github.com:googlemaps/android-maps-compose.git' - url = 'https://github.com/googlemaps/android-maps-compose' - } - - licenses { - license { - name = 'The Apache Software License, Version 2.0' - url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution = 'repo' - } - } - - organization { - name = 'Google Inc' - url = 'http://developers.google.com/maps' - } - - developers { - developer { - name = 'Google Inc.' - } - } - } - } - } - - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - name = "mavencentral" - url = project.version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username sonatypeUsername - password sonatypePassword - } - } - } - } - - signing { - sign publishing.publications.aar - } -} - -tasks.register('clean', Delete) { - delete rootProject.layout.buildDirectory -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..7bd4b0e49 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,41 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + val kotlinVersion by extra(libs.versions.kotlin.get()) + val androidxTestVersion by extra(libs.versions.androidxtest.get()) + repositories { + google() + mavenCentral() + } + dependencies { + classpath(libs.android.gradle.plugin) + classpath(libs.maps.secrets.plugin) + classpath(libs.kotlin.gradle.plugin) + classpath(libs.dokka.plugin) + classpath(libs.jacoco.android.plugin) + } +} + +plugins { + alias(libs.plugins.dokka) apply true + alias(libs.plugins.compose.compiler) apply false + id("com.autonomousapps.dependency-analysis") version "1.32.0" + +} + +val projectArtifactId by extra { project: Project -> + if (project.name in listOf("maps-compose", "maps-compose-widgets", "maps-compose-utils")) { + project.name + } else { + null + } +} + +allprojects { + group = "com.google.maps.android" + version = "5.0.3" + val projectArtifactId by extra { project.name } +} + +tasks.register("clean", Delete::class) { + delete(rootProject.buildDir) +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f1bd26abc..5d54fb9bf 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,19 +1,19 @@ [versions] activitycompose = "1.9.0" -agp = "8.4.1" +agp = "8.4.2" androidxtest = "1.5.0" compose-bom = "2024.05.00" coroutines = "1.7.3" dokka = "1.9.20" espresso = "3.5.1" jacoco-plugin = "0.2.1" -jacoco-tool-plugin = "0.8.7" junitktx = "1.1.5" junit = "4.13.2" kotlin = "2.0.0" material = "1.12.0" mapsktx = "5.0.0" mapsecrets = "2.0.1" +org-jacoco-core = "0.8.7" android-core = "1.13.1" [libraries] @@ -41,9 +41,9 @@ maps-ktx-std = { module = "com.google.maps.android:maps-ktx", version.ref = "map maps-ktx-utils = { module = "com.google.maps.android:maps-utils-ktx", version.ref = "mapsktx" } maps-secrets-plugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "mapsecrets" } material = { module = "com.google.android.material:material", version.ref = "material" } +org-jacoco-core = { module = "org.jacoco:org.jacoco.core", version.ref = "org-jacoco-core" } test-junit = { module = "junit:junit", version.ref = "junit" } [plugins] dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } -org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } \ No newline at end of file diff --git a/maps-compose-utils/build.gradle b/maps-compose-utils/build.gradle deleted file mode 100644 index 5d89a34f9..000000000 --- a/maps-compose-utils/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -plugins { - id 'kotlin-android' - alias libs.plugins.compose.compiler -} - -android { - namespace "com.google.maps.android.compose.utils" - compileSdk 34 - - defaultConfig { - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - buildFeatures { - buildConfig false - compose true - } - - kotlinOptions { - jvmTarget = '1.8' - freeCompilerArgs += '-Xexplicit-api=strict' - freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn' - } -} - -dependencies { - api project(':maps-compose') - - implementation libs.androidx.core - implementation platform(libs.androidx.compose.bom) - implementation libs.androidx.compose.ui - implementation libs.kotlin - api libs.maps.ktx.utils -} diff --git a/maps-compose-utils/build.gradle.kts b/maps-compose-utils/build.gradle.kts new file mode 100644 index 000000000..958cfe987 --- /dev/null +++ b/maps-compose-utils/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + id("kotlin-android") + alias(libs.plugins.compose.compiler) + id("android.maps.compose.PublishingConventionPlugin") +} + +android { + namespace = "com.google.maps.android.compose.utils" + compileSdk = 34 + + defaultConfig { + minSdk = 21 + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + buildFeatures { + buildConfig = false + compose = true + } + + kotlinOptions { + jvmTarget = "1.8" + freeCompilerArgs += "-Xexplicit-api=strict" + freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + } +} + +dependencies { + api(project(":maps-compose")) + + implementation(libs.androidx.core) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.ui) + implementation(libs.kotlin) + api(libs.maps.ktx.utils) +} diff --git a/maps-compose-widgets/build.gradle b/maps-compose-widgets/build.gradle deleted file mode 100644 index b0e340826..000000000 --- a/maps-compose-widgets/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -plugins { - id 'kotlin-android' - alias libs.plugins.compose.compiler -} - -android { - namespace "com.google.maps.android.compose.widgets" - compileSdk 34 - - defaultConfig { - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - buildFeatures { - buildConfig false - compose true - } - - kotlinOptions { - jvmTarget = '1.8' - freeCompilerArgs += '-Xexplicit-api=strict' - freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn' - } -} - -dependencies { - implementation project(':maps-compose') - - implementation platform(libs.androidx.compose.bom) - implementation libs.androidx.compose.foundation - implementation libs.androidx.compose.material - implementation libs.androidx.core - implementation libs.kotlin - api libs.maps.ktx.std - api libs.maps.ktx.utils - - testImplementation libs.test.junit - androidTestImplementation platform(libs.androidx.compose.bom) - androidTestImplementation libs.androidx.test.espresso - androidTestImplementation libs.androidx.test.junit.ktx -} diff --git a/maps-compose-widgets/build.gradle.kts b/maps-compose-widgets/build.gradle.kts new file mode 100644 index 000000000..ff7ee1412 --- /dev/null +++ b/maps-compose-widgets/build.gradle.kts @@ -0,0 +1,49 @@ +plugins { + id("kotlin-android") + alias (libs.plugins.compose.compiler) + id("android.maps.compose.PublishingConventionPlugin") +} + +android { + namespace = "com.google.maps.android.compose.widgets" + compileSdk = 34 + + defaultConfig { + minSdk = 21 + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + buildFeatures { + buildConfig = false + compose = true + } + + kotlinOptions { + jvmTarget = "1.8" + freeCompilerArgs += listOf( + "-Xexplicit-api=strict", + "-Xopt-in=kotlin.RequiresOptIn" + ) + } +} + +dependencies { + implementation(project(":maps-compose")) + + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.compose.foundation) + implementation(libs.androidx.compose.material) + implementation(libs.androidx.core) + implementation(libs.kotlin) + api(libs.maps.ktx.std) + api(libs.maps.ktx.utils) + + testImplementation(libs.test.junit) + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.test.espresso) + androidTestImplementation(libs.androidx.test.junit.ktx) +} diff --git a/maps-compose/build.gradle b/maps-compose/build.gradle deleted file mode 100644 index c02a9805d..000000000 --- a/maps-compose/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -plugins { - id 'kotlin-android' - alias libs.plugins.compose.compiler -} - -android { - namespace "com.google.maps.android.compose" - compileSdk 34 - - defaultConfig { - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - buildFeatures { - buildConfig false - compose true - } - - kotlinOptions { - jvmTarget = '1.8' - freeCompilerArgs += '-Xexplicit-api=strict' - freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn' - - freeCompilerArgs += [ - "-P", - "plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=" + - layout.projectDirectory.file('compose_compiler.conf').asFile.absolutePath - ] - - if (findProperty("composeCompilerReports") == "true") { - freeCompilerArgs += [ - "-P", - "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + - project.layout.buildDirectory.absolutePath + "/compose_compiler" - ] - } - if (findProperty("composeCompilerMetrics") == "true") { - freeCompilerArgs += [ - "-P", - "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + - project.layout.buildDirectory.absolutePath + "/compose_compiler" - ] - } - } -} - -dependencies { - implementation platform(libs.androidx.compose.bom) - implementation libs.androidx.core - implementation libs.androidx.compose.foundation - implementation libs.kotlin - api libs.maps.ktx.std - - testImplementation libs.test.junit - - androidTestImplementation platform(libs.androidx.compose.bom) - androidTestImplementation libs.androidx.test.espresso - androidTestImplementation libs.androidx.test.junit.ktx -} diff --git a/maps-compose/build.gradle.kts b/maps-compose/build.gradle.kts new file mode 100644 index 000000000..cc94451ab --- /dev/null +++ b/maps-compose/build.gradle.kts @@ -0,0 +1,62 @@ +plugins { + id("org.jetbrains.kotlin.android") + alias(libs.plugins.compose.compiler) + id("android.maps.compose.PublishingConventionPlugin") +} + +android { + + namespace = "com.google.maps.android.compose" + compileSdk = 34 + + defaultConfig { + minSdk = 21 + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + buildFeatures { + buildConfig = false + compose = true + } + + kotlinOptions { + jvmTarget = "1.8" + val stabilityConfigurationFile = layout.projectDirectory.file("compose_compiler_stability_config.conf").asFile + freeCompilerArgs += listOf( + "-Xexplicit-api=strict", + "-Xopt-in=kotlin.RequiresOptIn", + "-P", + "plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${stabilityConfigurationFile.absolutePath}" + ) + if (findProperty("composeCompilerReports") == "true") { + freeCompilerArgs += listOf( + "-P", + "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${layout.buildDirectory.dir("compose_compiler").get()}", + ) + } + if (findProperty("composeCompilerMetrics") == "true") { + freeCompilerArgs += listOf( + "-P", + "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${layout.buildDirectory.dir("compose_compiler").get()}", + ) + } + } +} + +dependencies { + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.core) + implementation(libs.androidx.compose.foundation) + implementation(libs.kotlin) + api(libs.maps.ktx.std) + + testImplementation(libs.test.junit) + + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.test.espresso) + androidTestImplementation(libs.androidx.test.junit.ktx) +} diff --git a/maps-compose/compose_compiler.conf b/maps-compose/compose_compiler_stability_config.conf similarity index 100% rename from maps-compose/compose_compiler.conf rename to maps-compose/compose_compiler_stability_config.conf diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index e9d0d6f41..000000000 --- a/settings.gradle +++ /dev/null @@ -1,12 +0,0 @@ -dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) - repositories { - google() - mavenCentral() - } -} -rootProject.name = "android-maps-compose" -include ':app' -include ':maps-compose' -include ':maps-compose-widgets' -include ':maps-compose-utils' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..64325fddd --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,21 @@ +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +pluginManagement { + includeBuild("build-logic") + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +rootProject.name = "android-maps-compose" + +include(":app") +include(":maps-compose") +include(":maps-compose-widgets") +include(":maps-compose-utils") \ No newline at end of file