lib/build/versioners/svn.step in uppercutbuild-0.9.0.346.20100805 vs lib/build/versioners/svn.step in uppercutbuild-1.0.0.0.20100806
- old
+ new
@@ -1,112 +1,113 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<project name="SVNVersioner" default="go">
- <!-- Project UppercuT - http://projectuppercut.org -->
- <!-- DO NOT EDIT THIS FILE - This creates the assembly file to be used by the rest of the application - find out more at http://uppercut.pbwiki.com -->
- <property name="build.config.settings" value="__NONE__" overwrite="false" />
- <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
- <property name="file.current.no_extension" value="svn" />
- <property name="path.to.toplevel" value="..\.." />
- <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
- <property name="folder.build_scripts" value="build" overwrite="false" />
- <property name="folder.build_scripts_custom" value="build.custom\" overwrite="false" />
- <property name="dirs.build_scripts_custom" value="${dirs.current}\${path.to.toplevel}\${folder.build_scripts_custom}\versioners" />
- <property name="repository.path" value="__REPOSITORY_PATH__" overwrite="false" />
- <property name="version.revision" value="0" overwrite="false" />
- <property name="file.custom.step.before" value="${dirs.build_scripts_custom}\${file.current.no_extension}.pre.step" />
- <property name="file.custom.step.after" value="${dirs.build_scripts_custom}\${file.current.no_extension}.post.step" />
- <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}\${file.current.no_extension}.replace.step" />
- <property name="is.replaced" value="false" />
- <property name="fail.build.on.error" value="false" />
-
- <target name="go" depends="run_tasks" />
-
- <target name="run_tasks">
- <echo message="Running ${project::get-name()} tasks." />
- <call target="prepare" if="${target::exists('prepare')}" />
- <call target="custom_tasks_before" if="${target::exists('custom_tasks_before')}" />
- <call target="custom_tasks_replace" if="${target::exists('custom_tasks_replace')}" />
- <call target="run_normal_tasks" if="${not is.replaced}" />
- <call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
- </target>
-
- <target name="run_normal_tasks"
- depends="get_revision, get_externally_provided_revision, set_version_environment_variable"
- description="Generating Assembly File." />
-
- <target name="custom_tasks_before">
- <echo message="Running custom tasks if ${file.custom.step.before} exists." />
- <nant buildfile="${file.custom.step.before}" inheritall="true" if="${file::exists(file.custom.step.before)}" failonerror="${fail.build.on.error}" />
- <exec program="powershell.exe" if="${file::exists(file.custom.step.before + '.ps1')}" failonerror="${fail.build.on.error}">
- <arg value="${path::get-full-path(file.custom.step.before + '.ps1')}" />
- </exec>
- <exec program="ruby.exe" if="${file::exists(file.custom.step.before + '.rb')}" failonerror="${fail.build.on.error}">
- <arg value="${path::get-full-path(file.custom.step.before + '.rb')}" />
- </exec>
- </target>
-
- <target name="custom_tasks_replace">
- <echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace)}" />
- <nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" failonerror="${fail.build.on.error}" />
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.ps1')}" />
- <exec program="powershell.exe" if="${file::exists(file.custom.step.replace + '.ps1')}" failonerror="${fail.build.on.error}" >
- <arg value="${path::get-full-path(file.custom.step.replace + '.ps1')}" />
- </exec>
- <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.rb')}" />
- <exec program="ruby.exe" if="${file::exists(file.custom.step.replace + '.rb')}" failonerror="${fail.build.on.error}" >
- <arg value="${path::get-full-path(file.custom.step.replace + '.rb')}" />
- </exec>
- </target>
-
- <target name="get_revision">
- <echo message="Getting revision number from working directory ${directory::get-parent-directory(dirs.current)} or remotely at ${repository.path}."/>
- <!-- try to update the revision -->
- <exec
- program="svn"
- commandline="info ${dirs.current}\${path.to.toplevel}\ --xml"
- output="_revision.xml"
- failonerror="false"/>
- <xmlpeek
- file="_revision.xml"
- xpath="/info/entry/commit/@revision"
- property="version.revision"
- failonerror="false"/>
- <exec
- program="svn"
- commandline="info ${repository.path} --xml"
- output="_revision.xml"
- failonerror="false"
- if="${version.revision == '0'}"
- />
- <xmlpeek
- file="_revision.xml"
- xpath="/info/entry/@revision"
- property="version.revision"
- failonerror="false"
- if="${version.revision == '0'}"
- />
- <delete file="_revision.xml" failonerror="false" />
- </target>
-
- <target name="get_externally_provided_revision">
- <property name="version.revision" value="${environment::get-variable('BUILD_VCS_NUMBER')}" if="${version.revision == '0' and environment::variable-exists('BUILD_VCS_NUMBER')}" />
- </target>
-
- <target name="set_version_environment_variable">
- <setenv name="uc.app.revision" value="${version.revision}"/>
- <setenv name="uc.app.revision.hash" value="${version.revision}"/>
- </target>
-
-
- <target name="custom_tasks_after">
- <echo message="Running custom tasks if ${file.custom.step.after} exists." />
- <nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="${fail.build.on.error}" />
- <exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
- <arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
- </exec>
- <exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
- <arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
- </exec>
- </target>
-
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="SVNVersioner" default="go">
+ <!-- Project UppercuT - http://projectuppercut.org -->
+ <!-- DO NOT EDIT THIS FILE - This creates the assembly file to be used by the rest of the application - find out more at http://uppercut.pbwiki.com -->
+ <property name="build.config.settings" value="__NONE__" overwrite="false" />
+ <include buildfile="${build.config.settings}" if="${file::exists(build.config.settings)}" />
+ <property name="path.separator" value="${string::trim(path::combine(' ', ' '))}" />
+ <property name="file.current.no_extension" value="svn" />
+ <property name="path.to.toplevel" value="..${path.separator}.." />
+ <property name="dirs.current" value="${directory::get-parent-directory(project::get-buildfile-path())}" />
+ <property name="folder.build_scripts" value="build" overwrite="false" />
+ <property name="folder.build_scripts_custom" value="build.custom${path.separator}" overwrite="false" />
+ <property name="dirs.build_scripts_custom" value="${dirs.current}${path.separator}${path.to.toplevel}${path.separator}${folder.build_scripts_custom}${path.separator}versioners" />
+ <property name="repository.path" value="__REPOSITORY_PATH__" overwrite="false" />
+ <property name="version.revision" value="0" overwrite="false" />
+ <property name="file.custom.step.before" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.pre.step" />
+ <property name="file.custom.step.after" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.post.step" />
+ <property name="file.custom.step.replace" value="${dirs.build_scripts_custom}${path.separator}${file.current.no_extension}.replace.step" />
+ <property name="is.replaced" value="false" />
+ <property name="fail.build.on.error" value="false" />
+
+ <target name="go" depends="run_tasks" />
+
+ <target name="run_tasks">
+ <echo message="Running ${project::get-name()} tasks." />
+ <call target="prepare" if="${target::exists('prepare')}" />
+ <call target="custom_tasks_before" if="${target::exists('custom_tasks_before')}" />
+ <call target="custom_tasks_replace" if="${target::exists('custom_tasks_replace')}" />
+ <call target="run_normal_tasks" if="${not is.replaced}" />
+ <call target="custom_tasks_after" if="${target::exists('custom_tasks_after')}" />
+ </target>
+
+ <target name="run_normal_tasks"
+ depends="get_revision, get_externally_provided_revision, set_version_environment_variable"
+ description="Generating Assembly File." />
+
+ <target name="custom_tasks_before">
+ <echo message="Running custom tasks if ${file.custom.step.before} exists." />
+ <nant buildfile="${file.custom.step.before}" inheritall="true" if="${file::exists(file.custom.step.before)}" failonerror="${fail.build.on.error}" />
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.before + '.ps1')}" failonerror="${fail.build.on.error}">
+ <arg value="${path::get-full-path(file.custom.step.before + '.ps1')}" />
+ </exec>
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.before + '.rb')}" failonerror="${fail.build.on.error}">
+ <arg value="${path::get-full-path(file.custom.step.before + '.rb')}" />
+ </exec>
+ </target>
+
+ <target name="custom_tasks_replace">
+ <echo message="Running custom tasks instead of normal tasks if ${file.custom.step.replace} exists." />
+ <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace)}" />
+ <nant buildfile="${file.custom.step.replace}" inheritall="true" if="${file::exists(file.custom.step.replace)}" failonerror="${fail.build.on.error}" />
+ <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.ps1')}" />
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.replace + '.ps1')}" failonerror="${fail.build.on.error}" >
+ <arg value="${path::get-full-path(file.custom.step.replace + '.ps1')}" />
+ </exec>
+ <property name="is.replaced" value="true" if="${file::exists(file.custom.step.replace + '.rb')}" />
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.replace + '.rb')}" failonerror="${fail.build.on.error}" >
+ <arg value="${path::get-full-path(file.custom.step.replace + '.rb')}" />
+ </exec>
+ </target>
+
+ <target name="get_revision">
+ <echo message="Getting revision number from working directory ${directory::get-parent-directory(dirs.current)} or remotely at ${repository.path}."/>
+ <!-- try to update the revision -->
+ <exec
+ program="svn"
+ commandline="info ${dirs.current}${path.separator}${path.to.toplevel}${path.separator} --xml"
+ output="_revision.xml"
+ failonerror="false"/>
+ <xmlpeek
+ file="_revision.xml"
+ xpath="/info/entry/commit/@revision"
+ property="version.revision"
+ failonerror="false"/>
+ <exec
+ program="svn"
+ commandline="info ${repository.path} --xml"
+ output="_revision.xml"
+ failonerror="false"
+ if="${version.revision == '0'}"
+ />
+ <xmlpeek
+ file="_revision.xml"
+ xpath="/info/entry/@revision"
+ property="version.revision"
+ failonerror="false"
+ if="${version.revision == '0'}"
+ />
+ <delete file="_revision.xml" failonerror="false" />
+ </target>
+
+ <target name="get_externally_provided_revision">
+ <property name="version.revision" value="${environment::get-variable('BUILD_VCS_NUMBER')}" if="${version.revision == '0' and environment::variable-exists('BUILD_VCS_NUMBER')}" />
+ </target>
+
+ <target name="set_version_environment_variable">
+ <setenv name="uc.app.revision" value="${version.revision}"/>
+ <setenv name="uc.app.revision.hash" value="${version.revision}"/>
+ </target>
+
+
+ <target name="custom_tasks_after">
+ <echo message="Running custom tasks if ${file.custom.step.after} exists." />
+ <nant buildfile="${file.custom.step.after}" inheritall="true" if="${file::exists(file.custom.step.after)}" failonerror="${fail.build.on.error}" />
+ <exec program="powershell.exe" if="${file::exists(file.custom.step.after + '.ps1')}" failonerror="${fail.build.on.error}" >
+ <arg value="${path::get-full-path(file.custom.step.after + '.ps1')}" />
+ </exec>
+ <exec program="ruby.exe" if="${file::exists(file.custom.step.after + '.rb')}" failonerror="${fail.build.on.error}" >
+ <arg value="${path::get-full-path(file.custom.step.after + '.rb')}" />
+ </exec>
+ </target>
+
</project>
\ No newline at end of file