Browse Source

Add version bumping task.

mark_story 12 years ago
parent
commit
021e84af57
1 changed files with 28 additions and 1 deletions
  1. 28 1
      Makefile

+ 28 - 1
Makefile

@@ -1,7 +1,10 @@
-.PHONY: help
 
 VERSION="unset"
 
+
+ALL: help
+.PHONY: help
+
 help:
 	@echo "CakePHP Makefile"
 	@echo "================"
@@ -15,3 +18,27 @@ help:
 	@echo ""
 	@echo "bump-version"
 	@echo "  Bumps the version to VERSION"
+
+
+# Download composer
+composer.phar:
+	curl -sS https://getcomposer.org/installer | php
+
+# Install dependencies
+install: composer.phar
+	php composer.phar install
+
+test: install
+	vendor/bin/phpunit
+
+# Update VERSION.txt to new version.
+bump-version:
+	@if [ $(VERSION) = "unset" ]; \
+	then \
+		echo "You must specify a version to bump to."; \
+		exit 1; \
+	fi;
+	# Work around bash being bad.
+	mv VERSION.txt VERSION.old
+	cat VERSION.old | sed s'/^[0-9]\.[0-9]\.[0-9].*/$(VERSION)/' > VERSION.txt
+	rm VERSION.old