Skip to content

Commit

Permalink
Reworks build
Browse files Browse the repository at this point in the history
- Changes build target to ./build/
- Adds `make watch`
- Adds duo.json to clean list

Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
  • Loading branch information
chrissrogers committed Mar 17, 2015
1 parent b5ab08d commit 794ac14
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ npm-debug.log

components/duo.json

build

test/build.js
test/components
test/server/pid.txt

/recurly.js
/recurly.min.js
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
BIN = node_modules/.bin
DUO = $(BIN)/duo
MINIFY = $(BIN)/uglifyjs
WATCH = $(BIN)/wr
DELEGATE = test test-browser test-sauce test-coverage

recurly.js: node_modules
@$(DUO) --global recurly --stdout index.js > recurly.js
@$(MINIFY) recurly.js --output recurly.min.js
BUILD = ./build
WATCH_FILES = lib index.js component.json Makefile

build: node_modules
@mkdir -p $(BUILD)
@$(DUO) --quiet --stdout --global recurly index.js > $(BUILD)/recurly.js
@$(MINIFY) $(BUILD)/recurly.js --output $(BUILD)/recurly.min.js

watch: node_modules
@$(WATCH) make $(WATCH_FILES)

node_modules: package.json
@npm install --silent

$(DELEGATE): recurly.js
$(DELEGATE): build
@cd test && make $@

clean:
@rm -rf node_modules recurly.js recurly.min.js
@rm -rf node_modules components/duo.json $(BUILD)
@cd test && make $@

.PHONY: recurly.js
.PHONY: clean test test-browser
.PHONY: test-sauce test-coverage
.PHONY: clean build test test-browser test-sauce test-coverage
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"jade": "1.x",
"mocha-phantomjs": "3.5.2",
"gravy": "0.x",
"debug": "0.x"
"debug": "0.x",
"wr": "*"
}
}
2 changes: 1 addition & 1 deletion test/server/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ html
head
title recurly.js tests
link(rel='stylesheet', href='/test/server/mocha.css')
script(src='/recurly.js')
script(src='/build/recurly.js')
script(src='/test/server/sinon.js')
script(src='/test/server/mocha.js')
script.
Expand Down

0 comments on commit 794ac14

Please sign in to comment.