mk_jars
changeset 348 b5b6ed38c2f2
parent 297 eab44dbee855
child 349 682611a0fb89
--- a/mk_jars	Mon Nov 02 02:31:44 2020 +0000
+++ b/mk_jars	Mon Nov 02 13:10:02 2020 +0000
@@ -1,13 +1,16 @@
 #!/bin/sh
 set -e
 
-for sd in solutions*; do
+subdirs=${1:-"pre_solution1 pre_solution2 pre_solution3 pre_solution4 main_solution1 main_solution2 main_solution3 main_solution4 main_solution5"} 
+
+for sd in $subdirs; do
   cd $sd
   for fl in *.scala; do
-     echo "$fl compiled to ${fl%".scala"}.jar"
-     scalac -d ${fl%".scala"}.jar $fl
-     echo "copied to ../templates${sd#"solutions"}/"
-     cp ${fl%".scala"}.jar ../templates${sd#"solutions"}/
+      echo "$sd/$fl"
+      echo "copy to ${sd/solution/templates}/${fl%.scala}.jar"
+      scalac -d ${fl%.scala}.jar $fl
+      cp ${fl%.scala}.jar "../${sd/solution/templates}"
+      hg add "../${sd/solution/templates}/${fl%.scala}.jar"
   done
   cd ..
 done