Skip to content

Commit

Permalink
Merge pull request #758 from amqp-node/commit-defs
Browse files Browse the repository at this point in the history
Commit defs
  • Loading branch information
cressie176 authored Nov 18, 2024
2 parents 64d1c1e + 368074a commit 0a87ee4
Show file tree
Hide file tree
Showing 6 changed files with 5,580 additions and 21 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
*~
lib/defs.js
scratch
node_modules/
bin/amqp-rabbitmq-0.9.1.json
etc/
coverage/
/.idea/
Expand Down
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ scratch
# do not ignore lib/defs.js, we need that
# node_modules is ignored anyway
.travis.yml
bin/amqp-rabbitmq-0.9.1.json
etc/
coverage/
35 changes: 19 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,36 @@ _MOCHA=./node_modules/.bin/_mocha
UGLIFY=./node_modules/.bin/uglifyjs
NYC=./node_modules/.bin/nyc

.PHONY: test test-all-nodejs all clean coverage
.PHONY: test test-all-nodejs coverage lib/defs.js

all: lib/defs.js
error:
@echo "Please choose one of the following targets: test, test-all-nodejs, coverage, lib/defs.js"
@exit 1

clean:
rm lib/defs.js bin/amqp-rabbitmq-0.9.1.json
rm -rf ./coverage

lib/defs.js: $(UGLIFY) bin/generate-defs.js bin/amqp-rabbitmq-0.9.1.json
(cd bin; node ./generate-defs.js > ../lib/defs.js)
$(UGLIFY) ./lib/defs.js -o ./lib/defs.js \
-c 'sequences=false' --comments \
-b 'indent-level=2' 2>&1 | (grep -v 'WARN' || true)

test: lib/defs.js
test:
$(MOCHA) --check-leaks -u tdd --exit test/

test-all-nodejs: lib/defs.js
test-all-nodejs:
for v in $(NODEJS_VERSIONS); \
do echo "-- Node version $$v --"; \
nave use $$v $(MOCHA) -u tdd --exit -R progress test; \
done

coverage: $(NYC) lib/defs.js
$(NYC) --reporter=lcov --reporter=text $(_MOCHA) -u tdd -R progress test/
coverage: $(NYC)
$(NYC) --clean --reporter=lcov --reporter=text $(_MOCHA) -u tdd --exit -R progress test/
@echo "HTML report at file://$$(pwd)/coverage/lcov-report/index.html"

lib/defs.js: clean bin/generate-defs test

clean:
rm -f lib/defs.js bin/amqp-rabbitmq-0.9.1.json

bin/generate-defs: $(UGLIFY) bin/generate-defs.js bin/amqp-rabbitmq-0.9.1.json
(cd bin; node ./generate-defs.js > ../lib/defs.js)
$(UGLIFY) ./lib/defs.js -o ./lib/defs.js \
-c 'sequences=false' --comments \
-b 'indent-level=2' 2>&1 | (grep -v 'WARN' || true)

bin/amqp-rabbitmq-0.9.1.json:
curl -L $(AMQP_JSON) > $@

Expand Down
Loading

0 comments on commit 0a87ee4

Please sign in to comment.