Repo version, add missing script
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Wed, 18 Jul 2012 15:45:50 -0700
changeset 8937 b16ceb0b5c7f
parent 8936 7bf5bc2eb3e0
child 8938 a437ac59db2f
Repo version, add missing script
doc/ns3_html_theme/get_version.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/ns3_html_theme/get_version.sh	Wed Jul 18 15:45:50 2012 -0700
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Get the current repo version
+# and format appropriately as a
+# Javascript variable for inclusion in html files
+
+# Distance from last tag
+# Zero distance means we're at the tag
+distance=`hg log -r tip --template '{latesttagdistance}'`
+
+if [ $distance -eq 0 ]; then
+    version=`hg log -r tip --template '{latesttag}'`
+else
+    repo=`basename $PWD`
+    version=`hg log -r tip --template "$repo @ {node|short}"`
+fi
+
+jsver="var ns3_version = \"$version\";"
+echo $jsver > doc/ns3_html_theme/static/ns3_version.js
+
+# Copy to html directories
+# This is done automatically by the Doxygen and Sphinx build steps
+cd doc
+for d in {manual,models,tutorial{,-pt-br}}/build/html/_static html ; do
+    cp ns3_html_theme/static/ns3_version.js $d
+done
+
+# Show what was done
+echo ns-3 javascript version: $jsver