2010-03-19 06:13:27 +08:00
|
|
|
#
|
|
|
|
# Run all tests
|
|
|
|
#
|
2011-01-20 01:22:24 +08:00
|
|
|
test:
|
|
|
|
@@node test/mess-test.js
|
2010-03-19 06:13:27 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# Run benchmark
|
|
|
|
#
|
|
|
|
benchmark:
|
|
|
|
node benchmark/less-benchmark.js
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build less.js
|
|
|
|
#
|
|
|
|
SRC = lib/less
|
|
|
|
HEADER = build/header.js
|
2010-05-27 01:37:34 +08:00
|
|
|
VERSION = `cat package.json | grep version \
|
2010-06-07 17:08:52 +08:00
|
|
|
| grep -o '[0-9]\.[0-9]\.[0-9]\+'`
|
2010-05-27 01:37:34 +08:00
|
|
|
DIST = dist/less-${VERSION}.js
|
|
|
|
DIST_MIN = dist/less-${VERSION}.min.js
|
2010-03-19 06:13:27 +08:00
|
|
|
|
|
|
|
less:
|
2010-03-30 10:24:09 +08:00
|
|
|
@@mkdir -p dist
|
2010-05-27 01:37:34 +08:00
|
|
|
@@touch ${DIST}
|
|
|
|
@@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST}
|
2010-06-16 06:05:03 +08:00
|
|
|
@@echo "(function (window, undefined) {" >> ${DIST}
|
2010-06-16 06:54:46 +08:00
|
|
|
@@cat build/require.js\
|
|
|
|
build/ecma-5.js\
|
2010-03-23 11:12:58 +08:00
|
|
|
${SRC}/parser.js\
|
2010-03-19 06:13:27 +08:00
|
|
|
${SRC}/functions.js\
|
2010-03-23 11:12:58 +08:00
|
|
|
${SRC}/tree/*.js\
|
2010-03-30 10:24:09 +08:00
|
|
|
${SRC}/tree.js\
|
2010-05-27 01:37:34 +08:00
|
|
|
${SRC}/browser.js >> ${DIST}
|
2010-06-16 06:05:03 +08:00
|
|
|
@@echo "})(window);" >> ${DIST}
|
2010-03-27 14:24:39 +08:00
|
|
|
@@echo ${DIST} built.
|
2010-03-19 06:13:27 +08:00
|
|
|
|
|
|
|
min: less
|
2010-03-30 10:24:09 +08:00
|
|
|
@@echo minifying...
|
2010-03-27 14:24:39 +08:00
|
|
|
@@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST_MIN}
|
2010-03-19 06:13:27 +08:00
|
|
|
@@java -jar build/compiler.jar\
|
2010-03-27 14:24:39 +08:00
|
|
|
--js ${DIST} >> ${DIST_MIN}
|
2010-03-19 06:13:27 +08:00
|
|
|
|
2010-07-08 06:55:20 +08:00
|
|
|
clean:
|
|
|
|
git rm dist/*
|
|
|
|
|
|
|
|
dist: clean min
|
|
|
|
git add dist/*
|
|
|
|
git commit -a -m "(dist) build ${VERSION}"
|
|
|
|
git archive master --prefix=less/ -o less-${VERSION}.tar.gz
|
|
|
|
npm publish less-${VERSION}.tar.gz
|
|
|
|
|
|
|
|
stable:
|
|
|
|
npm tag less ${VERSION} stable
|
|
|
|
|
|
|
|
|
2010-03-19 06:13:27 +08:00
|
|
|
.PHONY: test benchmark
|