File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
plugins/src/main/java/com/google/firebase/gradle/plugins Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,12 @@ import org.gradle.kotlin.dsl.register
3737 */
3838abstract class CopyGoogleServicesPlugin : Plugin <Project > {
3939 override fun apply (project : Project ) {
40- val sourcePath = getSourcePath(project)
41- if (sourcePath == null ) {
40+ if (File (project.projectDir, " google-services.json" ).exists()) {
4241 project.logger.warn(" Google Services file already present in project, skipping copy task" )
4342 return
4443 }
4544
45+ val sourcePath = getSourcePath(project)
4646 val copyRootGoogleServices = registerCopyRootGoogleServicesTask(project, sourcePath)
4747
4848 project.allprojects {
@@ -99,12 +99,9 @@ abstract class CopyGoogleServicesPlugin : Plugin<Project> {
9999 return ! file.readText().contains(targetPackageLine)
100100 }
101101
102- private fun getSourcePath (project : Project ): String? {
102+ private fun getSourcePath (project : Project ): String {
103103 val path =
104104 System .getenv(" FIREBASE_GOOGLE_SERVICES_PATH" ) ? : " ${project.rootDir} /google-services.json"
105- if (File (project.projectDir, " google-services.json" ).exists()) {
106- return null
107- }
108105 if (File (path).exists()) {
109106 return path
110107 }
You can’t perform that action at this time.
0 commit comments