Skip to content

Commit

Permalink
Fix JPMS issues, move module-info.java to correct place (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
skalarproduktraum committed Feb 9, 2024
1 parent 7e301c2 commit 2fdd947
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 19 deletions.
16 changes: 13 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -39,6 +41,7 @@ val lwjglArtifacts = listOf(
"lwjgl-jawt"
)


dependencies {
val scijavaParentPomVersion = project.properties["scijavaParentPOMVersion"]
val lwjglVersion = project.properties["lwjglVersion"]
Expand Down Expand Up @@ -110,6 +113,8 @@ dependencies {
api("sc.fiji:bigdataviewer-core:10.4.13")
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")
}
Expand All @@ -120,8 +125,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")
Expand Down Expand Up @@ -150,6 +155,7 @@ dependencies {
val isRelease: Boolean
get() = System.getProperty("release") == "true"


tasks {
withType<KotlinCompile>().all {
kotlinOptions {
Expand All @@ -161,6 +167,10 @@ tasks {
withType<JavaCompile>().all {
targetCompatibility = project.properties["jvmTarget"]?.toString() ?: "21"
sourceCompatibility = project.properties["jvmTarget"]?.toString() ?: "21"

// Set high error limit, such that all JPMS errors are shown, it's over 9000!
options.compilerArgs.addAll("-Xmaxerrs 9001".split(" "))

}

withType<GenerateMavenPom>().configureEach {
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ repositories {

dependencies {
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.9.10")
// implementation("org.gradlex:extra-java-module-info:1.8")
}



//, imagej, imgLib2, scifio, fiji, bigDataViewer, trakEM2, n5, boneJ, ome, omero,
//groovy, apache, batik, commons, eclipseCollections, eclipseSwt, googleCloud, jackson,
//jetty, jGraphT, jna, jogamp, kotlib, logBack, migLayout, rSyntaxTextArea, slf4j,
Expand Down
13 changes: 13 additions & 0 deletions buildSrc/src/main/kotlin/scenery/base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,21 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent

plugins {
jacoco
// id("org.gradlex.extra-java-module-info")
}

//extraJavaModuleInfo {
//// module("net.imglib2:imglib2", "net.imglib2") {
//// mergeJar("sc.fiji:bigdataviewer-core")
//// }
//
//// automaticModule("sc.fiji:bigdataviewer-core", "bdv") {
//// mergeJar("sc.fiji:bigdataviewer-vistools")
//// }
//
// deriveAutomaticModuleNamesFromFileNames.set(true)
//}

repositories {
mavenCentral()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
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 jinput;
// requires trove4j;
// requires org.scijava.ui.behaviour;
requires org.slf4j;

// opens java.nio;
// opens java.nio;
// opens sun.nio.ch;
// opens sun.
}
requires bvv;
requires bdv;
// requires bdv.util;
requires net.imglib2.realtransform;
requires net.imglib2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
import java.nio.file.Files


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2fdd947

Please sign in to comment.