Skip to content

Commit 1830e5c

Browse files
sarahchen6bric3
andauthored
Update task naming in gradle files PT 1 (#9608)
* Update for test-published-dependencies/ * Updated for gradle/ * Add types * chore: Add Test type --------- Co-authored-by: Brice Dutheil <[email protected]>
1 parent b09dcc5 commit 1830e5c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

gradle/jacoco.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ afterEvaluate {
5252
}
5353
}
5454

55-
jacocoTestCoverageVerification {
55+
tasks.named("jacocoTestCoverageVerification", JacocoCoverageVerification) {
5656
violationRules {
5757
rule {
5858
element = 'CLASS'

gradle/java_no_deps.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ if (project.hasProperty('minJavaVersionForTests') && project.getProperty('minJav
5858
}
5959
}
6060

61-
"compileMain_${name}Java" {
61+
tasks.named("compileMain_${name}Java", JavaCompile).configure {
6262
sourceCompatibility = version
6363
targetCompatibility = version
6464
}
@@ -74,7 +74,7 @@ if (project.hasProperty('minJavaVersionForTests') && project.getProperty('minJav
7474
}
7575
}
7676

77-
jar {
77+
tasks.named("jar", Jar) {
7878
from sourceSets."main_$name".output
7979
}
8080

@@ -98,7 +98,7 @@ java {
9898
withSourcesJar()
9999
}
100100

101-
jar {
101+
tasks.named("jar", Jar) {
102102
/**
103103
Make Jar build fail on duplicate files
104104
By default Gradle Jar task can put multiple files with the same name
@@ -136,7 +136,7 @@ tasks.withType(Javadoc).configureEach {
136136
}
137137
}
138138

139-
javadoc {
139+
tasks.named("javadoc", Javadoc) {
140140
source = sourceSets.main.java.srcDirs
141141
classpath = configurations.compileClasspath
142142

test-published-dependencies/agent-logs-on-java-7/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies {
1919
testImplementation('org.junit.jupiter:junit-jupiter')
2020
}
2121

22-
test {
22+
tasks.named("test", Test) {
2323
dependsOn('jar')
2424
useJUnitPlatform()
2525
testLogging {
@@ -29,7 +29,7 @@ test {
2929
jvmArgs "-Dtest.published.dependencies.jar=${tasks.jar.archiveFile.get()}"
3030
}
3131

32-
jar {
32+
tasks.named("jar", Jar) {
3333
manifest {
3434
attributes('Main-Class': 'test.published.dependencies.App')
3535
}
@@ -39,7 +39,7 @@ application {
3939
mainClass = 'test.published.dependencies.App'
4040
}
4141

42-
compileTestJava {
42+
tasks.named("compileTestJava", JavaCompile) {
4343
sourceCompatibility = JavaVersion.VERSION_1_8
4444
targetCompatibility = JavaVersion.VERSION_1_8
4545
}

test-published-dependencies/ot-pulls-in-api/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies {
1313
testImplementation('org.junit.jupiter:junit-jupiter')
1414
}
1515

16-
test {
16+
tasks.named("test", Test) {
1717
useJUnitPlatform()
1818
testLogging {
1919
events "passed", "skipped", "failed"

0 commit comments

Comments
 (0)