Skip to content

Commit

Permalink
[WIP] Update to JDK 14 (#6145)
Browse files Browse the repository at this point in the history
* Update to JDK 14

* Update check-outdated-dependencies.yml

* Update guidelines-for-setting-up-a-local-workspace.md

* Update tests-fetchers.yml

* Update tests-oracle.yml

* Update build.gradle

* Update deployment.yml

* Update README.md

* Update gradle-wrapper.properties

* Remove specification of old Jacoco version

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
  • Loading branch information
tobiasdiez and koppor committed Mar 20, 2020
1 parent 052eddd commit 23b0064
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-outdated-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13.0.2
java-version: 14
- name: Look for outdated dependencies
run: ./gradlew -q checkOutdatedDependencies
- name: Report issues
Expand Down
52 changes: 11 additions & 41 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,15 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
include:
- os: ubuntu-latest
displayName: linux
jpackageDownload: https://download.java.net/java/early_access/jdk14/34/GPL/openjdk-14-ea+34_linux-x64_bin.tar.gz
jdk14Path: /jdk-14
archivePortable: tar -c -C build/distribution JabRef | pigz --rsyncable > build/distribution/JabRef-portable_linux.tar.gz && rm -R build/distribution/JabRef
- os: windows-latest
displayName: windows
jpackageDownload: https://download.java.net/java/early_access/jdk14/34/GPL/openjdk-14-ea+34_windows-x64_bin.zip
jdk14Path: /jdk-14
archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip ./build/distribution/JabRef && rm -R build/distribution/JabRef
- os: macOS-latest
displayName: macOS
jpackageDownload: https://download.java.net/java/early_access/jdk14/34/GPL/openjdk-14-ea+34_osx-x64_bin.tar.gz
jdk14Path: /jdk-14.jdk/Contents/Home
archivePortable: brew install pigz && tar -c -C build/distribution JabRef.app | pigz --rsyncable > build/distribution/JabRef-portable_macos.tar.gz && rm -R build/distribution/JabRef.app
- os: ubuntu-latest
displayName: linux
archivePortable: tar -c -C build/distribution JabRef | pigz --rsyncable > build/distribution/JabRef-portable_linux.tar.gz && rm -R build/distribution/JabRef
- os: windows-latest
displayName: windows
archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip ./build/distribution/JabRef && rm -R build/distribution/JabRef
- os: macOS-latest
displayName: macOS
archivePortable: brew install pigz && tar -c -C build/distribution JabRef.app | pigz --rsyncable > build/distribution/JabRef-portable_macos.tar.gz && rm -R build/distribution/JabRef.app

runs-on: ${{ matrix.os }}
name: Create installer and portable version for ${{ matrix.displayName }}
Expand All @@ -59,7 +53,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13.0.2
java-version: 14
# configuration based on https://github.com/actions/cache/blob/master/examples.md#java---gradle
- uses: actions/cache@v1
name: Restore gradle cache
Expand All @@ -75,34 +69,10 @@ jobs:
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Download jpackage
# We need to download jpackage from https://jdk.java.net/jpackage/
run: |
import tarfile
import zipfile
import sys
if sys.version_info[0] >= 3:
from urllib.request import urlretrieve
else:
from urllib import urlretrieve
url = "${{ matrix.jpackageDownload }}"
tmpfile, headers = urlretrieve(url)
if (url.endswith("tar.gz")):
tar = tarfile.open(tmpfile)
tar.extractall()
tar.close()
elif (url.endswith("zip")):
zip = zipfile.ZipFile(tmpfile)
zip.extractall()
zip.close()
shell: python
- name: Build runtime image
run: ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jlinkZip
- name: Build installer
run: |
export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}"
./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage
run: ./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage
shell: bash
- name: Package application image
run: ${{ matrix.archivePortable }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-fetchers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13.0.2
java-version: 14
- uses: actions/cache@v1
name: Restore gradle chache
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13.0.2
java-version: 14
- uses: actions/cache@v1
name: Restore gradle chache
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13.0.2
java-version: 14
- uses: actions/cache@v1
name: Restore gradle cache
with:
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13
java-version: 14
- uses: actions/cache@v1
name: Restore gradle chache
with:
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13
java-version: 14
- uses: actions/cache@v1
name: Restore gradle chache
with:
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13
java-version: 14
- uses: actions/cache@v1
name: Restore gradle chache
with:
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 13
java-version: 14
- uses: actions/cache@v1
name: Restore gradle chache
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ We will discuss improvements with you and agree to merge them once the [develope

If you want a step-by-step walk-through on how to set-up your workspace, please check [this guideline](https://devdocs.jabref.org/guidelines-for-setting-up-a-local-workspace/).

To compile JabRef from source, you need a Java Development Kit 13 and `JAVA_HOME` pointing to this JDK.
To compile JabRef from source, you need a Java Development Kit 14 and `JAVA_HOME` pointing to this JDK.
To run it, just execute `gradlew run`.
When you want to develop, it is necessary to generate additional sources using `gradlew generateSource`
and then generate the Eclipse `gradlew eclipse`.
Expand Down
8 changes: 2 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ group = "org.jabref"
version = project.findProperty('projVersion') ?: '100.0.0'

java {
sourceCompatibility = JavaVersion.VERSION_13
targetCompatibility = JavaVersion.VERSION_13
sourceCompatibility = JavaVersion.VERSION_14
targetCompatibility = JavaVersion.VERSION_14
}

application {
Expand Down Expand Up @@ -217,10 +217,6 @@ dependencies {
jython 'org.python:jython-standalone:2.7.1'
}

jacoco {
toolVersion = '0.8.3'
}

dependencyUpdates {
outputFormatter = "json"
}
Expand Down
18 changes: 9 additions & 9 deletions docs/guidelines-for-setting-up-a-local-workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ For a complete step-by-step guide for Linux using IntellJ IDEA as the IDE, have

## Prerequisites

### Java Development Kit 13
### Java Development Kit 14

A working Java 13 installation is required. In the command line \(terminal in Linux, cmd in Windows\) run `javac -version` and make sure that the reported version is Java 13 \(e.g `javac 13.0.1`\). If `javac` is not found or a wrong version is reported, check your PATH environment variable, your JAVA\_HOME environment variable or install the most recent JDK.
A working Java 14 installation is required. In the command line \(terminal in Linux, cmd in Windows\) run `javac -version` and make sure that the reported version is Java 14 \(e.g `javac 14`\). If `javac` is not found or a wrong version is reported, check your PATH environment variable, your JAVA\_HOME environment variable or install the most recent JDK.

### git

Expand Down Expand Up @@ -57,16 +57,16 @@ To configure IntelliJ IDEA for developing JabRef, you should first ensure that y

the _Gradle_ and _Gradle Extension_ enabled.

After that, you can open `jabref/build.gradle` as a project. It is crucial that Java 13 is used consistently for the JabRef project which includes ensuring the right settings for your project structure, Gradle build, and run configurations.
After that, you can open `jabref/build.gradle` as a project. It is crucial that Java 14 is used consistently for the JabRef project which includes ensuring the right settings for your project structure, Gradle build, and run configurations.

* Ensure you have a Java 13 SDK configured by navigating to
* Ensure you have a Java 14 SDK configured by navigating to

**File \| Project Structure \| Platform Settings \| SDKs**. If you don't have one, add a new Java JDK and point it to the

location of a JDK 13.
location of a JDK 14.

* Navigate to **File \| Project Structure \| Project** and ensure that the projects' SDK is Java 13
* Navigate to **File \| Settings \| Build, Execution, Deployment \| Build Tools \| Gradle** and select the Java 13 SDK as
* Navigate to **File \| Project Structure \| Project** and ensure that the projects' SDK is Java 14
* Navigate to **File \| Settings \| Build, Execution, Deployment \| Build Tools \| Gradle** and select the Java 14 SDK as

the Gradle JVM at the bottom.

Expand Down Expand Up @@ -119,7 +119,7 @@ To use IntelliJ IDEA's internal build system when you build JabRef through **Bui

To use the "JabRef Main" run configuration, open **Run \| Edit Configurations... \| Application \| JabRef Main** and

* Verify, that your JDK 13 is used
* Verify, that your JDK 14 is used
* Set "VM Options" to the following:

```text
Expand Down Expand Up @@ -239,7 +239,7 @@ Got it running? GREAT! You are ready to lurk the code and contribute to JabRef.

### Java installation

An indication that `JAVA_HOME` is not correctly set or no JDK 13 is installed is following error message:
An indication that `JAVA_HOME` is not correctly set or no JDK 14 is installed is following error message:

```text
compileJava FAILED
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-rc-3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 23b0064

Please sign in to comment.