Skip to content

Commit

Permalink
v0.45-BETA1; switch to jspecify
Browse files Browse the repository at this point in the history
  • Loading branch information
xzel23 committed Oct 26, 2024
1 parent 4cd3c81 commit 905bad5
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 30 deletions.
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import com.adarshr.gradle.testlogger.theme.ThemeType
import com.dua3.cabe.processor.Config
import com.dua3.cabe.processor.Configuration
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import java.net.URI

Expand Down Expand Up @@ -67,9 +67,9 @@ subprojects {

cabe {
if (isReleaseVersion) {
config.set(Config.StandardConfig.STANDARD.config)
config.set(Configuration.StandardConfig.STANDARD.config())
} else {
config.set(Config.StandardConfig.DEVELOPMENT.config)
config.set(Configuration.StandardConfig.DEVELOPMENT.config())
}
}

Expand All @@ -85,7 +85,7 @@ subprojects {
// dependencies
dependencies {
// Cabe (source annotations)
compileOnly(rootProject.libs.cabe.annotations)
compileOnly(rootProject.libs.jspecify)

// LOG4J
implementation(rootProject.libs.log4j.api)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/**
* This package contains classes for writing FXML based JavaFX applications.
*/
@NotNullApi
package com.dua3.fx.application.fxml;

import com.dua3.cabe.annotations.NotNullApi;
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import org.jspecify.annotations.NullMarked;

/**
* This module provides the base class for applications using FXML for declaring the user interface.
* <p>
* This module exports and opens the package com.dua3.fx.application.fxml, allowing other modules to access
* its classes.
* <p>
* This module requires the module com.dua3.fx.application and the module org.apache.logging.log4j.
* <p>
* This module also requires the modules com.dua3.cabe.annotations, com.dua3.utility,
* javafx.fxml, and javafx.graphics.
*/
@NullMarked
module com.dua3.fx.application.fxml {
exports com.dua3.fx.application.fxml;
opens com.dua3.fx.application.fxml;
Expand All @@ -31,8 +26,8 @@

requires org.apache.logging.log4j;

requires static com.dua3.cabe.annotations;
requires com.dua3.utility;
requires javafx.fxml;
requires javafx.graphics;
requires org.jspecify;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package com.dua3.fx.application;

import com.dua3.cabe.annotations.Nullable;
import com.dua3.utility.fx.controls.Dialogs;
import com.dua3.utility.i18n.I18N;
import com.dua3.utility.lang.LangUtil;
Expand All @@ -28,6 +27,7 @@
import javafx.stage.Stage;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jspecify.annotations.Nullable;

import java.io.IOException;
import java.io.UncheckedIOException;
Expand Down Expand Up @@ -385,7 +385,7 @@ private Path initApplicationDataDir() {
String dirName = getClass().getName();
Path home = Paths.get(System.getProperty("user.home"));

switch(Platform.currentPlatform()) {
switch (Platform.currentPlatform()) {
case WINDOWS -> {
// try to determine location by evaluating standard windows settings
String appData = System.getenv("LOCALAPPDATA");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package com.dua3.fx.application;

import com.dua3.cabe.annotations.Nullable;
import com.dua3.utility.fx.controls.Dialogs;
import com.dua3.utility.i18n.I18N;
import com.dua3.utility.lang.LangUtil;
Expand All @@ -29,6 +28,7 @@
import javafx.stage.FileChooser.ExtensionFilter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jspecify.annotations.Nullable;

import java.io.IOException;
import java.net.URI;
Expand Down Expand Up @@ -530,7 +530,7 @@ void setApp(A app) {
}

protected void init(A app) {
// nop
// do nothing in the default implementation
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/**
* This package contains classes for writing JavaFX applications.
*/
@NotNullApi
package com.dua3.fx.application;

import com.dua3.cabe.annotations.NotNullApi;
5 changes: 4 additions & 1 deletion fx-application/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import org.jspecify.annotations.NullMarked;

/**
* Provides classes and interfaces for building and managing JavaFX applications.
*/
@NullMarked
module com.dua3.fx.application {
exports com.dua3.fx.application;
opens com.dua3.fx.application;
Expand All @@ -29,5 +32,5 @@
requires java.prefs;
requires javafx.base;
requires javafx.controls;
requires static com.dua3.cabe.annotations;
requires org.jspecify;
}
12 changes: 6 additions & 6 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rootProject.name = "dua3-fx"
val projectVersion = "0.45-SNAPSHOT"
val projectVersion = "0.45-BETA-1"

include("fx-application")
include("fx-application:fx-application-fxml")
Expand All @@ -14,20 +14,20 @@ dependencyResolutionManagement {

plugin("versions", "com.github.ben-manes.versions").version("0.51.0")
plugin("test-logger", "com.adarshr.test-logger").version("4.0.0")
plugin("spotbugs", "com.github.spotbugs").version("6.0.23")
plugin("cabe", "com.dua3.cabe").version("2.1.2")
plugin("spotbugs", "com.github.spotbugs").version("6.0.25")
plugin("cabe", "com.dua3.cabe").version("3.0-beta-7")

version("cabe", "2.0")
version("commons-logging", "1.3.1")
version("dua3-utility", "13.2-SNAPSHOT")
version("dua3-utility", "14.0-BETA-1")
version("javafx", "23")
version("jspecify", "1.0.0")
version("log4j", "2.24.1")

library("cabe-annotations", "com.dua3.cabe", "cabe-annotations").versionRef("cabe")
library("commons-logging", "commons-logging", "commons-logging").versionRef("commons-logging")
library("dua3-utility", "com.dua3.utility", "utility").versionRef("dua3-utility")
library("dua3-utility-db", "com.dua3.utility", "utility-db").versionRef("dua3-utility")
library("dua3-utility-logging", "com.dua3.utility", "utility-logging").versionRef("dua3-utility")
library("jspecify", "org.jspecify", "jspecify").versionRef("jspecify")
library(
"dua3-utility-logging-log4j",
"com.dua3.utility",
Expand Down

0 comments on commit 905bad5

Please sign in to comment.