Use openjfx dependencies from maven central

* Can use the release flag of maven-compiler-plugin again
* Make the openjfx dependencies as provided, so that they
  don't end up in pmd-bin-*.zip
This commit is contained in:
Andreas Dangel
2018-07-29 19:50:53 +02:00
parent 62612dc507
commit 707781600f
3 changed files with 43 additions and 52 deletions

View File

@ -3,16 +3,4 @@ set TOPDIR=%~dp0..
set OPTS=
set MAIN_CLASS=net.sourceforge.pmd.util.fxdesigner.DesignerStarter
:: sets the jver variable to the java version, eg 901 for 9.0.1+x or 180 for 1.8.0_171-b11
for /f tokens^=2-4^ delims^=.-_+^" %%j in ('java -fullversion 2^>^&1') do set /A jver="%%j%%k%%l"
if "%jver%" GEQ "900" (
:: enable reflection
Set jreopts=--add-opens javafx.controls/javafx.scene.control.skin=ALL-UNNAMED
) else (
Set jreopts=
)
java %jreopts% -classpath "%TOPDIR%\lib\*" %OPTS% %MAIN_CLASS% %*
java -classpath "%TOPDIR%\lib\*" %OPTS% %MAIN_CLASS% %*

View File

@ -74,34 +74,6 @@ check_lib_dir() {
fi
}
jre_specific_vm_options() {
full_ver=$(java -version 2>&1)
# java_ver is eg "18" for java 1.8, "90" for java 9.0, "100" for java 10.0.x
java_ver=$(echo $full_ver | sed -n '{
# replace early access versions, e.g. 11-ea with 11.0.0
s/-ea/.0.0/
# replace versions such as 10 with 10.0.0
s/version "\([0-9]\{1,\}\)"/version "\1.0.0"/
# extract the major and minor parts of the version
s/^.* version "\(.*\)\.\(.*\)\..*".*$/\1\2/p
}')
options=""
if [ "$java_ver" -ge 90 ] && [ "${APPNAME}" = "designer" ]
then # open internal module of javafx to reflection (for our TreeViewWrapper)
options="--add-opens javafx.controls/javafx.scene.control.skin=ALL-UNNAMED"
# The rest here is for RichtextFX
options+=" --add-opens javafx.graphics/javafx.scene.text=ALL-UNNAMED"
options+=" --add-opens javafx.graphics/com.sun.javafx.scene.text=ALL-UNNAMED"
options+=" --add-opens javafx.graphics/com.sun.javafx.text=ALL-UNNAMED"
options+=" --add-opens javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED"
# Warn of remaining illegal accesses
options+=" --illegal-access=warn"
fi
echo $options
}
readonly APPNAME="${1}"
if [ -z "${APPNAME}" ]; then
usage
@ -156,5 +128,5 @@ cygwin_paths
java_heapsize_settings
java ${HEAPSIZE} $(jre_specific_vm_options) -cp "${classpath}" "${CLASSNAME}" "$@"
java ${HEAPSIZE} -cp "${classpath}" "${CLASSNAME}" "$@"

View File

@ -15,6 +15,8 @@
<!-- Workaround for https://youtrack.jetbrains.com/issue/IDEA-188690 -->
<maven.compiler.source>1.${java.version}</maven.compiler.source>
<maven.compiler.target>1.${java.version}</maven.compiler.target>
<openjfx.version>11-ea+19</openjfx.version>
</properties>
<build>
@ -29,15 +31,6 @@
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration combine.self="override">
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<!-- Compiles Less files into CSS files. Currently compatible with Less 1.7.0 -->
<!-- If need be, we can probably update the Less version by using the lessJs
configuration property and having a custom less.js file around. -->
@ -76,13 +69,51 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>${project.version}</version>
</dependency>
<!-- OpenJFX dependencies are provided. OpenJFX needs to be installed separately. -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>${openjfx.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${openjfx.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${openjfx.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${openjfx.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>${openjfx.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>${openjfx.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.fxmisc.richtext</groupId>
<artifactId>richtextfx</artifactId>