diff options
author | Alexander Early <alexander.early@gmail.com> | 2016-01-21 14:39:04 -0800 |
---|---|---|
committer | Alexander Early <alexander.early@gmail.com> | 2016-01-21 14:39:04 -0800 |
commit | a191cb4a07a271dd735b5de5438724dc5557e86b (patch) | |
tree | 8f47c4ee01dfe8c5f9f80e0a9d52c3b080e9f300 /Makefile | |
parent | d8bdb7a0d38b9b444d63ee7cd139dafb0b1486e2 (diff) | |
download | async-a191cb4a07a271dd735b5de5438724dc5557e86b.tar.gz |
clean up makefile, add smoke test to build process
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 37 |
1 files changed, 26 insertions, 11 deletions
@@ -1,3 +1,7 @@ +# This makefile is meant to be run on OSX/Linux. Make sure any artifacts +# created here are checked in so people on all platforms can run npm scripts. +# This build should be run once per release. + export PATH := ./node_modules/.bin/:$(PATH):./bin/ PACKAGE = asyncjs @@ -14,6 +18,7 @@ JS_SRC = $(shell find lib/ -type f -name '*.js') package.json LINT_FILES = lib/ test/ mocha_test/ $(shell find perf/ -maxdepth 2 -type f) support/ gulpfile.js karma.conf.js UMD_BUNDLE = $(BUILDDIR)/async.js +UMD_BUNDLE_MIN = $(BUILDDIR)/async.min.js CJS_BUNDLE = $(BUILDDIR)/index.js all: lint test clean build @@ -21,9 +26,6 @@ all: lint test clean build test: npm test -test-build: build - mocha support/build.test.js - clean: rm -rf $(BUILDDIR) rm -rf $(DIST) @@ -32,7 +34,7 @@ lint: jshint $(LINT_FILES) jscs $(LINT_FILES) - +# Compile the ES6 modules to singular bundles, and individual bundles build-bundle: build-modules $(UMD_BUNDLE) $(CJS_BUNDLE) build-modules: @@ -44,16 +46,29 @@ $(UMD_BUNDLE): $(JS_SRC) $(CJS_BUNDLE): $(JS_SRC) $(BABEL_NODE) $(SCRIPTS)/build/aggregate-cjs.js -.PHONY: build-modules build-bundle +# Create the minified UMD versions and copy them to dist/ for bower +build-dist: $(DIST) $(DIST)/async.js $(DIST)/async.min.js $(UMD_BUNDLE_MIN) + +$(DIST): + mkdir -p $(DIST)/ -build-dist: - mkdir -p $(DIST) - cp $(BUILDDIR)/async.js $(DIST)/async.js - $(UGLIFY) $(DIST)/async.js -mc \ +$(UMD_BUNDLE_MIN): $(UMD_BUNDLE) + $(UGLIFY) $< --mangle --compress \ --source-map $(DIST)/async.min.map \ - -o $(DIST)/async.min.js + -o $@ + +$(DIST)/async.js: $(UMD_BUNDLE) + cp $< $@ + +$(DIST)/async.min.js: $(UMD_BUNDLE_MIN) + cp $< $@ + +test-build: + mocha support/build.test.js + +.PHONY: build-modules build-bundle build-dist test-build -build: clean build-bundle build-dist +build: clean build-bundle build-dist test-build .PHONY: test lint build all clean |