Makefile in countless-1.0.0 vs Makefile in countless-1.1.0

- old
+ new

@@ -19,23 +19,24 @@ GEMFILES_DIR ?= gemfiles BIN_DIR ?= bin # Host binaries BASH ?= bash +CHMOD ?= chmod COMPOSE ?= docker-compose +CURL ?= curl ID ?= id MKDIR ?= mkdir RM ?= rm -CURL ?= curl -CHMOD ?= chmod # Container binaries -BUNDLE ?= bundle APPRAISAL ?= appraisal +BUNDLE ?= bundle +GUARD ?= guard RAKE ?= rake +RSPEC ?= rspec RUBOCOP ?= rubocop -GUARD ?= guard YARD ?= yard # Files GEMFILES ?= $(subst _,-,$(patsubst $(GEMFILES_DIR)/%.gemfile,%,\ $(wildcard $(GEMFILES_DIR)/*.gemfile))) @@ -59,13 +60,17 @@ all: # Countless # # install Install the dependencies - # test Run the whole test suite + # update Update the local Gemset dependencies # clean Clean the dependencies # + # test Run the whole test suite + # test-style Test the code styles + # watch Watch for code changes and rerun the test suite + # # docs Generate the Ruby documentation of the library # stats Print the code statistics (library and test suite) # notes Print all the notes from the code # release Release a new Gem version (maintainers only) # @@ -80,17 +85,27 @@ @$(MKDIR) -p $(VENDOR_DIR) @$(call run-shell,$(BUNDLE) check || $(BUNDLE) install --path $(VENDOR_DIR)) @$(call run-shell,$(BUNDLE) exec $(APPRAISAL) install) @$(MAKE) --no-print-directory .fetch-cloc +update: + # Install the dependencies + @$(MKDIR) -p $(VENDOR_DIR) + @$(call run-shell,$(BUNDLE) update) + @$(call run-shell,$(BUNDLE) exec $(APPRAISAL) update) + .fetch-cloc: # Fetch the CLOC ($(CLOC_VERSION)) binary ifeq ("$(wildcard $(BIN_DIR)/cloc)","") @$(CURL) -L '$(CLOC_URL)' -o '$(BIN_DIR)/cloc' @$(CHMOD) +x '$(BIN_DIR)/cloc' endif +watch: install .interactive + # Watch for code changes and rerun the test suite + @$(call run-shell,$(BUNDLE) exec $(GUARD)) + test: \ test-specs \ test-style test-specs: .fetch-cloc @@ -98,33 +113,41 @@ @$(call run-shell,$(BUNDLE) exec $(RAKE) stats spec) $(TEST_GEMFILES): GEMFILE=$(@:test-%=%) $(TEST_GEMFILES): # Run the whole test suite ($(GEMFILE)) - @$(call run-shell,$(BUNDLE) exec $(APPRAISAL) $(GEMFILE) $(RAKE)) + @$(call run-shell,$(BUNDLE) exec $(APPRAISAL) $(GEMFILE) $(RSPEC)) test-style: \ test-style-ruby test-style-ruby: # Run the static code analyzer (rubocop) @$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a) -watch: install .interactive - # Watch for code changes and rerun the test suite - @$(call run-shell,$(BUNDLE) exec $(GUARD)) - clean: # Clean the dependencies @$(RM) -rf $(VENDOR_DIR) + @$(RM) -rf $(GEMFILES_DIR)/vendor + @$(RM) -rf $(GEMFILES_DIR)/*.lock + @$(RM) -rf .bundle .yardoc coverage pkg Gemfile.lock doc/api \ + .rspec_status clean-containers: # Clean running containers ifeq ($(MAKE_ENV),docker) @$(COMPOSE) down endif -distclean: clean clean-containers +clean-images: + # Clean build images +ifeq ($(MAKE_ENV),docker) + @-$(DOCKER) images | $(GREP) $(shell basename "`pwd`") \ + | $(AWK) '{ print $$3 }' \ + | $(XARGS) -rn1 $(DOCKER) rmi -f +endif + +distclean: clean clean-containers clean-images shell: # Run an interactive shell on the container @$(call run-shell,$(BASH) -i)