Skip to content

Commit 6baae44

Browse files
authored
Merge 69351c1 into 5ddcc4b
2 parents 5ddcc4b + 69351c1 commit 6baae44

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.google.firebase.gradle.plugins
1818

1919
import com.android.build.gradle.BaseExtension
20-
import com.android.build.gradle.internal.tasks.factory.dependsOn
2120
import java.io.File
2221
import org.gradle.api.Plugin
2322
import org.gradle.api.Project
@@ -38,18 +37,17 @@ import org.gradle.kotlin.dsl.register
3837
abstract class CopyGoogleServicesPlugin : Plugin<Project> {
3938
override fun apply(project: Project) {
4039
if (File(project.projectDir, "google-services.json").exists()) {
41-
project.logger.warn("Google Services file already present in project, skipping copy task")
42-
return
43-
}
44-
45-
val sourcePath = getSourcePath(project)
46-
val copyRootGoogleServices = registerCopyRootGoogleServicesTask(project, sourcePath)
47-
48-
project.allprojects {
49-
// fixes dependencies with gradle tasks that do not properly dependOn `preBuild`
50-
tasks.configureEach {
51-
if (name !== "copyRootGoogleServices") {
52-
dependsOn(copyRootGoogleServices)
40+
project.logger.info("Google Services file already present in project, skipping copy task")
41+
} else {
42+
val sourcePath = getSourcePath(project)
43+
val copyRootGoogleServices = registerCopyRootGoogleServicesTask(project, sourcePath)
44+
45+
project.allprojects {
46+
// fixes dependencies with gradle tasks that do not properly dependOn `preBuild`
47+
tasks.configureEach {
48+
if (name !== "copyRootGoogleServices") {
49+
dependsOn(copyRootGoogleServices)
50+
}
5351
}
5452
}
5553
}

0 commit comments

Comments
 (0)