Skip to content

Commit

Permalink
Upgrade build to latest Gradle and JavaFX
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Dec 4, 2018
1 parent 1b9fefd commit 7067d76
Show file tree
Hide file tree
Showing 191 changed files with 467 additions and 146 deletions.
174 changes: 75 additions & 99 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,38 +16,20 @@
* limitations under the License.
*/

buildscript {
repositories {
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
}

dependencies {
classpath 'org.kordamp.gradle:project-gradle-plugin:0.6.0'
classpath 'gradle.plugin.gradle-java9-collision:plugin:0.2.3'
//classpath 'gradle.plugin.org.javamodularity:moduleplugin:1.0.1'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.9.2'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
classpath 'com.google.gradle:osdetector-gradle-plugin:1.6.0'
}
plugins {
id 'groovy'
id 'idea'
id 'org.kordamp.gradle.project' version '0.9.0'
id 'org.openjfx.javafxplugin' version '0.0.5'
id 'org.asciidoctor.convert' version '1.5.9.2'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'org.jonnyzzz.java9c' version '0.2.3'
}

apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'org.kordamp.gradle.project'
apply plugin: 'com.google.osdetector'
apply plugin: 'org.jonnyzzz.java9c'
//apply plugin: 'org.javamodularity.moduleplugin'

ext.platform = osdetector.os != 'osx' ? osdetector.os : 'mac'

if (!project.hasProperty('bintrayUsername')) ext.bintrayUsername = ''
if (!project.hasProperty('bintrayApiKey')) ext.bintrayApiKey = ''
if (!project.hasProperty('sonatypeUsername')) ext.sonatypeUsername = ''
if (!project.hasProperty('sonatypePassword')) ext.sonatypePassword = ''
if (!project.hasProperty('bintrayUsername')) project.ext.bintrayUsername = ''
if (!project.hasProperty('bintrayApiKey')) project.ext.bintrayApiKey = ''
if (!project.hasProperty('sonatypeUsername')) project.ext.sonatypeUsername = ''
if (!project.hasProperty('sonatypePassword')) project.ext.sonatypePassword = ''

config {
release = (rootProject.findProperty('release') ?: false).toBoolean()
Expand All @@ -65,11 +49,11 @@ config {

people {
[
JimClarke5 : 'Jim Clarke',
deanriverson : 'Dean Iverson',
russel : 'Russel Winder',
aalmiray : 'Andres Almiray',
Dierk : 'Dierk König'
JimClarke5 : 'Jim Clarke',
deanriverson : 'Dean Iverson',
russel : 'Russel Winder',
aalmiray : 'Andres Almiray',
Dierk : 'Dierk König'
].each { devId, devName ->
person {
id = devId
Expand Down Expand Up @@ -107,10 +91,6 @@ config {
githubRepo = 'groovyfx-project/groovyfx'
}

stats {
formats = ['xml', 'txt']
}

apidoc {
enabled = false
}
Expand All @@ -135,67 +115,76 @@ configurations {
jansi.extendsFrom(runtime)
}

javafx {
modules = [
'javafx.base',
'javafx.graphics',
'javafx.controls',
'javafx.fxml',
'javafx.swing',
'javafx.web',
'javafx.media'
]
}

dependencies {
compile "org.codehaus.groovy:groovy-all:${groovyfx_groovyVersion}"
testCompile "junit:junit:${groovyfx_junitVersion}"
jansi "org.fusesource.jansi:jansi:${groovyfx_jansiVersion}"
testCompile("org.spockframework:spock-core:${groovyfx_spockVersion}") {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}

// TODO refactor duplication

compile "org.openjfx:javafx-base:${groovyfx_javafxVersion}:${platform}"
compile "org.openjfx:javafx-graphics:${groovyfx_javafxVersion}:${platform}"
compile "org.openjfx:javafx-controls:${groovyfx_javafxVersion}:${platform}"
compile "org.openjfx:javafx-fxml:${groovyfx_javafxVersion}:${platform}"
compile "org.openjfx:javafx-swing:${groovyfx_javafxVersion}:${platform}"
compile "org.openjfx:javafx-web:${groovyfx_javafxVersion}:${platform}"
compile "org.openjfx:javafx-media:${groovyfx_javafxVersion}:${platform}"
}

apply {
// from 'gradle/demo.gradle'
license {
mapping {
java = 'SLASHSTAR_STYLE'
groovy = 'SLASHSTAR_STYLE'
gdsl = 'SLASHSTAR_STYLE'
dsld = 'SLASHSTAR_STYLE'
fxml = 'XML_STYLE'
}
exclude '**/*.png'
exclude '**/*.jpg'
}

idea {
module {
// excludeDirs += file('gradle/') // Gradle directory including the wrapper subdirectory.
excludeDirs += file('.settings/') // Eclipse settings directory.
excludeDirs += file('bin') // Eclipse compilation directory.
excludeDirs += file('out') // IDEA compilation directory.
excludeDirs += file('build') // Gradle compilation directory.
}
project {
jdkName '11'
languageLevel '11'
ipr {
withXml { provider ->
final node = provider.asNode()
final component = provider.asNode().component
node.component.find { it.'@name' == 'VcsDirectoryMappings' }.mapping[0].'@vcs' = 'Git'
final gradleSettings = node.appendNode('component' , [name: 'GradleSettings'])
gradleSettings.appendNode('option', [name: 'linkedProjectPath', value: '$PROJECT_DIR$/build.gradle'])
}
module {
// excludeDirs += file('gradle/') // Gradle directory including the wrapper subdirectory.
excludeDirs += file('.settings/') // Eclipse settings directory.
excludeDirs += file('bin') // Eclipse compilation directory.
excludeDirs += file('out') // IDEA compilation directory.
excludeDirs += file('build') // Gradle compilation directory.
}
project {
jdkName '11'
languageLevel '11'
ipr {
withXml { provider ->
final node = provider.asNode()
final component = provider.asNode().component
node.component.find { it.'@name' == 'VcsDirectoryMappings' }.mapping[0].'@vcs' = 'Git'
final gradleSettings = node.appendNode('component', [name: 'GradleSettings'])
gradleSettings.appendNode('option', [name: 'linkedProjectPath', value: '$PROJECT_DIR$/build.gradle'])
}
}
}
}
}

asciidoctor {
//sources { include 'index.adoc' }
attributes toc: 'left',
doctype: 'book',
icons: 'font',
encoding: 'utf-8',
sectlink: true,
sectanchors: true,
numbered: true,
linkattrs: true,
imagesdir: 'images',
stylesheet: 'css/style.css',
'source-highlighter': 'coderay',
'groovyfx-version': project.version,
'groovy-version': project.groovyfx_groovyVersion
attributes toc: 'left',
doctype: 'book',
icons: 'font',
encoding: 'utf-8',
sectlink: true,
sectanchors: true,
numbered: true,
linkattrs: true,
imagesdir: 'images',
stylesheet: 'css/style.css',
'source-highlighter': 'coderay',
'groovyfx-version': project.version,
'groovy-version': project.groovyfx_groovyVersion
}

test {
Expand All @@ -208,23 +197,10 @@ jacoco {
toolVersion = '0.8.2'
}

jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
additionalSourceDirs = project.files(sourceSets.main.allSource.srcDirs)
sourceDirectories = project.files(sourceSets.main.allSource.srcDirs)
classDirectories = project.files(sourceSets.main.output)
reports {
xml.enabled = true
csv.enabled = false
html.enabled = true
}
}

processResources {
from(sourceSets.main.resources.srcDirs) {
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
'groovyfx.version' : project.version
'groovyfx.version': project.version
])
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group = org.groovyfx
archivesBaseName = groovyfx
version = 11.0.0-SNAPSHOT
groovyfx_javafxVersion = 11
groovyfx_groovyVersion = 2.5.3
groovyfx_groovyVersion = 2.5.4
groovyfx_junitVersion = 4.12
groovyfx_spockVersion = 1.2-groovy-2.5
groovyfx_jansiVersion = 1.17.1
15 changes: 15 additions & 0 deletions gradle/LICENSE_HEADER
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SPDX-License-Identifier: Apache-2.0

Copyright ${copyrightYear} the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
4 changes: 3 additions & 1 deletion gradle/demo.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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-4.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
2 changes: 1 addition & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
2 changes: 2 additions & 0 deletions src/main/groovy/groovyx/javafx/GroovyFX.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 2 additions & 0 deletions src/main/groovy/groovyx/javafx/GroovyFXEnhancer.groovy
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 2 additions & 0 deletions src/main/groovy/groovyx/javafx/InterpolatorEnums.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
27 changes: 0 additions & 27 deletions src/main/groovy/groovyx/javafx/JdkUtil.groovy

This file was deleted.

2 changes: 2 additions & 0 deletions src/main/groovy/groovyx/javafx/SceneGraphBuilder.groovy
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 2 additions & 0 deletions src/main/groovy/groovyx/javafx/animation/GTimeline.groovy
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 2 additions & 0 deletions src/main/groovy/groovyx/javafx/animation/TargetHolder.groovy
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 2 additions & 0 deletions src/main/groovy/groovyx/javafx/appsupport/Action.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 2 additions & 0 deletions src/main/groovy/groovyx/javafx/beans/FXBindable.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading

0 comments on commit 7067d76

Please sign in to comment.