-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Switch to gradlex for modularity #13112
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
Conversation
jablib/build.gradle.kts
Outdated
|
||
// --add-opens | ||
opensTo.add("javafx.base/com.sun.javafx.beans=net.bytebuddy") | ||
opensTo.add("javafx.fxml/javafx.fxml=org.jabref") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The opensTo
here is oriented at what you can do in module-info.java
files and not at the command line. The idea is to have this "block" look similar to how you would write a module-info.java
if it were possible for whitebox tests.
The opensTo
opens all packages of this test module (tests of org.jabref.jablib
) to another module.
E.g. by default the plugin already does opensTo.add("org.junit.platform.commons")
.
You can consistently open packages in the existing modules javafx.base
of javafx.fxml
by patching them. See my comment here.
build-logic/src/main/kotlin/buildlogic.java-common-conventions.gradle.kts
Outdated
Show resolved
Hide resolved
@trag-bot didn't find any issues in the code! ✅✨ |
@trag-bot didn't find any issues in the code! ✅✨ |
The build of this PR is available at https://builds.jabref.org/pull/13112/merge. |
@@ -27,10 +25,16 @@ application{ | |||
) | |||
} | |||
|
|||
val javafxVersion = "24.0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be moved to common build.gradle.kts or is the variable unreachable then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Juli(a)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK if dependabot will know it then...
…or-test * upstream/main: (102 commits) Try to fix output Improve AI preferences UI and templates (JabRef#13202) Bump jablib/src/main/abbrv.jabref.org from `6926b83` to `333c2f1` (JabRef#13216) Bump jablib/src/main/resources/csl-styles from `8a2317a` to `c3df987` (JabRef#13215) Fixed search result focus handling (JabRef#13174) New Crowdin updates (JabRef#13214) Add Pseudonymization to CLI (JabRef#13158) Try parallel gource build Update gource.yml Fix position of checkout Preapre: Enable gradle configuration cache (JabRef#13212) Add yml as YAML extension (JabRef#13213) Fix wrong detection of issue numbers (JabRef#13211) Miscellaneous refactoring - II (JabRef#13197) Run Windows tests only on main (and on demand) (JabRef#13210) Fix porcelain for consistency check (JabRef#13209) Use setup-jbang action (instead of custom call of .sh script) (JabRef#13208) Add link to JabRef guru (JabRef#13207) Switch to gradlex for modularity (JabRef#13112) feat(ci-cd): change issue URL pattern (JabRef#13206) ...
After a clean, I now get issues on macOS (m1, arm) with run @jjohannes You use a mac as well, do you have a hint? Do we need to readd the openjfx plugin?
build: |
Maybe we need to partially revert I think, this is the snippet: build-logic/src/main/kotlin/buildlogic.java-common-conventions.gradle.kts + val arch = System.getProperty("os.arch")
+ val javafxPlatform = when {
+ os.isWindows -> "win"
+ os.isMacOsX && arch == "aarch64" -> "mac-aarch64"
+ os.isMacOsX -> "mac"
+ os.isLinux && arch == "aarch64" -> "linux-aarch64"
+ os.isLinux -> "linux"
+ else -> error("Unsupported OS/arch: ${os.name} / $arch")
+ }
+ project.extra["javafxPlatform"] = javafxPlatform (and in multiple files) + implementation("org.openjfx:javafx-base:$javafxVersion:$javafxPlatform")
+ implementation("org.openjfx:javafx-controls:$javafxVersion:$javafxPlatform")
+ implementation("org.openjfx:javafx-fxml:$javafxVersion:$javafxPlatform")
+ // implementation("org.openjfx:javafx-graphics:24.0.1:win")
+ implementation("org.openjfx:javafx-graphics:$javafxVersion:$javafxPlatform")
+ implementation("org.openjfx:javafx-swing:$javafxVersion:$javafxPlatform")
+ implementation("org.openjfx:javafx-web:$javafxVersion:$javafxPlatform")
- implementation("org.openjfx:javafx-base:$javafxVersion")
- implementation("org.openjfx:javafx-controls:$javafxVersion")
- implementation("org.openjfx:javafx-fxml:$javafxVersion")
- // implementation("org.openjfx:javafx-graphics:24.0.1")
- implementation("org.openjfx:javafx-graphics:$javafxVersion")
- implementation("org.openjfx:javafx-swing:$javafxVersion")
- implementation("org.openjfx:javafx-web:$javafxVersion")
``´ |
Yeaht that seems like the best option |
@Siedlerchr @koppor hi. No need to revert this. The issue is in the OS detection code. This: jabref/build-logic/src/main/kotlin/buildlogic.java-common-conventions.gradle.kts Lines 40 to 41 in 4f1b9fc
Should be something like this: val arch = System.getProperty("os.arch")
if (arch.contains("aarch")) "macos-14" else "macos-13" The names for the targets are taken from the current GitHub hosted runner names. (Note: Based on your feedback, this OS detection may work out of the box in the future - gradlex-org/java-module-packaging#51) |
Fixes https://github.com/JabRef/jabref-issue-melting-pot/issues/919
gradle-modules-plugin
, which I needed to patch: Add usage of java Command-Line Argument File on Windows java9-modularity/gradle-modules-plugin#282org.openjfx.javafxplugin
Replaces all by better alternatives
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)