Skip to content

Commit 6cec2f5

Browse files
authored
Merge pull request #272 from google/davidmotson.crashlytics_outputs
added a task output which just contains the gmp_app_id for crashlytic…
2 parents b635f8f + bdc2773 commit 6cec2f5

File tree

11 files changed

+17
-9
lines changed

11 files changed

+17
-9
lines changed

google-services-plugin/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ plugins {
2020
}
2121

2222
group = "com.google.gms"
23-
version = "5.0.0"
23+
version = "4.4.0"
2424

2525
dependencies {
2626
compileOnly(gradleApi())

google-services-plugin/src/main/kotlin/com/google/gms/googleservices/GoogleServicesPlugin.kt

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class GoogleServicesPlugin : Plugin<Project> {
9292
variant.productFlavors.map { it.second },
9393
project.projectDir))
9494
it.applicationId.set(variant.applicationId)
95+
it.gmpAppId.set(project.buildDir.resolve("gmpAppId.txt"))
9596
}
9697

9798
// TODO: add an AGP version check to this block

google-services-plugin/src/main/kotlin/com/google/gms/googleservices/GoogleServicesTask.kt

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import org.gradle.api.tasks.Input
3030
import org.gradle.api.tasks.InputFiles
3131
import org.gradle.api.tasks.Internal
3232
import org.gradle.api.tasks.OutputDirectory
33+
import org.gradle.api.tasks.OutputFile
3334
import org.gradle.api.tasks.PathSensitive
3435
import org.gradle.api.tasks.PathSensitivity
3536
import org.gradle.api.tasks.TaskAction
@@ -53,6 +54,8 @@ abstract class GoogleServicesTask : DefaultTask() {
5354

5455
@get:Input abstract val missingGoogleServicesStrategy: Property<MissingGoogleServicesStrategy>
5556

57+
@get:OutputFile abstract val gmpAppId: Property<File>
58+
5659
@Throws(GradleException::class)
5760
@TaskAction
5861
fun action() {
@@ -230,6 +233,7 @@ abstract class GoogleServicesTask : DefaultTask() {
230233
"config file that contains a Google App Id")
231234
}
232235
resValues["google_app_id"] = googleAppIdStr
236+
gmpAppId.get().writeText(googleAppIdStr, Charsets.UTF_8)
233237
}
234238

235239
fun FirebaseClientData.handleWebClientId(resValues: MutableMap<String, String?>) {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
33
id("com.android.application") version "7.3.0" apply false
4-
id("com.google.gms.google-services") version "5.0.0" apply false
4+
id("com.google.gms.google-services") version "4.4.0" apply false
55
}

google-services-plugin/src/test/testData/project1-agp730/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ kotlin.code.style=official
2222
# thereby reducing the size of the R class for that library
2323
android.nonTransitiveRClass=true
2424
android.nonFinalResIds=false
25-
org.gradle.jvmargs=-Xmx1500m
25+
org.gradle.jvmargs=-Xmx2000m
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
33
id("com.android.application") version "7.4.1" apply false
4-
id("com.google.gms.google-services") version "5.0.0" apply false
4+
id("com.google.gms.google-services") version "4.4.0" apply false
55
}

google-services-plugin/src/test/testData/project1/gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ kotlin.code.style=official
2121
# resources declared in the library itself and none from the library's dependencies,
2222
# thereby reducing the size of the R class for that library
2323
android.nonTransitiveRClass=true
24-
android.nonFinalResIds=false
24+
android.nonFinalResIds=false
25+
org.gradle.jvmargs=-Xmx2000m
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
33
id("com.android.application") version "7.4.1" apply false
4-
id("com.google.gms.google-services") version "5.0.0" apply false
4+
id("com.google.gms.google-services") version "4.4.0" apply false
55
}

google-services-plugin/src/test/testData/project2/gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ kotlin.code.style=official
2121
# resources declared in the library itself and none from the library's dependencies,
2222
# thereby reducing the size of the R class for that library
2323
android.nonTransitiveRClass=true
24-
android.nonFinalResIds=false
24+
android.nonFinalResIds=false
25+
org.gradle.jvmargs=-Xmx2000m
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
33
id("com.android.application") version "7.4.1" apply false
4-
id("com.google.gms.google-services") version "5.0.0" apply false
4+
id("com.google.gms.google-services") version "4.4.0" apply false
55
}

google-services-plugin/src/test/testData/project3/gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ kotlin.code.style=official
2121
# resources declared in the library itself and none from the library's dependencies,
2222
# thereby reducing the size of the R class for that library
2323
android.nonTransitiveRClass=true
24-
android.nonFinalResIds=false
24+
android.nonFinalResIds=false
25+
org.gradle.jvmargs=-Xmx2000m

0 commit comments

Comments
 (0)