Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to javafx18 and java17 #2623

Merged
merged 21 commits into from Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/checks.yml
Expand Up @@ -16,11 +16,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up JDK 15.0.1
uses: actions/setup-java@v1
- name: Set up JDK 17.0.1
uses: actions/setup-java@v2
with:
java-version: 15.0.1
java-package: jdk+fx
distribution: "temurin"
java-version: 17.0.1

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/create-release.yml
Expand Up @@ -16,7 +16,7 @@ jobs:
environment: deploy
runs-on: ubuntu-latest
env:
INSTALL4J_DIR: "install4j/install4j9.0.2"
INSTALL4J_DIR: "install4j/install4j9.0.5"

steps:
- uses: actions/checkout@v2
Expand All @@ -28,11 +28,11 @@ jobs:
echo ::set-output name=major_release::true
fi

- name: Set up JDK 15
uses: actions/setup-java@v1
- name: Set up JDK 17.0.1
uses: actions/setup-java@v2
with:
java-version: 15.0.1
java-package: jdk+fx
distribution: "temurin"
java-version: 17.0.1

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand All @@ -45,13 +45,13 @@ jobs:
- name: Download Install4j
run: |
mkdir -p "$HOME/install4j"
curl https://download-gcdn.ej-technologies.com/install4j/install4j_unix_9_0_2.tar.gz -o "$HOME/install4j/install4j.tar.gz"
curl https://download-gcdn.ej-technologies.com/install4j/install4j_unix_9_0_5.tar.gz -o "$HOME/install4j/install4j.tar.gz"
tar xzf "$HOME/install4j/install4j.tar.gz" -C "$HOME/install4j"

- name: Download Bundled JRE
run: |
mkdir -p "$HOME/.install4j8/jres/"
curl https://content.faforever.com/jre/windows-amd64-15.0.1.tar.gz -o "$HOME/.install4j8/jres/windows-amd64-15.0.1.tar.gz"
mkdir -p "$HOME/.local/share/install4j/v9/jres"
curl https://content.faforever.com/build/jre/windows-amd64-17.0.1.tar.gz -o "$HOME/.local/share/install4j/v9/jres/windows-amd64-17.0.1.tar.gz"

- name: Build Windows Files
run: |
Expand All @@ -72,27 +72,14 @@ jobs:
--stacktrace \
buildInstall4jMediaFiles

- name: Create Draft Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: ${{ github.sha }}
tag_name: v${{ github.event.inputs.version }}
release_name: v${{ github.event.inputs.version }}
draft: true
prerelease: ${{ steps.tag_check.outputs.major_release != 'true'}}
generate_release_notes: true

- name: Get Artifact Paths
id: artifact_paths
run: |
LINUX_TAR=$(ls build/install4j/dfc_unix_*.tar.gz | head -n 1)
LINUX_TAR=$(ls build/install4j/faf_unix_*.tar.gz | head -n 1)
LINUX_TAR_NAME=$(basename $LINUX_TAR)
WINDOWS_EXE=$(ls build/install4j/dfc_windows-x64_*.exe | head -n 1)
WINDOWS_EXE=$(ls build/install4j/faf_windows-x64_*.exe | head -n 1)
WINDOWS_EXE_NAME=$(basename $WINDOWS_EXE)
WINDOWS_ZIP=$(ls build/install4j/dfc_windows-x64_*.zip | head -n 1)
WINDOWS_ZIP=$(ls build/install4j/faf_windows-x64_*.zip | head -n 1)
WINDOWS_ZIP_NAME=$(basename $WINDOWS_ZIP)
EXE_PATH=$(dirname $WINDOWS_EXE)/
echo ::set-output name=EXE_PATH::${EXE_PATH}
Expand All @@ -103,6 +90,19 @@ jobs:
echo ::set-output name=WINDOWS_ZIP::${WINDOWS_ZIP}
echo ::set-output name=WINDOWS_ZIP_NAME::${WINDOWS_ZIP_NAME}

