update to gradle 7

https://github.com/eclipse/xtext/issues/1548

Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
This commit is contained in:
Christian Dietrich 2021-08-10 12:02:12 +02:00
parent 87ac743c65
commit c2af18180a
25 changed files with 124 additions and 109 deletions

6
.classpath Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>

View file

@ -5,6 +5,11 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
@ -12,6 +17,7 @@
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>

View file

@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.source=11

View file

@ -16,4 +16,5 @@ fi
-PignoreTestFailures=true \
--refresh-dependencies \
--continue \
--warning-mode all \
$@

View file

@ -27,9 +27,9 @@ subprojects {
version = rootProject.version
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'java-library'
dependencies {
compile platform("org.eclipse.xtext:xtext-dev-bom:$project.version")
api platform("org.eclipse.xtext:xtext-dev-bom:$project.version")
}
if (findProperty('compileXtend') == 'true') {
apply plugin: 'org.xtext.xtend'

View file

@ -98,7 +98,6 @@ if (isTestProject || name.contains('testlanguage')) {
enabled = false
}
javadocJar.enabled = false
uploadArchives.enabled = false
} else {
artifacts.archives javadocJar
}

View file

@ -36,7 +36,7 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
configurations {
optional {
description 'Dependencies required at build time, but not exported into meta data'
extendsFrom compile
extendsFrom api
}
// Put any unwanted transitive dependencies here, they will be excluded from all projects.

View file

@ -3,18 +3,20 @@
*/
sourceSets {
mwe2 {}
}
mwe2 {
eclipse.classpath.plusConfigurations += [configurations.mwe2Runtime]
}
}
eclipse.classpath.plusConfigurations += [configurations.mwe2RuntimeClasspath]
dependencies {
if (!name.endsWith('bootstrap')) {
mwe2Compile project(':org.eclipse.xtext.xtext.generator')
mwe2Implementation project(':org.eclipse.xtext.xtext.generator')
}
mwe2Runtime 'org.eclipse.emf:org.eclipse.emf.mwe2.launch'
mwe2Runtime "org.eclipse.xtext:org.eclipse.xtext.common.types:$versions.xtext_bootstrap"
mwe2Runtime "org.eclipse.xtext:org.eclipse.xtext.ecore:$versions.xtext_bootstrap"
mwe2Implementation 'org.eclipse.emf:org.eclipse.emf.mwe2.launch'
mwe2Implementation "org.eclipse.xtext:org.eclipse.xtext.common.types:$versions.xtext_bootstrap"
mwe2Implementation "org.eclipse.xtext:org.eclipse.xtext.ecore:$versions.xtext_bootstrap"
mwe2Implementation platform("org.eclipse.xtext:xtext-dev-bom:$project.version")
}
if (findProperty('compileXtend') == 'true') {
@ -24,7 +26,7 @@ if (findProperty('compileXtend') == 'true') {
class XtextGeneratorTask extends JavaExec {
XtextGeneratorTask() {
group = 'Build'
main = 'org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher'
mainClass = 'org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher'
classpath = project.sourceSets.mwe2.runtimeClasspath
}
def setWorkflow(File workflowFile) {

Binary file not shown.

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -10,6 +10,7 @@ if (findProperty('compileXtend') == 'true') {
// Defer the sources jar configuration to later when the source sets are set up completely
afterEvaluate {
sourcesJar {
dependsOn generateTestXtext
from (sourceSets.main.xtendOutputDir) {
include '**/*._trace'
}

33
gradlew vendored
View file

@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
@ -82,6 +82,7 @@ esac
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
@ -129,6 +130,7 @@ fi
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
@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; 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
@ -175,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
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"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

25
gradlew.bat vendored
View file

@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -51,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@ -61,28 +64,14 @@ echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell

View file

@ -1,13 +1,13 @@
apply from: "${rootDir}/gradle/mwe2-workflows.gradle"
dependencies {
compile project(':org.eclipse.xtext.ide')
compile project(':org.eclipse.xtext.testing')
compile project(':org.eclipse.xtext.testlanguages')
compile project(':org.eclipse.xtext.testlanguages.ide')
compile 'junit:junit'
compile 'org.eclipse.lsp4j:org.eclipse.lsp4j'
compile 'org.eclipse.emf:org.eclipse.emf.ecore.change'
api project(':org.eclipse.xtext.ide')
api project(':org.eclipse.xtext.testing')
api project(':org.eclipse.xtext.testlanguages')
api project(':org.eclipse.xtext.testlanguages.ide')
api 'junit:junit'
api 'org.eclipse.lsp4j:org.eclipse.lsp4j'
api 'org.eclipse.emf:org.eclipse.emf.ecore.change'
}
sourceSets.test.java {

View file

@ -2,7 +2,7 @@ ext.title = 'Xtext IDE Library'
description = 'Platform-independent language support.'
dependencies {
compile project(':org.eclipse.xtext')
compile 'org.eclipse.emf:org.eclipse.emf.ecore.change'
compile 'org.eclipse.lsp4j:org.eclipse.lsp4j'
api project(':org.eclipse.xtext')
api 'org.eclipse.emf:org.eclipse.emf.ecore.change'
api 'org.eclipse.lsp4j:org.eclipse.lsp4j'
}

View file

@ -2,9 +2,9 @@ ext.title = 'Xtext Testing Library'
description = 'Infrastructure for testing Xtext languages (supersedes org.eclipse.xtext.junit4).'
dependencies {
compile project(':org.eclipse.xtext')
compile project(':org.eclipse.xtext.ide')
compile 'org.eclipse.lsp4j:org.eclipse.lsp4j'
api project(':org.eclipse.xtext')
api project(':org.eclipse.xtext.ide')
api 'org.eclipse.lsp4j:org.eclipse.lsp4j'
optional 'junit:junit'
optional 'org.junit.jupiter:junit-jupiter-api'
optional 'org.junit.jupiter:junit-jupiter-engine'

View file

@ -1,4 +1,4 @@
dependencies {
compile project(':org.eclipse.xtext.testlanguages')
compile project(':org.eclipse.xtext.ide')
api project(':org.eclipse.xtext.testlanguages')
api project(':org.eclipse.xtext.ide')
}

View file

@ -1,11 +1,11 @@
apply from: "${rootDir}/gradle/mwe2-workflows.gradle"
dependencies {
compile project(':org.eclipse.xtext')
compile project(':org.eclipse.xtext.testing')
compile 'org.eclipse.platform:org.eclipse.equinox.common'
compile 'org.eclipse.platform:org.eclipse.core.runtime'
compile 'org.eclipse.emf:org.eclipse.emf.mwe2.runtime'
api project(':org.eclipse.xtext')
api project(':org.eclipse.xtext.testing')
api 'org.eclipse.platform:org.eclipse.equinox.common'
api 'org.eclipse.platform:org.eclipse.core.runtime'
api 'org.eclipse.emf:org.eclipse.emf.mwe2.runtime'
}
// Include the mwe2 and xtext files from the main source set when executing the workflow
@ -15,3 +15,5 @@ task generateTestLanguages(type: XtextGeneratorTask) {
workflow = file('src/org/eclipse/xtext/testlanguages/GenerateTestLanguages.mwe2')
outputs.dir 'src-gen'
}
compileJava.mustRunAfter generateTestLanguages

View file

@ -1,18 +1,18 @@
apply from: "${rootDir}/gradle/mwe2-workflows.gradle"
dependencies {
compile project(':org.eclipse.xtext.testing')
compile project(':org.eclipse.xtext.xtext.generator')
compile project(':org.eclipse.xtext.xtext.wizard')
compile project(':org.eclipse.xtext.testlanguages')
mwe2Compile project(':org.eclipse.xtext.testlanguages')
compile 'junit:junit'
compile 'org.eclipse.emf:org.eclipse.emf.common'
compile 'org.eclipse.emf:org.eclipse.emf.ecore.xmi'
api project(':org.eclipse.xtext.testing')
api project(':org.eclipse.xtext.xtext.generator')
api project(':org.eclipse.xtext.xtext.wizard')
api project(':org.eclipse.xtext.testlanguages')
mwe2Implementation project(':org.eclipse.xtext.testlanguages')
api 'junit:junit'
api 'org.eclipse.emf:org.eclipse.emf.common'
api 'org.eclipse.emf:org.eclipse.emf.ecore.xmi'
optional files('lib/simple.jar')
// The MWE2 workflow depends on emf-gen, so we have to include it in the test dependencies
testCompile sourceSets.mwe2.output
testCompile 'args4j:args4j'
testImplementation sourceSets.mwe2.output
testImplementation 'args4j:args4j'
// optional for the utilities but mandatory to run the tests
testImplementation 'junit:junit'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
@ -33,8 +33,12 @@ sourceSets.mwe2 {
runtimeClasspath += processTestResources.outputs.files
}
jar.from sourceSets.mwe2.output
sourcesJar.from sourceSets.mwe2.allSource
sourcesJar {
if (findProperty('compileXtend') == 'true') {
dependsOn(generateTestXtext)
}
from sourceSets.mwe2.allSource
}
task generateTestLanguages(type: XtextGeneratorTask) {
workflow = file('src/org/eclipse/xtext/GenerateAllTestLanguages.mwe2')
outputs.dir 'src-gen'

View file

@ -2,11 +2,11 @@ ext.title = 'Xtext Utilities'
description = 'Utility classes used throughout Xtext.'
dependencies {
compile "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext"
compile 'log4j:log4j'
compile 'org.eclipse.emf:org.eclipse.emf.common'
compile 'org.eclipse.emf:org.eclipse.emf.ecore'
compile 'com.google.inject:guice'
api "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext"
api 'log4j:log4j'
api 'org.eclipse.emf:org.eclipse.emf.common'
api 'org.eclipse.emf:org.eclipse.emf.ecore'
api 'com.google.inject:guice'
}
// Set the value of the Maven-Version attribute

View file

@ -11,8 +11,8 @@ dependencies {
// We cannot use the projects within the workspace, as we would have
// to compile them before generating the code, so we need to stick to the bootstrapping version.
// Buildship, however, links the workspace projects anyway if a composite build is used.
compile "org.eclipse.xtext:org.eclipse.xtext:$versions.xtext_bootstrap"
compile "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:$versions.xtext_bootstrap"
api "org.eclipse.xtext:org.eclipse.xtext:$versions.xtext_bootstrap"
api "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:$versions.xtext_bootstrap"
}
sourceSets.main.java.srcDirs = []
@ -28,10 +28,14 @@ sourceSets.mwe2 {
java.srcDir 'xtend-gen'
}
}
configurations.mwe2Compile.extendsFrom configurations.compile
configurations.mwe2Implementation.extendsFrom configurations.api
jar.from sourceSets.mwe2.output
sourcesJar.from sourceSets.mwe2.allSource
sourcesJar {
if (findProperty('compileXtend') == 'true') {
dependsOn generateMwe2Xtext
}
from sourceSets.mwe2.allSource
}
task generateXtextLanguage(type: XtextGeneratorTask) {
workflow = file('src/org/eclipse/xtext/xtext/bootstrap/GenerateXtext.mwe2')
}

View file

@ -2,12 +2,12 @@ ext.title = 'Xtext Generator'
description = 'Generator for infrastructure of Xtext languages (supersedes org.eclipse.xtext.generator).'
dependencies {
compile project(':org.eclipse.xtext')
compile 'org.eclipse.emf:org.eclipse.emf.codegen'
compile 'org.eclipse.emf:org.eclipse.emf.codegen.ecore'
compile 'org.eclipse.emf:org.eclipse.emf.mwe.utils'
compile 'org.eclipse.emf:org.eclipse.emf.mwe2.lib'
compile 'org.eclipse.platform:org.eclipse.equinox.common'
api project(':org.eclipse.xtext')
api 'org.eclipse.emf:org.eclipse.emf.codegen'
api 'org.eclipse.emf:org.eclipse.emf.codegen.ecore'
api 'org.eclipse.emf:org.eclipse.emf.mwe.utils'
api 'org.eclipse.emf:org.eclipse.emf.mwe2.lib'
api 'org.eclipse.platform:org.eclipse.equinox.common'
optional 'org.eclipse.platform:org.eclipse.core.runtime'
optional 'org.eclipse.jdt:org.eclipse.jdt.core'
}

View file

@ -2,5 +2,5 @@ ext.title = 'Xtext Language IDE Support'
description = 'Xtext Language generic IDE support.'
dependencies {
compile project(':org.eclipse.xtext.ide')
api project(':org.eclipse.xtext.ide')
}

View file

@ -2,8 +2,8 @@ ext.title = 'Xtext Wizard'
description = 'Platform-independent component for creating new Xtext projects.'
dependencies {
compile project(':org.eclipse.xtext')
compile 'args4j:args4j'
api project(':org.eclipse.xtext')
api 'args4j:args4j'
}
sourceSets.main.resources.srcDir 'resources'

View file

@ -2,16 +2,16 @@ ext.title = 'Xtext Runtime Bundle'
description = 'Core component of Xtext.'
dependencies {
compile project(':org.eclipse.xtext.util')
compile "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext"
compile 'log4j:log4j'
compile 'org.eclipse.platform:org.eclipse.equinox.common'
api project(':org.eclipse.xtext.util')
api "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtext"
api 'log4j:log4j'
api 'org.eclipse.platform:org.eclipse.equinox.common'
// remove me, once the following is fixed : https://bugs.eclipse.org/bugs/show_bug.cgi?id=510504
compile 'org.eclipse.platform:org.eclipse.osgi'
compile 'org.eclipse.emf:org.eclipse.emf.common'
compile 'org.eclipse.emf:org.eclipse.emf.ecore.xmi'
compile 'com.google.inject:guice'
compile 'org.antlr:antlr-runtime'
api 'org.eclipse.platform:org.eclipse.osgi'
api 'org.eclipse.emf:org.eclipse.emf.common'
api 'org.eclipse.emf:org.eclipse.emf.ecore.xmi'
api 'com.google.inject:guice'
api 'org.antlr:antlr-runtime'
optional 'org.eclipse.platform:org.eclipse.core.runtime'
optional 'org.eclipse.platform:org.eclipse.equinox.registry'
optional 'org.eclipse.emf:org.eclipse.emf.mwe.utils'