-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.xml
207 lines (182 loc) · 9.67 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
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Qookery - Declarative UI Building for Qooxdoo
Copyright (c) Ergobyte Informatics S.A., www.ergobyte.gr
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="Qookery" basedir=".">
<!-- QX CLI -->
<macrodef name="qx-compiler">
<attribute name="dir" default="." />
<attribute name="command" />
<attribute name="failonerror" default="true" />
<element name="exec-elements" optional="true" />
<sequential>
<echo>Executing "@{command}" QX command in directory "@{dir}"</echo>
<exec executable="npx" failonerror="@{failonerror}" dir="@{dir}">
<arg value="qx" />
<arg value="@{command}" />
<exec-elements />
</exec>
</sequential>
</macrodef>
<target name="Clean" description="Clean project workspace">
<qx-compiler dir="qookery" command="clean" />
<qx-compiler dir="qookerydemo" command="clean" />
<delete failonerror="no" dir="." includes="*/compiled" />
<delete failonerror="no" dir="." includes="*/qx_packages" />
<delete failonerror="no" dir="." includes="*/source/resource/qookery/lib/" />
</target>
<target name="Lint" description="Perform syntactic checks on application">
<qx-compiler dir="qookery" command="lint" failonerror="false" />
<qx-compiler dir="qookeryace" command="lint" failonerror="false" />
<qx-compiler dir="qookerycalendar" command="lint" failonerror="false" />
<qx-compiler dir="qookerydemo" command="lint" failonerror="false" />
<qx-compiler dir="qookerymaps" command="lint" failonerror="false" />
<qx-compiler dir="qookeryrichtext" command="lint" failonerror="false" />
</target>
<!-- Demo -->
<target name="Demo.Source" description="Generate the source version of the demo application">
<qx-compiler dir="qookerydemo" command="compile">
<exec-elements>
<arg line="--target source" />
</exec-elements>
</qx-compiler>
</target>
<target name="Demo.Build" description="Generate the build version of the demo application">
<qx-compiler dir="qookerydemo" command="compile">
<exec-elements>
<arg line="--target build" />
</exec-elements>
</qx-compiler>
</target>
<target name="Demo.Deploy" description="Generate and deploy the build version of the demo application">
<qx-compiler dir="qookerydemo" command="deploy">
<exec-elements>
<arg line="--clean" />
</exec-elements>
</qx-compiler>
</target>
<target name="Demo.Publish" depends="Demo.Deploy" description="Publish project build to a WAFFLE server - do not use if not working at Ergobyte">
<zip destfile="qookerydemo/compiled/waffle-archive.zip" level="9" basedir="qookerydemo/compiled/deploy" includes="qookerydemo/** resource/** index.html" />
<input addproperty="waffle.serverHost" message="WAFFLE server hostname : " defaultvalue="www.ergobyte.net" />
<input addproperty="waffle.safiraUsername" message="Safira username : " defaultvalue="${user.name}" />
<input addproperty="waffle.safiraPassword" message="Safira password : " />
<exec executable="${user.home}/git/kitchen/com.ergobyte.ria.waffle/tool/uploader.py">
<arg line="--server ${waffle.serverHost}" />
<arg line="--username ${waffle.safiraUsername}" />
<arg line="--password ${waffle.safiraPassword}" />
<arg line="--application qookerydemo" />
<arg value="qookerydemo/compiled/waffle-archive.zip" />
</exec>
</target>
<!-- API -->
<target name="Api.Deploy" description="Deploy the Qookery API">
<qx-compiler dir="qookery" command="deploy">
<exec-elements>
<arg line="--clean" />
</exec-elements>
</qx-compiler>
</target>
<target name="Api.Publish" depends="Api.Deploy" description="Publish API documentation to a WAFFLE server - do not use if not working at Ergobyte">
<zip destfile="qookery/compiled/waffle-archive.zip" level="9" basedir="qookery/compiled/deploy" includes="qookeryapi/** resource/** index.html" />
<input addproperty="waffle.serverHost" message="WAFFLE server hostname : " defaultvalue="www.ergobyte.net" />
<input addproperty="waffle.safiraUsername" message="Safira username : " defaultvalue="${user.name}" />
<input addproperty="waffle.safiraPassword" message="Safira password : " />
<exec executable="${user.home}/git/kitchen/com.ergobyte.ria.waffle/tool/uploader.py">
<arg line="--server ${waffle.serverHost}" />
<arg line="--username ${waffle.safiraUsername}" />
<arg line="--password ${waffle.safiraPassword}" />
<arg line="--application qookeryapi" />
<arg value="qookery/compiled/waffle-archive.zip" />
</exec>
</target>
<!-- External libraries -->
<macrodef name="define-library">
<attribute name="project" />
<attribute name="library" />
<attribute name="version" />
<sequential>
<property file="@{project}/source/resource/qookery/lib/versions.properties" />
<property name="@{project}.@{library}.version" value="@{version}" />
<condition property="@{project}.@{library}.uptodate">
<equals arg1="${@{project}.@{library}.installed}" arg2="@{version}" />
</condition>
</sequential>
</macrodef>
<macrodef name="install-library">
<attribute name="project" />
<attribute name="library" />
<sequential>
<propertyfile file="@{project}/source/resource/qookery/lib/versions.properties">
<entry key="@{project}.@{library}.installed" value="${@{project}.@{library}.version}" />
</propertyfile>
<echo message="Installed @{library} ${@{project}.@{library}.version}" />
</sequential>
</macrodef>
<extension-point name="Download" description="Download external dependencies" />
<target name="Download.Init">
<define-library project="qookeryace" library="Ace" version="1.4.3" />
<define-library project="qookerycalendar" library="FullCalendar" version="6.1.4" />
<define-library project="qookerycalendar" library="Moment" version="2.27.0" />
<define-library project="qookeryrichtext" library="CKEditor" version="4.9.2" />
</target>
<target name="Download.Ace" depends="Download.Init" extensionOf="Download" unless="qookeryace.Ace.uptodate">
<property name="ace.target" location="qookeryace/source/resource/qookery/lib/ace" />
<property name="ace.downloadBase" value="https://raw.githubusercontent.com/ajaxorg/ace-builds/v${qookeryace.Ace.version}/src-min" />
<mkdir dir="${ace.target}" />
<get dest="${ace.target}" skipExisting="true" verbose="on" httpusecaches="no">
<url url="${ace.downloadBase}/ace.js" />
<url url="${ace.downloadBase}/ext-language_tools.js" />
<url url="${ace.downloadBase}/ext-searchbox.js" />
<url url="${ace.downloadBase}/mode-html.js" />
<url url="${ace.downloadBase}/mode-javascript.js" />
<url url="${ace.downloadBase}/mode-json.js" />
<url url="${ace.downloadBase}/mode-plain_text.js" />
<url url="${ace.downloadBase}/mode-textile.js" />
<url url="${ace.downloadBase}/mode-xml.js" />
<url url="${ace.downloadBase}/theme-eclipse.js" />
<url url="${ace.downloadBase}/theme-textmate.js" />
<url url="${ace.downloadBase}/worker-html.js" />
<url url="${ace.downloadBase}/worker-javascript.js" />
<url url="${ace.downloadBase}/worker-json.js" />
<url url="${ace.downloadBase}/worker-xml.js" />
</get>
<install-library project="qookeryace" library="Ace" />
</target>
<target name="Download.Calendar" depends="Download.Init" extensionOf="Download" unless="qookerycalendar.FullCalendar.uptodate">
<property name="fullcalendar.target" location="qookerycalendar/source/resource/qookery/lib" />
<mkdir dir="${fullcalendar.target}/fullcalendar" />
<get dest="${fullcalendar.target}/fullcalendar" skipExisting="true" verbose="on" httpusecaches="no">
<url url="https://cdn.jsdelivr.net/npm/fullcalendar@${qookerycalendar.FullCalendar.version}/index.global.min.js" />
<url url="https://cdn.jsdelivr.net/npm/@fullcalendar/core@${qookerycalendar.FullCalendar.version}/locales/el.global.min.js" />
</get>
<get verbose="on" httpusecaches="no" skipExisting="true" src="https://cdn.jsdelivr.net/npm/@fullcalendar/moment@${qookerycalendar.FullCalendar.version}/index.global.min.js"
dest="${fullcalendar.target}/fullcalendar/moment-to-fullcalendar.min.js" />
<get verbose="on" httpusecaches="no" skipExisting="true" src="https://cdn.jsdelivr.net/npm/moment@${qookerycalendar.Moment.version}/min/moment.min.js"
dest="${fullcalendar.target}/moment" />
<install-library project="qookerycalendar" library="FullCalendar" />
</target>
<target name="Download.CKEditor" depends="Download.Init" extensionOf="Download" unless="qookeryrichtext.CKEditor.uptodate">
<property name="ckeditor.package" value="full" />
<property name="ckeditor.zipFilename" value="ckeditor_${qookeryrichtext.CKEditor.version}_${ckeditor.package}.zip" />
<property name="ckeditor.downloadUrl" value="http://download.cksource.com/CKEditor/CKEditor/CKEditor%20${qookeryrichtext.CKEditor.version}/${ckeditor.zipFilename}" />
<property name="ckeditor.target" location="qookeryrichtext/source/resource/qookery/lib" />
<mkdir dir="${ckeditor.target}" />
<get dest="${ckeditor.target}" skipExisting="true" verbose="on" httpusecaches="no">
<url url="${ckeditor.downloadUrl}" />
</get>
<unzip src="${ckeditor.target}/${ckeditor.zipFilename}" dest="${ckeditor.target}/" />
<delete file="${ckeditor.target}/${ckeditor.zipFilename}" />
<delete dir="${ckeditor.target}/ckeditor/samples" />
<install-library project="qookeryrichtext" library="CKEditor" />
</target>
</project>