Skip to content

Commit a00d726

Browse files
authored
Updates Gradle to 8.7 and fix deprecation warning on the build script (#90)
Updates Gradle to 8.7 and fix deprecation warning on the build script. It updates also Shadow to the latest and restructure the sections because plugins must be after buildscript. Make explicit the dependency of compileTestJava by patchYaml task.
1 parent b55bb5e commit a00d726

5 files changed

Lines changed: 226 additions & 160 deletions

File tree

build.gradle

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,37 @@ import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
2424
* specific language governing permissions and limitations
2525
* under the License.
2626
*/
27-
apply plugin: "java"
28-
apply plugin: 'maven-publish'
29-
apply plugin: "distribution"
30-
apply plugin: "idea"
31-
32-
group "org.logstash.filters"
33-
version Files.readAllLines(Paths.get("version")).first()
34-
35-
sourceCompatibility = JavaVersion.VERSION_1_8
36-
37-
buildscript {
27+
buildscript {
3828
repositories {
3929
mavenCentral()
4030
gradlePluginPortal()
4131
}
4232

4333
dependencies {
4434
classpath group: 'org.jruby', name: 'jruby-complete', version: "9.2.11.0"
45-
classpath 'gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0'
4635
classpath 'de.undercouch:gradle-download-task:4.0.4'
4736
}
4837
}
4938

39+
// apply plugin: 'com.github.johnrengelman.shadow'
40+
plugins {
41+
id 'com.github.johnrengelman.shadow' version '8.1.1'
42+
43+
id 'java'
44+
id 'maven-publish'
45+
id 'distribution'
46+
id 'idea'
47+
}
48+
49+
50+
51+
group "org.logstash.filters"
52+
version Files.readAllLines(Paths.get("version")).first()
53+
54+
java {
55+
sourceCompatibility = JavaVersion.VERSION_1_8
56+
}
57+
5058
repositories {
5159
mavenCentral()
5260
}
@@ -71,6 +79,11 @@ task patchYaml(type: Copy, dependsOn: [downloadYaml]) {
7179
}
7280
}
7381

82+
// testJava tasks uses the patched yaml, so make explicit the dependency.
83+
tasks.getByPath(":compileTestJava").configure {
84+
dependsOn patchYaml
85+
}
86+
7487
task downloadTestYaml(type: Download, overwrite: false) {
7588
src([
7689
yamlResourceRoot + '/test_resources/additional_os_tests.yaml',
@@ -115,11 +128,9 @@ test {
115128
}
116129
}
117130

118-
apply plugin: 'com.github.johnrengelman.shadow'
119-
120131
shadowJar {
121132
dependsOn 'verifyYaml'
122-
archiveClassifier = null
133+
archiveClassifier.set('')
123134
}
124135

125136
task vendor(dependsOn: shadowJar) {

gradle/wrapper/gradle-wrapper.jar

-11.9 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)