MINOR Consolidated 'archive' and 'archiveTask' targets in build.xml (they belong into one definition)

This commit is contained in:
Ingo Schommer 2012-02-01 17:54:36 +01:00
parent 7464a47d83
commit 1b8d1bebc7
1 changed files with 65 additions and 71 deletions

136
build.xml
View File

@ -108,74 +108,6 @@ Options:
<echo msg="checked out ${tagname} tag/branch in '${reponame}' git repository" />
</target>
<!-- Archives the base folder as a *.tar.gz or *.zip, without version information -->
<target name="archiveTask" if="archivetype,basedir,archivename,archivefilename">
<!-- Copy into a new folder, and tar the whole folder in order to avoid toplevel extracts -->
<php function="sys_get_temp_dir" returnProperty="systmp" />
<property name="tmp" value="${systmp}/archiveTask/" />
<copy todir="${tmp}/${archivename}">
<fileset dir="${basedir}">
<include name="**/**" />
<exclude name="assets/**" />
<exclude name="mysite/local.conf.php" />
<exclude name="mysite/db.conf.php" />
<exclude name="**/*.log" />
<exclude name="**/.svn/**" />
<exclude name="**/.git/**" />
<exclude name="**/.project" /> <!-- remove eclipse configuration file -->
<exclude name="**/.buildpath" />
<exclude name="**/.settings" />
<exclude name="**/.idea/**" /> <!-- remove phpstorm configuration file -->
<exclude name="tools/**" />
<exclude name="**/tests/**" />
<exclude name="cms/docs/**" />
<exclude name="sapphire/docs/**" />
<exclude name="build.xml" />
<exclude name="dependent-modules*" />
<exclude name="changelog-definitions*" />
<exclude name="_ss_environment.php" />
</fileset>
<fileset dir="${basedir}">
<include name="assets/Uploads" />
<include name="assets/.htaccess" />
<include name="assets/web.config" />
</fileset>
</copy>
<!-- TODO Remove once we figured out how to nest git repositories for themes -->
<move file="${tmp}/${archivename}/themes/blackcandy/blackcandy_blog" todir="${tmp}/${archivename}/themes" haltonerror='false' />
<move file="${tmp}/${archivename}/themes/blackcandy/blackcandy_calendar" todir="${tmp}/${archivename}/themes" haltonerror='false' />
<move file="${tmp}/${archivename}/themes/blackcandy/blackcandy" todir="${tmp}/${archivename}/themes" haltonerror='false' />
<!-- create tar archive -->
<if>
<equals arg1="${archivetype}" arg2="tar.gz" casesensitive="false" trim="true"/>
<then>
<tar destfile="${archivedest}/${archivefilename}" compression="gzip">
<fileset dir="${tmp}">
<include name="**/**" />
</fileset>
</tar>
</then>
</if>
<!-- create zip archive -->
<if>
<equals arg1="${archivetype}" arg2="zip" casesensitive="false" trim="true"/>
<then>
<zip destfile="${archivedest}/${archivefilename}">
<fileset dir="${tmp}">
<include name="**/**" />
</fileset>
</zip>
</then>
</if>
<delete dir="${tmp}" />
</target>
<target name="createDependentModulesFile" unless="dependent-modules-file-exists">
<copy file="${dependent-modules-file}.default" tofile="${dependent-modules-file}" />
</target>
@ -250,8 +182,7 @@ Options:
<foreach list="${GitReposList}" param="reponame" target="checkoutTask" />
</target>
<!-- Creates a gzip archive from the current folder (removes any version control files) -->
<target name="archive" if="basedir">
<target name="archive" if="basedir" description="Creates a gzip archive from the current folder (removes any version control files)">
<if>
<isset property="archivetype"/>
<then>
@ -276,7 +207,70 @@ Options:
<property name="archivefilename" value="${archivename}.${archivetype}" />
<phingCall target="archiveTask" />
<!-- Copy into a new folder, and tar the whole folder in order to avoid toplevel extracts -->
<php function="sys_get_temp_dir" returnProperty="systmp" />
<property name="tmp" value="${systmp}/archiveTask/" />
<copy todir="${tmp}/${archivename}">
<fileset dir="${basedir}">
<include name="**/**" />
<exclude name="assets/**" />
<exclude name="mysite/local.conf.php" />
<exclude name="mysite/db.conf.php" />
<exclude name="**/*.log" />
<exclude name="**/.svn/**" />
<exclude name="**/.git/**" />
<exclude name="**/.project" /> <!-- remove eclipse configuration file -->
<exclude name="**/.buildpath" />
<exclude name="**/.settings" />
<exclude name="**/.idea/**" /> <!-- remove phpstorm configuration file -->
<exclude name="tools/**" />
<exclude name="**/tests/**" />
<exclude name="cms/docs/**" />
<exclude name="sapphire/docs/**" />
<exclude name="build.xml" />
<exclude name="dependent-modules*" />
<exclude name="changelog-definitions*" />
<exclude name="_ss_environment.php" />
</fileset>
<fileset dir="${basedir}">
<include name="assets/Uploads" />
<include name="assets/.htaccess" />
<include name="assets/web.config" />
</fileset>
</copy>
<!-- TODO Remove once we figured out how to nest git repositories for themes -->
<move file="${tmp}/${archivename}/themes/blackcandy/blackcandy_blog" todir="${tmp}/${archivename}/themes" haltonerror='false' />
<move file="${tmp}/${archivename}/themes/blackcandy/blackcandy_calendar" todir="${tmp}/${archivename}/themes" haltonerror='false' />
<move file="${tmp}/${archivename}/themes/blackcandy/blackcandy" todir="${tmp}/${archivename}/themes" haltonerror='false' />
<!-- create tar archive -->
<if>
<equals arg1="${archivetype}" arg2="tar.gz" casesensitive="false" trim="true"/>
<then>
<tar destfile="${archivedest}/${archivefilename}" compression="gzip">
<fileset dir="${tmp}">
<include name="**/**" />
</fileset>
</tar>
</then>
</if>
<!-- create zip archive -->
<if>
<equals arg1="${archivetype}" arg2="zip" casesensitive="false" trim="true"/>
<then>
<zip destfile="${archivedest}/${archivefilename}">
<fileset dir="${tmp}">
<include name="**/**" />
</fileset>
</zip>
</then>
</if>
<delete dir="${tmp}" />
<echo msg="Created archive in: ${basedir}/${archivename}" />
</target>