diff --git a/ApiDemos/java/README.md b/ApiDemos/java/README.md index a8f8b971e..36163cdc8 100644 --- a/ApiDemos/java/README.md +++ b/ApiDemos/java/README.md @@ -33,7 +33,7 @@ If prompted for a gradle configuration accept the default settings. Alternatively use the `gradlew build` command to build the project directly. -This demo app requires that you add your own Google Maps API key. See [Get an API Key](../../docs/GET_AN_API_KEY.md) for more instructions. +This demo app requires that you add your own Google Maps API key. See [Get an API key](https://developers.google.com/maps/documentation/android-sdk/get-api-key) for more instructions. Support ------- diff --git a/ApiDemos/java/app/build.gradle b/ApiDemos/java/app/build.gradle deleted file mode 100644 index f822a8829..000000000 --- a/ApiDemos/java/app/build.gradle +++ /dev/null @@ -1,69 +0,0 @@ -import org.apache.tools.ant.filters.ConcatFilter - -plugins { - id 'com.android.application' - id 'project-report' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - compileSdk 34 - - defaultConfig { - applicationId "com.example.mapdemo" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - multiDexEnabled true - } - buildFeatures { - compose true - buildConfig = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - flavorDimensions "version" - productFlavors { - gms { - dimension "version" - applicationIdSuffix ".gms" - versionNameSuffix "-gms" - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - namespace "com.example.mapdemo" -} - -dependencies { - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation "androidx.recyclerview:recyclerview:1.3.2" - implementation 'com.android.volley:volley:1.2.1' - implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0")) - // GMS - gmsImplementation 'com.google.android.gms:play-services-maps:19.0.0' - - // Tests - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' -} - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = "local.defaults.properties" -} diff --git a/ApiDemos/java/app/build.gradle.kts b/ApiDemos/java/app/build.gradle.kts new file mode 100644 index 000000000..e9647eb8e --- /dev/null +++ b/ApiDemos/java/app/build.gradle.kts @@ -0,0 +1,90 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("project-report") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + compileSdk = 34 + + productFlavors { + create("gms") { + dimension = "version" + applicationIdSuffix = ".gms" + versionNameSuffix = "-gms" + } + } + + defaultConfig { + applicationId = "com.example.mapdemo" + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + multiDexEnabled = true + } + + buildFeatures { + compose = true + buildConfig = true + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + flavorDimensions.add("version") + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + namespace = "com.example.mapdemo" +} + +dependencies { + implementation(libs.appcompat) + implementation(libs.recyclerview) + implementation(libs.volley) + implementation(platform(libs.kotlinBom)) + + // GMS + implementation(libs.playServicesMaps) + + // Tests + testImplementation(libs.junit) + androidTestImplementation(libs.androidxJunit) + androidTestImplementation(libs.espressoCore) +} + +secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + + // A properties file containing default secret values. This file can be + // checked in version control. + defaultPropertiesFileName = "local.defaults.properties" +} \ No newline at end of file diff --git a/ApiDemos/java/build.gradle b/ApiDemos/java/build.gradle deleted file mode 100644 index 4c7d41738..000000000 --- a/ApiDemos/java/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenLocal() - google() - mavenCentral() - } -} - -tasks.register('clean', Delete) { - delete rootProject.buildDir -} diff --git a/ApiDemos/java/build.gradle.kts b/ApiDemos/java/build.gradle.kts new file mode 100644 index 000000000..bef357605 --- /dev/null +++ b/ApiDemos/java/build.gradle.kts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle:8.5.1") + classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1") + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + mavenLocal() + google() + mavenCentral() + } +} + +tasks.register("clean") { + delete(rootProject.layout.projectDirectory) +} diff --git a/ApiDemos/java/gradle/libs.versions.toml b/ApiDemos/java/gradle/libs.versions.toml new file mode 100644 index 000000000..c2bd8411a --- /dev/null +++ b/ApiDemos/java/gradle/libs.versions.toml @@ -0,0 +1,20 @@ +[versions] +appcompat = "1.7.0" +recyclerview = "1.3.2" +volley = "1.2.1" +kotlinBom = "2.0.0" +playServicesMaps = "19.0.0" +junit = "4.13.2" +androidxJunit = "1.2.1" +espresso = "3.6.1" + + +[libraries] +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" } +volley = { group = "com.android.volley", name = "volley", version.ref = "volley" } +kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" } +playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidxJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxJunit" } +espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" } \ No newline at end of file diff --git a/ApiDemos/java/settings.gradle b/ApiDemos/java/settings.gradle deleted file mode 100644 index e7b4def49..000000000 --- a/ApiDemos/java/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/ApiDemos/java/settings.gradle.kts b/ApiDemos/java/settings.gradle.kts new file mode 100644 index 000000000..f006b9d51 --- /dev/null +++ b/ApiDemos/java/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +include(":app") \ No newline at end of file diff --git a/ApiDemos/kotlin/README.md b/ApiDemos/kotlin/README.md index c1077e122..dab7eab13 100644 --- a/ApiDemos/kotlin/README.md +++ b/ApiDemos/kotlin/README.md @@ -34,7 +34,7 @@ If prompted for a gradle configuration accept the default settings. Alternatively use the `gradlew build` command to build the project directly. -This demo app requires that you add your own Google Maps API key. See [Get an API Key](../../docs/GET_AN_API_KEY.md) for more instructions. +This demo app requires that you add your own Google Maps API key. See [Get an API key](https://developers.google.com/maps/documentation/android-sdk/get-api-key) for more instructions. Support ------- diff --git a/ApiDemos/kotlin/app/build.gradle b/ApiDemos/kotlin/app/build.gradle deleted file mode 100644 index dd861f446..000000000 --- a/ApiDemos/kotlin/app/build.gradle +++ /dev/null @@ -1,83 +0,0 @@ -import org.apache.tools.ant.filters.ConcatFilter - -plugins { - id 'com.android.application' - id 'kotlin-android' - id 'kotlin-parcelize' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - compileSdk 34 - defaultConfig { - applicationId "com.example.kotlindemos" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - multiDexEnabled true - } - buildFeatures { - buildConfig = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - flavorDimensions "version" - productFlavors { - gms { - dimension "version" - applicationIdSuffix ".gms" - versionNameSuffix "-gms" - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - lintOptions { - abortOnError false - } - kotlinOptions { - freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" - } - namespace "com.example.kotlindemos" -} - -dependencies { - api 'androidx.appcompat:appcompat:1.7.0' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "androidx.cardview:cardview:1.0.0" - implementation "androidx.recyclerview:recyclerview:1.3.2" - implementation 'androidx.multidex:multidex:2.0.1' - implementation 'com.android.volley:volley:1.2.1' - - // GMS - gmsImplementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3' - gmsImplementation 'com.google.maps.android:maps-ktx:5.1.1' - - // Below is used to run the easypermissions library to manage location permissions - // EasyPermissions is needed to help us request for permission to access location - implementation 'pub.devrel:easypermissions:3.0.0' - - // Tests - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' -} - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = "local.defaults.properties" -} diff --git a/ApiDemos/kotlin/app/build.gradle.kts b/ApiDemos/kotlin/app/build.gradle.kts new file mode 100644 index 000000000..feb0bb723 --- /dev/null +++ b/ApiDemos/kotlin/app/build.gradle.kts @@ -0,0 +1,106 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("kotlin-android") + id("kotlin-parcelize") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.kotlindemos" + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + multiDexEnabled = true + } + + productFlavors { + create("gms") { + dimension = "version" + applicationIdSuffix = ".gms" + versionNameSuffix = "-gms" + } + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + flavorDimensions.add("version") + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + + lint { + abortOnError = false + } + + kotlinOptions { + freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn") + } + + namespace = "com.example.kotlindemos" +} + +dependencies { + api(libs.appcompat) + implementation(libs.kotlinStdlib) + implementation(libs.cardview) + implementation(libs.recyclerview) + implementation(libs.multidex) + implementation(libs.volley) + + // GMS + implementation(libs.lifecycleRuntimeKtx) + implementation(libs.mapsKtx) + + // Below is used to run the easypermissions library to manage location permissions + // EasyPermissions is needed to help us request for permission to access location + implementation(libs.easypermissions) + + // Tests + testImplementation(libs.junit) + androidTestImplementation(libs.androidxJunit) + androidTestImplementation(libs.espressoCore) +} + +secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + + // A properties file containing default secret values. This file can be + // checked in version control. + defaultPropertiesFileName = "local.defaults.properties" +} \ No newline at end of file diff --git a/ApiDemos/kotlin/build.gradle b/ApiDemos/kotlin/build.gradle deleted file mode 100644 index 54dfa12a8..000000000 --- a/ApiDemos/kotlin/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext.kotlin_version = '2.0.0' - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - google() - mavenCentral() - flatDir { - dirs 'libs' - } - } -} - -tasks.register('clean', Delete) { - delete rootProject.buildDir -} diff --git a/ApiDemos/kotlin/build.gradle.kts b/ApiDemos/kotlin/build.gradle.kts new file mode 100644 index 000000000..1eaf691c4 --- /dev/null +++ b/ApiDemos/kotlin/build.gradle.kts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath(libs.gradle) + classpath(libs.kotlinGradlePlugin) + classpath(libs.secretsGradlePlugin) + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle.kts files + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} \ No newline at end of file diff --git a/ApiDemos/kotlin/gradle/libs.versions.toml b/ApiDemos/kotlin/gradle/libs.versions.toml new file mode 100644 index 000000000..c120ab014 --- /dev/null +++ b/ApiDemos/kotlin/gradle/libs.versions.toml @@ -0,0 +1,32 @@ +[versions] +gradle = "8.5.1" +kotlin = "2.0.0" +appcompat = "1.7.0" +cardview = "1.0.0" +recyclerview = "1.3.2" +multidex = "2.0.1" +secretsGradlePlugin = "2.0.1" +volley = "1.2.1" +lifecycle = "2.8.4" +mapsKtx = "5.1.0" +easypermissions = "3.0.0" +junit = "4.13.2" +androidxJunit = "1.2.1" +espresso = "3.6.1" + +[libraries] +gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } +kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +kotlinStdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk7", version.ref = "kotlin" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +cardview = { group = "androidx.cardview", name = "cardview", version.ref = "cardview" } +recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" } +multidex = { group = "androidx.multidex", name = "multidex", version.ref = "multidex" } +secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" } +volley = { group = "com.android.volley", name = "volley", version.ref = "volley" } +lifecycleRuntimeKtx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" } +mapsKtx = { group = "com.google.maps.android", name = "maps-ktx", version.ref = "mapsKtx" } +easypermissions = { group = "pub.devrel", name = "easypermissions", version.ref = "easypermissions" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidxJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxJunit" } +espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso" } \ No newline at end of file diff --git a/ApiDemos/kotlin/settings.gradle b/ApiDemos/kotlin/settings.gradle deleted file mode 100644 index e7b4def49..000000000 --- a/ApiDemos/kotlin/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/ApiDemos/kotlin/settings.gradle.kts b/ApiDemos/kotlin/settings.gradle.kts new file mode 100644 index 000000000..f006b9d51 --- /dev/null +++ b/ApiDemos/kotlin/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +include(":app") \ No newline at end of file diff --git a/WearOS/Wearable/build.gradle b/WearOS/Wearable/build.gradle deleted file mode 100644 index fe8b82aa4..000000000 --- a/WearOS/Wearable/build.gradle +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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.application' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} -apply plugin: 'kotlin-android' - -android { - compileSdk 34 - - defaultConfig { - applicationId "com.example.wearos" - minSdk 23 - targetSdk 31 - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - namespace 'com.example.wearosmap' - - kotlinOptions { - jvmTarget = "21" - } - kotlin { - jvmToolchain(21) - } -} - -// [START maps_wear_os_dependencies] -dependencies { - // [START_EXCLUDE] - implementation "androidx.core:core-ktx:1.13.1" - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.0' - // [END_EXCLUDE] - compileOnly 'com.google.android.wearable:wearable:2.9.0' - implementation 'com.google.android.support:wearable:2.9.0' - implementation 'com.google.android.gms:play-services-maps:19.0.0' - - // This dependency is necessary for ambient mode - implementation 'androidx.wear:wear:1.3.0' -} -// [END maps_wear_os_dependencies] - -secrets { - defaultPropertiesFileName 'local.defaults.properties' -} diff --git a/WearOS/Wearable/build.gradle.kts b/WearOS/Wearable/build.gradle.kts new file mode 100644 index 000000000..f62d6c0d6 --- /dev/null +++ b/WearOS/Wearable/build.gradle.kts @@ -0,0 +1,69 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") + kotlin("android") // The Kotlin plugin is applied differently in Kotlin DSL +} + +android { + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.wearos" + minSdk = 23 + targetSdk = 31 + versionCode = 1 + versionName = "1.0" + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + namespace = "com.example.wearosmap" + + kotlinOptions { + jvmTarget = "21" + } + + kotlin { + jvmToolchain(21) + } +} + +// [START maps_wear_os_dependencies] +dependencies { + // [START_EXCLUDE] + implementation("androidx.core:core-ktx:1.13.1") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.0") + // [END_EXCLUDE] + compileOnly("com.google.android.wearable:wearable:2.9.0") + implementation("com.google.android.support:wearable:2.9.0") + implementation("com.google.android.gms:play-services-maps:19.0.0") + + // This dependency is necessary for ambient mode + implementation("androidx.wear:wear:1.3.0") +} +// [END maps_wear_os_dependencies] + +secrets { + defaultPropertiesFileName = "local.defaults.properties" +} diff --git a/WearOS/build.gradle b/WearOS/build.gradle.kts similarity index 67% rename from WearOS/build.gradle rename to WearOS/build.gradle.kts index a4ad22378..a390dbf9e 100644 --- a/WearOS/build.gradle +++ b/WearOS/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Google Inc. All Rights Reserved. + * 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. @@ -15,7 +15,7 @@ */ plugins { - id 'com.android.application' version '8.5.2' apply false - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false - id 'org.jetbrains.kotlin.android' version '2.0.0' apply false + id("com.android.application") version "8.5.0" apply false + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") version "2.0.1" apply false + id("org.jetbrains.kotlin.android") version "2.0.0" apply false } diff --git a/WearOS/gradle/libs.versions.toml b/WearOS/gradle/libs.versions.toml new file mode 100644 index 000000000..e69de29bb diff --git a/WearOS/settings.gradle b/WearOS/settings.gradle.kts similarity index 91% rename from WearOS/settings.gradle rename to WearOS/settings.gradle.kts index f78c24215..a6147da13 100644 --- a/WearOS/settings.gradle +++ b/WearOS/settings.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Google Inc. All Rights Reserved. + * 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. @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + pluginManagement { repositories { gradlePluginPortal() @@ -20,11 +21,14 @@ pluginManagement { mavenCentral() } } + dependencyResolutionManagement { + repositories repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() } } -include ':Wearable' + +include(":Wearable") diff --git a/snippets/app-compose/build.gradle b/snippets/app-compose/build.gradle deleted file mode 100644 index 399cfa585..000000000 --- a/snippets/app-compose/build.gradle +++ /dev/null @@ -1,75 +0,0 @@ -plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' - id 'org.jetbrains.kotlin.plugin.compose' version "2.0.0" - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - namespace 'com.example.app_compose' - compileSdk 34 - - defaultConfig { - applicationId "com.example.app_compose" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - - buildFeatures { - compose true - buildConfig = true - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - kotlinOptions { - jvmTarget = '21' - } -} - -// [START maps_android_compose_dependency] -dependencies { - - // [START_EXCLUDE silent] - implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.0' - implementation 'androidx.core:core-ktx:1.13.1' - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation "androidx.compose.foundation:foundation:1.7.0-beta04" - implementation "androidx.compose.material:material:1.7.0-beta04" - implementation 'com.google.android.material:material:1.12.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7' - implementation 'androidx.navigation:navigation-ui-ktx:2.7.7' - implementation 'com.android.volley:volley:1.2.1' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3' - // [END_EXCLUDE] - - // Android Maps Compose composables for the Maps SDK for Android - implementation 'com.google.maps.android:maps-compose:6.1.0' -} -// [END maps_android_compose_dependency] - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = 'local.defaults.properties' -} diff --git a/snippets/app-compose/build.gradle.kts b/snippets/app-compose/build.gradle.kts new file mode 100644 index 000000000..a61e38b76 --- /dev/null +++ b/snippets/app-compose/build.gradle.kts @@ -0,0 +1,89 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("org.jetbrains.kotlin.plugin.compose") version "2.0.0" + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + namespace = "com.example.app_compose" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.app_compose" + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + + buildFeatures { + compose = true + buildConfig = true + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + kotlinOptions { + jvmTarget = "21" + } +} + +// [START maps_android_compose_dependency] +dependencies { + // [START_EXCLUDE silent] + implementation(libs.kotlin.stdlib) + implementation(libs.core.ktx) + implementation(libs.appcompat) + implementation(libs.compose.foundation) + implementation(libs.compose.material) + implementation(libs.material) + implementation(libs.constraintlayout) + implementation(libs.navigation.fragment.ktx) + implementation(libs.navigation.ui.ktx) + implementation(libs.volley) + implementation(libs.lifecycle.runtime.ktx) + // [END_EXCLUDE] + + // Android Maps Compose composables for the Maps SDK for Android + implementation("com.google.maps.android:maps-compose:6.1.0") +} +// [END maps_android_compose_dependency] + +secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + + // A properties file containing default secret values. This file can be + // checked in version control. + defaultPropertiesFileName = "local.defaults.properties" +} \ No newline at end of file diff --git a/snippets/app-ktx/build.gradle b/snippets/app-ktx/build.gradle deleted file mode 100644 index 04e152758..000000000 --- a/snippets/app-ktx/build.gradle +++ /dev/null @@ -1,66 +0,0 @@ -plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - namespace 'com.example.app_ktx' - compileSdk 34 - - defaultConfig { - applicationId "com.example.app_ktx" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary true - } - } - buildFeatures { - buildConfig = true - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - kotlinOptions { - jvmTarget = '21' - } -} - -// [START maps_android_ktx_install_snippet] -dependencies { - // [START_EXCLUDE silent] - implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.0' - implementation 'androidx.core:core-ktx:1.13.1' - implementation "androidx.appcompat:appcompat:1.7.0" - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3' - // [END_EXCLUDE] - - // KTX for the Maps SDK for Android library - implementation 'com.google.maps.android:maps-ktx:5.1.1' -} -// [END maps_android_ktx_install_snippet] - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = 'local.defaults.properties' -} diff --git a/snippets/app-ktx/build.gradle.kts b/snippets/app-ktx/build.gradle.kts new file mode 100644 index 000000000..a6392f54a --- /dev/null +++ b/snippets/app-ktx/build.gradle.kts @@ -0,0 +1,83 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + namespace = "com.example.app_ktx" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.app_ktx" + minSdk = 21 + targetSdk = 34 + 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") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + kotlinOptions { + jvmTarget = "21" + } +} + +// [START maps_android_ktx_install_snippet] +dependencies { + // [START_EXCLUDE silent] + implementation(libs.kotlin.stdlib) + implementation(libs.core.ktx) + implementation(libs.appcompat) + implementation(libs.lifecycle.runtime.ktx) + // [END_EXCLUDE] + + // KTX for the Maps SDK for Android library + implementation("com.google.maps.android:maps-ktx:5.1.1") +} +// [END maps_android_ktx_install_snippet] + +secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + + // A properties file containing default secret values. This file can be + // checked in version control. + defaultPropertiesFileName = "local.defaults.properties" +} \ No newline at end of file diff --git a/snippets/app-places-ktx/build.gradle b/snippets/app-places-ktx/build.gradle deleted file mode 100644 index 9cc0d8e13..000000000 --- a/snippets/app-places-ktx/build.gradle +++ /dev/null @@ -1,66 +0,0 @@ -plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - namespace 'com.example.app_places_ktx' - compileSdk 34 - - defaultConfig { - applicationId "com.example.app_places_ktx" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildFeatures { - buildConfig = true - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - kotlinOptions { - jvmTarget = '21' - } -} -// [START places_android_ktx_install_snippet] -dependencies { - // [START_EXCLUDE silent] - implementation 'androidx.core:core-ktx:1.13.1' - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'com.android.volley:volley:1.2.1' - implementation 'com.google.android.material:material:1.12.0' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' - // [END_EXCLUDE] - - // KTX for the Places SDK for Android library - implementation 'com.google.maps.android:places-ktx:3.2.0' -} -// [END places_android_ktx_install_snippet] - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = 'local.defaults.properties' -} diff --git a/snippets/app-places-ktx/build.gradle.kts b/snippets/app-places-ktx/build.gradle.kts new file mode 100644 index 000000000..92e705a28 --- /dev/null +++ b/snippets/app-places-ktx/build.gradle.kts @@ -0,0 +1,83 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + namespace = "com.example.app_places_ktx" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.app_places_ktx" + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + kotlinOptions { + jvmTarget = "21" + } +} + +// [START places_android_ktx_install_snippet] +dependencies { + // [START_EXCLUDE silent] + implementation(libs.core.ktx) + implementation(libs.appcompat) + implementation(libs.volley) + implementation(libs.material) + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) + // [END_EXCLUDE] + + // KTX for the Places SDK for Android library + implementation("com.google.maps.android:places-ktx:3.2.0") +} +// [END places_android_ktx_install_snippet] + +secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + + // A properties file containing default secret values. This file can be + // checked in version control. + defaultPropertiesFileName = "local.defaults.properties" +} \ No newline at end of file diff --git a/snippets/app-rx/build.gradle b/snippets/app-rx/build.gradle deleted file mode 100644 index 7dc1c3fe4..000000000 --- a/snippets/app-rx/build.gradle +++ /dev/null @@ -1,75 +0,0 @@ -plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - namespace 'com.example.app_maps_rx' - compileSdk 34 - - defaultConfig { - applicationId "com.example.app_maps_rx" - minSdk 24 - targetSdk 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildFeatures { - buildConfig = true - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - kotlinOptions { - jvmTarget = '21' - } -} - -// [START maps_android_maps_rx_install] -dependencies { - // RxJava bindings for the Maps SDK - implementation 'com.google.maps.android:maps-rx:1.0.0' - - // RxJava bindings for the Places SDK - implementation 'com.google.maps.android:places-rx:1.0.0' - - // It is recommended to also include the latest Maps SDK, Places SDK and RxJava so you - // have the latest features and bug fixes. - implementation "com.google.android.gms:play-services-maps:19.0.0" - implementation 'com.google.android.libraries.places:places:3.5.0' - implementation 'io.reactivex.rxjava3:rxjava:3.1.8' - - // [START_EXCLUDE silent] - implementation "androidx.appcompat:appcompat:1.7.0" - implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.3" - implementation "com.google.android.material:material:1.12.0" - implementation "com.trello.rxlifecycle4:rxlifecycle-android-lifecycle-kotlin:4.0.2" - implementation "com.google.maps.android:maps-ktx:5.1.1" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.0" - // [END_EXCLUDE silent] -} -// [END maps_android_maps_rx_install] - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = 'local.defaults.properties' -} diff --git a/snippets/app-rx/build.gradle.kts b/snippets/app-rx/build.gradle.kts new file mode 100644 index 000000000..f50b8e5da --- /dev/null +++ b/snippets/app-rx/build.gradle.kts @@ -0,0 +1,91 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + namespace = "com.example.app_maps_rx" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.app_maps_rx" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + kotlinOptions { + jvmTarget = "21" + } +} + +// [START maps_android_maps_rx_install] +dependencies { + // RxJava bindings for the Maps SDK + implementation("com.google.maps.android:maps-rx:1.0.0") + + // RxJava bindings for the Places SDK + implementation("com.google.maps.android:places-rx:1.0.0") + + // It is recommended to also include the latest Maps SDK, Places SDK and RxJava so you + // have the latest features and bug fixes. + implementation("com.google.android.gms:play-services-maps:19.0.0") + implementation("com.google.android.libraries.places:places:3.5.0") + implementation("io.reactivex.rxjava3:rxjava:3.1.8") + + // [START_EXCLUDE silent] + implementation(libs.appcompat) + implementation(libs.lifecycle.runtime.ktx) + implementation(libs.material) + implementation(libs.rxlifecycle.android.lifecycle.kotlin) + implementation(libs.maps.ktx) + implementation(libs.kotlin.stdlib.jdk8) + // [END_EXCLUDE silent] +} +// [END maps_android_maps_rx_install] + +secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + + // A properties file containing default secret values. This file can be + // checked in version control. + defaultPropertiesFileName = "local.defaults.properties" +} \ No newline at end of file diff --git a/snippets/app-utils-ktx/build.gradle b/snippets/app-utils-ktx/build.gradle deleted file mode 100644 index 04c4cbd8f..000000000 --- a/snippets/app-utils-ktx/build.gradle +++ /dev/null @@ -1,64 +0,0 @@ -plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - namespace 'com.example.app_utils_ktx' - compileSdk 34 - - defaultConfig { - applicationId "com.example.app_utils_ktx" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildFeatures { - buildConfig = true - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - kotlinOptions { - jvmTarget = '21' - } -} - -// [START maps_android_utils_ktx_install_snippet] -dependencies { - // [START_EXCLUDE silent] - implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.0' - implementation 'androidx.core:core-ktx:1.13.1' - implementation "androidx.appcompat:appcompat:1.7.0" - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3' - // [END_EXCLUDE] - - // KTX for the Maps SDK for Android Utility Library - implementation 'com.google.maps.android:maps-utils-ktx:5.1.1' -} -// [END maps_android_utils_ktx_install_snippet] - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = 'local.defaults.properties' -} diff --git a/snippets/app-utils-ktx/build.gradle.kts b/snippets/app-utils-ktx/build.gradle.kts new file mode 100644 index 000000000..f79eff2d4 --- /dev/null +++ b/snippets/app-utils-ktx/build.gradle.kts @@ -0,0 +1,82 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + namespace = "com.example.app_utils_ktx" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.app_utils_ktx" + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + getByName("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + + kotlinOptions { + jvmTarget = "21" + } +} + +// [START maps_android_utils_ktx_install_snippet] +dependencies { + // [START_EXCLUDE silent] + implementation(libs.kotlin.stdlib) + implementation(libs.core.ktx) + implementation(libs.appcompat) + implementation(libs.lifecycle.runtime.ktx) + // [END_EXCLUDE] + + // KTX for the Maps SDK for Android Utility Library + implementation("com.google.maps.android:maps-utils-ktx:5.1.1") +} +// [END maps_android_utils_ktx_install_snippet] + +secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + + // A properties file containing default secret values. This file can be + // checked in version control. + defaultPropertiesFileName = "local.defaults.properties" +} \ No newline at end of file diff --git a/snippets/app-utils/build.gradle b/snippets/app-utils/build.gradle deleted file mode 100644 index 0dde33254..000000000 --- a/snippets/app-utils/build.gradle +++ /dev/null @@ -1,69 +0,0 @@ -plugins { - id 'com.android.application' - id 'org.jetbrains.kotlin.android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - namespace 'com.example.app_utils' - compileSdk 34 - - defaultConfig { - applicationId "com.example.app_utils" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildFeatures { - buildConfig = true - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - kotlinOptions { - jvmTarget = '21' - } -} - -// [START maps_android_utils_install_snippet] -dependencies { - - // [START_EXCLUDE silent] - implementation 'androidx.core:core-ktx:1.13.1' - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'com.google.android.material:material:1.12.0' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' - // [END_EXCLUDE] - - // Utility Library for Maps SDK for Android - // You do not need to add a separate dependency for the Maps SDK for Android - // since this library builds in the compatible version of the Maps SDK. - implementation 'com.google.maps.android:android-maps-utils:3.8.0' -} -// [END maps_android_utils_install_snippet] - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = 'local.defaults.properties' -} diff --git a/snippets/app-utils/build.gradle.kts b/snippets/app-utils/build.gradle.kts new file mode 100644 index 000000000..426fd4e49 --- /dev/null +++ b/snippets/app-utils/build.gradle.kts @@ -0,0 +1,85 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + namespace = "com.example.app_utils" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.app_utils" + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + kotlinOptions { + jvmTarget = "21" + } +} + +// [START maps_android_utils_install_snippet] +dependencies { + + // [START_EXCLUDE silent] + implementation(libs.core.ktx) + implementation(libs.appcompat) + implementation(libs.material) + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) + // [END_EXCLUDE] + + // Utility Library for Maps SDK for Android + // You do not need to add a separate dependency for the Maps SDK for Android + // since this library builds in the compatible version of the Maps SDK. + implementation("com.google.maps.android:android-maps-utils:3.8.2") +} +// [END maps_android_utils_install_snippet] + +secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + + // A properties file containing default secret values. This file can be + // checked in version control. + defaultPropertiesFileName = "local.defaults.properties" +} \ No newline at end of file diff --git a/snippets/app/build.gradle b/snippets/app/build.gradle deleted file mode 100644 index 393696c8d..000000000 --- a/snippets/app/build.gradle +++ /dev/null @@ -1,89 +0,0 @@ -// [START maps_android_secrets_gradle_plugin] -plugins { - // [START_EXCLUDE] - id 'com.android.application' - id 'kotlin-android' - // [END_EXCLUDE] - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} -// [END maps_android_secrets_gradle_plugin] - -android { - compileSdk 34 - defaultConfig { - applicationId "com.google.maps.example" - minSdk 24 - targetSdk 34 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildFeatures { - buildConfig = true - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - flavorDimensions "version" - - productFlavors { - gms { - dimension "version" - applicationIdSuffix ".gms" - versionNameSuffix "-gms" - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - namespace 'com.google.maps.example' -} - -// [START maps_android_play_services_maps_dependency] -dependencies { - // [START_EXCLUDE silent] - implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.0' - implementation 'androidx.core:core-ktx:1.13.1' - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation "androidx.compose.foundation:foundation:1.7.0-beta05" - implementation "androidx.compose.material:material:1.7.0-beta05" - implementation 'com.google.android.material:material:1.12.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7' - implementation 'androidx.navigation:navigation-ui-ktx:2.7.7' - implementation 'com.android.volley:volley:1.2.1' - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3' - implementation 'com.google.android.libraries.places:places:3.5.0' - // [END_EXCLUDE] - - // Maps SDK for Android - implementation 'com.google.android.gms:play-services-maps:19.0.0' -} -// [END maps_android_play_services_maps_dependency] - -// [START maps_android_secrets_gradle_plugin_config] -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = "local.defaults.properties" - - // Configure which keys should be ignored by the plugin by providing regular expressions. - // "sdk.dir" is ignored by default. - ignoreList.add("keyToIgnore") // Ignore the key "keyToIgnore" - ignoreList.add("sdk.*") // Ignore all keys matching the regexp "sdk.*" -} -// [END maps_android_secrets_gradle_plugin_config] diff --git a/snippets/app/build.gradle.kts b/snippets/app/build.gradle.kts new file mode 100644 index 000000000..cca70f9ff --- /dev/null +++ b/snippets/app/build.gradle.kts @@ -0,0 +1,105 @@ +/* + * 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. + */ + +// [START maps_android_secrets_gradle_plugin] +plugins { + // [START_EXCLUDE] + id("com.android.application") + id("kotlin-android") + // [END_EXCLUDE] + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} +// [END maps_android_secrets_gradle_plugin] + +android { + compileSdk = 34 + defaultConfig { + applicationId = "com.google.maps.example" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + + flavorDimensions.add("version") + + productFlavors { + create("gms") { + dimension = "version" + applicationIdSuffix = ".gms" + versionNameSuffix = "-gms" + } + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + namespace = "com.google.maps.example" +} + +// [START maps_android_play_services_maps_dependency] +dependencies { + // [START_EXCLUDE silent] + implementation(libs.kotlin.stdlib) + implementation(libs.core.ktx) + implementation(libs.appcompat) + implementation(libs.compose.foundation) + implementation(libs.compose.material) + implementation(libs.material) + implementation(libs.constraintlayout) + implementation(libs.navigation.fragment.ktx) + implementation(libs.navigation.ui.ktx) + implementation(libs.volley) + implementation(libs.lifecycle.runtime.ktx) + implementation(libs.places) + // [END_EXCLUDE] + + // Maps SDK for Android + implementation("com.google.android.gms:play-services-maps:19.0.0") +} +// [END maps_android_play_services_maps_dependency] + +// [START maps_android_secrets_gradle_plugin_config] +secrets { + // To add your Maps API key to this project: + // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. + // 2. Add this line, where YOUR_API_KEY is your API key: + // MAPS_API_KEY=YOUR_API_KEY + propertiesFileName = "secrets.properties" + + // A properties file containing default secret values. This file can be + // checked in version control. + defaultPropertiesFileName = "local.defaults.properties" + + // Configure which keys should be ignored by the plugin by providing regular expressions. + // "sdk.dir" is ignored by default. + ignoreList.add("keyToIgnore") // Ignore the key "keyToIgnore" + ignoreList.add("sdk.*") // Ignore all keys matching the regexp "sdk.*" +} +// [END maps_android_secrets_gradle_plugin_config] \ No newline at end of file diff --git a/snippets/build.gradle b/snippets/build.gradle deleted file mode 100644 index e22a1a636..000000000 --- a/snippets/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -// [START maps_android_secrets_gradle_plugin_project_level_config] -buildscript { - dependencies { - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - } -} -// [END maps_android_secrets_gradle_plugin_project_level_config] - -plugins { - id 'com.android.application' version '8.5.0' apply false - id 'org.jetbrains.kotlin.android' version '2.0.0' apply false -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/snippets/build.gradle.kts b/snippets/build.gradle.kts new file mode 100644 index 000000000..cf34308dc --- /dev/null +++ b/snippets/build.gradle.kts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// [START maps_android_secrets_gradle_plugin_project_level_config] +buildscript { + dependencies { + classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1") + } +} +// [END maps_android_secrets_gradle_plugin_project_level_config] + +plugins { + id("com.android.application") version "8.5.0" apply false + id("org.jetbrains.kotlin.android") version "2.0.0" apply false +} + +tasks.register("clean") { + delete(rootProject.buildDir) +} diff --git a/snippets/gradle/libs.versions.toml b/snippets/gradle/libs.versions.toml new file mode 100644 index 000000000..bea68b064 --- /dev/null +++ b/snippets/gradle/libs.versions.toml @@ -0,0 +1,37 @@ +[versions] +espressoCore = "3.6.1" +junit = "4.13.2" +junitVersion = "1.2.1" +kotlin = "2.0.0" +coreKtx = "1.13.1" +appCompat = "1.7.0" +composeFoundation = "1.7.0-beta06" +composeMaterial = "1.7.0-beta06" +mapsKtx = "5.1.1" +material = "1.12.0" +constraintLayout = "2.1.4" +navigation = "2.7.7" +rxlifecycleAndroidLifecycleKotlin = "4.0.2" +volley = "1.2.1" +lifecycleRuntime = "2.8.4" +places = "3.5.0" + +[libraries] +espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" } +ext-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" } +junit = { module = "junit:junit", version.ref = "junit" } +kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" } +core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appCompat" } +compose-foundation = { group = "androidx.compose.foundation", name = "foundation", version.ref = "composeFoundation" } +compose-material = { group = "androidx.compose.material", name = "material", version.ref = "composeMaterial" } +kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" } +maps-ktx = { module = "com.google.maps.android:maps-ktx", version.ref = "mapsKtx" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintLayout" } +navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigation" } +navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigation" } +rxlifecycle-android-lifecycle-kotlin = { module = "com.trello.rxlifecycle4:rxlifecycle-android-lifecycle-kotlin", version.ref = "rxlifecycleAndroidLifecycleKotlin" } +volley = { group = "com.android.volley", name = "volley", version.ref = "volley" } +lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntime" } +places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" } \ No newline at end of file diff --git a/snippets/settings.gradle b/snippets/settings.gradle deleted file mode 100644 index 742db9a65..000000000 --- a/snippets/settings.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// [START maps_android_settings_plugin_management] -pluginManagement { - repositories { - gradlePluginPortal() - google() - mavenCentral() - } -} -// [END maps_android_settings_plugin_management] -// [START maps_android_settings_dependency_resolution_management] -dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) - repositories { - google() - mavenCentral() - } -} -// [END maps_android_settings_dependency_resolution_management] -include ':app' -rootProject.name = "Snippets App" -include ':app-ktx' -include ':app-utils-ktx' -include ':app-compose' -include ':app-places-ktx' -include ':app-rx' -include ':app-utils' diff --git a/snippets/settings.gradle.kts b/snippets/settings.gradle.kts new file mode 100644 index 000000000..dcbc57410 --- /dev/null +++ b/snippets/settings.gradle.kts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// [START maps_android_settings_plugin_management] +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +// [END maps_android_settings_plugin_management] + +// [START maps_android_settings_dependency_resolution_management] +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +// [END maps_android_settings_dependency_resolution_management] + +include(":app") +rootProject.name = "Snippets App" +include(":app-ktx") +include(":app-utils-ktx") +include(":app-compose") +include(":app-places-ktx") +include(":app-rx") +include(":app-utils") diff --git a/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle b/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle deleted file mode 100644 index 636cdf01b..000000000 --- a/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -plugins { - id 'com.android.application' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - compileSdk 34 - defaultConfig { - applicationId "com.example.currentplacedetailsonmap" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - } - buildFeatures { - buildConfig = true - } - buildTypes { - debug { - debuggable true - } - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - namespace 'com.example.currentplacedetailsonmap' -} - -dependencies { - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'com.google.android.gms:play-services-maps:19.0.0' - implementation 'com.google.android.libraries.places:places:3.5.0' - implementation 'com.android.volley:volley:1.2.1' - implementation platform("org.jetbrains.kotlin:kotlin-bom:2.0.0") - testImplementation'junit:junit:4.13.2' -} - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = 'local.defaults.properties' -} diff --git a/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle.kts b/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle.kts new file mode 100644 index 000000000..b998621cc --- /dev/null +++ b/tutorials/java/CurrentPlaceDetailsOnMap/app/build.gradle.kts @@ -0,0 +1,62 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.currentplacedetailsonmap" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + versionCode = libs.versions.versionCode.get().toInt() + versionName = libs.versions.versionName.get() + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + debug { + isDebuggable = true + } + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + namespace = "com.example.currentplacedetailsonmap" +} + +dependencies { + implementation(libs.appcompat) + implementation(libs.playServicesMaps) + implementation(libs.places) + implementation(libs.volley) + implementation(platform(libs.kotlinBom)) + testImplementation(libs.junit) +} + +secrets { + propertiesFileName = "secrets.properties" + defaultPropertiesFileName = "local.defaults.properties" +} diff --git a/tutorials/java/CurrentPlaceDetailsOnMap/build.gradle b/tutorials/java/CurrentPlaceDetailsOnMap/build.gradle deleted file mode 100644 index 12ab2ee8e..000000000 --- a/tutorials/java/CurrentPlaceDetailsOnMap/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - maven { - url 'https://maven.google.com' - } - mavenCentral() - } -} - -tasks.register('clean', Delete) { - delete rootProject.buildDir -} diff --git a/tutorials/java/CurrentPlaceDetailsOnMap/build.gradle.kts b/tutorials/java/CurrentPlaceDetailsOnMap/build.gradle.kts new file mode 100644 index 000000000..ed87dff71 --- /dev/null +++ b/tutorials/java/CurrentPlaceDetailsOnMap/build.gradle.kts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + mavenCentral() + google() + } + dependencies { + classpath(libs.gradle) + classpath(libs.secretsGradlePlugin) + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + maven { + url = uri("https://maven.google.com") + } + mavenCentral() + } +} + +tasks.register("clean") { + delete(rootProject.buildDir) +} diff --git a/tutorials/java/CurrentPlaceDetailsOnMap/gradle/libs.versions.toml b/tutorials/java/CurrentPlaceDetailsOnMap/gradle/libs.versions.toml new file mode 100644 index 000000000..bcba2ce0d --- /dev/null +++ b/tutorials/java/CurrentPlaceDetailsOnMap/gradle/libs.versions.toml @@ -0,0 +1,24 @@ +[versions] +compileSdk = "34" +gradle = "8.5.2" +minSdk = "21" +secretsGradlePlugin = "2.0.1" +targetSdk = "34" +versionCode = "1" +versionName = "1.0" +appcompat = "1.7.0" +playServicesMaps = "19.0.0" +places = "3.5.0" +volley = "1.2.1" +kotlinBom = "2.0.0" +junit = "4.13.2" + +[libraries] +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } +playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" } +places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" } +secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" } +volley = { group = "com.android.volley", name = "volley", version.ref = "volley" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" } diff --git a/tutorials/java/CurrentPlaceDetailsOnMap/settings.gradle b/tutorials/java/CurrentPlaceDetailsOnMap/settings.gradle deleted file mode 100644 index e7b4def49..000000000 --- a/tutorials/java/CurrentPlaceDetailsOnMap/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/tutorials/java/CurrentPlaceDetailsOnMap/settings.gradle.kts b/tutorials/java/CurrentPlaceDetailsOnMap/settings.gradle.kts new file mode 100644 index 000000000..0ca0a0f7d --- /dev/null +++ b/tutorials/java/CurrentPlaceDetailsOnMap/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +include(":app") diff --git a/tutorials/java/MapWithMarker/app/build.gradle b/tutorials/java/MapWithMarker/app/build.gradle deleted file mode 100644 index ed548f0f6..000000000 --- a/tutorials/java/MapWithMarker/app/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -plugins { - id 'com.android.application' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - compileSdk 34 - defaultConfig { - applicationId "com.example.mapwithmarker" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildFeatures { - buildConfig = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - namespace "com.example.mapwithmarker" -} - -dependencies { - implementation 'com.google.android.gms:play-services-maps:19.0.0' - implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0")) - implementation 'androidx.appcompat:appcompat:1.7.0' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' -} - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // To add your Maps API key to this project: - // 1. Open the root project's local.properties file - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - defaultPropertiesFileName 'local.defaults.properties' -} diff --git a/tutorials/java/MapWithMarker/app/build.gradle.kts b/tutorials/java/MapWithMarker/app/build.gradle.kts new file mode 100644 index 000000000..7625efe65 --- /dev/null +++ b/tutorials/java/MapWithMarker/app/build.gradle.kts @@ -0,0 +1,59 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.mapwithmarker" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + versionCode = libs.versions.versionCode.get().toInt() + versionName = libs.versions.versionName.get() + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + namespace = "com.example.mapwithmarker" +} + +dependencies { + implementation(libs.playServicesMaps) + implementation(platform(libs.kotlinBom)) + implementation(libs.appcompat) + testImplementation(libs.junit) + androidTestImplementation(libs.androidxTestExtJunit) + androidTestImplementation(libs.espressoCore) +} + +secrets { + defaultPropertiesFileName = "local.defaults.properties" +} diff --git a/tutorials/java/MapWithMarker/build.gradle b/tutorials/java/MapWithMarker/build.gradle deleted file mode 100644 index 03eee02a5..000000000 --- a/tutorials/java/MapWithMarker/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenCentral() - google() - } -} - -tasks.register('clean', Delete) { - delete rootProject.buildDir -} diff --git a/tutorials/java/MapWithMarker/build.gradle.kts b/tutorials/java/MapWithMarker/build.gradle.kts new file mode 100644 index 000000000..fc7cb2973 --- /dev/null +++ b/tutorials/java/MapWithMarker/build.gradle.kts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + mavenCentral() + google() + } + dependencies { + classpath("com.android.tools.build:gradle:8.5.0") + classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1") + } +} + +allprojects { + repositories { + mavenCentral() + google() + } +} + +tasks.register("clean") { + delete(rootProject.buildDir) +} diff --git a/tutorials/java/MapWithMarker/gradle/libs.versions.toml b/tutorials/java/MapWithMarker/gradle/libs.versions.toml new file mode 100644 index 000000000..8b47e88c4 --- /dev/null +++ b/tutorials/java/MapWithMarker/gradle/libs.versions.toml @@ -0,0 +1,20 @@ +[versions] +compileSdk = "34" +minSdk = "21" +targetSdk = "34" +versionCode = "1" +versionName = "1.0" +playServicesMaps = "19.0.0" +kotlinBom = "2.0.0" +appcompat = "1.7.0" +junit = "4.13.2" +androidxTestExtJunit = "1.2.1" +espressoCore = "3.6.1" + +[libraries] +playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" } +kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" } +espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } diff --git a/tutorials/java/MapWithMarker/settings.gradle b/tutorials/java/MapWithMarker/settings.gradle deleted file mode 100644 index e7b4def49..000000000 --- a/tutorials/java/MapWithMarker/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/tutorials/java/MapWithMarker/settings.gradle.kts b/tutorials/java/MapWithMarker/settings.gradle.kts new file mode 100644 index 000000000..0ca0a0f7d --- /dev/null +++ b/tutorials/java/MapWithMarker/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +include(":app") diff --git a/tutorials/java/Polygons/app/build.gradle b/tutorials/java/Polygons/app/build.gradle deleted file mode 100644 index e509a2ccd..000000000 --- a/tutorials/java/Polygons/app/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -plugins { - id 'com.android.application' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - compileSdk 34 - defaultConfig { - applicationId "com.example.polygons" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildFeatures { - buildConfig = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - namespace "com.example.polygons" -} - -dependencies { - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'com.google.android.gms:play-services-maps:19.0.0' - implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0")) - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' -} - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // To add your Maps API key to this project: - // 1. Open the root project's local.properties file - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - defaultPropertiesFileName 'local.defaults.properties' -} diff --git a/tutorials/java/Polygons/app/build.gradle.kts b/tutorials/java/Polygons/app/build.gradle.kts new file mode 100644 index 000000000..d34aaaddd --- /dev/null +++ b/tutorials/java/Polygons/app/build.gradle.kts @@ -0,0 +1,59 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.polygons" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + versionCode = libs.versions.versionCode.get().toInt() + versionName = libs.versions.versionName.get() + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + namespace = "com.example.polygons" +} + +dependencies { + implementation(libs.appcompat) + implementation(libs.playServicesMaps) + implementation(platform(libs.kotlinBom)) + testImplementation(libs.junit) + androidTestImplementation(libs.androidxTestExtJunit) + androidTestImplementation(libs.espressoCore) +} + +secrets { + defaultPropertiesFileName = "local.defaults.properties" +} diff --git a/tutorials/java/Polygons/build.gradle b/tutorials/java/Polygons/build.gradle deleted file mode 100644 index 03eee02a5..000000000 --- a/tutorials/java/Polygons/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenCentral() - google() - } -} - -tasks.register('clean', Delete) { - delete rootProject.buildDir -} diff --git a/tutorials/java/Polygons/build.gradle.kts b/tutorials/java/Polygons/build.gradle.kts new file mode 100644 index 000000000..c2cbb6d43 --- /dev/null +++ b/tutorials/java/Polygons/build.gradle.kts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + mavenCentral() + google() + } + dependencies { + classpath("com.android.tools.build:gradle:8.5.2") + classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1") + } +} + +allprojects { + repositories { + mavenCentral() + google() + } +} + +tasks.register("clean") { + delete(rootProject.buildDir) +} diff --git a/tutorials/java/Polygons/gradle/libs.versions.toml b/tutorials/java/Polygons/gradle/libs.versions.toml new file mode 100644 index 000000000..9a2212484 --- /dev/null +++ b/tutorials/java/Polygons/gradle/libs.versions.toml @@ -0,0 +1,20 @@ +[versions] +compileSdk = "34" +minSdk = "21" +targetSdk = "34" +versionCode = "1" +versionName = "1.0" +appcompat = "1.7.0" +playServicesMaps = "19.0.0" +kotlinBom = "2.0.0" +junit = "4.13.2" +androidxTestExtJunit = "1.2.1" +espressoCore = "3.6.1" + +[libraries] +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" } +kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" } +espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } diff --git a/tutorials/java/Polygons/settings.gradle b/tutorials/java/Polygons/settings.gradle deleted file mode 100644 index e7b4def49..000000000 --- a/tutorials/java/Polygons/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/tutorials/java/Polygons/settings.gradle.kts b/tutorials/java/Polygons/settings.gradle.kts new file mode 100644 index 000000000..edbbf0769 --- /dev/null +++ b/tutorials/java/Polygons/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +include (":app") diff --git a/tutorials/java/StyledMap/app/build.gradle b/tutorials/java/StyledMap/app/build.gradle deleted file mode 100644 index 1c99151d2..000000000 --- a/tutorials/java/StyledMap/app/build.gradle +++ /dev/null @@ -1,51 +0,0 @@ -plugins { - id 'com.android.application' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - compileSdk 34 - defaultConfig { - applicationId "com.example.styledmap" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildFeatures { - buildConfig = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - namespace "com.example.styledmap" -} - -dependencies { - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'com.google.android.gms:play-services-maps:19.0.0' - implementation(platform("org.jetbrains.kotlin:kotlin-bom:2.0.0")) - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' -} - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // A properties file containing default secret values. This file can be - // checked in version control. - defaultPropertiesFileName = 'local.defaults.properties' -} diff --git a/tutorials/java/StyledMap/app/build.gradle.kts b/tutorials/java/StyledMap/app/build.gradle.kts new file mode 100644 index 000000000..4a53b2b73 --- /dev/null +++ b/tutorials/java/StyledMap/app/build.gradle.kts @@ -0,0 +1,65 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.styledmap" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + versionCode = libs.versions.versionCode.get().toInt() + versionName = libs.versions.versionName.get() + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + compileOptions { + sourceCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get()) + targetCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get()) + } + + namespace = "com.example.styledmap" +} + +dependencies { + implementation(libs.appcompat) + implementation(libs.playServicesMaps) + implementation(platform(libs.kotlinBom)) + testImplementation(libs.junit) + androidTestImplementation(libs.androidxTestExtJunit) + androidTestImplementation(libs.espressoCore) +} + +secrets { + propertiesFileName = "secrets.properties" + defaultPropertiesFileName = "local.defaults.properties" +} diff --git a/tutorials/java/StyledMap/build.gradle b/tutorials/java/StyledMap/build.gradle deleted file mode 100644 index ee783a0e2..000000000 --- a/tutorials/java/StyledMap/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenCentral() - google() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/tutorials/java/StyledMap/build.gradle.kts b/tutorials/java/StyledMap/build.gradle.kts new file mode 100644 index 000000000..695869d66 --- /dev/null +++ b/tutorials/java/StyledMap/build.gradle.kts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + mavenCentral() + google() + } + dependencies { + classpath(libs.gradle) + classpath(libs.secretsGradlePlugin) + } +} + +allprojects { + repositories { + mavenCentral() + google() + } +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/tutorials/java/StyledMap/gradle/libs.versions.toml b/tutorials/java/StyledMap/gradle/libs.versions.toml new file mode 100644 index 000000000..14b2665f4 --- /dev/null +++ b/tutorials/java/StyledMap/gradle/libs.versions.toml @@ -0,0 +1,25 @@ +[versions] +compileSdk = "34" +gradle = "8.5.2" +minSdk = "21" +secretsGradlePlugin = "2.0.1" +targetSdk = "34" +versionCode = "1" +versionName = "1.0" +appcompat = "1.7.0" +playServicesMaps = "19.0.0" +kotlinBom = "2.0.0" +junit = "4.13.2" +androidxTestExtJunit = "1.2.1" +espressoCore = "3.6.1" +javaVersion = "21" + +[libraries] +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } +playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" } +kotlinBom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version.ref = "kotlinBom" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" } +espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" } diff --git a/tutorials/java/StyledMap/settings.gradle b/tutorials/java/StyledMap/settings.gradle deleted file mode 100644 index e7b4def49..000000000 --- a/tutorials/java/StyledMap/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/tutorials/java/StyledMap/settings.gradle.kts b/tutorials/java/StyledMap/settings.gradle.kts new file mode 100644 index 000000000..edbbf0769 --- /dev/null +++ b/tutorials/java/StyledMap/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +include (":app") diff --git a/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle b/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle deleted file mode 100644 index ac1048e46..000000000 --- a/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - compileSdk 34 - defaultConfig { - applicationId "com.example.currentplacedetailsonmap" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildFeatures { - buildConfig = true - } - buildTypes { - debug { - debuggable true - } - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - namespace 'com.example.currentplacedetailsonmap' -} - -dependencies { - androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', { - exclude group: 'com.android.support', module: 'support-annotations' - }) - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'com.google.android.gms:play-services-maps:19.0.0' - implementation 'com.google.android.libraries.places:places:3.5.0' - implementation 'com.android.volley:volley:1.2.1' - testImplementation'junit:junit:4.13.2' - implementation "androidx.core:core-ktx:1.13.1" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // To add your Maps API key to this project: - // 1. Open the root project's local.properties file - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - defaultPropertiesFileName 'local.defaults.properties' -} - diff --git a/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle.kts b/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle.kts new file mode 100644 index 000000000..cd2ff02f1 --- /dev/null +++ b/tutorials/kotlin/CurrentPlaceDetailsOnMap/app/build.gradle.kts @@ -0,0 +1,74 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.currentplacedetailsonmap" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + versionCode = libs.versions.versionCode.get().toInt() + versionName = libs.versions.versionName.get() + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + debug { + isDebuggable = true + } + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + compileOptions { + sourceCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get()) + targetCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get()) + } + + namespace = "com.example.currentplacedetailsonmap" +} + +dependencies { + androidTestImplementation(libs.espressoCore) { + exclude(group = "com.android.support", module = "support-annotations") + } + implementation(libs.appcompat) + implementation(libs.playServicesMaps) + implementation(libs.places) + implementation(libs.volley) + testImplementation(libs.junit) + implementation(libs.coreKtx) + implementation(libs.lifecycleViewModelKtx) + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${libs.versions.kotlin.get()}") +} + +secrets { + propertiesFileName = "secrets.properties" + defaultPropertiesFileName = "local.defaults.properties" +} diff --git a/tutorials/kotlin/CurrentPlaceDetailsOnMap/build.gradle b/tutorials/kotlin/CurrentPlaceDetailsOnMap/build.gradle deleted file mode 100644 index e1778ad95..000000000 --- a/tutorials/kotlin/CurrentPlaceDetailsOnMap/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext.kotlin_version = '2.0.0' - repositories { - mavenCentral() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - maven { - url 'https://maven.google.com' - } - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/tutorials/kotlin/CurrentPlaceDetailsOnMap/build.gradle.kts b/tutorials/kotlin/CurrentPlaceDetailsOnMap/build.gradle.kts new file mode 100644 index 000000000..609e6617e --- /dev/null +++ b/tutorials/kotlin/CurrentPlaceDetailsOnMap/build.gradle.kts @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + val kotlinVersion by extra("2.0.0") + repositories { + mavenCentral() + google() + } + dependencies { + classpath(libs.gradle) + classpath(libs.kotlinGradlePlugin) + classpath(libs.secretsGradlePlugin) + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + maven { + url = uri("https://maven.google.com") + } + mavenCentral() + } +} + +tasks.register("clean") { + delete(rootProject.buildDir) +} diff --git a/tutorials/kotlin/CurrentPlaceDetailsOnMap/gradle/libs.versions.toml b/tutorials/kotlin/CurrentPlaceDetailsOnMap/gradle/libs.versions.toml new file mode 100644 index 000000000..f4d2bd68e --- /dev/null +++ b/tutorials/kotlin/CurrentPlaceDetailsOnMap/gradle/libs.versions.toml @@ -0,0 +1,32 @@ +[versions] +compileSdk = "34" +gradle = "8.5.2" +kotlinGradlePlugin = "2.0.0" +minSdk = "21" +secretsGradlePlugin = "2.0.1" +targetSdk = "34" +versionCode = "1" +versionName = "1.0" +kotlin = "2.0.0" +appcompat = "1.7.0" +playServicesMaps = "19.0.0" +places = "3.5.0" +volley = "1.2.1" +junit = "4.13.2" +coreKtx = "1.13.1" +lifecycleViewModelKtx = "2.8.4" +espressoCore = "3.0.2" +javaVersion = "21" + +[libraries] +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } +kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" } +playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" } +places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" } +secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" } +volley = { group = "com.android.volley", name = "volley", version.ref = "volley" } +coreKtx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +lifecycleViewModelKtx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "lifecycleViewModelKtx" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +espressoCore = { group = "com.android.support.test.espresso", name = "espresso-core", version.ref = "espressoCore" } diff --git a/tutorials/kotlin/CurrentPlaceDetailsOnMap/settings.gradle b/tutorials/kotlin/CurrentPlaceDetailsOnMap/settings.gradle deleted file mode 100644 index e7b4def49..000000000 --- a/tutorials/kotlin/CurrentPlaceDetailsOnMap/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/tutorials/kotlin/CurrentPlaceDetailsOnMap/settings.gradle.kts b/tutorials/kotlin/CurrentPlaceDetailsOnMap/settings.gradle.kts new file mode 100644 index 000000000..f006b9d51 --- /dev/null +++ b/tutorials/kotlin/CurrentPlaceDetailsOnMap/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +include(":app") \ No newline at end of file diff --git a/tutorials/kotlin/MapWithMarker/app/build.gradle b/tutorials/kotlin/MapWithMarker/app/build.gradle deleted file mode 100644 index 68ba7e1bb..000000000 --- a/tutorials/kotlin/MapWithMarker/app/build.gradle +++ /dev/null @@ -1,57 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - compileSdk 34 - defaultConfig { - applicationId "com.example.mapwithmarker" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildFeatures { - buildConfig = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - namespace "com.example.mapwithmarker" -} - -dependencies { - implementation "androidx.core:core-ktx:1.13.1" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'com.google.android.gms:play-services-maps:19.0.0' - - // Tests - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' -} - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // To add your Maps API key to this project: - // 1. Open the root project's local.properties file - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - defaultPropertiesFileName 'local.defaults.properties' -} diff --git a/tutorials/kotlin/MapWithMarker/app/build.gradle.kts b/tutorials/kotlin/MapWithMarker/app/build.gradle.kts new file mode 100644 index 000000000..9e884e8f7 --- /dev/null +++ b/tutorials/kotlin/MapWithMarker/app/build.gradle.kts @@ -0,0 +1,68 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.mapwithmarker" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + versionCode = libs.versions.versionCode.get().toInt() + versionName = libs.versions.versionName.get() + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + compileOptions { + sourceCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get()) + targetCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get()) + } + + namespace = "com.example.mapwithmarker" +} + +dependencies { + implementation(libs.coreKtx) + implementation(libs.kotlinStdlib) + implementation(libs.appcompat) + implementation(libs.playServicesMaps) + + // Tests + testImplementation(libs.junit) + androidTestImplementation(libs.androidxTestExtJunit) + androidTestImplementation(libs.espressoCore) +} + +secrets { + defaultPropertiesFileName = "local.defaults.properties" +} \ No newline at end of file diff --git a/tutorials/kotlin/MapWithMarker/build.gradle b/tutorials/kotlin/MapWithMarker/build.gradle deleted file mode 100644 index ed1806906..000000000 --- a/tutorials/kotlin/MapWithMarker/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext.kotlin_version = '2.0.0' - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenCentral() - google() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/tutorials/kotlin/MapWithMarker/build.gradle.kts b/tutorials/kotlin/MapWithMarker/build.gradle.kts new file mode 100644 index 000000000..a62971798 --- /dev/null +++ b/tutorials/kotlin/MapWithMarker/build.gradle.kts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath(libs.gradle) + classpath(libs.secretsGradlePlugin) + classpath(libs.kotlinGradlePlugin) + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + mavenCentral() + google() + } +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/tutorials/kotlin/MapWithMarker/gradle/libs.versions.toml b/tutorials/kotlin/MapWithMarker/gradle/libs.versions.toml new file mode 100644 index 000000000..3a5e75fd9 --- /dev/null +++ b/tutorials/kotlin/MapWithMarker/gradle/libs.versions.toml @@ -0,0 +1,29 @@ +[versions] +compileSdk = "34" +gradle = "8.5.2" +kotlinGradlePlugin = "2.0.0" +minSdk = "21" +secretsGradlePlugin = "2.0.1" +targetSdk = "34" +versionCode = "1" +versionName = "1.0" +kotlin = "2.0.0" +coreKtx = "1.13.1" +appcompat = "1.7.0" +playServicesMaps = "19.0.0" +junit = "4.13.2" +androidxTestExtJunit = "1.2.1" +espressoCore = "3.6.1" +javaVersion = "21" + +[libraries] +coreKtx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } +kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" } +kotlinStdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk7", version.ref = "kotlin" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" } +espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +secretsGradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secretsGradlePlugin" } diff --git a/tutorials/kotlin/MapWithMarker/settings.gradle b/tutorials/kotlin/MapWithMarker/settings.gradle deleted file mode 100644 index e7b4def49..000000000 --- a/tutorials/kotlin/MapWithMarker/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/tutorials/kotlin/MapWithMarker/settings.gradle.kts b/tutorials/kotlin/MapWithMarker/settings.gradle.kts new file mode 100644 index 000000000..edbbf0769 --- /dev/null +++ b/tutorials/kotlin/MapWithMarker/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +include (":app") diff --git a/tutorials/kotlin/Polygons/app/build.gradle b/tutorials/kotlin/Polygons/app/build.gradle deleted file mode 100644 index 519b1dedd..000000000 --- a/tutorials/kotlin/Polygons/app/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' - id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' -} - -android { - compileSdk 34 - defaultConfig { - applicationId "com.example.polygons" - minSdk 21 - targetSdk 34 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildFeatures { - buildConfig = true - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_21 - targetCompatibility JavaVersion.VERSION_21 - } - namespace "com.example.polygons" -} - -dependencies { - implementation 'androidx.appcompat:appcompat:1.7.0' - implementation 'com.google.android.gms:play-services-maps:19.0.0' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.2.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' - implementation "androidx.core:core-ktx:1.13.1" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} - -secrets { - // To add your Maps API key to this project: - // 1. If the secrets.properties file does not exist, create it in the same folder as the local.properties file. - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - propertiesFileName = "secrets.properties" - - // To add your Maps API key to this project: - // 1. Open the root project's local.properties file - // 2. Add this line, where YOUR_API_KEY is your API key: - // MAPS_API_KEY=YOUR_API_KEY - defaultPropertiesFileName 'local.defaults.properties' -} diff --git a/tutorials/kotlin/Polygons/app/build.gradle.kts b/tutorials/kotlin/Polygons/app/build.gradle.kts new file mode 100644 index 000000000..073f0155f --- /dev/null +++ b/tutorials/kotlin/Polygons/app/build.gradle.kts @@ -0,0 +1,68 @@ +/* + * 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. + */ + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + +android { + compileSdk = libs.versions.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.polygons" + minSdk = libs.versions.minSdk.get().toInt() + targetSdk = libs.versions.targetSdk.get().toInt() + versionCode = libs.versions.versionCode.get().toInt() + versionName = libs.versions.versionName.get() + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + buildConfig = true + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } + + compileOptions { + sourceCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get()) + targetCompatibility = JavaVersion.toVersion(libs.versions.javaVersion.get()) + } + + namespace = "com.example.polygons" +} + +dependencies { + implementation(libs.appcompat) + implementation(libs.playServicesMaps) + implementation(libs.coreKtx) + implementation(libs.kotlinStdlib) + + // Tests + testImplementation(libs.junit) + androidTestImplementation(libs.androidxTestExtJunit) + androidTestImplementation(libs.espressoCore) +} + +secrets { + defaultPropertiesFileName = "local.defaults.properties" +} diff --git a/tutorials/kotlin/Polygons/build.gradle b/tutorials/kotlin/Polygons/build.gradle deleted file mode 100644 index 6108d5ffe..000000000 --- a/tutorials/kotlin/Polygons/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext.kotlin_version = '2.0.0' - repositories { - mavenCentral() - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenCentral() - google() - } -} - -tasks.register('clean', Delete) { - delete rootProject.buildDir -} diff --git a/tutorials/kotlin/Polygons/build.gradle.kts b/tutorials/kotlin/Polygons/build.gradle.kts new file mode 100644 index 000000000..89e123657 --- /dev/null +++ b/tutorials/kotlin/Polygons/build.gradle.kts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + val kotlinVersion = "2.0.0" + repositories { + mavenCentral() + google() + } + dependencies { + classpath("com.android.tools.build:gradle:8.5.0") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") + classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1") + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + mavenCentral() + google() + } +} + +tasks.register("clean") { + delete(rootProject.buildDir) +} diff --git a/tutorials/kotlin/Polygons/gradle/libs.versions.toml b/tutorials/kotlin/Polygons/gradle/libs.versions.toml new file mode 100644 index 000000000..cbe5ed383 --- /dev/null +++ b/tutorials/kotlin/Polygons/gradle/libs.versions.toml @@ -0,0 +1,23 @@ +[versions] +compileSdk = "34" +minSdk = "21" +targetSdk = "34" +versionCode = "1" +versionName = "1.0" +kotlin = "1.8.0" # Replace with your Kotlin version if different +appcompat = "1.7.0" +playServicesMaps = "19.0.0" +junit = "4.13.2" +androidxTestExtJunit = "1.2.1" +espressoCore = "3.6.1" +coreKtx = "1.13.1" +javaVersion = "21" + +[libraries] +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +playServicesMaps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" } +coreKtx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidxTestExtJunit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" } +espressoCore = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +kotlinStdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk7", version.ref = "kotlin" } diff --git a/tutorials/kotlin/Polygons/settings.gradle.kts b/tutorials/kotlin/Polygons/settings.gradle.kts new file mode 100644 index 000000000..edbbf0769 --- /dev/null +++ b/tutorials/kotlin/Polygons/settings.gradle.kts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +include (":app")