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

Convert projects to Java modules #1500

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion 2d/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 TweetWallFX
* Copyright (c) 2015-2023 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,9 +21,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
apply plugin: 'org.openjfx.javafxplugin'

dependencies {
implementation 'org.slf4j:slf4j-api'
implementation project(':tweetwallfx-configuration')
implementation project(':tweetwallfx-controls')
}

javafx {
modules = [ 'javafx.controls', 'javafx.graphics' ]
}
31 changes: 31 additions & 0 deletions 2d/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2023-2023 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
module org.tweetwallfx.twod {
exports org.tweetwallfx.twod;
requires javafx.controls;
requires javafx.graphics;
requires org.slf4j;
requires org.tweetwallfx.config;
requires org.tweetwallfx.controls;
}
61 changes: 21 additions & 40 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2023 TweetWallFX
* Copyright (c) 2015-2022 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,16 +25,15 @@
plugins {
id 'base'
id 'build-dashboard'
id 'java-platform'
id 'com.diffplug.spotless' version '6.25.0'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'com.github.spotbugs' version '6.0.8' apply false
id 'com.diffplug.spotless' version '6.15.0'
id 'com.github.ben-manes.versions' version '0.46.0'
id 'com.github.spotbugs' version '5.0.13' apply false
id 'com.google.osdetector' version '1.7.3'
id 'com.netflix.nebula.info' version '13.0.0' apply false
id 'com.netflix.nebula.maven-base-publish' version '21.0.0' apply false
id 'net.ltgt.errorprone' version '3.1.0' apply false
id 'org.sonarqube' version '4.4.1.3373'
id 'com.autonomousapps.dependency-analysis' version '1.30.0'
id 'nebula.info-dependencies' version '11.4.1' apply false
id 'nebula.maven-nebula-publish' version '18.4.0' apply false
id 'net.ltgt.errorprone' version '3.0.1' apply false
id 'org.sonarqube' version '4.0.0.2929'
id 'com.autonomousapps.dependency-analysis' version '1.19.0'
}

ext {
Expand Down Expand Up @@ -72,7 +71,7 @@ allprojects {

repositories {
mavenCentral()
jcenter()
mavenLocal()
}

// configuring Spotless
Expand Down Expand Up @@ -204,11 +203,13 @@ allprojects {

all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
/*
if (details.requested.group == 'org.ow2.asm' &&
details.requested.name == 'asm') {
details.useVersion '9.5'
details.because 'workaround for spotbugs not yet supporting JDK 21 class formats'
}
*/
}
}

Expand All @@ -228,15 +229,15 @@ allprojects {
// get recommended versions from the platform project
api platform(rootProject)

javafx group: 'org.openjfx', name: 'javafx-base', version: '21.0.2', classifier: javaFxPlatform
javafx group: 'org.openjfx', name: 'javafx-graphics', version: '21.0.2', classifier: javaFxPlatform
javafx group: 'org.openjfx', name: 'javafx-fxml', version: '21.0.2', classifier: javaFxPlatform
javafx group: 'org.openjfx', name: 'javafx-controls', version: '21.0.2', classifier: javaFxPlatform
javafx group: 'org.openjfx', name: 'javafx-base', version: '19.0.2.1', classifier: javaFxPlatform
javafx group: 'org.openjfx', name: 'javafx-graphics', version: '19.0.2.1', classifier: javaFxPlatform
javafx group: 'org.openjfx', name: 'javafx-fxml', version: '19.0.2.1', classifier: javaFxPlatform
javafx group: 'org.openjfx', name: 'javafx-controls', version: '19.0.2.1', classifier: javaFxPlatform

jaxb 'jakarta.activation:jakarta.activation-api:2.1.3'
jaxb 'org.eclipse.angus:angus-activation:2.0.2'
jaxb 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.1'
jaxb 'org.glassfish.jaxb:jaxb-runtime:4.0.4'
jaxb 'jakarta.activation:jakarta.activation-api:2.1.1'
jaxb 'org.eclipse.angus:angus-activation:2.0.0'
jaxb 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
jaxb 'org.glassfish.jaxb:jaxb-runtime:4.0.2'

testFramework 'org.assertj:assertj-core:3.25.3'
testFramework 'org.junit.jupiter:junit-jupiter-api'
Expand All @@ -255,8 +256,8 @@ allprojects {
'jakarta.activation',
'jakarta.xml.bind',
'javafx.controls',
'javafx.fxml',
'javafx.graphics',
'javafx.fxml'
].toUnique().toSorted().join(',')
}
}
Expand All @@ -266,8 +267,6 @@ allprojects {
}

