gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
ant task to save the version number in git
authorDoni Pracner <quinnuendo@gmail.com>
Fri, 19 Jul 2019 14:53:30 +0000 (16:53 +0200)
committerDoni Pracner <quinnuendo@gmail.com>
Fri, 19 Jul 2019 14:53:30 +0000 (16:53 +0200)
build.xml

index 762aef3448059dd8656e15eff8928a9488401f2e..a122a38cda7cd4010998e35f5f93e3ec9a58c5f9 100644 (file)
--- a/build.xml
+++ b/build.xml
             </exec>
     </target>
 
+    <target name="git-version-string" if="version">
+            <!-- explicitly store the new  version string in git -->
+            <!-- needs the version set already, preferably from the command line -->
+            <echo message="version=${version}"/>
+            <dirname file="${version.file}" property="version.file.dir"/>
+            <mkdir dir="${version.file.dir}" />
+            <propertyfile file="${version.file}">
+                    <entry key="version" value="${version}"/>
+            </propertyfile>
+           <!-- remove the first line with the date if you can.
+                for whatever reason Java Properties always writes this
+             -->
+           <exec executable="sed" failifexecutionfails="false">
+             <arg line="-e '1d' -i ${version.file}"/>
+           </exec>
+            <exec executable="git" failifexecutionfails="false">
+                    <arg value="update-index"/>
+                    <arg value="--no-assume-unchanged"/>
+                    <arg value="${version.file}"/>
+            </exec>
+    </target>
+
     <!-- **************************************** -->
     <!-- mjc2wsl related tasks -->
     <!-- **************************************** -->
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner