From 7425afe431dbb4d4b43e28fc22f85cf94e9d98b7 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Wed, 17 Mar 2021 10:18:02 +0100 Subject: [PATCH] Add compile script to javafx shell --- shells/javafx.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/shells/javafx.nix b/shells/javafx.nix index e8ab02e1..419b24db 100644 --- a/shells/javafx.nix +++ b/shells/javafx.nix @@ -1,13 +1,22 @@ let pkgs = import { }; extraRpath = pkgs.stdenv.lib.strings.makeLibraryPath (with pkgs; [ ffmpeg ]); + java = pkgs.writeShellScriptBin "java" '' + old_path="$(patchelf --print-rpath ${pkgs.jdk11}/bin/java)" + LD_LIBRARY_PATH="$old_path:${extraRpath}" ${pkgs.jdk11}/bin/java $@ + ''; in pkgs.mkShell { buildInputs = with pkgs; [ + java ( - pkgs.writeShellScriptBin "java" '' - old_path="$(patchelf --print-rpath ${jdk11}/bin/java)" - LD_LIBRARY_PATH="$old_path:${extraRpath}" ${jdk11}/bin/java $@ + pkgs.writeShellScriptBin "compile" '' + find src -name '*.java' -print0 | xargs --no-run-if-empty -0 ${jdk11}/bin/javac -d out -sourcepath src + find src -type d -printf '%P\0' | xargs -0 -I \{\} mkdir -p out/\{\} + find resources -type d -printf '%P\0' | xargs -0 -I \{\} mkdir -p out/\{\} + find src -type f -not -name '*.java' -printf '%P\0' | xargs -0 -I \{\} cp src/\{\} out/\{\} + find resources -type f -not -name '*.java' -printf '%P\0' | xargs -0 -I \{\} cp resources/\{\} out/\{\} + (cd out && ${java}/bin/java polis.Main) '' ) jdk11