File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
plugins/src/main/java/com/google/firebase/gradle/plugins Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 1717package com.google.firebase.gradle.plugins
1818
1919import com.android.build.gradle.BaseExtension
20- import com.android.build.gradle.internal.tasks.factory.dependsOn
2120import java.io.File
2221import org.gradle.api.Plugin
2322import org.gradle.api.Project
@@ -38,18 +37,17 @@ import org.gradle.kotlin.dsl.register
3837abstract 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 }
You can’t perform that action at this time.
0 commit comments