Skip to content

Commit c314a37

Browse files
authored
Merge pull request #14914 from wordpress-mobile/improve-gradle-configuration
Use task avoidance in build.gradle & WordPress/build.gradle
2 parents 88c0af2 + 143876d commit c314a37

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

WordPress/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ android.buildTypes.all { buildType ->
469469
}
470470
}
471471

472-
task violationCommentsToGitHub(type: se.bjurr.violations.comments.github.plugin.gradle.ViolationCommentsToGitHubTask) {
472+
tasks.register("violationCommentsToGitHub", se.bjurr.violations.comments.github.plugin.gradle.ViolationCommentsToGitHubTask) {
473473
repositoryOwner = "wordpress-mobile"
474474
repositoryName = "WordPress-Android"
475475
pullRequestId = System.properties['GITHUB_PULLREQUESTID']
@@ -495,7 +495,7 @@ task violationCommentsToGitHub(type: se.bjurr.violations.comments.github.plugin.
495495
]
496496
}
497497

498-
task printVersionName {
498+
tasks.register("printVersionName") {
499499
doLast {
500500
println android.productFlavors.vanilla.versionName
501501
}

build.gradle

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ allprojects {
4848
}
4949
}
5050

51-
task checkstyle(type: Checkstyle) {
51+
tasks.register("checkstyle", Checkstyle) {
5252
source 'src'
5353

5454
classpath = files()
@@ -91,19 +91,19 @@ subprojects {
9191
ktlint 'com.github.shyiko:ktlint:0.29.0'
9292
}
9393

94-
task ktlint(type: JavaExec) {
94+
tasks.register("ktlint", JavaExec) {
9595
main = "com.github.shyiko.ktlint.Main"
9696
classpath = configurations.ktlint
9797
args "src/**/*.kt"
9898
}
9999

100-
task ktlintFormat(type: JavaExec) {
100+
tasks.register("ktlintFormat", JavaExec) {
101101
main = "com.github.shyiko.ktlint.Main"
102102
classpath = configurations.ktlint
103103
args "-F", "src/**/*.kt"
104104
}
105105

106-
task ciktlint(type: JavaExec) {
106+
tasks.register("ciktlint", JavaExec) {
107107
main = "com.github.shyiko.ktlint.Main"
108108
classpath = configurations.ktlint
109109
args "src/**/*.kt", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
@@ -158,7 +158,7 @@ ext {
158158
}
159159

160160
// Onboarding and dev env setup tasks
161-
task checkBundler(type:Exec) {
161+
tasks.register("checkBundler", Exec) {
162162
doFirst {
163163
println "Check Bundler"
164164
}
@@ -176,7 +176,8 @@ task checkBundler(type:Exec) {
176176
}
177177
}
178178

179-
task checkBundle(type:Exec, dependsOn:checkBundler) {
179+
tasks.register("checkBundle", Exec) {
180+
dependsOn tasks.named("checkBundler")
180181
doFirst {
181182
println "Check Bundle"
182183
}
@@ -194,7 +195,8 @@ task checkBundle(type:Exec, dependsOn:checkBundler) {
194195
}
195196
}
196197

197-
task applyCredentials(type:Exec, dependsOn:checkBundle) {
198+
tasks.register("applyCredentials", Exec) {
199+
dependsOn tasks.named("checkBundle")
198200
doFirst {
199201
println "Apply credentials for this branch"
200202
}

0 commit comments

Comments
 (0)