Skip to content

Commit 8bfff2c

Browse files
author
David Motsonashvili
committed
format
1 parent 3ccf580 commit 8bfff2c

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

plugins/src/main/java/com/google/firebase/gradle/plugins/CopyGoogleServicesPlugin.kt

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import org.gradle.kotlin.dsl.getByType
2626
import org.gradle.kotlin.dsl.register
2727

2828
/**
29-
* Copies the root google-services.json into the project directory during build time.
30-
* If the file doesn't exist, a dummy file is created and copied instead
29+
* Copies the root google-services.json into the project directory during build time. If the file
30+
* doesn't exist, a dummy file is created and copied instead
3131
*
3232
* If a path is provided via `FIREBASE_GOOGLE_SERVICES_PATH`, that will be used instead. The file
3333
* will also be renamed to `google-services.json`, so provided files do *not* need to be properly
@@ -48,7 +48,7 @@ abstract class CopyGoogleServicesPlugin : Plugin<Project> {
4848
project.allprojects {
4949
// fixes dependencies with gradle tasks that do not properly dependOn `preBuild`
5050
tasks.configureEach {
51-
if (name !== "copyRootGoogleServices" && name!== "createRootGoogleServices") {
51+
if (name !== "copyRootGoogleServices" && name !== "createRootGoogleServices") {
5252
dependsOn(copyRootGoogleServices)
5353
}
5454
}
@@ -66,12 +66,12 @@ abstract class CopyGoogleServicesPlugin : Plugin<Project> {
6666
return gradle.startParameter.taskNames.any { testTasks.any(it::contains) }
6767
}
6868

69-
private fun registerDummyGoogleServicesTask(
70-
project: Project,
71-
path: String
72-
) = project.tasks.register("createRootGoogleServices") {
73-
println("Google services file not found, using fallback")
74-
File(path).writeText("""
69+
private fun registerDummyGoogleServicesTask(project: Project, path: String) =
70+
project.tasks.register("createRootGoogleServices") {
71+
println("Google services file not found, using fallback")
72+
File(path)
73+
.writeText(
74+
"""
7575
{
7676
"project_info": {
7777
"project_number": "1234567",
@@ -96,8 +96,10 @@ abstract class CopyGoogleServicesPlugin : Plugin<Project> {
9696
],
9797
"configuration_version": "1"
9898
}
99-
""".trimIndent())
100-
}
99+
"""
100+
.trimIndent()
101+
)
102+
}
101103

102104
private fun registerCopyRootGoogleServicesTask(project: Project) =
103105
project.tasks.register<Copy>("copyRootGoogleServices") {

0 commit comments

Comments
 (0)