-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.xml
160 lines (148 loc) · 6.95 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?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="Geeklog building tools"/>
<echo msg="----------------------"/>
<echo msg="First of all, change the directory to the root directory of the repository, where 'build.xml' resides."/>
<echo msg="For Unixy users, please use 'phing' instead of 'phing.bat' in the descriptions below."/>
<echo msg=""/>
<echo msg="To show help [this screen], enter:"/>
<echo msg="./system/build/vendor/phing/phing/bin/phing.bat[ENTER]"/>
<echo msg=""/>
<echo msg="To create a tarball, enter:"/>
<echo msg="./system/build/vendor/phing/phing/bin/phing.bat dist[ENTER]"/>
<echo msg=""/>
<echo msg="To synchronize language files, enter:"/>
<echo msg="./system/build/vendor/phing/phing/bin/phing.bat lang[ENTER]"/>
</target>
<!-- ============================== -->
<!-- Target: lang -->
<!-- ============================== -->
<target name="lang">
<echo msg="Synchronizing language files..."/>
<if>
<os family="windows"/>
<then>
<exec command="uplng.bat" dir="${srcDir}/system/build/lm"/>
</then>
<else>
<exec command="uplng.sh" dir="${srcDir}/system/build/lm"/>
</else>
</if>
<echo msg="Done."/>
</target>
<!-- ============================== -->
<!-- Target: prepare -->
<!-- ============================== -->
<target name="prepare">
<echo msg="Making directory ${dstDir}..."/>
<delete dir="${dstDir}" quiet="true"/>
<mkdir dir="${dstDir}"/>
</target>
<!-- ============================== -->
<!-- Target: build -->
<!-- ============================== -->
<target name="build" depends="prepare">
<!-- Copy files -->
<echo msg="Copying 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="phpunit.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"/>
<exclude name="*.tar.gz"/>
<exclude name="**/node_modules"/>
<exclude name="**/node_modules/**"/>
<exclude name="**/css_src/dest"/>
<exclude name="**/css_src/dest/**"/>
</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"/>
<!-- Move filemanager configuration file -->
<copy file="${srcDir}/public_html/filemanager/scripts/filemanager.config.default.json" tofile="${dstDir}/public_html/filemanager/scripts/filemanager.config.json" overwrite="true"/>
<!-- Change permissions -->
<echo msg="Changing directory and file 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"/>
<chmod file="${dstDir}/public_html/filemanager/scripts/filemanager.config.json" mode="0644"/>
</target>
<!-- ============================== -->
<!-- Target: dist -->
<!-- ============================== -->
<target name="dist" depends="build">
<echo msg="Creating an archive..."/>
<delete file="${project.basedir}/geeklog-${version}.tar.gz" quiet="true"/>
<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>