From c11f451f838d450f02f3093c2934d270cd4e9369 Mon Sep 17 00:00:00 2001 From: "Oliver, Jonathan" Date: Fri, 3 Jun 2016 13:43:02 -0600 Subject: [PATCH] Stubbing out various Makefile tasks. --- Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3076774..23e075e 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,22 @@ SOURCE_VERSION := 1.0 +build: + mvn compile + +test: + mvn test + +publish: tag + mvn clean deploy + +tag: version + @sed -i "" "s/0\.0\.0/$(shell git describe)/" pom.xml + @sed -i "" "s/0\.0\.0/$(shell git describe)/" src/main/java/com/smartystreets/api/Version.java + version: $(eval PREFIX := $(SOURCE_VERSION).) $(eval CURRENT := $(shell git describe 2>/dev/null)) $(eval EXPECTED := $(PREFIX)$(shell git tag -l "$(PREFIX)*" | wc -l | xargs expr -1 +)) $(eval INCREMENTED := $(PREFIX)$(shell git tag -l "$(PREFIX)*" | wc -l | xargs expr 0 +)) @if [ "$(CURRENT)" != "$(EXPECTED)" ]; then git tag -a "$(INCREMENTED)" -m "" 2>/dev/null || true; fi - -version2: - @sed -i "" "s/0\.0\.0/$(shell git describe)/" pom.xml - @sed -i "" "s/0\.0\.0/$(shell git describe)/" src/main/java/com/smartystreets/api/Version.java