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

Java 11 #3

Closed
wants to merge 16 commits into from
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: java
sudo: false
jdk:
- oraclejdk8
- oraclejdk11
before_install:
- chmod +x ./gradlew
script:
Expand All @@ -21,6 +22,12 @@ deploy:
on:
tags: true
jdk: oraclejdk8
- provider: script
skip_cleanup: true
script: ./gradlew bintrayUpload -Ddeployment=true -Denable.java.version.suffix=true
on:
tags: true
jdk: oraclejdk11
- provider: pages
skip_cleanup: true
github-token: $GITHUB_TOKEN
Expand Down
45 changes: 42 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.gradle.api.JavaVersion

buildscript {
project.ext['CERN_VM'] = System.getProperty('CERN_TECHNET_VM') ?: System.getenv('CERN_TECHNET_VM') ?: project.hasProperty('CERN_TECHNET_VM') ?: false
project.ext['DEPLOYMENT'] = System.getProperty('deployment') ?: false
Expand All @@ -6,8 +8,14 @@ buildscript {
project.ext['BINTRAY.userName'] = System.getProperty('BINTRAY_USER') ?: System.getenv('BINTRAY_USER')
project.ext['BINTRAY.apiToken'] = System.getProperty('BINTRAY_API_TOKEN') ?: System.getenv('BINTRAY_API_TOKEN')

project.ext['SONATYPE.userName'] = System.getProperty('SONATYPE_USER') ?: System.getenv('SONATYPE_USER')
project.ext['SONATYPE.password'] = System.getProperty('SONATYPE_PASSWORD') ?: System.getenv('SONATYPE_PASSWORD')
if (System.getProperty('enable.java.version.suffix')) {
project.ext['VERSION_SUFFIX'] = "-" + JavaVersion.current();
println "In case of deployment, using version suffix: '" + project.ext['VERSION_SUFFIX'] +"'"
} else {
/* Just for testing we disable syc to sonatype, as it is hard to remove things from there */
project.ext['SONATYPE.userName'] = System.getProperty('SONATYPE_USER') ?: System.getenv('SONATYPE_USER')
project.ext['SONATYPE.password'] = System.getProperty('SONATYPE_PASSWORD') ?: System.getenv('SONATYPE_PASSWORD')
}

repositories {
if (project['CERN_VM']) {
Expand All @@ -25,6 +33,12 @@ buildscript {
}
}


plugins {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure, but this could be removed since it is an alternative syntax of apply plugin that is done in the if jdk >= 11

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that in the apply plugin syntax, there is no way to specify a version ... I will check

id 'org.openjfx.javafxplugin' version '0.0.7' apply false
}


apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'idea'
Expand Down Expand Up @@ -56,9 +70,16 @@ dependencies {
compile group: 'org.springframework', name: 'spring-core', version: springVersion
compile group: 'org.springframework', name: 'spring-context', version: springVersion

compile group: 'de.jensd', name: 'fontawesomefx-fontawesome', version: '4.7.0-5'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'

if (JavaVersion.current() >= JavaVersion.VERSION_11) {
compile group: 'de.jensd', name: 'fontawesomefx-fontawesome', version: '4.7.0-11'
compile("javax.annotation:javax.annotation-api:1.3.2")
} else {
compile group: 'de.jensd', name: 'fontawesomefx-fontawesome', version: '4.7.0-5'
}


testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
Expand All @@ -83,6 +104,10 @@ test {
}
}

jacoco {
toolVersion = "0.8.4"
}

jacocoTestReport {
reports {
xml.enabled true
Expand Down Expand Up @@ -138,3 +163,17 @@ if (project['DEPLOYMENT']) {
apply plugin: 'com.jfrog.bintray'
apply from: 'https://raw.githubusercontent.com/ossgang/gradle-scripts/master/deployment/bintray-deploy.gradle'
}

if (JavaVersion.current() >= JavaVersion.VERSION_11) {
println 'Applying javafx plugin as java version is 11 or higher.'
apply plugin: 'org.openjfx.javafxplugin'
javafx {
// version = "12.0.1"
modules = ['javafx.controls', 'javafx.fxml', 'javafx.swing', 'javafx.web']
}
}

task printJavaVersion {
println 'Java Version: ' + JavaVersion.current();
}