Skip to content

Commit e522a69

Browse files
authored
chore: converts demo-kotlin build files to kts (#698)
Co-authored-by: dkhawk <[email protected]>
1 parent 6e9c870 commit e522a69

8 files changed

+123
-89
lines changed

Diff for: demo-kotlin/app/build.gradle

-61
This file was deleted.

Diff for: demo-kotlin/app/build.gradle.kts

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.jetbrains.kotlin.android)
4+
alias(libs.plugins.secrets.gradle.plugin)
5+
alias(libs.plugins.jetbrains.kotlin.parcelize)
6+
}
7+
8+
android {
9+
namespace = "com.example.placesdemo"
10+
compileSdk = 34
11+
12+
defaultConfig {
13+
applicationId = "com.example.placesdemo"
14+
minSdk = 21
15+
targetSdk = 34
16+
versionCode = 1
17+
versionName = "1.0"
18+
19+
multiDexEnabled = true
20+
}
21+
22+
compileOptions {
23+
sourceCompatibility = JavaVersion.VERSION_17
24+
targetCompatibility = JavaVersion.VERSION_17
25+
}
26+
27+
buildFeatures {
28+
viewBinding = true
29+
}
30+
}
31+
32+
dependencies {
33+
implementation(libs.appcompat)
34+
implementation(libs.core.ktx)
35+
implementation(libs.material)
36+
37+
implementation(libs.volley)
38+
implementation(libs.glide)
39+
implementation(libs.viewbinding)
40+
implementation(libs.multidex)
41+
42+
// Google Places
43+
implementation(libs.places.ktx)
44+
implementation(libs.maps.utils.ktx)
45+
}
46+
47+
// Secrets for Google Maps API Keys
48+
secrets {
49+
// To add your Google Maps Platform API key to this project:
50+
// 1. Copy local.defaults.properties to secrets.properties
51+
// 2. In the secrets.properties file, replace PLACES_API_KEY=DEFAULT_API_KEY with a key from a
52+
// project with Places API enabled
53+
// 3. In the secrets.properties file, replace MAPS_API_KEY=DEFAULT_API_KEY with a key from a
54+
// project with Maps SDK for Android enabled (can be the same project and key as in Step 2)
55+
defaultPropertiesFileName = "local.defaults.properties"
56+
57+
// Optionally specify a different file name containing your secrets.
58+
// The plugin defaults to "local.properties"
59+
propertiesFileName = "secrets.properties"
60+
}

Diff for: demo-kotlin/build.gradle

-26
This file was deleted.

Diff for: demo-kotlin/build.gradle.kts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
plugins {
4+
alias(libs.plugins.android.application) apply false
5+
alias(libs.plugins.jetbrains.kotlin.android) apply false
6+
alias(libs.plugins.secrets.gradle.plugin) apply false
7+
alias(libs.plugins.jetbrains.kotlin.parcelize) apply false
8+
}

Diff for: demo-kotlin/gradle/libs.versions.toml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[versions]
2+
androidGradlePlugin = "8.4.1"
3+
appcompat = "1.7.0"
4+
coreKtx = "1.13.1"
5+
glide = "4.16.0"
6+
kotlin = "2.0.0"
7+
mapsSecretsGradlePlugin = "2.0.1"
8+
mapsUtilsKtx = "5.0.0"
9+
material = "1.12.0"
10+
multidex = "2.0.1"
11+
placesKtx = "3.2.0"
12+
viewbinding = "8.4.1"
13+
volley = "1.2.1"
14+
kotlinParcelize = "1.9.24"
15+
16+
[libraries]
17+
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
18+
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
19+
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
20+
maps-utils-ktx = { module = "com.google.maps.android:maps-utils-ktx", version.ref = "mapsUtilsKtx" }
21+
material = { module = "com.google.android.material:material", version.ref = "material" }
22+
multidex = { module = "androidx.multidex:multidex", version.ref = "multidex" }
23+
places-ktx = { module = "com.google.maps.android:places-ktx", version.ref = "placesKtx" }
24+
viewbinding = { module = "com.android.databinding:viewbinding", version.ref = "viewbinding" }
25+
volley = { module = "com.android.volley:volley", version.ref = "volley" }
26+
27+
[plugins]
28+
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
29+
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
30+
secrets-gradle-plugin = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "mapsSecretsGradlePlugin" }
31+
jetbrains-kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlinParcelize" }

Diff for: demo-kotlin/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Mon Mar 28 15:44:27 PDT 2022
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

Diff for: demo-kotlin/settings.gradle

-1
This file was deleted.

Diff for: demo-kotlin/settings.gradle.kts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
pluginManagement {
2+
repositories {
3+
google {
4+
content {
5+
includeGroupByRegex("com\\.android.*")
6+
includeGroupByRegex("com\\.google.*")
7+
includeGroupByRegex("androidx.*")
8+
}
9+
}
10+
mavenCentral()
11+
gradlePluginPortal()
12+
}
13+
}
14+
dependencyResolutionManagement {
15+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
16+
repositories {
17+
google()
18+
mavenCentral()
19+
}
20+
}
21+
22+
rootProject.name = "Android Places Kotlin Demo"
23+
include(":app")

0 commit comments

Comments
 (0)