-
Notifications
You must be signed in to change notification settings - Fork 6
Preparation work for following feature work #29
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b7bdc39
Restructure project to build in multiple modules in preparation for f…
Col-E bbf8978
Migrate annotations to JSpecify
Col-E d0df339
Move annotations that are now 'out of place'
Col-E d3d209f
Update artifact coordinates
Col-E dc1ec65
Ignore generated sources folder
Col-E cdbe2cb
Add contributing guide with Eclipse/IntelliJ formatter configs
Col-E ddad5bb
Add gradle hash validation
Col-E a4741c6
Ensure license is copied to final output jars
Col-E 5ea4b06
Further breaking down of the demos module
Col-E 8379168
Fix demo sub-modules being unintentionally put in the publish dir
Col-E 06d5d01
Fix eclipse code format file name
Col-E c14f38c
Minor publish logic cleanup
Col-E 8c06802
Enable type-safe project accessors
Col-E 9e47f61
Enable build caching
Col-E 57fd56a
Swap gversion for buildconfig (cache compatible)
Col-E 3eddb95
Skip some unnecessary tasks for demos
Col-E File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Contributing to BentoFX | ||
|
|
||
| The following is a series of guidelines for contributing to BentoFX. | ||
| They're not _"rules"_ per say, rather they're more like goals to strive towards. | ||
|
|
||
| ## Coding Guidelines | ||
|
|
||
| **Style**: IDE code formatting rules can be found in the [`/setup` directory](setup). | ||
|
Col-E marked this conversation as resolved.
|
||
| If using IntelliJ or Eclipse you should be able to import one of the provided files. | ||
|
|
||
| **Commits**: Try to keep commits small and focused on a single change. | ||
| This makes it easier for reviewers to understand the context and purpose of each commit. | ||
| I know some features are large in scope, just break down what you can where possible. | ||
|
|
||
| ## License | ||
|
|
||
| BentoFX is licensed under the MIT License. Anything you contribute will thus also be under the MIT license. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,147 +1,121 @@ | ||
| plugins { | ||
| id 'java' | ||
| id 'maven-publish' | ||
| id 'org.openjfx.javafxplugin' version '0.1.0' | ||
| id 'org.jreleaser' version '1.22.0' | ||
| id 'xyz.wagyourtail.jvmdowngrader' version '1.3.4' | ||
| alias(libs.plugins.javafx) apply false | ||
| alias(libs.plugins.jreleaser) | ||
| alias(libs.plugins.benmanes.versions) apply false | ||
| alias(libs.plugins.buildconfig) apply false | ||
| } | ||
|
|
||
| group = 'software.coley' | ||
| version = '0.15.1' | ||
| ext.pluginId = { provider -> provider.get().pluginId } | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gradle recommends using Convention Plugins via an included build instead of |
||
| repositories { | ||
| mavenCentral() | ||
| allprojects { | ||
| group = 'software.coley.bento-fx' | ||
| version = '0.16.0' | ||
| } | ||
|
|
||
| dependencies { | ||
| // Provided dependencies | ||
| compileOnly 'org.openjfx:javafx-controls:19.0.2.1' | ||
| compileOnly 'jakarta.annotation:jakarta.annotation-api:3.0.0' | ||
| testCompileOnly 'jakarta.annotation:jakarta.annotation-api:3.0.0' | ||
|
|
||
| // Test dependencies | ||
| testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2' | ||
| testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2' | ||
| testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.2' | ||
| testRuntimeOnly 'org.junit.platform:junit-platform-surefire-provider:1.3.2' | ||
| testImplementation 'org.testfx:testfx-junit5:4.0.18' | ||
| } | ||
| subprojects { sub -> | ||
| apply plugin: 'java' | ||
| apply plugin: 'maven-publish' | ||
| apply plugin: pluginId(libs.plugins.javafx) | ||
| apply plugin: pluginId(libs.plugins.benmanes.versions) | ||
|
|
||
| javafx { | ||
| version = '19' | ||
| modules = ['javafx.controls'] | ||
| } | ||
| repositories { | ||
| mavenLocal() | ||
| mavenCentral() | ||
| } | ||
|
|
||
| java { | ||
| toolchain { | ||
| languageVersion = JavaLanguageVersion.of(21) | ||
| dependencies { | ||
| // Shared annotations for all modules | ||
| compileOnly(libs.bundles.annotations) | ||
| testCompileOnly(libs.bundles.annotations) | ||
|
|
||
| // Test dependencies | ||
| testImplementation(libs.bundles.test.libraries) | ||
| testRuntimeOnly(libs.bundles.test.runtime) | ||
| } | ||
|
|
||
| withJavadocJar() | ||
| withSourcesJar() | ||
| } | ||
| javafx { | ||
| version = '21.0.9' | ||
| modules = ['javafx.controls'] | ||
|
|
||
| tasks.withType(JavaCompile).configureEach { | ||
| options.compilerArgs << '-parameters' | ||
| } | ||
| // We don't want to include a specific version of JavaFX as a transitive dependency for users of the library | ||
| configurations = ['compileOnly', 'testImplementation'] | ||
| } | ||
|
|
||
| jvmdg { | ||
| downgradeTo = JavaVersion.VERSION_17 | ||
| } | ||
| java { | ||
| toolchain { | ||
| languageVersion = JavaLanguageVersion.of(21) | ||
| } | ||
|
|
||
| javadoc { | ||
| options { | ||
| addStringOption('Xdoclint:none', '-quiet') | ||
| withJavadocJar() | ||
| withSourcesJar() | ||
| } | ||
| } | ||
|
|
||
| // There is currently a bug with the shading portion of 'jvmdowngrader' which | ||
| // prevents the 'module-info' class from being copied into the final output. | ||
| // These two tasks will generate a modified shaded output jar that includes it. | ||
| tasks.register('copyModuleInfo', Copy) { | ||
| // Ensure the downgrader tasks all run | ||
| dependsOn(tasks.named("shadeDowngradedApi")) | ||
| tasks.withType(JavaCompile).configureEach { | ||
| options.compilerArgs << '-parameters' | ||
| } | ||
|
|
||
| // Copy the downgraded module-info into a temporary location | ||
| from(zipTree(tasks.named("downgradeJar").get().outputs.files.singleFile)) { | ||
| include('module-info.class') | ||
| tasks.named('jar') { | ||
| from(rootProject.layout.projectDirectory) { | ||
| include 'LICENSE' | ||
| into 'META-INF' | ||
| rename { 'LICENSE.txt' } | ||
| } | ||
| } | ||
| into(project.layout.buildDirectory.dir('module-info-temp')) | ||
| } | ||
| tasks.register('mergeShadedJar', Jar) { | ||
| // Run the copy task defined above | ||
| dependsOn(tasks.named('copyModuleInfo')) | ||
|
|
||
| archiveClassifier.set('merged-shaded') | ||
| javadoc { | ||
| options { | ||
| addStringOption('Xdoclint:none', '-quiet') | ||
| } | ||
| } | ||
|
|
||
| // Merge the shaded output and our module-info class we put in the temp dir | ||
| from(zipTree(tasks.named("shadeDowngradedApi").get().outputs.files.singleFile)) | ||
| from(project.layout.buildDirectory.dir('module-info-temp')) | ||
| } | ||
| test { | ||
| useJUnitPlatform() | ||
|
|
||
| // Ensure builds emit the corrected shaded jar | ||
| assemble.dependsOn mergeShadedJar | ||
|
|
||
| // Setup publishing to pull from our slightly modified outputs | ||
| def includeTransitives = false | ||
| publishing { | ||
| publications { | ||
| mavenJava(MavenPublication) { | ||
| groupId = project.group | ||
| artifactId = project.name | ||
| version = project.version | ||
|
|
||
| // Include our corrected shaded/downgraded jar | ||
| artifact(tasks.named('mergeShadedJar').get().outputs.files.singleFile) { | ||
| builtBy tasks.named('mergeShadedJar') | ||
| } | ||
| // Not all subprojects have tests, so don't fail the build if no tests are found. | ||
| failOnNoDiscoveredTests = false | ||
| } | ||
|
|
||
| publishing { | ||
| publications { | ||
| mavenJava(MavenPublication) { | ||
| groupId = sub.group | ||
| artifactId = sub.name | ||
| version = sub.version | ||
|
|
||
| // Include sources + javadoc jars | ||
| artifact(tasks.named('sourcesJar').get()) | ||
| artifact(tasks.named('javadocJar').get()) | ||
|
|
||
| pom { | ||
| name = project.name | ||
| description = 'A docking system for JavaFX.' | ||
| url = 'https://github.com/Col-E/BentoFX' | ||
| inceptionYear = '2025' | ||
| licenses { | ||
| license { | ||
| name = 'MIT' | ||
| url = 'https://spdx.org/licenses/MIT.html' | ||
| from sub.components.java | ||
|
|
||
| pom { | ||
| name = sub.name | ||
| description = 'A docking system for JavaFX.' | ||
| url = 'https://github.com/Col-E/BentoFX' | ||
| inceptionYear = '2025' | ||
| licenses { | ||
| license { | ||
| name = 'MIT' | ||
| url = 'https://spdx.org/licenses/MIT.html' | ||
| } | ||
| } | ||
| } | ||
| developers { | ||
| developer { | ||
| id = 'Col-E' | ||
| name = 'Matt Coley' | ||
| developers { | ||
| developer { | ||
| id = 'Col-E' | ||
| name = 'Matt Coley' | ||
| } | ||
| } | ||
| } | ||
| scm { | ||
| connection = 'scm:git:https://github.com/Col-E/BentoFX.git' | ||
| developerConnection = 'scm:git:ssh://github.com/Col-E/BentoFX.git' | ||
| url = 'https://github.com/Col-E/BentoFX' | ||
| } | ||
|
|
||
| // We aren't using "from components.java" so we need to rebuild the dependencies node ourselves | ||
| if (includeTransitives) withXml { | ||
| def allDeps = project.configurations.compileClasspath.resolvedConfiguration.firstLevelModuleDependencies | ||
| def root = asNode() | ||
| def depNode = root.appendNode("dependencies") | ||
| allDeps.each { d -> | ||
| def dn = depNode.appendNode("dependency") | ||
| dn.appendNode("groupId", d.moduleGroup) | ||
| dn.appendNode("artifactId", d.name) | ||
| dn.appendNode("version", d.moduleVersion) | ||
| scm { | ||
| connection = 'scm:git:https://github.com/Col-E/BentoFX.git' | ||
| developerConnection = 'scm:git:ssh://github.com/Col-E/BentoFX.git' | ||
| url = 'https://github.com/Col-E/BentoFX' | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| repositories { | ||
| mavenLocal() | ||
| maven { | ||
| url = layout.buildDirectory.dir('staging-deploy') | ||
| repositories { | ||
| mavenLocal() | ||
| maven { | ||
| // All modules will publish to the same staging directory. | ||
| url = rootProject.layout.projectDirectory.dir("build/staging-deploy") | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| plugins { | ||
| alias(libs.plugins.buildconfig) | ||
| } | ||
|
|
||
| buildConfig { | ||
| useJavaOutput() | ||
| className("BentoVersion") | ||
| packageName("software.coley.bentofx") | ||
| buildConfigField(String, "VERSION", provider { "${project.version}" }) | ||
| buildConfigField(String, "BUILD_DATE", provider { "${new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")}" }) | ||
| } |
2 changes: 1 addition & 1 deletion
2
src/main/java/module-info.java → core/src/main/java/module-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.