From d8ffefd36b660f78b827f2d1463487e29acf5750 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 12 Aug 2012 12:44:23 -0400 Subject: [PATCH] Add support for stamping the version file and committing it. --- Makefile | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 10bb605..caf3e9c 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,15 @@ # the terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or any later version. +VERSION_MAJOR=0 +VERSION_MINOR=8 +VERSION_NAMESPACE=armadillo.Version +VERSION_FILE=frontend/version.js.proto2 +VERSION_SOURCE=$(basename $(VERSION_FILE)) + FRONTEND_SOURCES=frontend/jquery-1.7.1.js \ frontend/utils.js \ - frontend/version.js \ + $(VERSION_SOURCE) \ frontend/tv_renamer.js \ frontend/path_control.js \ frontend/actor.js \ @@ -15,9 +21,7 @@ FRONTEND_SOURCES=frontend/jquery-1.7.1.js \ frontend/main.js FRONTEND_BIN=frontend/armadillo.js -VERSION_MAJOR=0 -VERSION_MINOR=8 -VERSION_FILE=frontend/version.js.proto2 +all: backend dev backend: go build -v . @@ -44,9 +48,15 @@ version: BUILD=$(shell gitcrement current) version: @echo "// This file is automatically generated." > $(VERSION_FILE) @echo >> $(VERSION_FILE) - @echo "$.namespace('armadillo.Version');" >> $(VERSION_FILE) + @echo "$$.namespace('$(VERSION_NAMESPACE)');" >> $(VERSION_FILE) @echo >> $(VERSION_FILE) - echo "armadillo.Version.MAJOR = $(VERSION_MAJOR);" >> $(VERSION_FILE) - echo "armadillo.Version.MINOR = $(VERSION_MINOR);" >> $(VERSION_FILE) - echo "armadillo.Version.BUILD = $(BUILD);" >> $(VERSION_FILE) - echo "armadillo.Version.STAMP = $(STAMP);" >> $(VERSION_FILE) + echo "$(VERSION_NAMESPACE).MAJOR = $(VERSION_MAJOR);" >> $(VERSION_FILE) + echo "$(VERSION_NAMESPACE).MINOR = $(VERSION_MINOR);" >> $(VERSION_FILE) + echo "$(VERSION_NAMESPACE).BUILD = $(BUILD);" >> $(VERSION_FILE) + echo "$(VERSION_NAMESPACE).STAMP = $(STAMP);" >> $(VERSION_FILE) + +stamp_version: stamp version + cp $(VERSION_FILE) $(VERSION_SOURCE) + git commit $(VERSION_SOURCE) \ + --author='Armadillo Build Script ' \ + -m 'Stamp version.js @ $(shell gitcrement current)' -- 2.22.5