Skip to content

Commit

Permalink
Migrate all snippets to most recent AGP and kts syntax (#451)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
marinacoelho and thatfiredev authored May 17, 2023
1 parent e29bc43 commit 3f18805
Show file tree
Hide file tree
Showing 196 changed files with 1,888 additions and 1,695 deletions.
49 changes: 0 additions & 49 deletions admob/app/build.gradle

This file was deleted.

53 changes: 53 additions & 0 deletions admob/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("com.google.gms.google-services")
}

android {
namespace = "com.google.firebase.example.admob"
compileSdk = 33

defaultConfig {
applicationId = "com.google.firebase.example.admob"
minSdk = 19
targetSdk = 33
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}

dependencies {
implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("androidx.browser:browser:1.5.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.firebase:firebase-ads:22.0.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.multidex:multidex:2.0.1")

// [START gradle_play_config]
implementation("com.google.android.gms:play-services-ads:22.0.0")
// [END gradle_play_config]

// Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
implementation(platform("com.google.firebase:firebase-bom:32.0.0"))

// For an optimal experience using AdMob, add the Firebase SDK
// for Google Analytics. This is recommended, but not required.
implementation("com.google.firebase:firebase-analytics")
}
2 changes: 1 addition & 1 deletion admob/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# By default, the flags in this file are appended to flags specified
# in /Users/ianbarber/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# directive in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
25 changes: 0 additions & 25 deletions admob/build.gradle

This file was deleted.

22 changes: 22 additions & 0 deletions admob/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

plugins {
id("com.android.application") version "8.0.0" apply false
id("com.android.library") version "8.0.0" apply false
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
id("com.google.gms.google-services") version "4.3.15" apply false
}

allprojects {
repositories {
mavenLocal()
google()
mavenCentral()
}
}

tasks {
register("clean", Delete::class) {
delete(rootProject.buildDir)
}
}
1 change: 1 addition & 0 deletions admob/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
2 changes: 1 addition & 1 deletion admob/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 0 additions & 1 deletion admob/settings.gradle

This file was deleted.

9 changes: 9 additions & 0 deletions admob/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

include(":app")
49 changes: 0 additions & 49 deletions analytics/app/build.gradle

This file was deleted.

44 changes: 44 additions & 0 deletions analytics/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("com.google.gms.google-services")
}

android {
namespace = "com.google.firebase.example.analytics"
compileSdk = 33

defaultConfig {
applicationId = "com.google.firebase.example.analytics"
minSdk = 19
targetSdk = 33
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}

dependencies {
implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.firebase:firebase-analytics:21.2.2")
implementation("com.google.firebase:firebase-analytics-ktx:21.2.2")
// Ironsource and AppLovin libraries used for ad_impression snippets
implementation("com.applovin:applovin-sdk:11.5.1")
implementation("com.ironsource.sdk:mediationsdk:7.2.4.1")

}
2 changes: 1 addition & 1 deletion analytics/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# By default, the flags in this file are appended to flags specified
# in /Users/ianbarber/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# directive in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
25 changes: 0 additions & 25 deletions analytics/build.gradle

This file was deleted.

23 changes: 23 additions & 0 deletions analytics/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

plugins {
id("com.android.application") version "8.0.0" apply false
id("com.android.library") version "8.0.0" apply false
id("org.jetbrains.kotlin.android") version "1.8.20" apply false
id("com.google.gms.google-services") version "4.3.15" apply false
}

allprojects {
repositories {
mavenLocal()
google()
mavenCentral()
maven("https://android-sdk.is.com/")
}
}

tasks {
register("clean", Delete::class) {
delete(rootProject.buildDir)
}
}
1 change: 1 addition & 0 deletions analytics/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
2 changes: 1 addition & 1 deletion analytics/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 0 additions & 10 deletions analytics/settings.gradle

This file was deleted.

11 changes: 11 additions & 0 deletions analytics/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
// Ironsource library used for ad_impression snippets
maven("https://android-sdk.is.com/")
}
}

include(":app")
Loading

0 comments on commit 3f18805

Please sign in to comment.