-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.xml
More file actions
195 lines (167 loc) · 7.14 KB
/
build.xml
File metadata and controls
195 lines (167 loc) · 7.14 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
<project name="EbrcWebsiteCommon" basedir=".">
<!-- oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo -->
<!-- oooooooooooooooooooooooooo Dependencies oooooooooooooooooooooooooo -->
<!-- oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo -->
<import file="${projectsDir}/WDK/build.xml" />
<!-- oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo -->
<!-- oooooooooooooooooooooooooo Installation oooooooooooooooooooooooooo -->
<!-- oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo -->
<target name="EbrcWebsiteCommon-Installation" depends="WDK-Installation,
EbrcWebsiteCommon/Site-Installation,
EbrcWebsiteCommon/Model-Installation,
EbrcWebsiteCommon/View-Installation,
EbrcWebsiteCommon/Watar-Installation">
<ant target="defaultProjectInstall">
<property name="project" value="EbrcWebsiteCommon" />
</ant>
</target>
<!-- ooooooooooooooooooooooo Install Components ooooooooooooooooooooooo -->
<target name="EbrcWebsiteCommon/Model-Installation">
<ant target="defaultComponentInstall">
<property name="project" value="EbrcWebsiteCommon" />
<property name="component" value="Model" />
</ant>
</target>
<target name="EbrcWebsiteCommon/Site-Installation">
<ant target="defaultComponentInstall">
<property name="project" value="EbrcWebsiteCommon" />
<property name="component" value="Site" />
</ant>
</target>
<target name="EbrcWebsiteCommon/View-Installation">
<ant target="defaultComponentInstall">
<property name="project" value="EbrcWebsiteCommon" />
<property name="component" value="View" />
</ant>
</target>
<target name="EbrcWebsiteCommon/Watar-Installation">
<ant target="defaultComponentInstall">
<property name="project" value="EbrcWebsiteCommon" />
<property name="component" value="Watar" />
</ant>
</target>
<!-- oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo -->
<!-- oooooooooooooooooooooooo Web Installation oooooooooooooooooooooooo -->
<!-- oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo -->
<target name="EbrcWebsiteCommon-WebInstallation" depends="WDK-WebInstallation,
EbrcWebsiteCommon-Installation,
EbrcWebsiteCommon/Site-WebInstallation"/>
<target name="EbrcWebsiteCommon/Site-WebInstallation">
<ant target="defaultWebComponentInstall">
<property name="project" value="EbrcWebsiteCommon" />
<property name="component" value="Site" />
</ant>
<ant target="webComponentPartCopy">
<property name="componentDir"
value="${projectsDir}/EbrcWebsiteCommon/Site" />
<property name="part" value="dashboard" />
<property name="to" value="${htdocsTargetDir}/../dashboard" />
</ant>
<available file="${htdocsTargetDir}/../dashboard" type="dir"
property="dashboard.present" />
<antcall target="dashboardDoc" />
<replace file="${cgibinTargetDir}/dataPlotter.pl"
token="@rProgram@"
value="${rProgram}" />
</target>
<target name="dashboardDoc" if="dashboard.present">
<echo message="Compiling phpdoc" />
<!-- errors to /dev/null due to Smarty bug: https://bugzilla.redhat.com/show_bug.cgi?id=1352882 -->
<exec executable="phpdoc"
failonerror="false"
failifexecutionfails="false"
error="/dev/null"
output="/dev/null"
>
<arg line="--ignore phpdoc/,css/,js/,config/,test/,images/,doc/" />
<arg line="--defaultpackagename dashboard" />
<arg line="--title /dashboard" />
<arg line="-t ${htdocsTargetDir}/../dashboard/phpdoc" />
<arg line="-d ${htdocsTargetDir}/../dashboard" />
<arg line="-o HTML:Smarty:PHP" />
<arg value="-q" />
</exec>
</target>
<!-- Targets used by component site builds -->
<target name="localBuildCheck">
<condition property="doLocalBuild">
<and>
<available file="${projectsDir}/web-monorepo" type="dir"/>
<not>
<and>
<isset property="webAssets.buildLocal"/>
<isfalse value="${webAssets.buildLocal}"/>
</and>
</not>
</and>
</condition>
</target>
<target name="localBuildWebAssets" depends="localBuildCheck" if="doLocalBuild">
<!-- Set default bundle mode if not specified -->
<property name="webAssets.bundleMode" value="development"/>
<!-- Normalize mode: convert dev/prod abbreviations -->
<condition property="bundleMode.normalized" value="development">
<or>
<equals arg1="${webAssets.bundleMode}" arg2="development"/>
<equals arg1="${webAssets.bundleMode}" arg2="dev"/>
</or>
</condition>
<condition property="bundleMode.normalized" value="production">
<or>
<equals arg1="${webAssets.bundleMode}" arg2="production"/>
<equals arg1="${webAssets.bundleMode}" arg2="prod"/>
</or>
</condition>
<!-- Fallback to development if no valid mode was recognized -->
<property name="bundleMode.normalized" value="development"/>
<!-- Determine nx bundle command based on mode -->
<condition property="nxBundleType" value="bundle:dev">
<equals arg1="${bundleMode.normalized}" arg2="development"/>
</condition>
<condition property="nxBundleType" value="bundle:npm">
<equals arg1="${bundleMode.normalized}" arg2="production"/>
</condition>
<echo message="Building web assets locally (mode: ${bundleMode.normalized})"/>
<exec executable="yarn"
dir="${projectsDir}/web-monorepo"
failonerror="true"
failifexecutionfails="true"
/>
<exec executable="yarn"
dir="${projectsDir}/web-monorepo"
failonerror="true"
failifexecutionfails="true"
>
<arg line="nx ${nxBundleType} @veupathdb/${sitePackageName}"/>
</exec>
<copy todir="${webappTargetDir}" overwrite="true">
<fileset
dir="${projectsDir}/web-monorepo/packages/sites/${sitePackageName}/dist"
excludes="bin"
/>
</copy>
<copy todir="${targetDir}/bin" overwrite="true">
<fileset
dir="${projectsDir}/web-monorepo/packages/sites/${sitePackageName}/dist/bin"
/>
</copy>
</target>
<target name="copyNpmAssets" depends="localBuildCheck" unless="doLocalBuild">
<echo message="Installing web assets from npm"/>
<copy todir="${webappTargetDir}" overwrite="true">
<fileset
dir="${projectsDir}/${project}/Site/node_modules/@veupathdb/${sitePackageName}/dist"
excludes="bin"
/>
</copy>
<copy todir="${targetDir}/bin" overwrite="true">
<fileset
dir="${projectsDir}/${project}/Site/node_modules/@veupathdb/${sitePackageName}/dist/bin"
/>
</copy>
</target>
<target name="installWebAssets">
<ant target="copyNpmAssets"/>
<ant target="localBuildWebAssets"/>
</target>
</project>