- name: Create Draft Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: ${{ github.sha }}
tag_name: v${{ github.event.inputs.version }}
release_name: v${{ github.event.inputs.version }}
draft: true
prerelease: ${{ steps.tag_check.outputs.major_release != 'true'}}
generate_release_notes: true

- name: Upload Linux Files
id: upload-linux
uses: actions/upload-release-asset@v1
Expand Down
2 changes: 1 addition & 1 deletion .idea/runConfigurations/Main.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Main_with_Reload.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 13 additions & 14 deletions build.gradle
Expand Up @@ -94,9 +94,9 @@ tasks.withType(Test) {

}

//Specify jacoco version to work with java15
//Specify jacoco version to work with java17
jacoco {
toolVersion = "0.8.6"
toolVersion = "0.8.7"
}

apply plugin: 'java'
Expand All @@ -105,8 +105,8 @@ apply plugin: 'io.spring.dependency-management'
apply plugin: 'distribution'


sourceCompatibility = JavaVersion.VERSION_15
targetCompatibility = JavaVersion.VERSION_15
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

// These are read from gradle.properties
version "${version}"
Expand Down Expand Up @@ -178,7 +178,6 @@ bootRun {
"-XX:ConcGCThreads=1",
"-XX:ParallelGCThreads=1",
"-XX:+UseG1GC",
"-javaagent:webview-patch/build/libs/webview-patch.jar",
"-Djava.net.preferIPv4Stack=true",
"-XX:TieredStopAtLevel=1"
]
Expand Down Expand Up @@ -276,7 +275,6 @@ task downloadNativeDependencies(dependsOn: [downloadUnixUid, downloadWindowsUid,
}

compileJava.dependsOn 'downloadNativeDependencies'
compileJava.dependsOn ':webview-patch:build'

task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) {
main = "com.codacy.CodacyCoverageReporter"
Expand Down Expand Up @@ -332,19 +330,20 @@ dependencies {
implementation("org.kitteh.irc:client-lib:8.0.0")
implementation("org.mapstruct:mapstruct:1.4.2.Final")

implementation("org.openjfx:javafx-base:15.0.1:${javafxPlatform}")
implementation("org.openjfx:javafx-controls:15.0.1:${javafxPlatform}")
implementation("org.openjfx:javafx-graphics:15.0.1:${javafxPlatform}")
implementation("org.openjfx:javafx-swing:15.0.1:${javafxPlatform}")
implementation("org.openjfx:javafx-fxml:15.0.1:${javafxPlatform}")
implementation("org.openjfx:javafx-web:15.0.1:${javafxPlatform}")
implementation("org.openjfx:javafx-media:15.0.1:${javafxPlatform}")

def javafxVersion = "18"
implementation("org.openjfx:javafx-base:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-controls:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-graphics:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-swing:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-fxml:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-web:${javafxVersion}:${javafxPlatform}")
implementation("org.openjfx:javafx-media:${javafxVersion}:${javafxPlatform}")
implementation("com.github.1-alex98:discord-rpc:1.6.2-jna")
implementation("org.controlsfx:controlsfx:11.1.1")
implementation("org.fxmisc.flowless:flowless:0.6.9")
implementation("de.codecentric.centerdevice:javafxsvg:1.3.0")

implementation(project(":webview-patch"))
implementation("org.javassist:javassist:3.28.0-GA")

implementation("com.install4j:install4j-runtime:9.0.2")
Expand Down
68 changes: 47 additions & 21 deletions faf-client.install4j
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<install4j version="8.0.8" transformSequenceNumber="8">
<install4j version="9.0.5" transformSequenceNumber="9">
<directoryPresets config="./src/media/appicon" />
<application name="FAF Client" applicationId="2848-7798-9769-5013" mediaDir="./build/install4j" lzmaCompression="true" pack200Compression="true" shortName="dfc" publisher="FAForever" publisherWeb="https://github.com/FAForever/downlords-faf-client" allPathsRelative="true" autoSave="true" macVolumeId="e230e730a6fc064c" javaMinVersion="15" javaMaxVersion="15" allowBetaVM="true">
<application name="FAF Client" applicationId="2848-7798-9769-5013" mediaDir="./build/install4j" lzmaCompression="true" pack200Compression="true" shortName="faf" publisher="FAForever" publisherWeb="https://github.com/FAForever/downlords-faf-client" allPathsRelative="true" autoSave="true" macVolumeId="e230e730a6fc064c" javaMinVersion="17" allowBetaVM="true">
<languages>
<additionalLanguages>
<language id="zh_CN" />
Expand All @@ -17,7 +17,7 @@
</languages>
<searchSequence empty="true" />
</application>
<files>
<files preserveSymlinks="false">
<roots>
<root id="506" location="${installer:sys.programDataDir}" />
</roots>
Expand Down Expand Up @@ -62,7 +62,6 @@
-XX:ParallelGCThreads=1
-XX:+UseG1GC
-XX:+HeapDumpOnOutOfMemoryError
-javaagent:lib/webview-patch.jar
-Djava.net.preferIPv4Stack=true
-DnativeDir=natives
-Dprism.forceGPU=true
Expand Down Expand Up @@ -476,11 +475,19 @@ return console.askYesNo(message, true);
<group id="233" beanClass="com.install4j.runtime.beans.groups.VerticalFormComponentGroup" useExternalParametrization="true" externalParametrizationName="Customize banner image" externalParametrizationMode="include">
<serializedBean>
<property name="backgroundColor">
<object class="java.awt.Color">
<int>255</int>
<int>255</int>
<int>255</int>
<int>255</int>
<object class="com.install4j.runtime.beans.LightOrDarkColor">
<object class="java.awt.Color">
<int>255</int>
<int>255</int>
<int>255</int>
<int>255</int>
</object>
<object class="java.awt.Color">
<int>49</int>
<int>52</int>
<int>53</int>
<int>255</int>
</object>
</object>
</property>
<property name="borderSides">
Expand All @@ -489,11 +496,19 @@ return console.askYesNo(message, true);
</object>
</property>
<property name="imageEdgeBackgroundColor">
<object class="java.awt.Color">
<int>25</int>
<int>143</int>
<int>220</int>
<int>255</int>
<object class="com.install4j.runtime.beans.LightOrDarkColor">
<object class="java.awt.Color">
<int>25</int>
<int>143</int>
<int>220</int>
<int>255</int>
</object>
<object class="java.awt.Color">
<int>0</int>
<int>74</int>
<int>151</int>
<int>255</int>
</object>
</object>
</property>
<property name="imageEdgeBorder" type="boolean" value="true" />
Expand Down Expand Up @@ -547,11 +562,19 @@ return console.askYesNo(message, true);
<group id="240" beanClass="com.install4j.runtime.beans.groups.VerticalFormComponentGroup" useExternalParametrization="true" externalParametrizationName="Customize title bar" externalParametrizationMode="include">
<serializedBean>
<property name="backgroundColor">
<object class="java.awt.Color">
<int>255</int>
<int>255</int>
<int>255</int>
<int>255</int>
<object class="com.install4j.runtime.beans.LightOrDarkColor">
<object class="java.awt.Color">
<int>255</int>
<int>255</int>
<int>255</int>
<int>255</int>
</object>
<object class="java.awt.Color">
<int>49</int>
<int>52</int>
<int>53</int>
<int>255</int>
</object>
</object>
</property>
<property name="borderSides">
Expand Down Expand Up @@ -659,32 +682,35 @@ return console.askYesNo(message, true);
<entry location="lib/faf-uid" />
<entry location="lib/uid" />
</exclude>
<jreBundle usePack200="false" jreBundleSource="preCreated" includedJre="windows-amd64-15.0.1" directDownload="true" />
<jreBundle usePack200="false" jreBundleSource="preCreated" includedJre="windows-amd64-17.0.1" directDownload="true" />
</windows>
<windowsArchive name="Windows Archive" id="330" installDir="faf-client-${compiler:sys.version}">
<exclude>
<entry location="lib/faf-ice-adapter" />
<entry location="lib/faf-uid" />
</exclude>
<jreBundle jreBundleSource="preCreated" includedJre="windows-amd64-15.0.1" />
<jreBundle jreBundleSource="preCreated" includedJre="windows-amd64-17.0.1" />
</windowsArchive>
<unixArchive name="Unix Archive" id="331" installDir="faf-client-${compiler:sys.version}">
<exclude>
<entry location="lib/faf-ice-adapter.exe" />
<entry location="lib/faf-uid.exe" />
</exclude>
<jreBundle jreBundleSource="none" />
</unixArchive>
<linuxRPM name="Linux RPM" id="332" installDir="/opt/faf-client-${compiler:sys.version}">
<exclude>
<entry location="lib/faf-ice-adapter.exe" />
<entry location="lib/faf-uid.exe" />
</exclude>
<jreBundle jreBundleSource="none" />
</linuxRPM>
<linuxDeb name="Linux Deb Archive" id="333" installDir="/opt/faf-client-${compiler:sys.version}" dependencies="oracle-java8-installer" description="FAF Client" maintainerEmail="michel.jung89@gmail.com">
<exclude>
<entry location="lib/faf-ice-adapter.exe" />
<entry location="lib/faf-uid.exe" />
</exclude>
<jreBundle jreBundleSource="none" />
</linuxDeb>
</mediaSets>
</install4j>
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -17,7 +17,7 @@ Post a bounty on Issue Hunt. You can reward and financially help developers that
[![Issue hunt](https://github.com/BoostIO/issuehunt-materials/raw/master/v1/issuehunt-button-v1.svg?sanitize=true)](https://issuehunt.io/r/FAForever/downlords-faf-client)

## How to run
1. Use [AdoptOpenJDK](https://adoptopenjdk.net/) 15 or Oracle JDK 15 (others might not work)
1. Use [AdoptOpenJDK](https://adoptopenjdk.net/) 17 or Oracle JDK 17 (others might not work)
1. Clone the project with Git
- using SSH: `git clone git@github.com:FAForever/downlords-faf-client.git`
- using HTTPS: `https://github.com/FAForever/downlords-faf-client.git`
Expand Down
2 changes: 0 additions & 2 deletions settings.gradle
@@ -1,3 +1 @@
rootProject.name = 'faf-client'
include 'webview-patch'

3 changes: 2 additions & 1 deletion src/main/java/com/faforever/client/fx/WebViewConfigurer.java
Expand Up @@ -7,6 +7,7 @@
import javafx.event.EventHandler;
import javafx.scene.input.KeyCode;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import lombok.RequiredArgsConstructor;
Expand All @@ -32,11 +33,11 @@ public class WebViewConfigurer {

private final UiService uiService;
private final ApplicationContext applicationContext;
private final PreferencesService preferencesService;
private final ClientProperties clientProperties;

public void configureWebView(WebView webView) {
WebEngine engine = webView.getEngine();
webView.setPageFill(Color.TRANSPARENT);
webView.setContextMenuEnabled(false);
webView.setOnScroll(event -> {
if (event.isControlDown()) {
Expand Down
Expand Up @@ -12,7 +12,7 @@
fx:controller="com.faforever.client.teammatchmaking.MatchmakingQueueItemController"
spacing="10.0" HBox.hgrow="ALWAYS" alignment="TOP_CENTER">
<ToggleButton fx:id="joinLeaveQueueButton" styleClass="tmm, queue" alignment="TOP_CENTER" text="&lt;QueueName&gt;"
maxWidth="1.7976931348623157E308" onAction="#onJoinLeaveQueueClicked" />
maxWidth="1.7976931348623157E308" maxHeight="50" onAction="#onJoinLeaveQueueClicked" />
<Button fx:id="mapPoolButton" text="%teammatchmaking.mapPool" styleClass="tmm, player-card-text, map-pool" alignment="TOP_CENTER" maxWidth="1.7976931348623157E308"
onAction="#showMapPool"/>
<FlowPane hgap="10">
Expand Down