Skip to content

Commit fc5de60

Browse files
authored
Modernize Gradle to fix #776 (#781)
- modernize gradle use - fix some gradle deprecations - update to gradle 8.5 Signed-off-by: Christian Dietrich <[email protected]>
1 parent 56100e1 commit fc5de60

File tree

13 files changed

+35
-25
lines changed

13 files changed

+35
-25
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ buildscript {
2121
}
2222
}
2323
dependencies {
24-
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:6.3.1"
24+
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:6.4.0"
2525
classpath "org.xtext:xtext-gradle-plugin:4.0.0"
2626
}
2727
}

gradle/java-compiler-settings.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1111
******************************************************************************/
1212

13-
sourceCompatibility = '11'
13+
java {
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
}
1416

1517
tasks.withType(Javadoc) {
1618
options.addStringOption('Xdoclint:none', '-quiet')

gradle/manifest-gen.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ else if (baseVersion.split('\\.').length == 4)
1818
baseVersion = baseVersion.substring(0, baseVersion.lastIndexOf('.'))
1919
def qualifiedVersion = baseVersion + '.v' + buildTime
2020

21-
jar.bnd (
21+
jar.bundle.bnd (
2222
'Bundle-Version': qualifiedVersion,
2323
'Bundle-Vendor': 'Eclipse LSP4J',
2424
'Bundle-RequiredExecutionEnvironment': 'JavaSE-11',

gradle/wrapper/gradle-wrapper.jar

-17.7 KB
Binary file not shown.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

+17-12
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
9088

9189
# Use the maximum available, or set MAX_FD != -1 to use that value.
9290
MAX_FD=maximum
@@ -133,26 +131,29 @@ location of your Java installation."
133131
fi
134132
else
135133
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137137
138138
Please set the JAVA_HOME variable in your environment to match the
139139
location of your Java installation."
140+
fi
140141
fi
141142

142143
# Increase the maximum file descriptors if we can.
143144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
146147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
148149
MAX_FD=$( ulimit -H -n ) ||
149150
warn "Could not query maximum file descriptor limit"
150151
esac
151152
case $MAX_FD in #(
152153
'' | soft) :;; #(
153154
*)
154155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
156157
ulimit -n "$MAX_FD" ||
157158
warn "Could not set maximum file descriptor limit to $MAX_FD"
158159
esac
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
197198
done
198199
fi
199200

200-
# Collect all arguments for the java command;
201-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202-
# shell script including quotes and variable substitutions, so put them in
203-
# double quotes to make sure that they get re-expanded; and
204-
# * put everything else in single quotes, so that it's not re-expanded.
201+
202+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204+
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
205210

206211
set -- \
207212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

org.eclipse.lsp4j.debug/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ dependencies {
2222
testImplementation "com.tngtech.archunit:archunit:$versions.archunit"
2323
}
2424

25-
jar.bnd (
25+
jar.bundle.bnd (
2626
'Import-Package': "com.google.gson.*;version=\"$versions.gson\",*",
2727
)

org.eclipse.lsp4j.generator/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ dependencies {
1818
api "org.eclipse.xtend:org.eclipse.xtend.lib:$versions.xtend_lib"
1919
}
2020

21-
jar.bnd (
21+
jar.bundle.bnd (
2222
'Import-Package': "com.google.common.*;version=\"$versions.guava\",com.google.gson.*;version=\"$versions.gson\",*"
2323
)

org.eclipse.lsp4j.jsonrpc.debug/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies {
1919
testImplementation "junit:junit:$versions.junit"
2020
}
2121

22-
jar.bnd(
22+
jar.bundle.bnd(
2323
'Import-Package': "com.google.gson.*;version=\"$versions.gson\",*"
2424
)
2525

org.eclipse.lsp4j.jsonrpc/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ dependencies {
1818
testImplementation "junit:junit:$versions.junit"
1919
}
2020

21-
jar.bnd(
21+
jar.bundle.bnd(
2222
'Import-Package': "com.google.gson.*;version=\"$versions.gson\",*"
2323
)

org.eclipse.lsp4j.websocket.jakarta/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ dependencies {
1919
testImplementation "junit:junit:$versions.junit"
2020
}
2121

22-
jar.bnd (
22+
jar.bundle.bnd (
2323
'Import-Package': '*'
2424
)

org.eclipse.lsp4j.websocket/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ dependencies {
1919
testImplementation "junit:junit:$versions.junit"
2020
}
2121

22-
jar.bnd(
22+
jar.bundle.bnd(
2323
'Import-Package': '*'
2424
)

org.eclipse.lsp4j/build.gradle

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
ext.title = 'LSP4J'
1414
description = 'Java bindings for the Language Server Protocol'
1515

16-
sourceCompatibility = '11'
17-
targetCompatibility = '11'
16+
java {
17+
sourceCompatibility = JavaVersion.VERSION_11
18+
targetCompatibility = JavaVersion.VERSION_11
19+
}
1820

1921
dependencies {
2022
compileOnly project(":org.eclipse.lsp4j.generator")
@@ -24,6 +26,6 @@ dependencies {
2426
testImplementation "com.tngtech.archunit:archunit:$versions.archunit"
2527
}
2628

27-
jar.bnd (
29+
jar.bundle.bnd (
2830
'Import-Package': "com.google.gson.*;version=\"$versions.gson\",*"
2931
)

0 commit comments

Comments
 (0)