- start rust rewrite

This commit is contained in:
Wim Pomp
2025-02-03 15:33:32 +01:00
parent 4a6a15686c
commit 3db6dc8ee1
22 changed files with 1487 additions and 3329 deletions

28
build.rs Normal file
View File

@@ -0,0 +1,28 @@
// copied from https://github.com/AzHicham/bioformats-rs
use j4rs::{errors::J4RsError, JvmBuilder, MavenArtifact, MavenArtifactRepo, MavenSettings};
use retry::{delay, delay::Exponential, retry};
fn main() -> anyhow::Result<()> {
println!("cargo:rerun-if-changed=build.rs");
Ok(retry(
Exponential::from_millis(1000).map(delay::jitter).take(4),
deploy_java_artifacts,
)?)
}
fn deploy_java_artifacts() -> Result<(), J4RsError> {
let jvm = JvmBuilder::new()
.with_maven_settings(MavenSettings::new(vec![MavenArtifactRepo::from(
"openmicroscopy::https://artifacts.openmicroscopy.org/artifactory/ome.releases",
)]))
.build()?;
jvm.deploy_artifact(&MavenArtifact::from("ome:bioformats_package:8.0.1"))?;
#[cfg(feature = "gpl-formats")]
jvm.deploy_artifact(&MavenArtifact::from("ome:formats-gpl:8.0.1"))?;
Ok(())
}