|
5 | 5 | ***********************************
|
6 | 6 |
|
7 | 7 | Author: Will Abson
|
8 |
| - Version: 1.3 |
| 8 | + Version: 1.5.1 |
9 | 9 |
|
10 | 10 | Provides a set of targets for building extensions to Alfresco Share in ZIP, AMP and JAR archive
|
11 | 11 | formats. Since Alfresco 3.3, JAR is the recommended package structure for all simple extensions.
|
|
58 | 58 | <property name="webapp.manager.url" value="${tomcat.url}/manager" />
|
59 | 59 | <property name="webapp.manager.username" value="admin" />
|
60 | 60 | <property name="webapp.manager.password" value="" />
|
| 61 | + <!-- Paths to local Tomcat instances --> |
| 62 | + <property name="tomcat.repo.home" value="${tomcat.home}" /> |
| 63 | + <property name="tomcat.share.home" value="${tomcat.home}" /> |
61 | 64 |
|
62 |
| - <!-- Additional property values. Generally should not be overridden --> |
| 65 | + <!-- Additional property values. Generally should not be overridden --> |
63 | 66 | <property name="config.dir" value="${basedir}/config" />
|
64 | 67 | <property name="res.dir" value="${basedir}/source/web" />
|
65 | 68 | <property name="build.dir" value="${basedir}/build" />
|
|
149 | 152 | <!-- Surf config -->
|
150 | 153 | <exclude name="alfresco/share*-config.xml" />
|
151 | 154 | <exclude name="alfresco/web-extension/share-config-custom.xml" />
|
| 155 | + <exclude name="share-config-custom.xml" /> |
152 | 156 | <!-- Global excludes -->
|
153 | 157 | <exclude name="${config.excludes}" />
|
154 | 158 | </fileset>
|
|
166 | 170 | </fileset>
|
167 | 171 | <globmapper from="alfresco/web-extension/*.xml" to="*.xml" handledirsep="true" />
|
168 | 172 | </copy>
|
| 173 | + <copy todir="${build.jar.dir}/META-INF" includeEmptyDirs="false"> |
| 174 | + <fileset dir="${config.dir}"> |
| 175 | + <filename name="share-config-custom.xml" /> |
| 176 | + </fileset> |
| 177 | + </copy> |
169 | 178 | <!-- Minify JS -->
|
170 | 179 | <yuicompress fromdir="${res.dir}" todir="${build.jar.dir}/META-INF" excludes="**/*-min.js" warn="${yuicompress.warn}">
|
171 | 180 | <include name="**/*.js" />
|
|
286 | 295 | </zip>
|
287 | 296 | </target>
|
288 | 297 |
|
| 298 | + <!-- Shared path definition used to copy files into the local Tomcat instance(s) --> |
| 299 | + <patternset id="hotcopy-tomcat-zip-patternset"> |
| 300 | + <!-- Spring config --> |
| 301 | + <exclude name="**/classes/web-application-config.xml" /> |
| 302 | + <exclude name="**/classes/surf-config.xml" /> |
| 303 | + <exclude name="**/classes/alfresco/slingshot-application-context.xml" /> |
| 304 | + <exclude name="**/classes/alfresco/web-extension/custom-slingshot-application-context.xml" /> |
| 305 | + <!-- Surf config --> |
| 306 | + <exclude name="**/classes/alfresco/share*-config.xml" /> |
| 307 | + <exclude name="**/classes/alfresco/web-extension/share-config-custom.xml" /> |
| 308 | + </patternset> |
| 309 | + |
289 | 310 | <!--
|
290 | 311 | Hot copy individual files into a local Tomcat instance.
|
291 | 312 |
|
292 | 313 | In version 3.3 and above the JAR file mechanism is recommended for distributing your
|
293 | 314 | customisations, but this target can still be used during development as it allows you to
|
294 |
| - reload changes . |
295 |
| - --> |
| 315 | + reload changes without restarting Tomcat. |
| 316 | + --> |
296 | 317 | <target name="hotcopy-tomcat-zip" depends="build-zip-tomcat" description="Hot copy individual files into a local Tomcat instance">
|
297 |
| - <copy todir="${tomcat.home}" includeEmptyDirs="false"> |
| 318 | + <echo message="Copying repository files" /> |
| 319 | + <copy todir="${tomcat.repo.home}" includeEmptyDirs="false"> |
298 | 320 | <fileset dir="${build.zip.dir}">
|
299 |
| - <!-- Spring config --> |
300 |
| - <exclude name="**/classes/web-application-config.xml" /> |
301 |
| - <exclude name="**/classes/surf-config.xml" /> |
302 |
| - <exclude name="**/classes/alfresco/slingshot-application-context.xml" /> |
303 |
| - <exclude name="**/classes/alfresco/web-extension/custom-slingshot-application-context.xml" /> |
304 |
| - <!-- Surf config --> |
305 |
| - <exclude name="**/classes/alfresco/share*-config.xml" /> |
306 |
| - <exclude name="**/classes/alfresco/web-extension/share-config-custom.xml" /> |
| 321 | + <patternset refid="hotcopy-tomcat-zip-patternset" /> |
| 322 | + <!-- Exclude static resources --> |
| 323 | + <exclude name="${build.res.dir}/**" /> |
| 324 | + <!-- Exclude web-tier config --> |
| 325 | + <exclude name="**/classes/alfresco/site-webscripts/**" /> |
| 326 | + <exclude name="**/classes/alfresco/site-data/**" /> |
| 327 | + <exclude name="**/classes/alfresco/web-extension/**" /> |
| 328 | + <exclude name="**/classes/org/springframework/extensions/surf/**" /> |
307 | 329 | </fileset>
|
308 | 330 | </copy>
|
| 331 | + <echo message="Copying Share files" /> |
| 332 | + <copy todir="${tomcat.share.home}" includeEmptyDirs="false"> |
| 333 | + <fileset dir="${build.zip.dir}"> |
| 334 | + <patternset refid="hotcopy-tomcat-zip-patternset" /> |
| 335 | + <!-- Exclude repo-tier web scripts config --> |
| 336 | + <exclude name="**/classes/alfresco/extension/**" /> |
| 337 | + <exclude name="**/classes/alfresco/templates/webscripts/**" /> |
| 338 | + </fileset> |
| 339 | + </copy> |
309 | 340 | </target>
|
310 | 341 |
|
311 | 342 | <!--
|
312 | 343 | Hot copy JAR file into a local Tomcat instance.
|
313 |
| - |
314 |
| - In version 3.3 and above the JAR file mechanism is recommended for distributing your |
315 |
| - customisations, but this target can still be used during development as it allows you to |
316 |
| - reload changes without restarting Tomcat. |
317 | 344 | -->
|
318 | 345 | <target name="hotcopy-tomcat-jar" depends="dist-jar" description="Hot copy JAR file into a local Tomcat instance">
|
319 |
| - <mkdir dir="${tomcat.home}/${build.lib.dir}" /> |
320 |
| - <copy todir="${tomcat.home}/${build.lib.dir}"> |
| 346 | + <mkdir dir="${tomcat.repo.home}/${build.lib.dir}" /> |
| 347 | + <mkdir dir="${tomcat.share.home}/${build.lib.dir}" /> |
| 348 | + <copy todir="${tomcat.repo.home}/${build.lib.dir}"> |
| 349 | + <fileset file="${dist.dir}/${jar.name}" /> |
| 350 | + </copy> |
| 351 | + <copy todir="${tomcat.share.home}/${build.lib.dir}"> |
321 | 352 | <fileset file="${dist.dir}/${jar.name}" />
|
322 | 353 | </copy>
|
323 | 354 | </target>
|
|
0 commit comments