Skip to content

Commit

Permalink
Stubbing out various Makefile tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver, Jonathan committed Jun 3, 2016
1 parent 0c0c7fe commit c11f451
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c11f451

Please sign in to comment.