Sha256: 113f7e5b08a5bf186d8bbd2a7f2803eb123dafdee7efb490cd72aabc4c9c4177

Contents?: true

Size: 1.72 KB

Versions: 9

Compression:

Stored size: 1.72 KB

Contents

SHELL := /usr/bin/env bash
RUBY_SOURCE_FILES = $(shell find . -name "*.rb")
GEMSPEC = $(shell find . -name "*.gemspec")
LIBNAME := $(shell basename $$(dirname $$(pwd)))
GEM := cucumber-$(LIBNAME)-$(NEW_VERSION).gem
IS_TESTDATA = $(findstring -testdata,${CURDIR})

# https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))

default: .tested
.PHONY: default

.deps: Gemfile.lock
	touch $@

Gemfile.lock: Gemfile $(GEMSPEC)
	bundle install
	touch $@

.tested: .deps $(RUBY_SOURCE_FILES)
	bundle exec rspec --color
	touch $@

update-dependencies:
	./scripts/update-gemspec
.PHONY: update-dependencies

ifdef NEW_VERSION
ifneq (,$(GEMSPEC))
gem: $(GEM)
else
gem:
	@echo "Not building gem because there is no gemspec"
endif
endif
.PHONY: gem

$(GEM): .tested
	gem build $(GEMSPEC)
	test -s "$(GEM)" || { echo "Gem not built: $(GEM)"; exit 1; }

remove-local-dependencies:
	cat Gemfile | sed 's/^gem /#gem /' > Gemfile.tmp
	mv Gemfile.tmp Gemfile
.PHONY: remove-local-dependencies

pre-release: remove-local-dependencies update-version update-dependencies gem
.PHONY: pre-release

update-version:
ifeq ($(IS_TESTDATA),-testdata)
	# no-op
else
ifdef NEW_VERSION
	@echo "$(NEW_VERSION)" > VERSION
endif
endif
.PHONY: update-version

publish: gem
ifeq ($(IS_TESTDATA),-testdata)
	# no-op
else
ifneq (,$(GEMSPEC))
	gem push $(GEM)
else
	@echo "Not publishing because there is no gemspec"
endif
endif
.PHONY: publish

post-release:
	cat Gemfile | sed 's/^#gem /gem /' > Gemfile.tmp
	mv Gemfile.tmp Gemfile
.PHONY: post-release

clean: clean-ruby
.PHONY: clean

clean-ruby:
	rm -rf .deps .linked .tested* Gemfile.lock *.gem acceptance
.PHONY: clean-ruby

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cucumber-cucumber-expressions-12.1.1 default.mk
cucumber-cucumber-expressions-12.1.0 default.mk
cucumber-cucumber-expressions-12.0.1 default.mk
cucumber-cucumber-expressions-12.0.0 default.mk
cucumber-cucumber-expressions-11.0.2 default.mk
cucumber-cucumber-expressions-11.0.1 default.mk
cucumber-cucumber-expressions-11.0.0 default.mk
cucumber-cucumber-expressions-10.3.0 default.mk
cucumber-cucumber-expressions-10.2.2 default.mk