Getting the right data into the manifest; sadly, not succeeding in getting

it out again.
This commit is contained in:
Simon Brooke 2014-07-27 21:05:47 +01:00
parent 829bc1780a
commit c0d26f7cc7
5 changed files with 41 additions and 23 deletions

View file

@ -49,16 +49,19 @@ function setup-build-sig {
if [ "${2}${3}${4}" = "" ] if [ "${2}${3}${4}" = "" ]
then then
t="unset" t="unset"
i="unset"
else else
t=`date --rfc-3339 seconds` t=`date --rfc-3339 seconds`
i="${v} built by ${u} on ${t}"
fi fi
cat <<-EOF > ${tmp}/manifest.sed cat <<-EOF > ${tmp}/manifest.sed
s/${o}/${v}/g s/${o}/${v}/g
s/^ *"build-signature-user" ".*" *\$/\t\t"build-signature-user" "${u}"/ s/"build-signature-user" *".*"/"build-signature-user" "${u}"/
s/^ *"build-signature-email" ".*" *\$/\t\t"build-signature-email" "${e}"/ s/"build-signature-email" *".*"/"build-signature-email" "${e}"/
s/^ *"build-signature-timestamp" ".*" *\$/\t\t"build-signature-timestamp" "${t}"/ s/"build-signature-timestamp" *".*"/"build-signature-timestamp" "${t}"/
s/^ *"build-signature-version" ".*" *\$/\t\t"build-signature-version" "${v}"/ s/"build-signature-version" *".*"/"build-signature-version" "${v}"/
s/"Implementation-Version" *".*"/"Implementation-Version" "${i}"/
EOF EOF
} }
@ -126,6 +129,7 @@ for dir in mw-*
do do
pushd ${dir} pushd ${dir}
# Make a temporary directory to keep the work-in-progress files.
if [ ! -d "${tmp}" ] if [ ! -d "${tmp}" ]
then then
rm -f "${tmp}" rm -f "${tmp}"
@ -182,6 +186,16 @@ do
lein marg lein marg
lein install 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 cat project.clj > ${tmp}/project.bak.2
setup-build-sig setup-build-sig
sed -f ${tmp}/manifest.sed ${tmp}/project.bak.2 > project.clj sed -f ${tmp}/manifest.sed ${tmp}/project.bak.2 > project.clj
@ -223,6 +237,7 @@ do
lein marg lein marg
lein install lein install
# Then unset manifest properties prior to committing.
cat project.clj > ${tmp}/project.bak.4 cat project.clj > ${tmp}/project.bak.4
setup-build-sig setup-build-sig
sed -f ${tmp}/manifest.sed ${tmp}/project.bak.4 > project.clj sed -f ${tmp}/manifest.sed ${tmp}/project.bak.4 > project.clj
@ -235,15 +250,7 @@ do
fi fi
fi fi
# Finally, if we're in the UI project, build the uberwar - and should # if nothing broke so far, clean up...
# 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
# rm -rf "${tmp}" # rm -rf "${tmp}"
popd popd
done done

View file

@ -1,13 +1,12 @@
(defproject mw-engine "0.1.3-SNAPSHOT" (defproject mw-engine "0.1.2-SNAPSHOT"
:description "Cellular automaton world builder." :description "Cellular automaton world builder."
:url "http://www.journeyman.cc/microworld/" :url "http://www.journeyman.cc/microworld/"
:manifest { :manifest {
;; do not reformat this! It is important for the buildall script "build-signature-version" "unset"
;; that each of these properties is on a line with nothing else. "build-signature-user" "unset"
"build-signature-version" "0.1.3-SNAPSHOT" "build-signature-email" "unset"
"build-signature-user" "Simon Brooke" "build-signature-timestamp" "unset"
"build-signature-email" "simon@journeyman.cc" "Implementation-Version" "unset"
"build-signature-timestamp" "2014-07-27 11:54:52+01:00"
} }
:license {:name "GNU General Public License v2" :license {:name "GNU General Public License v2"

View file

@ -2,8 +2,7 @@
(ns mw-engine.core (ns mw-engine.core
(:use mw-engine.utils) (: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 ;; 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 ;; fires, it returns a new cell, which should have the same values for :x and

View file

@ -164,3 +164,5 @@
(map #(set-cell-property % x y property value) (map #(set-cell-property % x y property value)
row))) row)))
world)))) world))))

11
src/mw_engine/version.clj Normal file
View file

@ -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)))