Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project name="geeklog" basedir="." default="help"> | ||
<property name="version" value="2.1.2" override="true"/> | ||
<property name="srcDir" value="." override="true"/> | ||
<property name="dstDir" value="./build" override="true"/> | ||
|
||
<!-- ============================== --> | ||
<!-- Target: help --> | ||
<!-- ============================== --> | ||
<target name="help"> | ||
<echo msg="USAGE: phing dist"/> | ||
</target> | ||
|
||
<!-- ============================== --> | ||
<!-- Target: prepare --> | ||
<!-- ============================== --> | ||
<target name="prepare"> | ||
<echo msg="Making directory ${dstDir}..."/> | ||
<mkdir dir="${dstDir}"/> | ||
</target> | ||
|
||
<!-- ============================== --> | ||
<!-- Target: build --> | ||
<!-- ============================== --> | ||
<target name="build" depends="prepare"> | ||
<!-- Copy files --> | ||
<copy todir="${dstDir}"> | ||
<fileset dir="${srcDir}"> | ||
<exclude name=".git"/> | ||
<exclude name=".git/**"/> | ||
<exclude name=".gitignore"/> | ||
<exclude name=".idea"/> | ||
<exclude name=".idea/**"/> | ||
<exclude name="build"/> | ||
<exclude name="build/**"/> | ||
<exclude name="build.xml"/> | ||
<exclude name="**/buildpackage.php"/> | ||
<exclude name="public_html/layout/professional_css"/> | ||
<exclude name="public_html/layout/professional_css/**"/> | ||
<exclude name="system/build"/> | ||
<exclude name="system/build/**"/> | ||
<exclude name="system/composer.phar"/> | ||
<exclude name="**/tests"/> | ||
<exclude name="**/tests/**"/> | ||
<exclude name="**/*.php.dist"/> | ||
</fileset> | ||
</copy> | ||
|
||
<!-- Move *.php.dist files --> | ||
<copy file="${srcDir}/db-config.php.dist" tofile="${dstDir}/db-config.php"/> | ||
<copy file="${srcDir}/system/lib-custom.php.dist" tofile="${dstDir}/system/lib-custom.php"/> | ||
<copy file="${srcDir}/public_html/siteconfig.php.dist" tofile="${dstDir}/public_html/siteconfig.php"/> | ||
|
||
<!-- Change permissions --> | ||
<chmod file="${dstDir}/emailgeeklogstories" mode="0755"/> | ||
<chmod file="${dstDir}/backups" mode="0775"/> | ||
<chmod file="${dstDir}/data" mode="0775"/> | ||
<chmod file="${dstDir}/logs" mode="0775"/> | ||
<chmod mode="0644"> | ||
<fileset dir="${dstDir}/logs"> | ||
<include name="*.log"/> | ||
</fileset> | ||
</chmod> | ||
<chmod file="${dstDir}/public_html/backend" mode="0775"/> | ||
<chmod mode="0644"> | ||
<fileset dir="${dstDir}/public_html/backend"> | ||
<include name="*.rss"/> | ||
</fileset> | ||
</chmod> | ||
<chmod file="${dstDir}/public_html/images/articles" mode="0775"/> | ||
<chmod mode="0644"> | ||
<fileset dir="${dstDir}/public_html/images/articles"> | ||
<include name="*"/> | ||
</fileset> | ||
</chmod> | ||
<chmod file="${dstDir}/public_html/images/library" mode="0775"/> | ||
<chmod file="${dstDir}/public_html/images/library/File" mode="0775"/> | ||
<chmod file="${dstDir}/public_html/images/library/Flash" mode="0775"/> | ||
<chmod file="${dstDir}/public_html/images/library/Image" mode="0775"/> | ||
<chmod file="${dstDir}/public_html/images/library/Media" mode="0775"/> | ||
<chmod file="${dstDir}/public_html/images/topics" mode="0775"/> | ||
<chmod mode="0644"> | ||
<fileset dir="${dstDir}/public_html/images/topics"> | ||
<include name="*"/> | ||
</fileset> | ||
</chmod> | ||
<chmod file="${dstDir}/public_html/images/userphotos" mode="0775"/> | ||
<chmod mode="0644"> | ||
<fileset dir="${dstDir}/public_html/images/userphotos"> | ||
<include name="*"/> | ||
</fileset> | ||
</chmod> | ||
<chmod file="${dstDir}/public_html/images/_thumbs" mode="0775"/> | ||
<chmod file="${dstDir}/public_html/images/_thumbs/articles" mode="0775"/> | ||
<chmod file="${dstDir}/public_html/images/_thumbs/library/Image" mode="0775"/> | ||
<chmod file="${dstDir}/public_html/images/_thumbs/userphotos" mode="0775"/> | ||
</target> | ||
|
||
<!-- ============================== --> | ||
<!-- Target: dist --> | ||
<!-- ============================== --> | ||
<target name="dist" depends="build"> | ||
<echo msg="Creating archive..."/> | ||
<tar destfile="${project.basedir}/geeklog-${version}.tar.gz" compression="gzip"> | ||
<fileset dir="${dstDir}"> | ||
<include name="*"/> | ||
</fileset> | ||
</tar> | ||
|
||
<echo msg="Removing work files..."/> | ||
<delete dir="${dstDir}"/> | ||
|
||
<echo msg="Files copied and compressed in the current directory OK!"/> | ||
</target> | ||
</project> |