From 695bb184f81df90791a46258ba57c5d9ed56236b Mon Sep 17 00:00:00 2001
From: Andy Summers <andrew.summers@wisc.edu>
Date: Fri, 15 Jul 2016 13:35:29 -0500
Subject: [PATCH] Prepare project for first release

---
 build.xml     | 21 +++++++++++++++++++++
 composer.json |  1 +
 2 files changed, 22 insertions(+)

diff --git a/build.xml b/build.xml
index cb36d44..1431c16 100644
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project name="uw-php-security" default="main">
 
+    <property name="build.workingDirectory" value="${project.basedir}" />
     <property name="composer.version" value="1.1.3"/>
+    <property name="git.upstream" value="git@git.doit.wisc.edu/adi-ia/uw-php-security.git" />
+    <property name="release.targetDirectory" value="${project.basedir}/target" />
+    <property name="release.version" value="false" />
 
     <!-- Default build target -->
     <target name="main" description="Default build target">
@@ -47,4 +51,21 @@
         </if>
     </target>
 
+    <target name="release">
+        <if>
+            <isfalse value="${release.version}" />
+            <then>
+                <fail msg="release.version property must be set" />
+            </then>
+        </if>
+
+        <property name="build.workingDirectory" value="${release.targetDirectory}" override="true" />
+        <delete dir="${build.workingDirectory" quiet="true" />
+        <gitclone repository="${git.upstream}" targetPath="${build.workingDirectory}" />
+        <phingcall target="test" />
+        <gittag name="${release.version}" repository="${release.targetDirectory}" />
+        <gitpush repository="${release.targetDirectory}" refspec="${release.version}" />
+        <delete dir="target" quiet="true" />
+    </target>
+
 </project>
diff --git a/composer.json b/composer.json
index d0b9a65..3fff86c 100644
--- a/composer.json
+++ b/composer.json
@@ -4,6 +4,7 @@
   "type": "library",
   "homepage": "https://git.doit.wisc.edu/adi-ia/uw-php-security",
   "license": "Apache-2.0",
+  "version": "1.0.0",
   "authors": [{
     "name": "UW-Madison DoIT ADI Integrated Applications",
     "email": "adi-ia@lists.wisc.edu",
-- 
GitLab