Permalink
Browse files

add new, simpler build system

  • Loading branch information...
1 parent 88fbcbc commit eeae3fbe81755981e854dd4a29c2a452268d357c @janl committed Feb 24, 2012
Showing with 62 additions and 2 deletions.
  1. +43 −0 Makefile
  2. +17 −0 build/wrappers.sh
  3. +1 −1 mustache.js
  4. +1 −1 package.json
View
@@ -0,0 +1,43 @@
+# Make mustaches
+
+# make a release
+release: args tag build-wrappers
+ @echo Done!
+
+args:
+ifeq ($(version),)
+ @echo "Usage make release version=x.y.z"
+else
+ @echo "Releasing: ${version}"
+endif
+
+tag:
+ # splice in version
+ sed -i.bak -e "s|%version%|${version}|" mustache.js package.json
+ git commit -m 'Released ${version}' mustache.js
+ # tag the version
+ git tag ${version}
+ # revert the version
+ sed -i.bak -e 's|exports.version = "${version}"|exports.version = "%version%"|' mustache.js
+ sed -i.bak -e 's|"version": "${version}"|"version": "%version%"|' package.json
+
+build-wrappers:
+ # from that tag:
+ # build all wrappers / minify
+ git checkout $(version)
+ build/wrappers.sh $(version)
+
+ git checkout gh-pages
+ mkdir ${version}
+ cp -r wrappers/mustache-* $(version)/
+ cp mustache.js $(version)/
+ cp package.json $(version)/
+ # update gh-pages with release links & travis
+ # update npm
+ # update cdnjs
+
+# make test
+test:
+ rspec spec/mustache_spec.rb
+
+PHONY: test release args tag build-wrappers
View
@@ -0,0 +1,17 @@
+#!/bin/sh -ex
+if [ -z "$1" ]; then
+ echo "Usage: ./build-wrapper.sh x.y.z"
+ exit 1
+fi
+version=$1
+cd wrappers
+ for wrapper in *; do
+ target_dir="mustache-${wrapper}-${version}"
+ mkdir -p $target_dir
+ target=$target_dir/${wrapper}.mustache.js
+ touch $target
+ cat ${wrapper}/mustache.js.pre >> ${target}
+ cat ../mustache.js >> ${target}
+ cat ${wrapper}/mustache.js.post >> ${target}
+ done
+cd ..
View
@@ -7,7 +7,7 @@ var Mustache = (typeof module !== "undefined" && module.exports) || {};
(function (exports) {
exports.name = "mustache.js";
- exports.version = "0.5.13";
+ exports.version = "%version%";
exports.tags = ["{{", "}}"];
exports.parse = parse;
exports.compile = compile;
View
@@ -1,6 +1,6 @@
{
"name": "mustache",
- "version": "0.5.0-dev",
+ "version": "%version%",
"description": "Logic-less {{mustache}} templates with JavaScript",
"author": "mustache.js Authors <http://github.com/janl/mustache.js>",
"keywords": ["mustache", "template", "templates", "ejs"],

0 comments on commit eeae3fb

Please sign in to comment.