Skip to content

Commit

Permalink
Merge pull request #342 from metafacture/gradle9Compatibility
Browse files Browse the repository at this point in the history
Provide Gradle 9 forward compatibility.
  • Loading branch information
blackwinter committed Feb 20, 2024
2 parents fa000d3 + d27e2ca commit 5de67d6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
16 changes: 13 additions & 3 deletions build.gradle
Expand Up @@ -39,6 +39,7 @@ subprojects {
'equalsverifier': '3.8.2',
'guava': '29.0-jre',
'jackson': '2.13.3',
'jdk': '8',
'jena': '3.17.0',
'jetty': '9.4.14.v20181114',
'jquery': '3.3.1-1',
Expand Down Expand Up @@ -66,9 +67,6 @@ subprojects {

check.dependsOn(javadoc)

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

repositories {
mavenCentral()
maven githubPackage.invoke("metafacture")
Expand All @@ -86,6 +84,18 @@ subprojects {
toolVersion '8.44'
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(versions.jdk)
}
}

tasks.withType(JavaExec) {
javaLauncher = javaToolchains.launcherFor {
languageVersion = java.toolchain.languageVersion
}
}

tasks.withType(JavaCompile) {
'all -processing -rawtypes -serial'.split().each {
options.compilerArgs << "-Xlint:${it}"
Expand Down
4 changes: 3 additions & 1 deletion gradle/source-layout.gradle
Expand Up @@ -22,5 +22,7 @@ jar {
}

plugins.withId('war') {
webAppDirName = 'src/main/webapp'
war {
webAppDirectory = file('src/main/webapp')
}
}
8 changes: 5 additions & 3 deletions metafix-ide/build.gradle
Expand Up @@ -12,11 +12,13 @@ dependencies {
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'

mainClassName = 'org.eclipse.xtext.ide.server.ServerLauncher'
applicationName = 'xtext-server'
application {
mainClass = 'org.eclipse.xtext.ide.server.ServerLauncher'
applicationName = 'xtext-server'
}

shadowJar {
from(project.convention.getPlugin(JavaPluginConvention).sourceSets.main.output)
from(sourceSets.main.output)
configurations = [project.configurations.runtimeClasspath]

exclude(
Expand Down
2 changes: 1 addition & 1 deletion metafix/build.gradle
@@ -1,6 +1,6 @@
plugins {
id 'maven-publish'
id 'me.champeau.jmh' version '0.6.6'
id 'me.champeau.jmh' version '0.7.2'
}

def passSystemProperties = {
Expand Down
Expand Up @@ -2310,7 +2310,7 @@ public void copyFieldToSubfieldOfArrayOfObjectsWithExplicitAppend() {

@Test
public void copyFieldToSubfieldOfArrayOfStringsWithIndexImplicitAppend() {
MetafixTestHelpers.assertProcessException(IndexOutOfBoundsException.class, "Index 0 out of bounds for length 0", () ->
MetafixTestHelpers.assertProcessException(IndexOutOfBoundsException.class, "Index: 0, Size: 0", () ->
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"set_array('test[]')",
"copy_field('key', 'test[].1')"
Expand Down
@@ -1,2 +1,2 @@
^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"\)$
^Caused by: java\.lang\.IndexOutOfBoundsException: Index 0 out of bounds for length 0$
^Caused by: java\.lang\.IndexOutOfBoundsException: Index: 0, Size: 0$
4 changes: 4 additions & 0 deletions settings.gradle
@@ -1,3 +1,7 @@
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}

include 'metafix'
include 'metafix-ide'
include 'metafix-runner'
Expand Down

0 comments on commit 5de67d6

Please sign in to comment.