tasks.named('javadoc') {
options.addStringOption('-module-path', getJvmModulePath())
options.addStringOption('-add-modules', getJvmAdditionalModules())
enabled = false // TODO: re-enable (currently breaks build with ClassCastException)
}

Expand All @@ -278,30 +277,17 @@ allprojects {
'--enable-preview',
'-Werror',
'-proc:none',
'--module-path',
getJvmModulePath(),
'--add-modules',
getJvmAdditionalModules(),
])
}

tasks.withType(JavaExec).configureEach {
jvmArgs '--enable-preview'
jvmArgs '--module-path'
jvmArgs getJvmModulePath()
jvmArgs '--add-modules'
jvmArgs getJvmAdditionalModules()
jvmArgs '--add-opens'
jvmArgs 'java.base/jdk.internal.misc=ALL-UNNAMED'
}

tasks.withType(Test).configureEach {
jvmArgs '--enable-preview'
jvmArgs '--module-path'
jvmArgs getJvmModulePath()
jvmArgs '--add-modules'
jvmArgs getJvmAdditionalModules()
systemProperty 'org.tweetwallfx.tests.executeConferenceClientLiveTests', executeConferenceClientLiveTests

useJUnitPlatform()
testLogging {
Expand Down Expand Up @@ -335,11 +321,6 @@ allprojects {
// fail build in case a failure was detected
ignoreFailures = false

jvmArgs.add '--module-path'
jvmArgs.add getJvmModulePath()
jvmArgs.add '--add-modules'
jvmArgs.add getJvmAdditionalModules()

excludeFilter = rootProject.file('spotbugs-exclude.xml')

omitVisitors = [
Expand Down
6 changes: 2 additions & 4 deletions cache/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 TweetWallFX
* Copyright (c) 2015-2023 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -25,9 +25,7 @@
dependencies {
api project(':tweetwallfx-configuration')

implementation 'com.github.spotbugs:spotbugs-annotations'
implementation 'org.ehcache:ehcache'
implementation 'org.slf4j:slf4j-api'
implementation 'org.ehcache:ehcache:3.10.8'

runtimeOnly 'org.apache.logging.log4j:log4j-slf4j-impl'
}
32 changes: 32 additions & 0 deletions cache/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2023-2023 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
module org.tweetwallfx.cache {
requires com.github.spotbugs.annotations;
requires org.ehcache.api;
requires org.ehcache.impl;
requires org.slf4j;
requires org.tweetwallfx.config;
requires org.tweetwallfx.util;
exports org.tweetwallfx.cache;
}
26 changes: 26 additions & 0 deletions conference-api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2023-2023 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
module org.tweetwallfx.conference.api {
exports org.tweetwallfx.conference.api;
}
28 changes: 28 additions & 0 deletions conference-spi/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2023-2023 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
module org.tweetwallfx.conference.spi {
requires jakarta.ws.rs;
requires org.slf4j;
requires org.tweetwallfx.conference.api;
}
8 changes: 7 additions & 1 deletion conference-stepengine/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 TweetWallFX
* Copyright (c) 2015-2023 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,6 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
apply plugin: 'org.openjfx.javafxplugin'

dependencies {
api project(':tweetwallfx-conference-api')

Expand All @@ -32,3 +34,7 @@ dependencies {
implementation project(':tweetwallfx-stepengine-dataproviders')
implementation project(':tweetwallfx-transitions')
}

javafx {
modules = [ 'javafx.graphics' ]
}
39 changes: 39 additions & 0 deletions conference-stepengine/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2023-2023 TweetWallFX
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
module org.tweetwallfx.conference.stepengine {
requires de.jensd.fx.fontawesomefx.fontawesome;
requires javafx.controls;
requires javafx.fxml;
requires javafx.graphics;
requires org.slf4j;
requires org.tweetwallfx.cache;
requires org.tweetwallfx.conference.api;
requires org.tweetwallfx.controls;
requires org.tweetwallfx.filterchain;
requires org.tweetwallfx.stepengine.api;
requires org.tweetwallfx.stepengine.dataproviders;
requires org.tweetwallfx.transitions;
requires org.tweetwallfx.tweet.api;
requires org.tweetwallfx.util;
}
Loading
Loading