-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
257 lines (218 loc) · 11.5 KB
/
build.xml
File metadata and controls
257 lines (218 loc) · 11.5 KB
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?xml version="1.0"?>
<project name="OTFrameworkApp" default="main" basedir=".">
<property name="zendframework.repoPath" value="http://framework.zend.com/svn/framework/standard/tags"/>
<!-- These are the default versions of the frameworks to use. These need to be changed when we move to new versions by default -->
<property name="defaultOtFrameworkVersion" value="2.7.4rc15"/>
<property name="defaultZendFrameworkVersion" value="1.12.1"/>
<property name="defaultPHPNcstateVersion" value="1.0.6" />
<!-- These are the installed version (if they are already installed) of the needed frameworks -->
<property name="installedOtFrameworkVersion" value="" />
<property name="insatlledZendFrameworkVersion" value="" />
<property name="installedPHPNcstateVersion" value="" />
<!-- Only svnexport is currently allowed -->
<property name="otframework.retrieval.mode" value="svnexport"/>
<property name="otframework.repoPath" value="https://svn.unity.ncsu.edu/svn/otframework/tags"/>
<target name="main">
<phingcall target="frameworksExport" />
<phingcall target="setPermissions" />
</target>
<!--
/**
* Determines the path to SVN for you. This is to help be OS agnostic, but some
* of the tasks use unix commands. Sorry...use OS X for now
*/
-->
<target name="setDefaultSvnPath" description="Sets the default path to the Svn binary">
<!-- Detect OS and set default/common ${svn.path} -->
<if>
<or>
<equals arg1="${host.os}" arg2="WINNT" />
<equals arg1="${host.os}" arg2="WIN32" />
</or>
<then>
<property name="svn.path" value="C:/Subversion/bin/svn.exe"/>
</then>
<else>
<property name="svn.path" value="/usr/bin/svn"/>
</else>
</if>
<echo msg="Path to SVN is ${svn.path}"/>
</target>
<target name="frameworksExport" depends="setDefaultSvnPath">
<includepath classpath="${project.basedir}/library" />
<!-- initialize ZF -->
<if>
<available file="${project.basedir}/library/Zend/Version.php" property="testZfExists" value="Yes"/>
<then>
<php expression="require_once 'Zend/Version.php';" />
<php expression="Zend_Version::VERSION;" returnProperty="installedZendFrameworkVersion" />
</then>
</if>
<echo msg="ZF Install: ${defaultZendFrameworkVersion} required, ${installedZendFrameworkVersion} detected" />
<if>
<not>
<equals arg1="${installedZendFrameworkVersion}" arg2="${defaultZendFrameworkVersion}" />
</not>
<then>
<delete dir="${project.basedir}/library/Zend" includeemptydirs="true" verbose="false" failonerror="false" />
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${zendframework.repoPath}/release-${defaultZendFrameworkVersion}/library/Zend"
todir="${project.basedir}/library/Zend"
/>
</then>
<else>
<echo message="Skipped re-install of Zend Framework because ${installedZendFrameworkVersion} already installed." />
</else>
</if>
<!-- initialize OTF -->
<if>
<available file="${project.basedir}/library/Ot/Version.php" property="testOtfExists" value="Yes"/>
<then>
<php expression="require_once 'Ot/Version.php';" />
<php expression="Ot_Version::VERSION;" returnProperty="installedOtFrameworkVersion" />
</then>
</if>
<echo msg="OTF Install: ${defaultOtFrameworkVersion} required, ${installedOtFrameworkVersion} detected" />
<if>
<not>
<equals arg1="${installedOtFrameworkVersion}" arg2="${defaultOtFrameworkVersion}" />
</not>
<then>
<delete dir="${project.basedir}/library/Ot" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/library/Oauth" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/application/modules/ot" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/application/languages/ot" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/public/css/ot" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/public/scripts/ot" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/public/images/ot" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/public/themes/ot" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/public/min" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/otutils" includeemptydirs="true" verbose="false" failonerror="false" />
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/library/Ot"
todir="${project.basedir}/library/Ot"
/>
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/library/Oauth"
todir="${project.basedir}/library/Oauth"
/>
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/application/modules/ot"
todir="${project.basedir}/application/modules/ot"
/>
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/application/languages/ot"
todir="${project.basedir}/application/languages/ot"
/>
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/public/css/ot"
todir="${project.basedir}/public/css/ot"
/>
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/public/scripts/ot"
todir="${project.basedir}/public/scripts/ot"
/>
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/public/images/ot"
todir="${project.basedir}/public/images/ot"
/>
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/public/themes/ot"
todir="${project.basedir}/public/themes/ot"
/>
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/public/min"
todir="${project.basedir}/public/min"
/>
<svnexport svnpath="${svn.path}"
username=""
password=""
nocache="true"
repositoryurl="${otframework.repoPath}/${defaultOtFrameworkVersion}/otutils"
todir="${project.basedir}/otutils"
/>
</then>
<else>
<echo message="Skipped re-install of OT Framework because ${installedOtFrameworkVersion} already installed." />
</else>
</if>
<!-- initialize NCState PHP Lib -->
<if>
<available file="${project.basedir}/library/Ncstate/Version.php" property="test_txt_exists" value="Yes"/>
<then>
<php expression="require_once 'Ncstate/Version.php';" />
<php expression="Ncstate_Version::VERSION;" returnProperty="installedPHPNcstateVersion" />
</then>
</if>
<echo msg="PHPNcstate Install: ${defaultPHPNcstateVersion} required, ${installedPHPNcstateVersion} detected" />
<if>
<not>
<equals arg1="${installedPHPNcstateVersion}" arg2="${defaultPHPNcstateVersion}" />
</not>
<then>
<delete dir="${project.basedir}/_phingtmp" includeemptydirs="true" verbose="false" failonerror="false" />
<delete dir="${project.basedir}/library/Ncstate" includeemptydirs="true" verbose="false" failonerror="false" />
<mkdir dir="${project.basedir}/_phingtmp" />
<mkdir dir="${project.basedir}/library/Ncstate" />
<httpget url="https://github.com/ncsuwebdev/PHP-Ncstate/archive/${defaultPHPNcstateVersion}.zip" dir="${project.basedir}/_phingtmp" sslVerifyPeer="false" followRedirects="true" />
<unzip file="${project.basedir}/_phingtmp/${defaultPHPNcstateVersion}.zip" todir="${project.basedir}/_phingtmp" />
<copy todir="${project.basedir}/library/Ncstate" >
<fileset dir="${project.basedir}/_phingtmp/PHP-Ncstate-${defaultPHPNcstateVersion}/Ncstate">
<include name="**" />
</fileset>
</copy>
<delete dir="${project.basedir}/_phingtmp" includeemptydirs="true" verbose="false" failonerror="false" />
</then>
<else>
<echo message="Skipped re-install of PHP-Ncstate because ${installedPHPNcstateVersion} already installed." />
</else>
</if>
</target>
<!-- Called by initProject to setup the correct file system permissions -->
<target name="setPermissions" description="Sets the file system permissions for the project">
<chmod file="${project.basedir}/cache" mode="0757"/>
<chmod file="${project.basedir}/overrides" mode="0757">
<fileset dir="${project.basedir}/overrides">
<include name="**"/>
</fileset>
</chmod>
</target>
<!--
/**
* Initializes a new project. It assumes the project directory has already been
* connected to SVN and is empty. It will export the specified version of the OT Framework
* and then do all the work of creating the externals and committing the initial
* layout for you.
*/
-->
</project>