Skip to content

Commit 5b6e18a

Browse files
authored
Using latest GWT 2.10 and update other versions (#185)
* Updated to gradle 7.2 to allow compilation with Java17 * Make build script compatible with gradle 7.x * Bump GWT to 2.10 * Use latest xtext and guava to allow running java 17 * Test further java and node versions during ci * Update gwt maven group id
1 parent d18f23f commit 5b6e18a

File tree

6 files changed

+144
-111
lines changed

6 files changed

+144
-111
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: elkjs CI
22

33
on:
44
push:
5+
branches:
6+
- master
57
repository_dispatch:
68
schedule:
79
- cron: '0 3 * * *'
@@ -14,10 +16,13 @@ jobs:
1416

1517
runs-on: ubuntu-latest
1618

19+
continue-on-error: true
20+
1721
strategy:
22+
fail-fast: false
1823
matrix:
19-
node-version: [ 12.x, 14.x ]
20-
java-version: [ 11 ]
24+
node-version: [ 14.x, 16.x, 18.x ]
25+
java-version: [ 8, 11, 13, 15, 17 ]
2126

2227
steps:
2328
- uses: actions/checkout@v1

build.gradle

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/*
2-
TODO document the script
3-
42
# Task depencencies
53
The dependencies are specified at the end of this file,
64
not within the task definitions.
@@ -18,8 +16,10 @@
1816
+-- xtend-gen
1917
*/
2018
plugins {
21-
id 'org.xtext.builder' version '2.0.5'
22-
id 'org.xtext.xtend' version '2.0.5'
19+
// The documentation of the plugin [1] states "tested up to [gradle] 7.2".
20+
// [1] https://xtext.github.io/xtext-gradle-plugin/xtext-builder.html
21+
id 'org.xtext.builder' version '3.0.2' // according to the docu, tested up to gradle 7.2
22+
id 'org.xtext.xtend' version '3.0.2'
2323
id 'java'
2424
}
2525

@@ -28,14 +28,11 @@ tasks.withType(JavaCompile) {
2828
options.encoding = 'UTF-8'
2929
}
3030

31-
// GWT requires to be run with Java [8, 11]
32-
// (http://www.gwtproject.org/release-notes.html#Release_Notes_2_9_0)
33-
if (![JavaVersion.VERSION_1_8,
34-
JavaVersion.VERSION_1_9,
35-
JavaVersion.VERSION_1_10,
36-
JavaVersion.VERSION_11,
37-
].contains(JavaVersion.current())) {
38-
throw new GradleException("elkjs build requires to be run with Java [8, 11] (due to GWT compilation).")
31+
// GWT 2.10 allows to run Java [8, 17]
32+
// (http://www.gwtproject.org/release-notes.html#Release_Notes_2_10_0)
33+
if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_1_8)
34+
|| JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_18)) {
35+
throw new GradleException("elkjs build requires to be run with Java [8, 17] (due to GWT compilation). You are running " + JavaVersion.current() + ".")
3936
}
4037

4138
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -44,12 +41,25 @@ if (![JavaVersion.VERSION_1_8,
4441

4542
ext.versions = [
4643
emfGwt: '2.12.4',
47-
gwt: '2.9.0',
48-
guava: '27.1-jre',
44+
gwt: '2.10.0',
45+
guava: '31.1-jre',
4946
melk: '0.9.0-SNAPSHOT',
50-
xtext: '2.20.0',
47+
xtext: '2.28.0',
48+
49+
// From 2.26 on Xtext supports Java 17, however,
50+
// "Xtext now supports running on Java 17 with Java 8 and 11 targets. Source and Target 17 are not supported yet".
51+
// https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2022/08/29/version-2-28-0
52+
sourceTargetCompatibility: JavaVersion.current().ordinal() < 11 - 1 ? '1.8' : '11'
5153
]
5254

55+
java {
56+
sourceCompatibility = "$versions.sourceTargetCompatibility"
57+
targetCompatibility = "$versions.sourceTargetCompatibility"
58+
}
59+
60+
project.logger.lifecycle("You are running Java version ${JavaVersion.current()}.")
61+
project.logger.lifecycle("Due to current Xtext's limitations ($versions.xtext), source and target compatibility have been set to ${versions.sourceTargetCompatibility}.")
62+
5363
if (!hasProperty('elkRepo')) {
5464
ext.elkRepo = '../elk'
5565
}
@@ -128,38 +138,37 @@ dependencies {
128138
xtextLanguages "org.eclipse.elk:org.eclipse.elk.core.meta:$versions.melk"
129139

130140
// for the minus sign to work in melk files
131-
xtextCompile "org.eclipse.xtext:org.eclipse.xtext.xbase.lib:$versions.xtext"
141+
xtextImplementation "org.eclipse.xtext:org.eclipse.xtext.xbase.lib:$versions.xtext"
132142

133-
xtextCompile "com.google.guava:guava:$versions.guava"
143+
xtextImplementation "com.google.guava:guava:$versions.guava"
134144

135-
xtextCompile "com.google.gwt:gwt-dev:$versions.gwt"
136-
xtextCompile "com.google.gwt:gwt-user:$versions.gwt"
145+
xtextImplementation "org.gwtproject:gwt-dev:$versions.gwt"
146+
xtextImplementation "org.gwtproject:gwt-user:$versions.gwt"
137147

138-
xtextCompile "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt"
139-
xtextCompile "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt"
148+
xtextImplementation "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt"
149+
xtextImplementation "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt"
140150

141151
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
142152

143153
// emf for gwt
144-
compile "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt"
145-
compile "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt"
154+
implementation "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt"
155+
implementation "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt"
146156
// guava
147-
compile "com.google.guava:guava:$versions.guava"
157+
implementation "com.google.guava:guava:$versions.guava"
148158
// gwt
149-
compile "com.google.gwt:gwt-user:$versions.gwt"
150-
compile "com.google.gwt:gwt-dev:$versions.gwt"
159+
implementation "org.gwtproject:gwt-user:$versions.gwt"
160+
implementation "org.gwtproject:gwt-dev:$versions.gwt"
151161
// xtend libs
152-
compile "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext"
153-
compile "org.eclipse.xtext:org.eclipse.xtext.xbase.lib:$versions.xtext"
162+
implementation "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext"
163+
implementation "org.eclipse.xtext:org.eclipse.xtext.xbase.lib:$versions.xtext"
154164

155165
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
156166

157167
gwt "com.google.guava:guava-gwt:$versions.guava"
158168

159-
gwt "com.google.gwt:gwt:$versions.gwt"
160-
gwt "com.google.gwt:gwt-dev:$versions.gwt"
161-
gwt "com.google.gwt:gwt-user:$versions.gwt"
162-
//gwt "com.google.gwt:gwt-servlet:$versions.gwt"
169+
gwt "org.gwtproject:gwt:$versions.gwt"
170+
gwt "org.gwtproject:gwt-dev:$versions.gwt"
171+
gwt "org.gwtproject:gwt-user:$versions.gwt"
163172

164173
gwt "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt:sources"
165174
gwt "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt:sources"

gradle/wrapper/gradle-wrapper.jar

6.77 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sun Jun 23 18:38:22 UTC 2019
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip

gradlew

Lines changed: 69 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)