Skip to content

Commit 0277f36

Browse files
committed
Compatibility with Gradle 5 API: don't use Task.execute()
1 parent 1fe7cb2 commit 0277f36

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

WordPress/build.gradle

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,6 @@ configurations.all {
250250
exclude group: 'org.wordpress', module: 'analytics'
251251
}
252252

253-
task copyGoogleServicesExampleFile(type: Copy) {
254-
from('.')
255-
into('.')
256-
include('google-services.json-example')
257-
rename('google-services.json-example', 'google-services.json')
258-
}
259-
260-
task copyGoogleServicesBuddybuildFile(type: Copy) {
261-
from(file(System.getenv("BUDDYBUILD_SECURE_FILES") + "/google-services.json"))
262-
into('.')
263-
}
264-
265253
task generateCrashlyticsConfig(group: "generate", description: "Generate Crashlytics config") {
266254
def outputFile = new File("${rootDir}/WordPress/crashlytics.properties")
267255
def inputFile = checkGradlePropertiesFile()
@@ -300,11 +288,11 @@ android.buildTypes.all { buildType ->
300288
// If Google services file doesn't exist...
301289
if (!file("google-services.json").exists()) {
302290
// ... copy example file.
303-
if (!file(System.getenv("BUDDYBUILD_SECURE_FILES") + "/google-services.json").exists()) {
304-
tasks.copyGoogleServicesExampleFile.execute()
305-
// ... copy Buddybuild file.
306-
} else {
307-
tasks.copyGoogleServicesBuddybuildFile.execute()
291+
copy {
292+
from(".")
293+
into(".")
294+
include("google-services.json-example")
295+
rename('google-services.json-example', 'google-services.json')
308296
}
309297
}
310298

@@ -317,11 +305,7 @@ android.buildTypes.all { buildType ->
317305
def checkGradlePropertiesFile() {
318306
def inputFile = file("${rootDir}/gradle.properties")
319307
if (!inputFile.exists()) {
320-
// Try the BuddyBuild provided file if it's there
321-
inputFile = file(System.getenv("BUDDYBUILD_SECURE_FILES") + "/gradle.properties")
322-
if (!inputFile.exists()) {
323-
throw new StopActionException("Build configuration file gradle.properties doesn't exist, follow README instructions")
324-
}
308+
throw new StopActionException("Build configuration file gradle.properties doesn't exist, follow README instructions")
325309
}
326310
return inputFile
327311
}

0 commit comments

Comments
 (0)