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
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,59 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
2+
3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
218

319
##############################################################################
420
##
521
## Gradle start up script for UN*X
622
##
723
##############################################################################
824

9-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10-
DEFAULT_JVM_OPTS=""
25+
# Attempt to set APP_HOME
26+
# Resolve links: $0 may be a link
27+
PRG="$0"
28+
# Need this for relative symlinks.
29+
while [ -h "$PRG" ] ; do
30+
ls=`ls -ld "$PRG"`
31+
link=`expr "$ls" : '.*-> \(.*\)$'`
32+
if expr "$link" : '/.*' > /dev/null; then
33+
PRG="$link"
34+
else
35+
PRG=`dirname "$PRG"`"/$link"
36+
fi
37+
done
38+
SAVED="`pwd`"
39+
cd "`dirname \"$PRG\"`/" >/dev/null
40+
APP_HOME="`pwd -P`"
41+
cd "$SAVED" >/dev/null
1142

1243
APP_NAME="Gradle"
1344
APP_BASE_NAME=`basename "$0"`
1445

46+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48+
1549
# Use the maximum available, or set MAX_FD != -1 to use that value.
1650
MAX_FD="maximum"
1751

18-
warn ( ) {
52+
warn () {
1953
echo "$*"
2054
}
2155

22-
die ( ) {
56+
die () {
2357
echo
2458
echo "$*"
2559
echo
@@ -30,6 +64,7 @@ die ( ) {
3064
cygwin=false
3165
msys=false
3266
darwin=false
67+
nonstop=false
3368
case "`uname`" in
3469
CYGWIN* )
3570
cygwin=true
@@ -40,33 +75,14 @@ case "`uname`" in
4075
MINGW* )
4176
msys=true
4277
;;
78+
NONSTOP* )
79+
nonstop=true
80+
;;
4381
esac
4482

45-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46-
if $cygwin ; then
47-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48-
fi
49-
50-
# Attempt to set APP_HOME
51-
# Resolve links: $0 may be a link
52-
PRG="$0"
53-
# Need this for relative symlinks.
54-
while [ -h "$PRG" ] ; do
55-
ls=`ls -ld "$PRG"`
56-
link=`expr "$ls" : '.*-> \(.*\)$'`
57-
if expr "$link" : '/.*' > /dev/null; then
58-
PRG="$link"
59-
else
60-
PRG=`dirname "$PRG"`"/$link"
61-
fi
62-
done
63-
SAVED="`pwd`"
64-
cd "`dirname \"$PRG\"`/" >&-
65-
APP_HOME="`pwd -P`"
66-
cd "$SAVED" >&-
67-
6883
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6984

85+
7086
# Determine the Java command to use to start the JVM.
7187
if [ -n "$JAVA_HOME" ] ; then
7288
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -90,7 +106,7 @@ location of your Java installation."
90106
fi
91107

92108
# Increase the maximum file descriptors if we can.
93-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
109+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
94110
MAX_FD_LIMIT=`ulimit -H -n`
95111
if [ $? -eq 0 ] ; then
96112
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -110,11 +126,13 @@ if $darwin; then
110126
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111127
fi
112128

113-
# For Cygwin, switch paths to Windows format before running java
114-
if $cygwin ; then
129+
# For Cygwin or MSYS, switch paths to Windows format before running java
130+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
115131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117133

134+
JAVACMD=`cygpath --unix "$JAVACMD"`
135+
118136
# We build the pattern for arguments to be converted via cygpath
119137
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120138
SEP=""
@@ -138,27 +156,30 @@ if $cygwin ; then
138156
else
139157
eval `echo args$i`="\"$arg\""
140158
fi
141-
i=$((i+1))
159+
i=`expr $i + 1`
142160
done
143161
case $i in
144-
(0) set -- ;;
145-
(1) set -- "$args0" ;;
146-
(2) set -- "$args0" "$args1" ;;
147-
(3) set -- "$args0" "$args1" "$args2" ;;
148-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
162+
0) set -- ;;
163+
1) set -- "$args0" ;;
164+
2) set -- "$args0" "$args1" ;;
165+
3) set -- "$args0" "$args1" "$args2" ;;
166+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154172
esac
155173
fi
156174

157-
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158-
function splitJvmOpts() {
159-
JVM_OPTS=("$@")
175+
# Escape application args
176+
save () {
177+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178+
echo " "
160179
}
161-
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162-
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
180+
APP_ARGS=`save "$@"`
181+
182+
# Collect all arguments for the java command, following the shell quoting and substitution rules
183+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
163184

164-
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
185+
exec "$JAVACMD" "$@"

0 commit comments

Comments
 (0)