Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

137 lines (103 sloc) 4.099 kB
MFLAGS = -s
MAKEFLAGS = ${MFLAGS}
MODULE = bolt
VERSION = local
PROJECTS = \
base \
loader \
kernel \
bolt \
test \
inline \
karma \
boltc \
ide/sublime
TESTS = \
test/scenarios/*/run-test
PROJECTS_DIR = projects
GEN = gen
DIST = ${GEN}/dist
DIST_ARTIFACTS = \
projects/inline/gen/dist/* \
projects/boltc/gen/dist/boltc.js \
projects/test/gen/dist/test.js \
projects/karma/gen/dist/bolt-karma.js \
projects/bolt/gen/dist/bolt.js
TAR = ${DIST}/${MODULE}-${VERSION}.tar.gz
TAR_IMAGE = ${GEN}/image
SUBLIME_PACKAGE = projects/ide/sublime/gen/dist/Bolt.sublime-package
SUBLIME_DIST = ${DIST}/${MODULE}-${VERSION}.sublime-package
STATIC_ARTIFACTS = LICENSE LICENSE.ephox CONTRIBUTORS COPYING README.md
RELEASE_DIR = ${TAR_IMAGE}/${MODULE}-${VERSION}
RELEASE_NPM = ${RELEASE_DIR}/package.json
RELEASE_VERSION = ${RELEASE_DIR}/bin/version
CONFIG_NPM = config/npm/package.json
CONFIG_SUBLIME = config/sublime/packages.json
CONFIG_VERSION = config/release/version
CONFIG_BUILD = config/release/build
PUBLISH_REPO_URL = git@github.com:boltjs/dist.boltjs.io.git
PUBLISH_REPO = ${GEN}/dist.boltjs.io
PUBLISH_DIR = ${PUBLISH_REPO}/${VERSION}
PUBLISH_GIT = git --work-tree ${PUBLISH_REPO} --git-dir ${PUBLISH_REPO}/.git
PUBLISH_ARTIFACTS = ${TAR} ${SUBLIME_DIST} ${RELEASE_DIR}/lib/bolt.js ${RELEASE_DIR}/lib/bolt-karma.js ${RELEASE_DIR}/lib/test.js
RELEASE_SUBLIME = ${PUBLISH_REPO}/packages.json
DIRECTORIES = ${GEN} ${DIST} ${TAR_IMAGE} ${RELEASE_DIR} ${RELEASE_DIR}/bin ${RELEASE_DIR}/lib ${RELEASE_DIR}/command
.PHONY: clean dist artifacts publish npm-register verify release ${PROJECTS} ${RELEASE_DIR} ${PUBLISH_DIR} ${PUBLISH_REPO}
default: clean artifacts
clean:
rm -rf ./${GEN}
for x in ${PROJECTS}; do \
(cd projects/$$x; ${MAKE} ${MFLAGS} clean); \
done
for x in test/scenarios/*; do \
rm -rf ./$$x/gen; \
done
dist: ${TAR} ${SUBLIME_DIST}
artifacts: clean ${PROJECTS} ${RELEASE_NPM} ${RELEASE_VERSION} ${STATIC_ARTIFACTS} ${RELEASE_DIR}/bin ${RELEASE_DIR}/lib ${RELEASE_DIR}/command
cp ${STATIC_ARTIFACTS} ${RELEASE_DIR}/.
cp ${DIST_ARTIFACTS} ${RELEASE_DIR}/lib/.
cp ${PROJECTS_DIR}/script/bin/* ${RELEASE_DIR}/bin/.
cp ${PROJECTS_DIR}/script/command/* ${RELEASE_DIR}/command/.
cp ${PROJECTS_DIR}/script/lib/* ${RELEASE_DIR}/lib/.
verify: artifacts
for x in ${TESTS}; do \
(cd `dirname $$x`; export RELEASE_DIR="../../../${RELEASE_DIR}"; PATH="../../../${RELEASE_DIR}/bin:$$PATH" ./run-test) || exit 1; \
done
release: clean
expr `cat ${CONFIG_BUILD}` + 1 > ${CONFIG_BUILD}
git commit -m "[release] Bump build number [`cat ${CONFIG_VERSION}`-`cat ${CONFIG_BUILD}`]." ${CONFIG_BUILD}
git push origin master
${MAKE} ${MFLAGS} publish VERSION=`cat ${CONFIG_VERSION}`-`cat ${CONFIG_BUILD}`
publish: npm-register artifacts verify ${TAR} ${RELEASE_DIR} ${PUBLISH_REPO} ${PUBLISH_DIR} ${RELEASE_SUBLIME}
cp ${PUBLISH_ARTIFACTS} ${PUBLISH_DIR}
${PUBLISH_GIT} add .
${PUBLISH_GIT} commit -m "[release] ${VERSION}"
${PUBLISH_GIT} push origin master
${PUBLISH_GIT} push -f origin master:gh-pages
npm publish ${RELEASE_DIR}
npm-register:
if [ "`npm whoami`" != "boltjs" ]; then \
echo 'Register machine for release. Please use - User: "boltjs", Email: "dev@boltjs.io"' ; \
npm adduser ; \
fi
${PROJECTS}:
cd ${PROJECTS_DIR}/$@ && ${MAKE} ${MFLAGS} test
${RELEASE_NPM}: ${RELEASE_DIR}
sed 's/__VERSION__/${VERSION}/g' ${CONFIG_NPM} > $@
${RELEASE_VERSION}: ${RELEASE_DIR}/bin
echo ${VERSION} > $@
${RELEASE_SUBLIME}: ${PUBLISH_REPO}
DATE=`date -u "+%Y-%m-%d %H:%M:%S"` && \
CHANNEL_VERSION=`cat ${CONFIG_VERSION}``cat ${CONFIG_BUILD} | xargs printf "%03d\n"` && \
sed -e 's/__VERSION__/${VERSION}/g' -e "s/__DATE__/$$DATE/g" -e "s/__CHANNEL_VERSION__/$$CHANNEL_VERSION/g" ${CONFIG_SUBLIME} > $@
${TAR}: artifacts ${DIST}
tar cfz ${TAR} -C ${TAR_IMAGE} ${MODULE}-${VERSION}
${SUBLIME_DIST}: ${DIST}
cp ${SUBLIME_PACKAGE} $@
${DIRECTORIES}:
mkdir -p $@
${PUBLISH_REPO}:
[ ! -d ${PUBLISH_REPO} ] || rm -rf ${PUBLISH_REPO}
git clone ${PUBLISH_REPO_URL} ${PUBLISH_REPO}
${PUBLISH_DIR}: ${PUBLISH_REPO}
mkdir -p $@
Jump to Line
Something went wrong with that request. Please try again.