-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
123 lines (106 loc) · 5.98 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
<?xml version="1.0"?>
<!--
===================================================================================
* Alfresco Amazon S3 Channel Publishing Plugin build script
* Copyright © 2014. Abhinav Kumar Mishra.
* All rights reserved.
* Developed by Abhinav K Mishra
*
* 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="Alfresco Amazon S3 Channel Publishing Plugin Build Project" default="build-alfresco-amp" basedir=".">
<property name="alfresco.install.dir" value="C:/Alfresco"/>
<property name="alfresco.deploy.dir" value="${alfresco.install.dir}/tomcat/webapps"/>
<property name="mmt.path" value="${alfresco.install.dir}/bin/alfresco-mmt.jar"/>
<property name="ref.lib" value="${basedir}\buildscript-lib"/>
<property name="project.dir" value="${basedir}"/>
<property name="build.dir" value="${project.dir}/appbuild"/>
<property name="config.dir" value="${project.dir}/config"/>
<property name="alf.jar.file" value="${build.dir}/lib/alfresco-amazon-s3-publishing.jar"/>
<property name="share.jar.file" value="${build.dir}/lib/alfresco-share-amazon-s3-publishing.jar"/>
<property name="alf.amp.file" value="${build.dir}/amp/alfresco-amazon-s3-publishing.amp"/>
<property name="share.amp.file" value="${build.dir}/amp/alfresco-share-amazon-s3-publishing.amp"/>
<property name="alfresco.war.file" value="${alfresco.deploy.dir}/alfresco.war"/>
<property name="share.war.file" value="${alfresco.deploy.dir}/share.war"/>
<property name="mmt.install.repo" value="install ${alf.amp.file} ${alfresco.war.file} -verbose"/>
<property name="mmt.install.share" value="install ${share.amp.file} ${share.war.file} -verbose"/>
<target name="-clean">
<delete dir="${build.dir}"/>
</target>
<target name="-init" depends="-clean">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir}/amp" />
<mkdir dir="${build.dir}/lib" />
<mkdir dir="${build.dir}/classes" />
</target>
<path id="class.path">
<dirset dir="${build.dir}" />
<fileset dir="${basedir}/lib" includes="**/*.jar"/>
<fileset dir="${ref.lib}" includes="**/*.jar"/>
</path>
<target name="-compile" depends="-init">
<javac debug="true" classpathref="class.path" srcdir="${project.dir}/src"
destdir="${build.dir}/classes" includeantruntime="true"/>
</target>
<target name="alfresco-jar" depends="-compile" description="Package the Module in jar file." >
<mkdir dir="${build.dir}/classes/META-INF" />
<jar destfile="${alf.jar.file}">
<fileset dir="${build.dir}/classes" includes="**/*.class, META-INF/*.*" />
</jar>
</target>
<target name="share-jar" depends="-compile" description="Package the Module in jar file." >
<mkdir dir="${build.dir}/classes/META-INF" />
<copy todir="${build.dir}/classes/META-INF"
file="${basedir}/config/share/resources/share-config-custom.xml"/>
<jar destfile="${share.jar.file}">
<!-- Packaging the share-config-custom.xml file to jar file and deploy to share -->
<fileset dir="${build.dir}/classes" includes="META-INF/*.*" />
</jar>
</target>
<target name="build-alfresco-amp" depends="alfresco-jar" description="Package the Module in amp file." >
<zip destfile="${alf.amp.file}" >
<fileset dir="${build.dir}" includes="lib/*.jar" />
<fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties config/share/**" />
<fileset dir="${project.dir}/config/alfresco/module/s3-integration" includes="module.properties" />
<fileset dir="${project.dir}" includes="lib/*.jar"
excludes="lib/commons-logging-1.1.1.jar lib/commons-httpclient-3.1.jar" />
</zip>
</target>
<target name="build-share-amp" depends="share-jar" description="Package the Module in amp file." >
<zip destfile="${share.amp.file}" >
<fileset dir="${project.dir}/config/alfresco/module/s3-integration" includes="module.properties" />
<fileset dir="${build.dir}" includes="lib/*alfresco-share-amazon-s3-publishing.jar" />
</zip>
</target>
<target name="deploy-alfresco-war" depends="build-alfresco-amp" description="Deploy the war file to tomcat webapps" >
<echo>Installing amps into alfresco.war files..</echo>
<java jar="${mmt.path}" fork="true" failonerror="true">
<arg line="${mmt.install.repo}"/>
</java>
<echo>Alfresco amp install has been completed..</echo>
</target>
<target name="deploy-share-war" depends="build-share-amp" description="Deploy the war file to tomcat webapps" >
<echo>Installing amps into share.war files..</echo>
<java jar="${mmt.path}" fork="true" failonerror="true">
<arg line="${mmt.install.share}"/>
</java>
<echo>Share amp install has been completed..</echo>
</target>
<target name="deploy-all" description="Deploy alfesco and share war files to tomcat webapps">
<ant antfile="build.xml" description="Deploy alfesco war files to tomcat webapps"
target="deploy-alfresco-war"/>
<ant antfile="build.xml" description="Deploy share war files to tomcat webapps"
target="deploy-share-war"/>
</target>
</project>