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

JPMS compatibility #619

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

skalarproduktraum
Copy link
Member

This PR improves compatibility with the JPMS, removing the need for --add-opens VM flags when running with Java 17+.

@skalarproduktraum skalarproduktraum added enhancement Issue or PR discusses an enhancement build-system Concerns the build system Dependencies Changes/bumps in dependencies of the project labels Sep 20, 2023
Copy link
Member

@ctrueden ctrueden left a comment

Choose a reason for hiding this comment

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

Various thoughts!

@@ -113,6 +116,8 @@ dependencies {
api("sc.fiji:bigdataviewer-core:10.4.14")
api("sc.fiji:bigdataviewer-vistools:1.0.0-beta-28")
api("sc.fiji:bigvolumeviewer:0.3.3") {
exclude("sc.fiji", "bigdataviewer-core")
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest to add a comment explaining what it accomplishes to exclude bigdataviewer-core and bigdataviewer-vistools here, when they are included as direct dependencies immediately above.

@@ -165,6 +170,10 @@ tasks {
withType<JavaCompile>().all {
targetCompatibility = project.properties["jvmTarget"]?.toString() ?: "21"
sourceCompatibility = project.properties["jvmTarget"]?.toString() ?: "21"
Copy link
Member

Choose a reason for hiding this comment

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

Not a thing with this PR specifically, but maybe rather than setting -target and source, you want to configure the --release?

    options.compilerArgs.add("--release")
    options.compilerArgs.add(project.properties["jvmTarget"]?.toString() ?: "21")

Why? Because.

exports graphics.scenery.textures;
exports graphics.scenery.ui;
exports graphics.scenery.utils;
exports graphics.scenery.volumes;
Copy link
Member

Choose a reason for hiding this comment

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

If I'm reading it right, it looks like this is exporting all the graphics.scenery.* packages, but none of the graphics.scenery.*.* ones? Specifically: missing are attribute.geometry, attribute.material, attribute.renderable, attribute.spatial, backends.software, backends.vulkan, controls.behaviours, controls.eyetracking, utils.extensions. Intentional, or no?

And are you sure you want to expose so much API surface? I guess since scenery hasn't hit 1.0.0 yet, you can still break things. But this work is an opportunity to consider whether it makes sense to create any internal (non-exported) packages, no?

//import org.janelia.saalfeldlab.n5.GzipCompression
//import org.janelia.saalfeldlab.n5.N5FSReader
//import org.janelia.saalfeldlab.n5.N5FSWriter
//import org.janelia.saalfeldlab.n5.imglib2.N5Utils
Copy link
Member

Choose a reason for hiding this comment

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

So, scenery only uses (used) n5 in tests? Please let me know if you find a good way of dealing with test-scope dependencies with JPMS. We have found it very challenging with SciJava Ops; we were unable to make a separate module-info.java in the src/test subtree work (see scijava/scijava@ae39206 for details).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-system Concerns the build system Dependencies Changes/bumps in dependencies of the project enhancement Issue or PR discusses an enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants