forked from liferay/liferay-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-common.xml
162 lines (136 loc) · 4.72 KB
/
build-common.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
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="build-common" xmlns:ivy="antlib:org.apache.ivy.ant">
<property environment="env" />
<property location="${project.dir}" name="project.location.absolute" />
<property file="${project.dir}/build.${user.name}.properties" />
<property file="${project.dir}/build.${env.COMPUTERNAME}.properties" />
<property file="${project.dir}/build.${env.HOST}.properties" />
<property file="${project.dir}/build.${env.HOSTNAME}.properties" />
<property file="${project.dir}/build.properties" />
<property name="app.server.classes.portal.dir" value="${app.server.portal.dir}/WEB-INF/classes" />
<property location="${app.server.portal.dir}/WEB-INF/lib" name="app.server.lib.portal.dir" />
<import file="build-common-ivy.xml" />
<ivy:cachepath pathid="ivy.lib.classpath" />
<ivy:cachepath conf="plugin" pathid="ivy.plugin.classpath" />
<ivy:cachepath conf="portal" pathid="ivy.portal.classpath" />
<ivy:cachepath conf="test" pathid="ivy.test.classpath" />
<path id="plugin.classpath">
<path refid="ivy.plugin.classpath" />
<path refid="plugin-lib.classpath" />
<fileset dir="${app.server.lib.global.dir}" includes="*.jar" />
<fileset dir="${app.server.lib.portal.dir}" includes="annotations.jar,commons-logging.jar,log4j.jar,util-bridges.jar,util-java.jar,util-taglib.jar" />
</path>
<path id="portal.classpath">
<path refid="ivy.portal.classpath" />
<pathelement location="${app.server.classes.portal.dir}" />
<fileset dir="${app.server.lib.global.dir}" includes="*.jar" />
<fileset dir="${app.server.lib.portal.dir}" includes="*.jar" />
</path>
<path id="test.classpath">
<path refid="ivy.test.classpath" />
<path refid="plugin.classpath" />
<fileset dir="${app.server.lib.portal.dir}" includes="commons-io.jar" />
<pathelement location="test-classes/integration" />
<pathelement location="test-classes/unit" />
</path>
<taskdef classpathref="ivy.lib.classpath" resource="net/sf/antcontrib/antlib.xml" />
<taskdef classpathref="ivy.lib.classpath" resource="ise/antelope/tasks/antlib.xml" uri="antlib:ise.antelope.tasks" />
<propertycopy
from="project.location.absolute"
name="project.dir"
override="true"
/>
<condition property="correct.ant.version">
<antversion atleast="1.7.0" />
</condition>
<if>
<not>
<equals arg1="${correct.ant.version}" arg2="true" />
</not>
<then>
<fail>Please use Ant 1.7.0 or above.</fail>
</then>
</if>
<whichresource resource="/org/eclipse/jdt/core/JDTCompilerAdapter.class" property="ecj.compiler" />
<if>
<and>
<equals arg1="${javac.compiler}" arg2="org.eclipse.jdt.core.JDTCompilerAdapter" />
<not>
<isset property="ecj.compiler" />
</not>
</and>
<then>
<ivy:retrieve
conf="ecj"
log="download-only"
pattern="${ant.home}/lib/[artifact].[ext]"
type="jar"
/>
<fail>
.
Task cannot continue because ECJ is not installed.
ECJ was automatically installed. Please rerun your task.
</fail>
</then>
</if>
<target name="compile-java">
<copy todir="${javac.destdir}">
<fileset dir="${javac.srcdir}" excludes="**/*.java" />
</copy>
<javac
classpathref="${javac.classpathref}"
compiler="${javac.compiler}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
destdir="${javac.destdir}"
encoding="${javac.encoding}"
includeAntRuntime="false"
nowarn="${javac.nowarn}"
srcdir="${javac.srcdir}"
/>
</target>
<target name="format-javadoc">
<java
classname="com.liferay.portal.tools.JavadocFormatter"
classpathref="portal.classpath"
fork="true"
newenvironment="true"
>
<jvmarg value="-Xmx512m" />
<arg value="javadoc.init=${init}" />
<arg value="javadoc.input.dir=${input.dir}" />
<arg value="javadoc.limit=${limit}" />
<arg value="javadoc.output.file.prefix=${output.file.prefix}" />
<arg value="javadoc.update=${update}" />
</java>
</target>
<target name="format-source">
<java
classname="com.liferay.portal.tools.SourceFormatter"
classpathref="portal.classpath"
fork="true"
newenvironment="true"
>
<jvmarg value="-Xmx512m" />
<jvmarg value="-Xss2048k" />
</java>
<delete file="ServiceBuilder.temp" />
</target>
<target name="print-current-time">
<tstamp>
<format property="current.time" pattern="MMMM d, yyyy 'at' hh:mm aa" />
</tstamp>
<echo message="${current.time}" />
</target>
<target name="setup-eclipse">
<java
classname="com.liferay.portal.tools.PluginsEnvironmentBuilder"
classpathref="portal.classpath"
fork="true"
newenvironment="true"
>
<jvmarg value="-Dplugins.env.dir=." />
</java>
</target>
</project>