Skip to content

Commit 3f18805

Browse files
Migrate all snippets to most recent AGP and kts syntax (firebase#451)
* Updated gradle version for all modules, migrated admob to kts syntax * Use kts syntax in analytics module * Use kts syntax in appcheck module * Use kts syntax in auth module * Use kts syntax in config module * Use kts syntax in crashlytics module * Use kts syntax in database module * Use kts syntax in dl invites module * Use kts syntax in dl module * Use kts syntax in firebaseoptions module * Use kts syntax in firestore module * Use kts syntax in functions module * Use kts syntax in inappmessaging module * Use kts syntax in installations module * Use kts syntax in messaging module * Use kts syntax in ml functions module * Use kts syntax in mlkit module * Use kts syntax in perf module * Use kts syntax in storage module * Use kts syntax in tasks module * Use kts syntax in test lab module * Updated main gradle files to kts syntax * chore(ktlint): inputs.file() --> inputs.files() * chore(storage): re-add google-services.json * Apply suggestions from code review * Update build.gradle.kts --------- Co-authored-by: Rosário P. Fernandes <[email protected]>
1 parent e29bc43 commit 3f18805

File tree

196 files changed

+1888
-1695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+1888
-1695
lines changed

admob/app/build.gradle

-49
This file was deleted.

admob/app/build.gradle.kts

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
id("com.google.gms.google-services")
5+
}
6+
7+
android {
8+
namespace = "com.google.firebase.example.admob"
9+
compileSdk = 33
10+
11+
defaultConfig {
12+
applicationId = "com.google.firebase.example.admob"
13+
minSdk = 19
14+
targetSdk = 33
15+
versionCode = 1
16+
versionName = "1.0"
17+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18+
multiDexEnabled = true
19+
}
20+
buildTypes {
21+
getByName("release") {
22+
isMinifyEnabled = false
23+
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
24+
}
25+
}
26+
compileOptions {
27+
sourceCompatibility = JavaVersion.VERSION_17
28+
targetCompatibility = JavaVersion.VERSION_17
29+
}
30+
kotlinOptions {
31+
jvmTarget = "17"
32+
}
33+
}
34+
35+
dependencies {
36+
implementation("androidx.legacy:legacy-support-v4:1.0.0")
37+
implementation("androidx.browser:browser:1.5.0")
38+
implementation("androidx.appcompat:appcompat:1.6.1")
39+
implementation("com.google.firebase:firebase-ads:22.0.0")
40+
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
41+
implementation("androidx.multidex:multidex:2.0.1")
42+
43+
// [START gradle_play_config]
44+
implementation("com.google.android.gms:play-services-ads:22.0.0")
45+
// [END gradle_play_config]
46+
47+
// Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
48+
implementation(platform("com.google.firebase:firebase-bom:32.0.0"))
49+
50+
// For an optimal experience using AdMob, add the Firebase SDK
51+
// for Google Analytics. This is recommended, but not required.
52+
implementation("com.google.firebase:firebase-analytics")
53+
}

admob/app/proguard-rules.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# By default, the flags in this file are appended to flags specified
33
# in /Users/ianbarber/Library/Android/sdk/tools/proguard/proguard-android.txt
44
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
5+
# directive in build.gradle.kts.
66
#
77
# For more details, see
88
# http://developer.android.com/guide/developing/tools/proguard.html

admob/build.gradle

-25
This file was deleted.

admob/build.gradle.kts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
plugins {
4+
id("com.android.application") version "8.0.0" apply false
5+
id("com.android.library") version "8.0.0" apply false
6+
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
7+
id("com.google.gms.google-services") version "4.3.15" apply false
8+
}
9+
10+
allprojects {
11+
repositories {
12+
mavenLocal()
13+
google()
14+
mavenCentral()
15+
}
16+
}
17+
18+
tasks {
19+
register("clean", Delete::class) {
20+
delete(rootProject.buildDir)
21+
}
22+
}

admob/gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
1212
org.gradle.jvmargs=-Xmx1536m
13+
android.useAndroidX=true
1314

1415
# When configured, Gradle will run in incubating parallel mode.
1516
# This option should only be used with decoupled projects. More details, visit
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

admob/settings.gradle

-1
This file was deleted.

admob/settings.gradle.kts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pluginManagement {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
gradlePluginPortal()
6+
}
7+
}
8+
9+
include(":app")

analytics/app/build.gradle

-49
This file was deleted.

analytics/app/build.gradle.kts

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
id("com.google.gms.google-services")
5+
}
6+
7+
android {
8+
namespace = "com.google.firebase.example.analytics"
9+
compileSdk = 33
10+
11+
defaultConfig {
12+
applicationId = "com.google.firebase.example.analytics"
13+
minSdk = 19
14+
targetSdk = 33
15+
versionCode = 1
16+
versionName = "1.0"
17+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18+
multiDexEnabled = true
19+
}
20+
buildTypes {
21+
getByName("release") {
22+
isMinifyEnabled = false
23+
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
24+
}
25+
}
26+
compileOptions {
27+
sourceCompatibility = JavaVersion.VERSION_17
28+
targetCompatibility = JavaVersion.VERSION_17
29+
}
30+
kotlinOptions {
31+
jvmTarget = "17"
32+
}
33+
}
34+
35+
dependencies {
36+
implementation("androidx.legacy:legacy-support-v4:1.0.0")
37+
implementation("androidx.appcompat:appcompat:1.6.1")
38+
implementation("com.google.firebase:firebase-analytics:21.2.2")
39+
implementation("com.google.firebase:firebase-analytics-ktx:21.2.2")
40+
// Ironsource and AppLovin libraries used for ad_impression snippets
41+
implementation("com.applovin:applovin-sdk:11.5.1")
42+
implementation("com.ironsource.sdk:mediationsdk:7.2.4.1")
43+
44+
}

analytics/app/proguard-rules.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# By default, the flags in this file are appended to flags specified
33
# in /Users/ianbarber/Library/Android/sdk/tools/proguard/proguard-android.txt
44
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
5+
# directive in build.gradle.kts.
66
#
77
# For more details, see
88
# http://developer.android.com/guide/developing/tools/proguard.html

analytics/build.gradle

-25
This file was deleted.

analytics/build.gradle.kts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
plugins {
4+
id("com.android.application") version "8.0.0" apply false
5+
id("com.android.library") version "8.0.0" apply false
6+
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
7+
id("com.google.gms.google-services") version "4.3.15" apply false
8+
}
9+
10+
allprojects {
11+
repositories {
12+
mavenLocal()
13+
google()
14+
mavenCentral()
15+
maven("https://android-sdk.is.com/")
16+
}
17+
}
18+
19+
tasks {
20+
register("clean", Delete::class) {
21+
delete(rootProject.buildDir)
22+
}
23+
}

analytics/gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
1212
org.gradle.jvmargs=-Xmx1536m
13+
android.useAndroidX=true
1314

1415
# When configured, Gradle will run in incubating parallel mode.
1516
# This option should only be used with decoupled projects. More details, visit
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

analytics/settings.gradle

-10
This file was deleted.

analytics/settings.gradle.kts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
pluginManagement {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
gradlePluginPortal()
6+
// Ironsource library used for ad_impression snippets
7+
maven("https://android-sdk.is.com/")
8+
}
9+
}
10+
11+
include(":app")

0 commit comments

Comments
 (0)