Skip to content

Commit

Permalink
Using latest GWT 2.10 and update other versions (#185)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
uruuru authored Nov 17, 2022
1 parent d18f23f commit 5b6e18a
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 111 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: elkjs CI

on:
push:
branches:
- master
repository_dispatch:
schedule:
- cron: '0 3 * * *'
Expand All @@ -14,10 +16,13 @@ jobs:

runs-on: ubuntu-latest

continue-on-error: true

strategy:
fail-fast: false
matrix:
node-version: [ 12.x, 14.x ]
java-version: [ 11 ]
node-version: [ 14.x, 16.x, 18.x ]
java-version: [ 8, 11, 13, 15, 17 ]

steps:
- uses: actions/checkout@v1
Expand Down
73 changes: 41 additions & 32 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
TODO document the script
# Task depencencies
The dependencies are specified at the end of this file,
not within the task definitions.
Expand All @@ -18,8 +16,10 @@
+-- xtend-gen
*/
plugins {
id 'org.xtext.builder' version '2.0.5'
id 'org.xtext.xtend' version '2.0.5'
// The documentation of the plugin [1] states "tested up to [gradle] 7.2".
// [1] https://xtext.github.io/xtext-gradle-plugin/xtext-builder.html
id 'org.xtext.builder' version '3.0.2' // according to the docu, tested up to gradle 7.2
id 'org.xtext.xtend' version '3.0.2'
id 'java'
}

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

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

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

ext.versions = [
emfGwt: '2.12.4',
gwt: '2.9.0',
guava: '27.1-jre',
gwt: '2.10.0',
guava: '31.1-jre',
melk: '0.9.0-SNAPSHOT',
xtext: '2.20.0',
xtext: '2.28.0',

// From 2.26 on Xtext supports Java 17, however,
// "Xtext now supports running on Java 17 with Java 8 and 11 targets. Source and Target 17 are not supported yet".
// https://www.eclipse.org/Xtext/releasenotes.html#/releasenotes/2022/08/29/version-2-28-0
sourceTargetCompatibility: JavaVersion.current().ordinal() < 11 - 1 ? '1.8' : '11'
]

java {
sourceCompatibility = "$versions.sourceTargetCompatibility"
targetCompatibility = "$versions.sourceTargetCompatibility"
}

project.logger.lifecycle("You are running Java version ${JavaVersion.current()}.")
project.logger.lifecycle("Due to current Xtext's limitations ($versions.xtext), source and target compatibility have been set to ${versions.sourceTargetCompatibility}.")

if (!hasProperty('elkRepo')) {
ext.elkRepo = '../elk'
}
Expand Down Expand Up @@ -128,38 +138,37 @@ dependencies {
xtextLanguages "org.eclipse.elk:org.eclipse.elk.core.meta:$versions.melk"

// for the minus sign to work in melk files
xtextCompile "org.eclipse.xtext:org.eclipse.xtext.xbase.lib:$versions.xtext"
xtextImplementation "org.eclipse.xtext:org.eclipse.xtext.xbase.lib:$versions.xtext"

xtextCompile "com.google.guava:guava:$versions.guava"
xtextImplementation "com.google.guava:guava:$versions.guava"

xtextCompile "com.google.gwt:gwt-dev:$versions.gwt"
xtextCompile "com.google.gwt:gwt-user:$versions.gwt"
xtextImplementation "org.gwtproject:gwt-dev:$versions.gwt"
xtextImplementation "org.gwtproject:gwt-user:$versions.gwt"

xtextCompile "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt"
xtextCompile "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt"
xtextImplementation "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt"
xtextImplementation "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt"

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// emf for gwt
compile "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt"
compile "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt"
implementation "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt"
implementation "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt"
// guava
compile "com.google.guava:guava:$versions.guava"
implementation "com.google.guava:guava:$versions.guava"
// gwt
compile "com.google.gwt:gwt-user:$versions.gwt"
compile "com.google.gwt:gwt-dev:$versions.gwt"
implementation "org.gwtproject:gwt-user:$versions.gwt"
implementation "org.gwtproject:gwt-dev:$versions.gwt"
// xtend libs
compile "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext"
compile "org.eclipse.xtext:org.eclipse.xtext.xbase.lib:$versions.xtext"
implementation "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext"
implementation "org.eclipse.xtext:org.eclipse.xtext.xbase.lib:$versions.xtext"

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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

gwt "com.google.gwt:gwt:$versions.gwt"
gwt "com.google.gwt:gwt-dev:$versions.gwt"
gwt "com.google.gwt:gwt-user:$versions.gwt"
//gwt "com.google.gwt:gwt-servlet:$versions.gwt"
gwt "org.gwtproject:gwt:$versions.gwt"
gwt "org.gwtproject:gwt-dev:$versions.gwt"
gwt "org.gwtproject:gwt-user:$versions.gwt"

gwt "com.genmymodel.emf.gwt:emf-common:$versions.emfGwt:sources"
gwt "com.genmymodel.emf.gwt:emf-ecore:$versions.emfGwt:sources"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun Jun 23 18:38:22 UTC 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
117 changes: 69 additions & 48 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,25 +1,59 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand All @@ -30,6 +64,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,33 +75,14 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


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

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

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

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
Expand All @@ -138,27 +156,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

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

0 comments on commit 5b6e18a

Please sign in to comment.