diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a296d3c3..c616ae62 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -32,7 +32,7 @@ jobs: uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v4.2.1 + uses: actions/setup-java@v4.5.0 with: java-version: '21' distribution: 'temurin' diff --git a/.github/workflows/lint-report.yml b/.github/workflows/lint-report.yml new file mode 100644 index 00000000..1841d920 --- /dev/null +++ b/.github/workflows/lint-report.yml @@ -0,0 +1,49 @@ +# Copyright 2024 Google LLC +# +# 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. + +name: Lint and Upload SARIF + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v4.5.0 + with: + distribution: 'adopt' + java-version: '17' + + - name: Run Android Lint + run: ./gradlew lint + + - name: Merge SARIF files + run: | + jq -s '{ "$schema": "https://json.schemastore.org/sarif-2.1.0", "version": "2.1.0", "runs": map(.runs) | add }' maps-ktx/build/reports/lint-results.sarif maps-utils-ktx/build/reports/lint-results.sarif app/build/reports/lint-results.sarif > merged.sarif + + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: merged.sarif diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c214bb1..458bc5a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up JDK - uses: actions/setup-java@v4.2.1 + uses: actions/setup-java@v4.5.0 with: java-version: '21' distribution: 'temurin' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05928902..7987ad45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: uses: gradle/actions/wrapper-validation@v4 - name: Set up JDK - uses: actions/setup-java@v4.2.1 + uses: actions/setup-java@v4.5.0 with: java-version: '21' distribution: 'temurin' diff --git a/.releaserc b/.releaserc index d7cda053..6a1f2602 100644 --- a/.releaserc +++ b/.releaserc @@ -6,7 +6,7 @@ plugins: - - "@google/semantic-release-replace-plugin" - replacements: - files: - - "build.gradle" + - "build.gradle.kts" from: "\\bversion = '.*'" to: "version = '${nextRelease.version}'" - files: @@ -18,7 +18,7 @@ plugins: publishCmd: "./gradlew publish --warn --stacktrace" - - "@semantic-release/git" - assets: - - "build.gradle" + - "build.gradle.kts" - "*.md" - "@semantic-release/github" options: diff --git a/app/build.gradle b/app/build.gradle.kts similarity index 56% rename from app/build.gradle rename to app/build.gradle.kts index 66cf2191..14c93f6b 100644 --- a/app/build.gradle +++ b/app/build.gradle.kts @@ -1,5 +1,5 @@ /** - * Copyright 2023 Google Inc. + * Copyright 2024 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,9 @@ */ plugins { - id 'com.android.application' - id 'kotlin-android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' + id("com.android.application") + id("kotlin-android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") } android { @@ -25,14 +25,14 @@ android { sarifOutput = file("$buildDir/reports/lint-results.sarif") } - compileSdk libs.versions.androidCompileSdk.get().toInteger() + compileSdk = libs.versions.androidCompileSdk.get().toInt() defaultConfig { - applicationId "com.google.maps.android.ktx.demo" - minSdkVersion libs.versions.androidMinSdk.get().toInteger() - targetSdkVersion libs.versions.androidTargetSdk.get().toInteger() - versionCode 1 - versionName "1.0" + applicationId = "com.google.maps.android.ktx.demo" + minSdk = libs.versions.androidMinSdk.get().toInt() + targetSdk = libs.versions.androidTargetSdk.get().toInt() + versionCode = 1 + versionName = "1.0" } buildFeatures { @@ -40,9 +40,9 @@ android { } buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } } @@ -54,19 +54,20 @@ android { kotlinOptions { jvmTarget = "1.8" } - namespace 'com.google.maps.android.ktx.demo' + + namespace = "com.google.maps.android.ktx.demo" } dependencies { - implementation libs.kotlinStdlib - implementation libs.androidxAppcompat - implementation libs.androidxCoreKtx - implementation libs.lifecycleRuntimeKtx + implementation(libs.kotlinStdlib) + implementation(libs.androidxAppcompat) + implementation(libs.androidxCoreKtx) + implementation(libs.lifecycleRuntimeKtx) // Instead of the lines below, regular apps would load these libraries from Maven according to // the README installation instructions - implementation project(':maps-ktx') - implementation project(':maps-utils-ktx') + implementation(project(":maps-ktx")) + implementation(project(":maps-utils-ktx")) } secrets { @@ -74,6 +75,6 @@ secrets { // 1. Create a file ./secrets.properties // 2. Add this line, where YOUR_API_KEY is your API key: // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName 'secrets.properties' - defaultPropertiesFileName 'secrets.defaults.properties' -} + propertiesFileName = "secrets.properties" + defaultPropertiesFileName = "secrets.defaults.properties" +} \ 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 00000000..6230e388 --- /dev/null +++ b/build-logic/convention/build.gradle.kts @@ -0,0 +1,26 @@ +plugins { + `kotlin-dsl` +} + +repositories { + google() + mavenCentral() + gradlePluginPortal() +} + + +dependencies { + implementation(libs.kotlinGradlePlugin) + implementation(libs.gradle) + implementation(libs.dokkaGradlePlugin) + implementation(libs.org.jacoco.core) +} + +gradlePlugin { + plugins { + register("publishingConventionPlugin") { + id = "android.maps.ktx.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 00000000..c89c0268 --- /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("Kotlin extensions (KTX) for Google Maps SDK") + url.set("https://github.com/googlemaps/android-maps-ktx") + scm { + connection.set("scm:git@github.com:googlemaps/android-maps-ktx.git") + developerConnection.set("scm:git@github.com:googlemaps/android-maps-ktx.git") + url.set("https://github.com/googlemaps/android-maps-ktx") + } + 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("sonatypeToken") as String? + password = project.findProperty("sonatypeTokenPassword") 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 00000000..2907fbfb --- /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 a6f5aa85..00000000 --- a/build.gradle +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Copyright 2023 Google Inc. - * - * 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. - */ - -buildscript { - ext.versions = [ - 'android' : [ - "buildTools": "30.0.3", - "compileSdk": 34, - "minSdk" : 21, - "targetSdk" : 34 - ]] - - repositories { - gradlePluginPortal() - google() - mavenCentral() - } - dependencies { - classpath libs.gradle - classpath libs.dokkaGradlePlugin - classpath libs.kotlinGradlePlugin - classpath libs.jacocoAndroid - classpath libs.secretsGradlePlugin - } -} - -ext.projectArtifactId = { project -> - if (project.name == 'maps-utils-ktx' || - project.name == 'maps-ktx') { - return project.name - } else { - return null - } -} - -/** - * Shared configs across subprojects - */ -allprojects { - group = 'com.google.maps.android' - version = '5.1.1' - project.ext.artifactId = rootProject.ext.projectArtifactId(project) - - repositories { - google() - mavenCentral() - flatDir { - dirs 'libs' - } - } -} - -/** - * 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' - - // Documentation - tasks.named("dokkaHtml") { - outputDirectory.set(file("${buildDir}/documentation")) - dokkaSourceSets { - configureEach { - skipDeprecated.set(true) - jdkVersion.set(8) - skipEmptyPackages.set(true) - reportUndocumented.set(true) - displayName.set("JVM") - } - } - } - - // Code coverage - jacoco { - toolVersion = "0.8.12" - } - - - tasks.withType(Test).configureEach { - jacoco.includeNoLocationClasses = true - jacoco.excludes = ['jdk.internal.*'] - } - - tasks.register('sourcesJar', Jar) { - from android.sourceSets.main.java.source - archiveClassifier = "sources" - } - - tasks.register('dokkaJar', Jar) { - dependsOn dokkaHtml - from dokkaHtml.outputDirectory - archiveClassifier = "javadoc" - } - - android { - publishing { - singleVariant("release") { - withSourcesJar() - withJavadocJar() - } - } - } - - publishing { - publications { - aar(MavenPublication) { - groupId project.group - artifactId project.ext.artifactId - version project.version - - pom { - name = project.name - description = "Kotlin extensions (KTX) for Google Maps SDK" - url = "https://github.com/googlemaps/android-maps-ktx" - scm { - connection = 'scm:git@github.com:googlemaps/android-maps-ktx.git' - developerConnection = 'scm:git@github.com:googlemaps/android-maps-ktx.git' - url = 'https://github.com/googlemaps/android-maps-ktx' - } - - 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.' - } - } - } - - pom.withXml { - def dependenciesNode = asNode().appendNode('dependencies') - project.configurations.api.allDependencies.each { dependency -> - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', dependency.group) - dependencyNode.appendNode('artifactId', dependency.name) - dependencyNode.appendNode('version', dependency.version) - } - } - - afterEvaluate { - artifact "$buildDir/outputs/aar/$project.name-release.aar" - artifact dokkaJar - artifact sourcesJar - } - } - } - - repositories { - maven { - name = "mavencentral" - url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - credentials { - username sonatypeToken - password sonatypeTokenPassword - } - } - } - } - - signing { - sign publishing.publications.aar - } -} - - -tasks.register('clean', Delete) { - delete rootProject.buildDir -} - diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..1ada420e --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,53 @@ +/** + * Copyright 2024 Google Inc. + * + * 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. + */ + +buildscript { + + repositories { + gradlePluginPortal() + google() + mavenCentral() + } + dependencies { + classpath(libs.gradle) + classpath(libs.dokkaGradlePlugin) + classpath(libs.kotlinGradlePlugin) + classpath(libs.jacocoAndroid) + classpath(libs.secretsGradlePlugin) + } +} + +val projectArtifactId: (Project) -> String? = { project -> + if (project.name == "maps-utils-ktx" || project.name == "maps-ktx") { + project.name + } else { + null + } +} + +/** + * Shared configs across subprojects + */ + +allprojects { + group = "com.google.maps.android" + version = "5.1.1" + val projectArtifactId by extra { project.name } +} + +tasks.register("clean") { + delete(rootProject.buildDir) +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f5ffca2c..8c2c359d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,6 +20,7 @@ kotlinGradlePlugin = "1.9.20" mockitoInline = "5.2.0" mockitoKotlin = "2.2.0" secretsGradlePlugin = "2.0.1" +org-jacoco-core = "0.8.11" [libraries] androidMapsUtils = { group = "com.google.maps.android", name = "android-maps-utils", version.ref = "androidMapsUtils" } @@ -40,10 +41,4 @@ mockitoInline = { group = "org.mockito", name = "mockito-inline", version.ref = mockitoKotlin = { group = "com.nhaarman.mockitokotlin2", name = "mockito-kotlin", version.ref = "mockitoKotlin" } playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "androidMapsSdk" } secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" } - -[plugins] -androidGradlePlugin = { id = "com.android.tools.build:gradle", version = "8.2.2" } -dokkaGradlePlugin = { id = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.9.20" } -jacocoAndroidPlugin = { id = "com.mxalbert.gradle:jacoco-android", version = "0.2.1" } -kotlinGradlePlugin = { id = "org.jetbrains.kotlin:kotlin-gradle-plugin", version = "2.0.0" } -secretsGradlePlugin = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version = "2.0.1" } +org-jacoco-core = { module = "org.jacoco:org.jacoco.core", version.ref = "org-jacoco-core" } diff --git a/maps-ktx/build.gradle b/maps-ktx/build.gradle.kts similarity index 52% rename from maps-ktx/build.gradle rename to maps-ktx/build.gradle.kts index 4b27cfb2..2d1dcbd4 100644 --- a/maps-ktx/build.gradle +++ b/maps-ktx/build.gradle.kts @@ -15,21 +15,23 @@ * */ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' +plugins { + id("com.android.library") + id("kotlin-android") + id("android.maps.ktx.PublishingConventionPlugin") +} android { lint { sarifOutput = file("$buildDir/reports/lint-results.sarif") } - compileSdk libs.versions.androidCompileSdk.get().toInteger() + compileSdk = libs.versions.androidCompileSdk.get().toInt() defaultConfig { - minSdkVersion libs.versions.androidMinSdk.get().toInteger() - targetSdkVersion libs.versions.androidTargetSdk.get().toInteger() - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' + minSdk = libs.versions.androidMinSdk.get().toInt() + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") } compileOptions { @@ -38,25 +40,27 @@ android { } kotlinOptions { - freeCompilerArgs += '-Xexplicit-api=strict' + freeCompilerArgs += "-Xexplicit-api=strict" jvmTarget = "1.8" } + buildFeatures { - viewBinding true + viewBinding = true } - namespace 'com.google.maps.android.ktx' + + namespace = "com.google.maps.android.ktx" } dependencies { - implementation libs.kotlinStdlib - implementation libs.kotlinxCoroutines - api libs.playServicesMaps + implementation(libs.kotlinStdlib) + implementation(libs.kotlinxCoroutines) + api(libs.playServicesMaps) // Tests - testImplementation libs.androidxTest - testImplementation libs.androidxJunit - testImplementation libs.junit - testImplementation libs.mockito - testImplementation libs.mockitoKotlin - testImplementation libs.mockitoInline + testImplementation(libs.androidxTest) + testImplementation(libs.androidxJunit) + testImplementation(libs.junit) + testImplementation(libs.mockito) + testImplementation(libs.mockitoKotlin) + testImplementation(libs.mockitoInline) } diff --git a/maps-utils-ktx/build.gradle b/maps-utils-ktx/build.gradle deleted file mode 100644 index 29285374..00000000 --- a/maps-utils-ktx/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright 2024 Google Inc. - * - * 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. - */ - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -android { - lint { - sarifOutput = file("$buildDir/reports/lint-results.sarif") - } - - compileSdk libs.versions.androidCompileSdk.get().toInteger() - - defaultConfig { - minSdkVersion libs.versions.androidMinSdk.get().toInteger() - targetSdkVersion libs.versions.androidTargetSdk.get().toInteger() - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles 'consumer-rules.pro' - } - - libraryVariants.configureEach { - it.generateBuildConfigProvider.configure { - it.enabled = true - } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } - - kotlinOptions { - freeCompilerArgs += '-Xexplicit-api=strict' - jvmTarget = "1.8" - } - buildFeatures { - viewBinding true - buildConfig true - } - namespace 'com.google.maps.android.ktx.utils' -} - -dependencies { - implementation libs.kotlinStdlib - api libs.androidMapsUtils - - // Tests - testImplementation libs.androidxTest - testImplementation libs.androidxJunit - testImplementation libs.junit - testImplementation libs.mockito - testImplementation libs.mockitoKotlin - testImplementation libs.mockitoInline -} diff --git a/maps-utils-ktx/build.gradle.kts b/maps-utils-ktx/build.gradle.kts new file mode 100644 index 00000000..e28ac77b --- /dev/null +++ b/maps-utils-ktx/build.gradle.kts @@ -0,0 +1,66 @@ +/** + * Copyright 2024 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("com.android.library") + id("kotlin-android") + id("android.maps.ktx.PublishingConventionPlugin") +} + +android { + lint { + sarifOutput = file("$buildDir/reports/lint-results.sarif") + } + + compileSdk = libs.versions.androidCompileSdk.get().toInt() + + defaultConfig { + minSdk = libs.versions.androidMinSdk.get().toInt() + targetSdk = libs.versions.androidTargetSdk.get().toInt() + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + freeCompilerArgs += "-Xexplicit-api=strict" + jvmTarget = "1.8" + } + + buildFeatures { + viewBinding = true + buildConfig = true + } + + namespace = "com.google.maps.android.ktx.utils" +} + +dependencies { + implementation(libs.kotlinStdlib) + api(libs.androidMapsUtils) + + // Tests + testImplementation(libs.androidxTest) + testImplementation(libs.androidxJunit) + testImplementation(libs.junit) + testImplementation(libs.mockito) + testImplementation(libs.mockitoKotlin) + testImplementation(libs.mockitoInline) +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 5550cf28..00000000 --- a/settings.gradle +++ /dev/null @@ -1,4 +0,0 @@ -include ':app' -include ':maps-ktx' -include ':maps-utils-ktx' -rootProject.name='android-maps-ktx' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..cdf753c6 --- /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-ktx" + +include(":app") +include(":maps-ktx") +include(":maps-utils-ktx") \ No newline at end of file