-
Notifications
You must be signed in to change notification settings - Fork 33
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
base: main
Are you sure you want to change the base?
JPMS compatibility #619
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import scenery.* | |
import java.net.URL | ||
|
||
plugins { | ||
`java-library` | ||
// kotlin and dokka versions are now managed in settings.gradle.kts and gradle.properties | ||
kotlin("jvm") | ||
kotlin("kapt") | ||
|
@@ -12,11 +13,12 @@ plugins { | |
scenery.base | ||
scenery.publish | ||
scenery.sign | ||
// id("com.github.elect86.sciJava") version "0.0.4" | ||
jacoco | ||
id("com.github.johnrengelman.shadow") apply false | ||
} | ||
|
||
|
||
|
||
repositories { | ||
mavenCentral() | ||
maven("https://maven.scijava.org/content/groups/public") | ||
|
@@ -41,6 +43,7 @@ val lwjglArtifacts = listOf( | |
"lwjgl-zstd" | ||
) | ||
|
||
|
||
dependencies { | ||
val scijavaParentPomVersion = project.properties["scijavaParentPOMVersion"] | ||
val lwjglVersion = project.properties["lwjglVersion"] | ||
|
@@ -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") | ||
exclude("sc.fiji", "bigdataviewer-vistools") | ||
exclude("org.jogamp.gluegen", "gluegen-rt") | ||
exclude("org.jogamp.jogl", "jogl-all") | ||
} | ||
|
@@ -123,9 +128,8 @@ dependencies { | |
exclude("org.lwjgl", "lwjgl-bom") | ||
exclude("org.lwjgl", "lwjgl") | ||
} | ||
|
||
implementation("org.janelia.saalfeldlab:n5") | ||
implementation("org.janelia.saalfeldlab:n5-imglib2") | ||
// implementation("org.janelia.saalfeldlab:n5") | ||
// implementation("org.janelia.saalfeldlab:n5-imglib2") | ||
listOf("core", "structure", "modfinder").forEach { | ||
implementation("org.biojava:biojava-$it:6.0.5") { | ||
exclude("org.slf4j", "slf4j-api") | ||
|
@@ -154,6 +158,7 @@ dependencies { | |
val isRelease: Boolean | ||
get() = System.getProperty("release") == "true" | ||
|
||
|
||
tasks { | ||
withType<KotlinCompile>().all { | ||
kotlinOptions { | ||
|
@@ -165,6 +170,10 @@ tasks { | |
withType<JavaCompile>().all { | ||
targetCompatibility = project.properties["jvmTarget"]?.toString() ?: "21" | ||
sourceCompatibility = project.properties["jvmTarget"]?.toString() ?: "21" | ||
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. Not a thing with this PR specifically, but maybe rather than setting options.compilerArgs.add("--release")
options.compilerArgs.add(project.properties["jvmTarget"]?.toString() ?: "21") Why? Because. |
||
|
||
// Set high error limit, such that all JPMS errors are shown, it's over 9000! | ||
options.compilerArgs.addAll("-Xmaxerrs 9001".split(" ")) | ||
|
||
} | ||
|
||
withType<GenerateMavenPom>().configureEach { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module graphics.scenery { | ||
exports graphics.scenery; | ||
exports graphics.scenery.atomicsimulations; | ||
exports graphics.scenery.attribute; | ||
exports graphics.scenery.backends; | ||
exports graphics.scenery.compute; | ||
exports graphics.scenery.controls; | ||
exports graphics.scenery.effectors; | ||
exports graphics.scenery.fonts; | ||
exports graphics.scenery.geometry; | ||
exports graphics.scenery.net; | ||
exports graphics.scenery.numerics; | ||
exports graphics.scenery.primitives; | ||
exports graphics.scenery.proteins; | ||
exports graphics.scenery.repl; | ||
exports graphics.scenery.serialization; | ||
exports graphics.scenery.textures; | ||
exports graphics.scenery.ui; | ||
exports graphics.scenery.utils; | ||
exports graphics.scenery.volumes; | ||
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. If I'm reading it right, it looks like this is exporting all the 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? |
||
|
||
requires java.base; | ||
requires java.desktop; | ||
requires java.management; | ||
requires java.logging; | ||
requires jdk.unsupported; | ||
|
||
requires kotlin.stdlib; | ||
requires kotlin.reflect; | ||
requires kotlinx.coroutines.core; | ||
|
||
requires org.joml; | ||
requires org.lwjgl; | ||
requires org.lwjgl.vulkan; | ||
requires org.lwjgl.tinyexr; | ||
requires org.lwjgl.remotery; | ||
requires org.lwjgl.openvr; | ||
requires org.lwjgl.glfw; | ||
requires org.lwjgl.spvc; | ||
requires org.lwjgl.shaderc; | ||
requires org.lwjgl.jemalloc; | ||
requires info.picocli; | ||
requires org.bytedeco.ffmpeg; | ||
requires com.fasterxml.jackson.core; | ||
requires com.fasterxml.jackson.databind; | ||
requires com.fasterxml.jackson.dataformat.yaml; | ||
requires com.fasterxml.jackson.kotlin; | ||
// requires jinput; | ||
// requires trove4j; | ||
// requires org.scijava.ui.behaviour; | ||
requires org.slf4j; | ||
requires bvv; | ||
requires bdv; | ||
// requires bdv.util; | ||
requires net.imglib2.realtransform; | ||
requires net.imglib2; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,10 @@ import net.imglib2.img.Img | |
import net.imglib2.img.display.imagej.ImageJFunctions | ||
import net.imglib2.type.numeric.integer.UnsignedShortType | ||
import net.imglib2.type.volatiles.VolatileUnsignedShortType | ||
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 | ||
//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 | ||
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. 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 |
||
import java.nio.file.Files | ||
|
||
|
||
|
@@ -50,12 +50,12 @@ class OutOfCoreRAIExample: SceneryBase("Out-of-core RAI Rendering example", 1280 | |
// and save it to a temporary location. | ||
val datasetName = "testDataset" | ||
val n5path = Files.createTempDirectory("scenery-t1-head-n5") | ||
val n5 = N5FSWriter(n5path.toString()) | ||
N5Utils.save(img, n5, datasetName, intArrayOf(img.dimension(0).toInt(), img.dimension(1).toInt(), img.dimension(2).toInt()), GzipCompression()) | ||
// val n5 = N5FSWriter(n5path.toString()) | ||
// N5Utils.save(img, n5, datasetName, intArrayOf(img.dimension(0).toInt(), img.dimension(1).toInt(), img.dimension(2).toInt()), GzipCompression()) | ||
|
||
// load the multiresolution N5 dataset from the temporary location and wrap it | ||
// as [net.imglib2.Volatile] dataset. | ||
val ooc: RandomAccessibleInterval<UnsignedShortType> = N5Utils.openVolatile(N5FSReader(n5path.toString()), datasetName) | ||
val ooc: RandomAccessibleInterval<UnsignedShortType>? = null //N5Utils.openVolatile(N5FSReader(n5path.toString()), datasetName) | ||
val wrapped = VolatileViews.wrapAsVolatile(ooc) | ||
|
||
// When loading datasets with multiple resolution levels, it's important to use Volatile types | ||
|
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.
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.