Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build/

### IntelliJ IDEA ###
.idea/*
.run/*
*.iws
*.iml
*.ipr
Expand Down Expand Up @@ -34,4 +35,7 @@ build/
.vscode/

### Mac OS ###
.DS_Store
.DS_Store

### Generated Content ###
**/generated/**
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Comment thread
Col-E marked this conversation as resolved.
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).
Comment thread
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.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ Requirements:
Gradle syntax:

```groovy
implementation "software.coley:bento-fx:${version}"
implementation "software.coley.bento-fx:core:${version}"
```

Maven syntax:

```xml
<dependency>
<groupId>software.coley</groupId>
<artifactId>bento-fx</artifactId>
<groupId>software.coley.bento-fx</groupId>
<artifactId>core</artifactId>
<version>${version}</version>
</dependency>
```
Expand Down Expand Up @@ -59,7 +59,7 @@ Bento comes with a few custom controls that you will want to create a custom sty
look and feel of your application.

An example reference sheet _(which is included in the dependency)_ can be found
in [`bento.css`](src/main/resources/bento.css).
in [`bento.css`](demos/basic/src/main/resources/bento.css).

| Control | Description |
|-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
Expand Down
206 changes: 90 additions & 116 deletions build.gradle
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 }

Copy link
Copy Markdown

@philliplbryant philliplbryant Apr 9, 2026

Choose a reason for hiding this comment

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

Gradle recommends using Convention Plugins via an included build instead of allprojects or subprojects.

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")
}
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions core/build.gradle
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")}" })
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module bento.fx {
requires static jakarta.annotation;
requires static org.jspecify;

requires javafx.base;
requires javafx.graphics;
Expand Down
Loading
Loading