-
Notifications
You must be signed in to change notification settings - Fork 334
Update build scripts to Gradle 9.4.1 from 8.14.4 #11272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import net.ltgt.gradle.errorprone.CheckSeverity | |
| plugins { | ||
| id 'com.gradleup.shadow' | ||
| id 'me.champeau.jmh' | ||
| id 'com.google.protobuf' version '0.8.18' | ||
| id 'com.google.protobuf' version '0.9.5' | ||
| id 'net.ltgt.errorprone' version '3.1.0' | ||
| } | ||
|
|
||
|
|
@@ -118,7 +118,7 @@ tasks.named("forbiddenApisJmh") { | |
| sourceSets { | ||
| test { | ||
| java { | ||
| srcDirs += ["$buildDir/generated/source/proto/test/java"] | ||
| srcDir tasks.named("generateTestProto").map { "${it.outputBaseDir}/java" } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: This might be eager. So we might need to use a different approach. |
||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,10 +100,10 @@ tasks.register('copyMetricConfigs', CopyMetricConfigsTask) { | |
| group = 'Build Setup' | ||
| description = 'Copy metrics.yaml files from integrations-core into resources' | ||
| inputDirectory = file("$projectDir/integrations-core") | ||
| outputDirectory = file("$buildDir/integrations-core-resources") | ||
| outputDirectory = layout.buildDirectory.dir("integrations-core-resources").get().asFile | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: I see |
||
| } | ||
|
|
||
| tasks.named("processResources", ProcessResources) { | ||
| dependsOn 'copyMetricConfigs' | ||
| from("$buildDir/integrations-core-resources") | ||
| from(layout.buildDirectory.dir("integrations-core-resources")) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,10 +14,19 @@ addTestSuiteForDir("latest7DepTest", "test") | |
| addTestSuiteExtendingForDir("latestDepForkedTest", "latestDepTest", "test") | ||
| addTestSuiteExtendingForDir("latest7DepForkedTest", "latest7DepTest", "test") | ||
|
|
||
| tasks.named("test", Test) { | ||
| failOnNoDiscoveredTests = false | ||
| } | ||
|
|
||
| tasks.named("latestDepTest", Test) { | ||
| testJvmConstraints { | ||
| minJavaVersion = JavaVersion.VERSION_21 | ||
| } | ||
| failOnNoDiscoveredTests = false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: I've seen this as well albeit not when trying Gradle 9.3 on dd-trace-java, IIRC... I think a better solution is to add that flag within the logic of |
||
| } | ||
|
|
||
| tasks.named("latest7DepTest", Test) { | ||
| failOnNoDiscoveredTests = false | ||
| } | ||
|
|
||
| tasks.named("latestDepForkedTest", Test) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| plugins { | ||
| id 'com.google.protobuf' version '0.8.18' | ||
| id 'com.google.protobuf' version '0.9.5' | ||
| } | ||
|
|
||
| muzzle { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| plugins { | ||
| id 'com.google.protobuf' version '0.8.18' | ||
| id 'com.google.protobuf' version '0.9.5' | ||
| } | ||
|
|
||
| muzzle { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ configurations { | |
| // In order to test the real log4j library we need to remove the log4j transitive | ||
| // dependency 'log4j-over-slf4j' brought in by :dd-java-agent:testing which would shadow | ||
| // the log4j module under test using a proxy to slf4j instead. | ||
| testCompile.exclude group: 'org.slf4j', module: 'log4j-over-slf4j' | ||
| testImplementation.exclude group: 'org.slf4j', module: 'log4j-over-slf4j' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: What was the problem with |
||
| } | ||
|
|
||
| muzzle { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,13 +79,13 @@ configurations.configureEach { | |
|
|
||
| sourceSets { | ||
| test { | ||
| output.dir("$buildDir/generated-resources/test", builtBy: 'generateAppResources') | ||
| output.dir(layout.buildDirectory.dir("generated-resources/test").get().asFile, builtBy: 'generateAppResources') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: I. believe we can do that without |
||
| } | ||
| mule46ForkedTest { | ||
| output.dir("$buildDir/generated-resources/mule46ForkedTest", builtBy: 'generateAppResources46') | ||
| output.dir(layout.buildDirectory.dir("generated-resources/mule46ForkedTest").get().asFile, builtBy: 'generateAppResources46') | ||
| } | ||
| latestDepForkedTest { | ||
| output.dir("$buildDir/generated-resources/latestDepForkedTest", builtBy: 'generateAppResourcesLatest') | ||
| output.dir(layout.buildDirectory.dir("generated-resources/latestDepForkedTest").get().asFile, builtBy: 'generateAppResourcesLatest') | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -191,7 +191,7 @@ dependencies { | |
| latestMuleServices group: 'org.mule.services', name: 'mule-service-weave', version: '2.8.1', classifier: 'mule-service' | ||
| } | ||
|
|
||
| def copyMuleArtifacts(String configName, String muleBaseDir, Sync sync) { | ||
| def copyMuleArtifacts(String configName, def muleBaseDir, Sync sync) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: Looks odd to go back to untyped parameter. |
||
| configurations[configName].resolvedConfiguration.resolvedArtifacts.findAll { | ||
| it.classifier == "mule-service" | ||
| } collect { artifact -> | ||
|
|
@@ -200,21 +200,21 @@ def copyMuleArtifacts(String configName, String muleBaseDir, Sync sync) { | |
| into("${id.name}-${id.version}") | ||
| } | ||
| } | ||
| sync.into "$muleBaseDir/services" | ||
| sync.into muleBaseDir.map { it.dir("services").asFile } | ||
| } | ||
|
|
||
| // extract the enabled services into the mule base directory | ||
| tasks.register('extractMuleServices', Sync) { | ||
| dependsOn configurations.named('muleServices') | ||
| copyMuleArtifacts("muleServices", "$buildDir/mule/test", it) | ||
| copyMuleArtifacts("muleServices", layout.buildDirectory.dir("mule/test"), it) | ||
| } | ||
| tasks.register('extractMule46Services', Sync) { | ||
| dependsOn configurations.named('mule46Services') | ||
| copyMuleArtifacts("mule46Services", "$buildDir/mule/mule46ForkedTest", it) | ||
| copyMuleArtifacts("mule46Services", layout.buildDirectory.dir("mule/mule46ForkedTest"), it) | ||
| } | ||
| tasks.register('extractLatestMuleServices', Sync) { | ||
| dependsOn configurations.named('latestMuleServices') | ||
| copyMuleArtifacts("latestMuleServices", "$buildDir/mule/latestDepForkedTest", it) | ||
| copyMuleArtifacts("latestMuleServices", layout.buildDirectory.dir("mule/latestDepForkedTest"), it) | ||
| } | ||
|
|
||
| // build the mule application via maven | ||
|
|
@@ -224,7 +224,7 @@ tasks.register('mvnPackage', Exec) { | |
|
|
||
| List<String> mvnArgs = [ | ||
| "$rootDir/mvnw", | ||
| "-Ddatadog.builddir=$buildDir", | ||
| "-Ddatadog.builddir=${layout.buildDirectory.get().asFile.absolutePath}", | ||
| "-Ddatadog.name=mule-test-application", | ||
| "-Ddatadog.version=$version", | ||
| "package" | ||
|
|
@@ -237,7 +237,7 @@ tasks.register('mvnPackage', Exec) { | |
|
|
||
| commandLine(mvnArgs) | ||
|
|
||
| outputs.dir("$buildDir/target") | ||
| outputs.dir(layout.buildDirectory.dir("target")) | ||
| inputs.dir("$appDir/src") | ||
| inputs.file("$appDir/pom.xml") | ||
| inputs.file("$appDir/mule-artifact.json") | ||
|
|
@@ -255,12 +255,15 @@ tasks.register('generateAppResourcesLatest') { | |
| } | ||
|
|
||
| def createAppResourceTask(Task task, String name) { | ||
| def generatedResourcesDir = "$buildDir/generated-resources/$name" | ||
| def buildDirectory = project.layout.buildDirectory | ||
| def muleBaseDir = buildDirectory.dir("mule/${name}") | ||
| def applicationJar = buildDirectory.file("target/mule-test-application-$version-mule-application.jar") | ||
| def generatedResourcesDir = buildDirectory.dir("generated-resources/${name}") | ||
| task.outputs.dir generatedResourcesDir | ||
| task.doLast { | ||
| def generated = new File(generatedResourcesDir, "test-build.properties") | ||
| generated.text = """|mule.base=$buildDir/mule/$name | ||
| |MuleTestApplicationConstants.jar=$buildDir/target/mule-test-application-$version-mule-application.jar | ||
| def generated = generatedResourcesDir.get().file("test-build.properties").asFile | ||
| generated.text = """|mule.base=${muleBaseDir.get().asFile.absolutePath} | ||
| |MuleTestApplicationConstants.jar=${applicationJar.get().asFile.absolutePath} | ||
| |MuleTestApplicationConstants.name=mule-test-application-$version-mule-application""".stripMargin() | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: One of the changes in Gradle 9 is that properties do no allow
nullanymore. Maybe something better can be used there.