mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 15:24:48 +01:00
fix: put java commands behind feature flag
This commit is contained in:
parent
71006696ee
commit
136ce6b052
2 changed files with 32 additions and 25 deletions
|
@ -41,3 +41,4 @@ rifgen = { git = "https://github.com/Kofituo/rifgen.git", rev = "d27d9785b2febcf
|
|||
[features]
|
||||
default = []
|
||||
java = ["lazy_static", "jni", "jni-sys", "flapigen", "rifgen", "log"]
|
||||
java-artifact = ["java"]
|
||||
|
|
8
build.rs
8
build.rs
|
@ -37,7 +37,12 @@ fn main() {
|
|||
out_dir.join("glue.rs")
|
||||
);
|
||||
|
||||
//TODO panic if no jdk
|
||||
#[cfg(feature = "java-artifact")] {
|
||||
// panic if no jdk
|
||||
std::process::Command::new("javac")
|
||||
.arg("--version")
|
||||
.status()
|
||||
.expect("java not found");
|
||||
|
||||
// compile java code
|
||||
let mut java_compiled = java_target.clone(); // target/debug/java/classes
|
||||
|
@ -68,6 +73,7 @@ fn main() {
|
|||
|
||||
println!("cargo:rerun-if-changed={}", generated_glue_file.display());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn recreate_path(path: &std::path::PathBuf) {
|
||||
|
|
Loading…
Reference in a new issue