-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.xml
195 lines (181 loc) · 7.07 KB
/
macros.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
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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="Ant - Macros">
<property name="minimumantversion" value="1.9.0"/>
<antversion property="antversion" atleast="${minimumantversion}"/>
<fail unless="antversion" message="Please upgrade ant to at least ${minimumantversion}. Current ant version is ${ant.version}"/>
<condition property="javaatleast18">
<not>
<matches pattern="^1\.[0-7]($|\..*)" string="${ant.java.version}"/>
</not>
</condition>
<fail unless="javaatleast18" message="Please upgrade java to at least 1.8. Current Java version is ${ant.java.version}"/>
<dirname property="ofbiz.home.dir" file="${ant.file.Ant - Macros}"/>
<macrodef name="iterate">
<attribute name="filelist" default="subdirs"/>
<attribute name="target" default=""/>
<attribute name="inheritall" default="false"/>
<sequential>
<subant target="@{target}" inheritall="@{inheritall}">
<filelist refid="@{filelist}"/>
</subant>
</sequential>
</macrodef>
<patternset id="src.inc.set">
<include name="**/*.java"/>
</patternset>
<patternset id="src.exc.set"/>
<path id="groovy.class.path">
<pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/groovy-all-2.4.5.jar"/>
</path>
<path id="rhino.class.path">
<pathelement location="${ofbiz.home.dir}/extension/rhino/lib/js-1.7.R1.jar"/>
</path>
<path id="junit.class.path">
<fileset dir="${ofbiz.home.dir}/framework/base/lib/scripting/" includes="*.jar"/>
<pathelement location="${ofbiz.home.dir}/framework/base/lib/ant/ant-apache-bsf-1.7.1.jar"/>
</path>
<path id="cobertura.class.path">
<pathelement location="${ofbiz.home.dir}/framework/base/lib/cobertura-1.9.4.1.jar" />
<pathelement location="${ofbiz.home.dir}/framework/base/lib/log4j-1.2.17.jar" />
<pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/asm-3.2.jar" />
<pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/jakarta-oro-2.0.8.jar" />
</path>
<path id="local.class.path"/>
<presetdef name="default-javac">
<javac debug="on" deprecation="on" destdir="${build.dir}/classes" srcdir="${src.dir}" classpathref="local.class.path">
<patternset refid="src.inc.set"/>
<patternset refid="src.exc.set"/>
</javac>
</presetdef>
<presetdef name="javac18">
<default-javac compiler="javac1.8" target="1.8" source="1.8" encoding="UTF-8" includeantruntime="false">
<compilerarg value="-Xlint:-path"/>
<!--
Please leave these lines here. It makes it easier to enable/disable it.
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xlint:unchecked"/>
-->
</default-javac>
</presetdef>
<presetdef name="default-javadoc">
<javadoc classpathref="local.class.path"
destdir="${build.dir}/javadocs"
windowtitle="Apache OFBiz - ${desc}"
useexternalfile="yes"
maxmemory="512M"
encoding="UTF-8"
packagenames="org.ofbiz.*">
<fileset dir="${basedir}" defaultexcludes="yes">
<include name="**/*.java"/>
<exclude name="**/ControlApplet.java"/>
<exclude name="**/ShipmentScaleApplet.java"/>
<exclude name="**/test/"/>
<exclude name="**/cybersource/"/>
<exclude name="**/PayPalServices.java"/>
<exclude name="**/ideal/"/>
<exclude name="**/orbital/"/>
<exclude name="**/securepay/"/>
<exclude name="**/verisign/"/>
<exclude name="**/JREntityListIteratorDataSource.java"/>
<exclude name="**/JRMapCollectionDataSource.java"/>
<exclude name="**/openoffice/"/>
<exclude name="**/JasperReportsXmlViewHandler.java"/>
<exclude name="**/JasperReportsJXlsViewHandler.java"/>
<exclude name="**/JasperReportsPoiXlsViewHandler.java"/>
</fileset>
<link href="http://docs.oracle.com/javase/8/docs/api" offline="true" packagelistLoc="${ofbiz.home.dir}/tools/api-java18"/>
</javadoc>
</presetdef>
<macrodef name="main-jar">
<attribute name="jarfile" default="${build.dir}/lib/${name}.jar"/>
<element name="main-pattern" optional="true"/>
<element name="main-elements" optional="true"/>
<sequential>
<jar jarfile="@{jarfile}">
<fileset dir="${build.dir}/classes">
<exclude name="**/test"/>
<exclude name="**/test/*"/>
<main-pattern/>
</fileset>
<fileset dir="${src.extra.dir}">
<and>
<not>
<or>
<filename name="**/test"/>
<filename name="**/test/*"/>
</or>
</not>
<selector refid="src-extra-set"/>
</and>
</fileset>
<!-- now add the NOTICE and LICENSE files to allow the jar file to be distributed alone -->
<zipfileset dir="${ofbiz.home.dir}" prefix="META-INF" includes="NOTICE,LICENSE"/>
<main-elements/>
</jar>
</sequential>
</macrodef>
<macrodef name="test-jar">
<attribute name="jarfile" default="${build.dir}/lib/${name}-test.jar"/>
<element name="test-selector" optional="true"/>
<element name="test-elements" optional="true"/>
<sequential>
<jar jarfile="@{jarfile}">
<fileset dir="${build.dir}/classes">
<or>
<filename name="**/test"/>
<filename name="**/test/*"/>
<test-selector/>
</or>
</fileset>
<fileset dir="${src.dir}">
<and>
<filename name="**/test/*"/>
<or>
<test-selector/>
<selector refid="src-extra-set"/>
</or>
</and>
</fileset>
<zipfileset dir="${ofbiz.home.dir}" prefix="META-INF" includes="NOTICE,LICENSE"/>
<test-elements/>
</jar>
</sequential>
</macrodef>
<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="groovy.class.path"/>
<presetdef name="default-groovyc">
<groovyc destdir="${build.dir}/classes" srcdir="${src.dir}">
<classpath>
<path refid="local.class.path"/>
<pathelement path="${build.dir}/classes"/>
</classpath>
</groovyc>
</presetdef>
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${ofbiz.home.dir}/framework/base/lib/ant/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<presetdef name="externalsubant">
<subant inheritall="false">
<propertyset>
<propertyref name="ofbiz.home.dir"/>
</propertyset>
</subant>
</presetdef>
</project>