-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
78 lines (64 loc) · 3.3 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
<?xml version="1.0"?>
<project name="Alfresco Web Script SSO Authenticator" default="package-amp" basedir=".">
<!-- Properties -->
<property environment="env"/>
<!-- ${alfresco.install.dir} and ${alfresco.src.dir} can be defined as Ant runtime
properties in Eclipse. Otherwise, simply set the ALFRESCO_HOME and ALFRESCO_SOURCE
environment variables instead.-->
<property name="alfresco.install.dir" value="${env.ALFRESCO_HOME}"/>
<property name="alfresco.sdk.dir" value="${env.ALFRESCO_SDK}"/>
<property name="alfresco.deploy.dir" value="${alfresco.install.dir}/tomcat/webapps"/>
<property name="project.dir" value="."/>
<property name="build.dir" value="${project.dir}/build"/>
<property name="config.dir" value="${project.dir}/config"/>
<property name="jar.file" value="${build.dir}/lib/alfresco-webscript-sso.jar"/>
<property name="amp.file" value="${build.dir}/dist/alfresco-webscript-sso.amp"/>
<property name="war.filename" value="alfresco.war" />
<property name="war.file" value="/Users/luis/Alfresco/alfresco-ent-4.0/tomcat/webapps/alfresco.war"/>
<target name="clean">
<delete dir="${build.dir}/dist"/>
<delete dir="${build.dir}/lib" />
<delete dir="${build.dir}/classes"/>
</target>
<target name="mkdirs" depends="clean">
<mkdir dir="${build.dir}/dist" />
<mkdir dir="${build.dir}/lib" />
<mkdir dir="${build.dir}/classes" />
</target>
<path id="class.path">
<dirset dir="${build.dir}" />
<fileset dir="${alfresco.sdk.dir}/lib/server" includes="**/*.jar"/>
</path>
<target name="compile">
<javac debug="true" classpathref="class.path" srcdir="${project.dir}/source" destdir="${build.dir}/classes" />
</target>
<target name="package-jar" depends="compile">
<mkdir dir="${build.dir}/classes/META-INF" />
<jar destfile="${jar.file}">
<fileset dir="${build.dir}/classes" includes="**/*.class, META-INF/*.*" />
</jar>
</target>
<target name="package-amp" depends="mkdirs, package-jar" description="Package the Module" >
<zip destfile="${amp.file}" >
<fileset dir="${build.dir}" includes="lib/*.jar" />
<fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties, **/file-mapping.properties" />
<fileset dir="${project.dir}/config/alfresco/module/org_alfresco_module_webscripts_sso_SSOAuthenticator" includes="module.properties, file-mapping.properties" />
<fileset dir="${project.dir}" includes="web/**/*.*" />
<fileset dir="${project.dir}" includes="WEB-INF/**/*.*" />
</zip>
</target>
<target name="deploy-war" depends="package-amp" description="Update the WAR file. Set -Dwar.file=..." >
<echo>Installing AMP into WAR</echo>
<copy file="${war.file}" todir="${build.dir}/dist" overwrite="true"/>
<copy file="${amp.file}" todir="${build.dir}/amp" overwrite="true"/>
<java dir="." fork="true"
classname="org.alfresco.repo.module.tool.ModuleManagementTool">
<classpath refid="class.path"/>
<arg
line="install ${build.dir}/amp/ ${build.dir}/dist/${war.filename}
-directory -force -verbose -nobackup"/>
</java>
<echo>Copy WAR to deploy folder</echo>
<copy file="${build.dir}/dist/${war.filename}" todir="${alfresco.deploy.dir}" overwrite="true"/>
</target>
</project>