You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer: I can spell"gradlew" correctly two times out of three, but have no other experience with that build tool.
The build instructions currently specify that we need to build the variant sources for all supported Java versions:
export BC_JDK8=/path/to/java8
export BC_JDK11=/path/to/java11
export BC_JDK17=/path/to/java17
export BC_JDK21=/path/to/java21
[...]
The project now uses ```gradlew``` which can be invoked for example:
# from the root of the project
# Ensure JAVA_HOME points to JDK 17 or higher JAVA_HOME
./gradlew clean build
The gradle script will endeavour to verify their existence but not the correctness of their value.
All four environment variables have to be set, otherwise gradlew immediately fails; even trying to run an "inspect-only" command like gradlew tasks requires them. Trying to use placeholder strings to pass the check...
...works, but obviously only until an actual build is attempted, which is not surprising:
$ ./gradlew build
> Configure project :
Environment setup:
Looking for JDK ENV 'BC_JDK8' found nope8
Looking for JDK ENV 'BC_JDK11' found nope11
Looking for JDK ENV 'BC_JDK17' found nope17
Looking for JDK ENV 'BC_JDK21' found /usr/lib/jvm/java-21-openjdk-amd64
Directory '/home...../bc-java/nope17' (environment variable 'BC_JDK17') used for java installations does not exist
Directory '/home...../bc-java/nope11' (environment variable 'BC_JDK11') used for java installations does not exist
Directory '/home...../bc-java/nope8' (environment variable 'BC_JDK8') used for java installations does not exist
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':jmail:compileJava'.
> Failed to query the value of extension 'errorprone' property 'enabled'.
> Failed to calculate the value of task ':jmail:compileJava' property 'javaCompiler'.
> No matching toolchains found for requested specification: {languageVersion=17, vendor=any, implementation=vendor-specific} for LINUX on x86_64.
> No locally installed toolchains match and toolchain auto-provisioning is not enabled.
Didn't expect that to work, but was hoping the error messages would help me track down what I need to disable, and where I need to do it, in order to only build for a single Java version, or potentially "17 and 21", etc. Or alternatively -- this would be even better, if it exists -- what "tasks" or "targets" or whatever Gradle calls them can be given on the command line instead of build, in order to skip trying to compile for Java 8.
The gradlew tasks --all with placeholder toolchain environment variables lists some promising-looking targets like prov:compileJava21Java, pkix:compileJava9Java, etc, but it's not clear what needs to be done in what order.
I also noticed the top-level build1-* scripts that I'm guessing were the previous build system, using Ant? I gave this a try:
$ export JDKPATH=$BC_JDK21 # required to not die horribly
$ sh ./build1-8+
[...]
[javac] Compiling 2502 source files to /home...../bc-java/build/bcprov-jdk18on-1.79b01/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 8
[javac] warning: [options] source value 8 is obsolete and will be removed in a future release
[javac] warning: [options] target value 8 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[.... lock up ...]
which actually looks really hopeful, but if this is what is intended then I need to find the "fork this many parallel compilations" setting and turn it way down, because it tried to do over twenty at the same time and then system daemons started getting killed off because they were failing their watchdog alarms. I haven't seen a load average that high since the accidental fork bombs of my university days. :-)
What's the best practice here, Gradle or the Ant script? And how do I skip past the builds targeting Java 8?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Disclaimer: I can spell
"gradlew"
correctly two times out of three, but have no other experience with that build tool.The build instructions currently specify that we need to build the variant sources for all supported Java versions:
All four environment variables have to be set, otherwise
gradlew
immediately fails; even trying to run an "inspect-only" command likegradlew tasks
requires them. Trying to use placeholder strings to pass the check......works, but obviously only until an actual build is attempted, which is not surprising:
Didn't expect that to work, but was hoping the error messages would help me track down what I need to disable, and where I need to do it, in order to only build for a single Java version, or potentially "17 and 21", etc. Or alternatively -- this would be even better, if it exists -- what "tasks" or "targets" or whatever Gradle calls them can be given on the command line instead of
build
, in order to skip trying to compile for Java 8.The
gradlew tasks --all
with placeholder toolchain environment variables lists some promising-looking targets likeprov:compileJava21Java
,pkix:compileJava9Java
, etc, but it's not clear what needs to be done in what order.I also noticed the top-level
build1-*
scripts that I'm guessing were the previous build system, using Ant? I gave this a try:which actually looks really hopeful, but if this is what is intended then I need to find the "fork this many parallel compilations" setting and turn it way down, because it tried to do over twenty at the same time and then system daemons started getting killed off because they were failing their watchdog alarms. I haven't seen a load average that high since the accidental fork bombs of my university days. :-)
What's the best practice here, Gradle or the Ant script? And how do I skip past the builds targeting Java 8?
Beta Was this translation helpful? Give feedback.
All reactions