-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease-script.xml
199 lines (146 loc) · 7.69 KB
/
release-script.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the Ant script (see http:/ant.apache.org) to generate builds for DiagramoScript
-->
<project name="diagramo" default="list" basedir=".">
<property name="php.dir" value="c:/Tools/php5.4.0"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="dist.dir" value="${basedir}/dist"/>
<property name="docs.dir" value="${basedir}/documents"/>
<property name="build-all-in-one.dir" value="${basedir}/build-all-in-one"/>
<property name="dist-all-in-one.dir" value="${basedir}/dist-all-in-one"/>
<property name="temp.dir" value="${basedir}/temp"/>
<property name="web.dir" value="${basedir}/web"/>
<property name="editor.dir" value="${web.dir}/editor"/>
<property name="script.release.file" value="${dist.dir}/diagramo-lamp.zip"/>
<property name="all-in-one.release.file" value="${dist.dir}/diagramo-all-in-one.zip"/>
<target name="list">
<echo>+---------------------------------------------------+</echo>
<echo>| Run ant [target] |</echo>
<echo>| list - prints this help |</echo>
<echo>| prepare - prepare folder structure |</echo>
<echo>| build - build application |</echo>
<echo>| obfuscate - obfuscate some parts of it |</echo>
<echo>| js.obfuscate - obfuscate JavaScript |</echo>
<echo>| php.obfuscate - obfuscate PHP |</echo>
<echo>| dist - creates ZIP distribution file |</echo>
<echo>| clean - clean project |</echo>
<echo>+---------------------------------------------------+</echo>
</target>
<target name="prepare">
<echo>+-------------------PREPARE-------------------------+</echo>
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${temp.dir}"/>
</target>
<target name="build" depends="prepare">
<echo>+------------------SCRIPT BUILD-----------------------------+</echo>
<copy todir="${build.dir}">
<fileset dir="${web.dir}">
<exclude name="editor/common/settings.php"/>
<exclude name="editor/test/"/>
<exclude name="editor/data/diagrams/*.dia"/>
<exclude name="editor/data/diagrams/*.svg"/>
<exclude name="editor/data/diagrams/*.png"/>
<exclude name="editor/data/diagrams/*.jpg"/>
<exclude name="editor/data/diagramo.db"/>
<exclude name="editor/exporter/*.png"/>
<exclude name="editor/exporter/*.svg"/>
<exclude name="editor/exporter/*.jpg"/>
<exclude name="editor/exporter/*.bat"/>
</fileset>
</copy>
<replace file="${build.dir}/install/umbilicus.php" token="http://diagramo.test" value="http://diagramo.com" />
</target>
<!-- @see: http://www.julienlecomte.net/blog/2007/09/16/ -->
<target name="js.obfuscate" depends="build">
<echo>+------------------OBFUSCATE JavaScript-----------------------------+</echo>
<echo>Obfuscate connections.js</echo>
<java jar="./documents/compressor/yuicompressor-2.4.2.jar" fork="true">
<arg value="${build.dir}/editor/lib/connections.js"/>
<arg value="-o"/>
<arg value="${build.dir}/editor/lib/connections.js"/>
</java>
<echo>Obfuscate handles.js</echo>
<java jar="./documents/compressor/yuicompressor-2.4.2.jar" fork="true">
<arg value="${build.dir}/editor/lib/handles.js"/>
<arg value="-o"/>
<arg value="${build.dir}/editor/lib/handles.js"/>
</java>
<echo>Obfuscate stack.js</echo>
<java jar="./documents/compressor/yuicompressor-2.4.2.jar" fork="true">
<arg value="${build.dir}/editor/lib/stack.js"/>
<arg value="-o"/>
<arg value="${build.dir}/editor/lib/stack.js"/>
</java>
<echo>Obfuscate text.js</echo>
<java jar="./documents/compressor/yuicompressor-2.4.2.jar" fork="true">
<arg value="${build.dir}/editor/lib/text.js"/>
<arg value="-o"/>
<arg value="${build.dir}/editor/lib/text.js"/>
</java>
<echo>Obfuscate main.js</echo>
<java jar="./documents/compressor/yuicompressor-2.4.2.jar" fork="true">
<arg value="${build.dir}/editor/lib/main.js"/>
<arg value="-o"/>
<arg value="${build.dir}/editor/lib/main.js"/>
</java>
</target>
<target name="php.obfuscate" depends="js.obfuscate">
<echo>+------------------OBFUSCATE PHP-----------------------------+</echo>
<echo>Obfuscate utils.php</echo>
<exec executable="php" output="${temp.dir}/encode.output.txt">
<arg line="./documents/encoder/encoder.php ${build.dir}/editor/common/utils.php ${build.dir}/editor/common/utils.php"/>
</exec>
<echo>Obfuscate delegate.php</echo>
<exec executable="php" output="${temp.dir}/encode.output.txt">
<arg line="./documents/encoder/encoder.php ${build.dir}/editor/common/delegate.php ${build.dir}/editor/common/delegate.php"/>
</exec>
<echo>Obfuscate controller.php</echo>
<exec executable="php" output="${temp.dir}/encode.output.txt">
<arg line="./documents/encoder/encoder.php ${build.dir}/editor/common/controller.php ${build.dir}/editor/common/controller.php"/>
</exec>
<echo>Obfuscate install/step3</echo>
<exec executable="php" output="${temp.dir}/encode.output.txt">
<arg line="./documents/encoder/encoder.php ${build.dir}/install/step3.php ${build.dir}/install/step3.php"/>
</exec>
<echo>Obfuscate install/step4</echo>
<exec executable="php" output="${temp.dir}/encode.output.txt">
<arg line="./documents/encoder/encoder.php ${build.dir}/install/step4.php ${build.dir}/install/step4.php"/>
</exec>
</target>
<target name="obfuscate" depends="js.obfuscate, php.obfuscate">
<echo>+------------------OBFUSCATE-----------------------------+</echo>
</target>
<target name="dist" depends="obfuscate">
<echo>+------------------SCRIPT DIST-----------------------------+</echo>
<zip destfile="${script.release.file}" basedir="${build.dir}" />
</target>
<target name="build-all-in-one" depends="obfuscate">
<echo>+------------------SCRIPT BUILD-----------------------------+</echo>
<copy todir="${build-all-in-one.dir}">
<fileset dir="${build.dir}">
</fileset>
</copy>
<copy todir="${build-all-in-one.dir}/php">
<fileset dir="${php.dir}">
</fileset>
</copy>
<copy todir="${build-all-in-one.dir}">
<fileset dir="${docs.dir}/all-in-one">
</fileset>
</copy>
</target>
<target name="dist-all-in-one" depends="build-all-in-one">
<echo>+------------------SCRIPT DIST-----------------------------+</echo>
<zip destfile="${all-in-one.release.file}" basedir="${build-all-in-one.dir}" />
</target>
<target name="clean">
<echo>+------------------SCRIPT CLEAN----------------------------+</echo>
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}" />
<delete dir="${build-all-in-one.dir}"/>
<delete dir="${dist-all-in-one.dir}" />
<delete dir="${temp.dir}" />
</target>
</project>