Skip to content

Commit 5de67d6

Browse files
authored
Merge pull request #342 from metafacture/gradle9Compatibility
Provide Gradle 9 forward compatibility.
2 parents fa000d3 + d27e2ca commit 5de67d6

File tree

7 files changed

+28
-10
lines changed

7 files changed

+28
-10
lines changed

build.gradle

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ subprojects {
3939
'equalsverifier': '3.8.2',
4040
'guava': '29.0-jre',
4141
'jackson': '2.13.3',
42+
'jdk': '8',
4243
'jena': '3.17.0',
4344
'jetty': '9.4.14.v20181114',
4445
'jquery': '3.3.1-1',
@@ -66,9 +67,6 @@ subprojects {
6667

6768
check.dependsOn(javadoc)
6869

69-
sourceCompatibility = '1.8'
70-
targetCompatibility = '1.8'
71-
7270
repositories {
7371
mavenCentral()
7472
maven githubPackage.invoke("metafacture")
@@ -86,6 +84,18 @@ subprojects {
8684
toolVersion '8.44'
8785
}
8886

87+
java {
88+
toolchain {
89+
languageVersion = JavaLanguageVersion.of(versions.jdk)
90+
}
91+
}
92+
93+
tasks.withType(JavaExec) {
94+
javaLauncher = javaToolchains.launcherFor {
95+
languageVersion = java.toolchain.languageVersion
96+
}
97+
}
98+
8999
tasks.withType(JavaCompile) {
90100
'all -processing -rawtypes -serial'.split().each {
91101
options.compilerArgs << "-Xlint:${it}"

gradle/source-layout.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ jar {
2222
}
2323

2424
plugins.withId('war') {
25-
webAppDirName = 'src/main/webapp'
25+
war {
26+
webAppDirectory = file('src/main/webapp')
27+
}
2628
}

metafix-ide/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ dependencies {
1212
apply plugin: 'application'
1313
apply plugin: 'com.github.johnrengelman.shadow'
1414

15-
mainClassName = 'org.eclipse.xtext.ide.server.ServerLauncher'
16-
applicationName = 'xtext-server'
15+
application {
16+
mainClass = 'org.eclipse.xtext.ide.server.ServerLauncher'
17+
applicationName = 'xtext-server'
18+
}
1719

1820
shadowJar {
19-
from(project.convention.getPlugin(JavaPluginConvention).sourceSets.main.output)
21+
from(sourceSets.main.output)
2022
configurations = [project.configurations.runtimeClasspath]
2123

2224
exclude(

metafix/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'maven-publish'
3-
id 'me.champeau.jmh' version '0.6.6'
3+
id 'me.champeau.jmh' version '0.7.2'
44
}
55

66
def passSystemProperties = {

metafix/src/test/java/org/metafacture/metafix/MetafixMethodTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2310,7 +2310,7 @@ public void copyFieldToSubfieldOfArrayOfObjectsWithExplicitAppend() {
23102310

23112311
@Test
23122312
public void copyFieldToSubfieldOfArrayOfStringsWithIndexImplicitAppend() {
2313-
MetafixTestHelpers.assertProcessException(IndexOutOfBoundsException.class, "Index 0 out of bounds for length 0", () ->
2313+
MetafixTestHelpers.assertProcessException(IndexOutOfBoundsException.class, "Index: 0, Size: 0", () ->
23142314
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
23152315
"set_array('test[]')",
23162316
"copy_field('key', 'test[].1')"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
^Exception in thread "main" org\.metafacture\.metafix\.FixProcessException: Error while executing Fix expression \(at .*/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldToArrayOfStringsWithIndex/test\.fix, line 2\): copy_field\("key", "test\[\]\.1"\)$
2-
^Caused by: java\.lang\.IndexOutOfBoundsException: Index 0 out of bounds for length 0$
2+
^Caused by: java\.lang\.IndexOutOfBoundsException: Index: 0, Size: 0$

settings.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
3+
}
4+
15
include 'metafix'
26
include 'metafix-ide'
37
include 'metafix-runner'

0 commit comments

Comments
 (0)