Skip to content

Commit

Permalink
Adds inline make documentation and 'help' command. (mattermost#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkraft authored and crspeller committed Dec 6, 2017
1 parent 087964d commit 413f93e
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.PHONY: build test run clean stop check-style run-unit emojis
.PHONY: build test run clean stop check-style run-unit emojis help

BUILD_SERVER_DIR = ../mattermost-server
EMOJI_TOOLS_DIR = ./build/emoji

check-style: .yarninstall
check-style: .yarninstall ## Checks JS file for ESLint confirmity
@echo Checking for style guide compliance

yarn run check

test: .yarninstall
test: .yarninstall ## Runs tests
@echo Running jest unit/component testing

yarn run test
Expand All @@ -21,7 +21,7 @@ test: .yarninstall

touch $@

package: build
package: build ## Packages app
@echo Packaging webapp

mkdir tmp
Expand All @@ -30,25 +30,24 @@ package: build
mv tmp/client dist
rmdir tmp


build: .yarninstall
build: .yarninstall ## Builds the app
@echo Building mattermost Webapp

rm -rf dist

yarn run build

run: .yarninstall
run: .yarninstall ## Runs app
@echo Running mattermost Webapp for development

yarn run run &

run-fullmap: .yarninstall
run-fullmap: .yarninstall ## Runs the app with the JS mapped to source (good for debugger)
@echo FULL SOURCE MAP Running mattermost Webapp for development FULL SOURCE MAP

yarn run run-fullmap &

stop:
stop: ## Stops webpack
@echo Stopping changes watching

ifeq ($(OS),Windows_NT)
Expand All @@ -60,7 +59,7 @@ else
done
endif

clean:
clean: ## Clears cached; deletes node_modules and dist directories
@echo Cleaning Webapp

yarn cache clean
Expand All @@ -69,7 +68,11 @@ clean:
rm -rf node_modules
rm -f .yarninstall

emojis:
emojis: ## Creates emoji JSX file and extracts emoji images from the system font
gem install bundler
bundle install --gemfile=$(EMOJI_TOOLS_DIR)/Gemfile
BUNDLE_GEMFILE=$(EMOJI_TOOLS_DIR)/Gemfile bundle exec $(EMOJI_TOOLS_DIR)/make-emojis

## Help documentatin à la https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

0 comments on commit 413f93e

Please sign in to comment.