Skip to content

Instantly share code, notes, and snippets.

@nshaw
Created September 5, 2012 15:31
Show Gist options
  • Save nshaw/3638482 to your computer and use it in GitHub Desktop.
Save nshaw/3638482 to your computer and use it in GitHub Desktop.
Patch tool ant targets
<target name="patching-init">
<property name="patching-tool.dir" value="${build.path}/patching-tool"/>
<property name="patches.dir" value="${patching-tool.dir}/patches"/>
<delete dir="${patching-tool.dir}"/>
<mkdir dir="${patches.dir}"/>
<unzip src="${bundles.dir}/patching-tool-6.zip" dest="${build.path}"/>
<copy todir="${patches.dir}">
<fileset dir="${bundles.dir}/patches" includes="*"/>
</copy>
<exec dir="${patching-tool.dir}" executable="chmod">
<arg line="+x patching-tool.sh"/>
</exec>
<!-- Copy the profile.properties into place to configure the tool -->
<copy file="${root.project.path}/patching_profile.properties"
todir="${patching-tool.dir}"
filtering="true">
<filterset begintoken="%" endtoken="%">
<filter token="app.server.dir" value="${app.server.dir}"/>
</filterset>
</copy>
</target>
<path id="groovy.classpath">
<fileset dir="${build.path}" includes="**/groovy.jar,**/asm.jar,**/antlr2.jar"/>
</path>
<taskdef name="groovy"
classname="org.codehaus.groovy.ant.Groovy"
classpathref="groovy.classpath"/>
<target name="detect-patch-conflicts" depends="patching-init">
<groovy src="detect-patch-conflicts.groovy"/>
<fail if="detected.patch.conflict"
message="A patch conflict was detected."/>
</target>
<target name="deploy-patches" depends="detect-patch-conflicts"
description="Deploy patches and hot fixes provided by Liferay Support">
<!-- Just for info purposes to document which patches are in place -->
<exec dir="${patching-tool.dir}" executable="./patching-tool.sh">
<arg line="patching_profile info"/>
</exec>
<!-- Install the patches -->
<exec dir="${patching-tool.dir}" executable="./patching-tool.sh">
<arg line="patching_profile install"/>
</exec>
</target>
<target name="revert-patches" depends="patching-init">
<!-- Just for info purposes to document which patches are in place -->
<exec dir="${patching-tool.dir}" executable="./patching-tool.sh">
<arg line="patching_profile info"/>
</exec>
<!-- Install the patches -->
<exec dir="${patching-tool.dir}" executable="./patching-tool.sh">
<arg line="patching_profile revert"/>
</exec>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment