diff --git a/buildall.sh b/buildall.sh index 2e443f6..7f72cde 100755 --- a/buildall.sh +++ b/buildall.sh @@ -49,16 +49,19 @@ function setup-build-sig { if [ "${2}${3}${4}" = "" ] then t="unset" + i="unset" else t=`date --rfc-3339 seconds` + i="${v} built by ${u} on ${t}" fi cat <<-EOF > ${tmp}/manifest.sed s/${o}/${v}/g -s/^ *"build-signature-user" ".*" *\$/\t\t"build-signature-user" "${u}"/ -s/^ *"build-signature-email" ".*" *\$/\t\t"build-signature-email" "${e}"/ -s/^ *"build-signature-timestamp" ".*" *\$/\t\t"build-signature-timestamp" "${t}"/ -s/^ *"build-signature-version" ".*" *\$/\t\t"build-signature-version" "${v}"/ +s/"build-signature-user" *".*"/"build-signature-user" "${u}"/ +s/"build-signature-email" *".*"/"build-signature-email" "${e}"/ +s/"build-signature-timestamp" *".*"/"build-signature-timestamp" "${t}"/ +s/"build-signature-version" *".*"/"build-signature-version" "${v}"/ +s/"Implementation-Version" *".*"/"Implementation-Version" "${i}"/ EOF } @@ -125,7 +128,8 @@ fi for dir in mw-* do pushd ${dir} - + + # Make a temporary directory to keep the work-in-progress files. if [ ! -d "${tmp}" ] then rm -f "${tmp}" @@ -182,6 +186,16 @@ do lein marg lein install + # If we're in the UI project, build the uberwar - and should + # probably deploy it to local Tomcat for test + if [ "${dir}" = "mw-ui" -a "${webappsdir}" != "" ] + then + lein ring uberwar + sudo cp target/microworld.war "${webappsdir}" + echo "Deployed new WAR file to local Tomcat at ${webappsdir}" + fi + + # Then unset manifest properties prior to committing. cat project.clj > ${tmp}/project.bak.2 setup-build-sig sed -f ${tmp}/manifest.sed ${tmp}/project.bak.2 > project.clj @@ -223,6 +237,7 @@ do lein marg lein install + # Then unset manifest properties prior to committing. cat project.clj > ${tmp}/project.bak.4 setup-build-sig sed -f ${tmp}/manifest.sed ${tmp}/project.bak.4 > project.clj @@ -235,15 +250,7 @@ do fi fi - # Finally, if we're in the UI project, build the uberwar - and should - # probably deploy it to local Tomcat for test - if [ "${dir}" = "mw-ui" ] - then - lein ring uberwar - sudo cp target/microworld.war /var/lib/tomcat7/webapps - echo "Deployed new WAR file to local Tomcat" - fi - + # if nothing broke so far, clean up... # rm -rf "${tmp}" popd done diff --git a/project.clj b/project.clj index e5d5315..8c2ae67 100644 --- a/project.clj +++ b/project.clj @@ -1,13 +1,12 @@ -(defproject mw-engine "0.1.3-SNAPSHOT" +(defproject mw-engine "0.1.2-SNAPSHOT" :description "Cellular automaton world builder." :url "http://www.journeyman.cc/microworld/" :manifest { - ;; do not reformat this! It is important for the buildall script - ;; that each of these properties is on a line with nothing else. - "build-signature-version" "0.1.3-SNAPSHOT" - "build-signature-user" "Simon Brooke" - "build-signature-email" "simon@journeyman.cc" - "build-signature-timestamp" "2014-07-27 11:54:52+01:00" + "build-signature-version" "unset" + "build-signature-user" "unset" + "build-signature-email" "unset" + "build-signature-timestamp" "unset" + "Implementation-Version" "unset" } :license {:name "GNU General Public License v2" diff --git a/src/mw_engine/core.clj b/src/mw_engine/core.clj index af5d686..ae3a065 100644 --- a/src/mw_engine/core.clj +++ b/src/mw_engine/core.clj @@ -2,8 +2,7 @@ (ns mw-engine.core (:use mw-engine.utils) - (:require [mw-engine.world :as world] - )) + (:require [mw-engine.world :as world])) ;; Every rule is a function of two arguments, a cell and a world. If the rule ;; fires, it returns a new cell, which should have the same values for :x and diff --git a/src/mw_engine/utils.clj b/src/mw_engine/utils.clj index 10220b5..a63422d 100644 --- a/src/mw_engine/utils.clj +++ b/src/mw_engine/utils.clj @@ -164,3 +164,5 @@ (map #(set-cell-property % x y property value) row))) world)))) + + diff --git a/src/mw_engine/version.clj b/src/mw_engine/version.clj new file mode 100644 index 0000000..18b9b0e --- /dev/null +++ b/src/mw_engine/version.clj @@ -0,0 +1,11 @@ +(ns mw-engine.version + (:gen-class)) + +(defn get-implementation-version + "Get the implementation version from the package of this namespace, which must + be compiled into a class (see clojure.java.interop)" + [namespace-class] + (.getImplementationVersion (.getPackage namespace-class))) + +(defn -main [] + (get-implementation-version (eval 'mw-engine.version)))