From 2badffe64b5eb1b08968faaba66c62f7ae864305 Mon Sep 17 00:00:00 2001 From: Walter Oggioni Date: Sat, 17 Mar 2018 10:49:56 +0100 Subject: [PATCH] improved nim structure --- .gitmodules | 2 +- build.sbt | 10 +--------- nim/build.sh | 4 ++-- nim/{ => lib}/htmlutils | 0 nim/nim.cfg | 1 + nim/{ => src}/jpacrepo.nim | 0 6 files changed, 5 insertions(+), 12 deletions(-) rename nim/{ => lib}/htmlutils (100%) create mode 100644 nim/nim.cfg rename nim/{ => src}/jpacrepo.nim (100%) diff --git a/.gitmodules b/.gitmodules index 678cd96..3646ea6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "nim/htmlutils"] - path = nim/htmlutils + path = nim/lib/htmlutils url = ssh://oggio88.soon.it:1122/mnt/git/htmlutils diff --git a/build.sbt b/build.sbt index 833b2b3..8f7191e 100644 --- a/build.sbt +++ b/build.sbt @@ -53,21 +53,13 @@ val compileNim = TaskKey[File]("compileNim", "Compile nim code of web interface" compileNim := { val result = new File("nim/nimcache/jpacrepo.js") - val cmd = s"nim js -d:release -d:serverURL= nim/jpacrepo.nim" + val cmd = s"nim js -d:release -d:serverURL= nim/src/jpacrepo.nim" println(cmd) sys.process.stringToProcess(cmd).! match { case 0 => case _ => throw new RuntimeException("Error occurred during deploy") } -// val outfile = (baseDirectory.value / "nim" / "nimcache" / "jpacrepo.min.js").toString -// val closureCmd = s"closure-compiler --strict_mode_input=false -O ADVANCED --language_in ECMASCRIPT5 --language_out ECMASCRIPT5 --js_output_file=${outfile} ${result.getAbsolutePath}" -// println(closureCmd) -// sys.process.stringToProcess(closureCmd).! match -// { -// case 0 => -// case _ => throw new RuntimeException("Error occurred during deploy") -// } result } diff --git a/nim/build.sh b/nim/build.sh index 84abd31..a69992c 100755 --- a/nim/build.sh +++ b/nim/build.sh @@ -1,4 +1,4 @@ #!/bin/bash set -e -nim js jpacrepo.nim -cp nimcache/jpacrepo.js static \ No newline at end of file +nim js src/jpacrepo.nim +cp nimcache/jpacrepo.js static diff --git a/nim/htmlutils b/nim/lib/htmlutils similarity index 100% rename from nim/htmlutils rename to nim/lib/htmlutils diff --git a/nim/nim.cfg b/nim/nim.cfg new file mode 100644 index 0000000..17b9954 --- /dev/null +++ b/nim/nim.cfg @@ -0,0 +1 @@ +path="lib" diff --git a/nim/jpacrepo.nim b/nim/src/jpacrepo.nim similarity index 100% rename from nim/jpacrepo.nim rename to nim/src/jpacrepo.nim