Просмотр исходного кода

add new, simpler build system

new-build-system
Jan Lehnardt 14 лет назад
Родитель
Сommit
eeae3fbe81
4 измененных файлов: 62 добавлений и 2 удалений
  1. +43
    -0
      Makefile
  2. +17
    -0
      build/wrappers.sh
  3. +1
    -1
      mustache.js
  4. +1
    -1
      package.json

+ 43
- 0
Makefile Просмотреть файл

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

+ 17
- 0
build/wrappers.sh Просмотреть файл

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

+ 1
- 1
mustache.js Просмотреть файл

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


+ 1
- 1
package.json Просмотреть файл

@@ -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"],


Загрузка…
Отмена
Сохранить