Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

264 lines (249 sloc) 9.757 kB
<?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">
<condition property="antatleast171">
<antversion atleast="1.7.1"/>
</condition>
<fail unless="antatleast171" message="Please upgrade ant to at least 1.7.1"/>
<condition property="javaatleast17">
<not>
<matches pattern="^1\.[0-6]($|\..*)" string="${ant.java.version}"/>
</not>
</condition>
<fail unless="javaatleast17" message="Please upgrade java to at least 1.7"/>
<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>
<path id="src-path">
<dirset dir=".">
<patternset refid="src-dirs"/>
</dirset>
</path>
<patternset id="src-dirs"/>
<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/commons/commons-cli-1.0.jar"/>
<pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/antlr-2.7.6.jar"/>
<pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/asm-3.2.jar"/>
<pathelement location="${ofbiz.home.dir}/framework/base/lib/scripting/groovy-all-1.8.6.jar"/>
</path>
<path id="rhino.class.path">
<pathelement location="${ofbiz.home.dir}/extension/rhino/lib/js-1.7.R1.jar"/>
</path>
<path id="ant.lib.class.path">
<pathelement location="${ofbiz.home.dir}/framework/base/lib/ant/ant-nodeps-1.7.1.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="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="javac17">
<default-javac compiler="javac1.7" target="1.7" source="1.7" encoding="UTF-8" sourcepathref="src-path" includeantruntime="false">
<compilerarg value="-Xlint:-path"/>
<!--
Please leave this line here. It makes it easier to enable/disable it.
<compilerarg value="-Xlint:unchecked"/>
-->
</default-javac>
</presetdef>
<presetdef name="default-javadoc">
<javadoc classpathref="local.class.path"
destdir="${build.dir}/javadocs"
windowtitle="Open for Business - ${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="**/XaPoolConnectionFactory.java"/>
<exclude name="**/JasperReportsPdfViewHandler.java"/>
<exclude name="**/JasperReportsXmlViewHandler.java"/>
<exclude name="**/JasperReportsJXlsViewHandler.java"/>
<exclude name="**/JasperReportsPoiXlsViewHandler.java"/>
<exclude name="**/GenericViewRenderer.java"/>
<exclude name="**/JPublishViewHandler.java"/>
<exclude name="**/JPublishWrapper.java"/>
<exclude name="**/FopPdfViewHandler.java"/>
<exclude name="**/FreeMarkerViewRenderer.java"/>
<exclude name="**/JpCacheIncludeTransform.java"/>
<exclude name="**/shark/"/>
</fileset>
<link href="https://docs.oracle.com/javase/7/docs/api/" offline="true" packagelistLoc="${ofbiz.home.dir}/tools/api-java17"/>
</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>
<taskdef name="javacc" classname="org.apache.tools.ant.taskdefs.optional.javacc.JavaCC" classpath="${ofbiz.home.dir}/framework/base/lib/ant/ant-nodeps-1.7.1.jar"/>
<taskdef name="jjtree" classname="org.apache.tools.ant.taskdefs.optional.javacc.JJTree" classpath="${ofbiz.home.dir}/framework/base/lib/ant/ant-nodeps-1.7.1.jar"/>
<macrodef name="ofbiz-javacc">
<attribute name="dir"/>
<attribute name="file"/>
<attribute name="prefix" default=""/>
<sequential>
<if>
<not>
<uptodate
srcfile="@{prefix}src/@{dir}/@{file}.jj"
targetfile="@{prefix}build/gen-src/javacc/@{dir}/@{file}.java"/>
</not>
<then>
<delete dir="@{prefix}build/gen-src/javacc/@{dir}"/>
<mkdir dir="@{prefix}build/gen-src/javacc/@{dir}"/>
<javacc target="@{prefix}src/@{dir}/@{file}.jj"
javacchome="${ofbiz.home.dir}/lib/build/javacc"
outputdirectory="@{prefix}build/gen-src/javacc/@{dir}"/>
<replace token="public class"
value='@SuppressWarnings("all") public class'
dir="@{prefix}build/gen-src/javacc/@{dir}"
includes="*.java" />
<delete dir="@{prefix}build/classes/@{dir}"/>
</then>
</if>
</sequential>
</macrodef>
<macrodef name="ofbiz-jjtree">
<attribute name="dir"/>
<attribute name="file"/>
<attribute name="prefix" default=""/>
<sequential>
<if>
<not>
<uptodate
srcfile="@{prefix}src/@{dir}/@{file}.jjt"
targetfile="@{prefix}build/gen-src/jjtree/@{dir}/@{file}.jj"/>
</not>
<delete dir="@{prefix}build/gen-src/jjtree/@{dir}"/>
<mkdir dir="@{prefix}build/gen-src/jjtree/@{dir}"/>
<jjtree target="@{prefix}src/@{dir}/@{file}.jjt"
javacchome="${ofbiz.home.dir}/lib/build/javacc"
outputdirectory="@{prefix}build/gen-src/jjtree/@{dir}"/>
</if>
<if>
<not>
<uptodate
srcfile="@{prefix}build/gen-src/jjtree/@{dir}/@{file}.jj"
targetfile="@{prefix}build/gen-src/javacc/@{dir}/@{file}.java"/>
</not>
<delete dir="@{prefix}build/gen-src/javacc/@{dir}"/>
<mkdir dir="@{prefix}build/gen-src/javacc/@{dir}"/>
<javacc target="@{prefix}build/gen-src/jjtree/@{dir}/@{file}.jj"
javacchome="${ofbiz.home.dir}/lib/build/javacc"
outputdirectory="@{prefix}build/gen-src/javacc/@{dir}"/>
<delete dir="@{prefix}build/classes/@{dir}"/>
</if>
</sequential>
</macrodef>
</project>
Jump to Line
Something went wrong with that request. Please try again.