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}" = "" ]
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
}
@ -126,6 +129,7 @@ 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

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."
: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"

View file

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

View file

@ -164,3 +164,5 @@
(map #(set-cell-property % x y property value)
row)))
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)))