Skip to content

Commit

Permalink
Cross-platform Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgo committed Oct 2, 2020
1 parent 23d20f3 commit d9776a8
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions Makefile
@@ -1,39 +1,32 @@
# platform-specificity
ifdef ComSpec
/ := $(strip \)
else
/ := /
endif

build: # builds the production version
@node_modules$/.bin$/tsc -p tsconfig-build.json
@${CURDIR}/node_modules/.bin/tsc -p tsconfig-build.json

clean: # removes all build artifacts
@rm -rf dist

coverage: build # measures test coverage
node_modules/.bin/nyc node_modules/.bin/mocha --require source-map-support/register test/*-test.ts
node_modules/.bin/nyc report --reporter=text-lcov | node_modules/.bin/coveralls
${CURDIR}/node_modules/.bin/nyc node_modules/.bin/mocha --require source-map-support/register test/*-test.ts
${CURDIR}/node_modules/.bin/nyc report --reporter=text-lcov | node_modules/.bin/coveralls

fix: # runs the fixers
tslint --project . --fix
node_modules/.bin/prettier --write .
${CURDIR}/node_modules/.bin/prettier --write .

help: # prints all make targets
@cat Makefile | grep '^[^ ]*:' | grep -v '.PHONY' | grep -v help | sed 's/:.*#/#/' | column -s "#" -t

lint: # runs the linters
node_modules/.bin/tslint --project .
node_modules/.bin/prettier -l .
${CURDIR}/node_modules/.bin/tslint --project .
${CURDIR}/node_modules/.bin/prettier -l .

setup: # sets up the installation on this machine
node_modules/o-tools/bin/check-paths
${CURDIR}/node_modules/o-tools/bin/check-paths
yarn install

test: build lint unit # runs all tests

unit: # runs the unit tests
@node_modules/.bin/mocha test/*-test.ts --reporter dot
@${CURDIR}/node_modules/.bin/mocha test/*-test.ts --reporter dot

update: # updates the dependencies
yarn upgrade --latest

0 comments on commit d9776a8

Please sign in to comment.