blob: ae3d89c7d243091f98c1c796e5076e2cccf27a93 [file] [log] [blame]
<?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="OFBiz Main Build" default="build" basedir=".">
<property name="site.dir" value="../site"/>
<property name="memory.initial.param" value="-Xms128M"/>
<property name="memory.max.param" value="-Xmx512M"/>
<available file="applications/build.xml" property="applications.present"/>
<available file="specialpurpose/build.xml" property="specialpurpose.present"/>
<!-- ================================================================== -->
<!-- Initialization of all property settings -->
<!-- ================================================================== -->
<target name="ofbiz-init">
<property environment="env"/>
</target>
<!-- ================================================================== -->
<!-- Removes all created files and directories -->
<!-- ================================================================== -->
<target name="refresh">
<antcall target="clean-all"/>
<antcall target="build"/>
</target>
<target name="clean-all">
<antcall target="clean-data"/>
<antcall target="clean-logs"/>
<antcall target="clean-output"/>
<antcall target="clean-xtra"/>
<antcall target="clean-catalina"/>
<antcall target="clean-cache"/>
<antcall target="clean"/>
</target>
<target name="clean-data">
<subant target="clean-data">
<filelist dir="." files="framework/build.xml"/>
</subant>
</target>
<target name="clean-logs">
<subant target="clean-logs">
<filelist dir="." files="framework/build.xml"/>
</subant>
</target>
<target name="clean-output">
<subant target="clean-output">
<filelist dir="." files="framework/build.xml"/>
</subant>
</target>
<target name="clean-xtra">
<delete verbose="on">
<fileset dir="." includes="**/.nbattrs,**/*~,**/.#*,**/.DS_Store,**/*.rej,**/*.orig"/>
</delete>
</target>
<target name="clean-catalina">
<subant target="clean-catalina">
<filelist dir="." files="framework/build.xml"/>
</subant>
</target>
<target name="clean-cache"
description="Clean the UtilCache file if errors found with old objects in the cache (Java runtime error something like 'local class incompatible')">
<property file="framework/base/config/cache.properties"/>
<echo message="NOTICE: deleting ${cache.file.store}.db"/>
<delete file="${cache.file.store}.db" verbose="true"/>
</target>
<target name="tests">
<subant target="tests">
<filelist dir="." files="framework/build.xml"/>
</subant>
</target>
<target name="clean">
<subant target="clean">
<fileset dir="${basedir}/hot-deploy" casesensitive="no">
<include name="**/build.xml"/>
</fileset>
</subant>
<subant target="clean" failonerror="${specialpurpose.present}" description="Use failonerror=false in case the specialpurpose directory is not there">
<filelist dir="." files="specialpurpose/build.xml"/>
</subant>
<subant target="clean" failonerror="${applications.present}" description="Use failonerror=false in case the applications directory is not there">
<filelist dir="." files="applications/build.xml"/>
</subant>
<subant target="clean">
<filelist dir="." files="framework/build.xml"/>
</subant>
<delete file="ofbiz.jar"/>
<echo message="[clean] ========== Done Cleaning =========="/>
</target>
<!-- ================================================================== -->
<!-- Build Components -->
<!-- ================================================================== -->
<target name="build">
<echo message="[build] ========== Start Building (Compile) =========="/>
<subant inheritall="false">
<filelist dir="." files="framework/build.xml"/>
</subant>
<subant inheritall="false" failonerror="${applications.present}">
<filelist dir="." files="applications/build.xml"/>
</subant>
<subant inheritall="false" failonerror="${specialpurpose.present}">
<filelist dir="." files="specialpurpose/build.xml"/>
</subant>
<subant inheritall="false">
<fileset dir="${basedir}/hot-deploy" casesensitive="no">
<exclude name="disabled/**"/>
<include name="**/build.xml"/>
</fileset>
</subant>
<echo message="[build] ========== Done Building (Compile) =========="/>
</target>
<!-- ================================================================== -->
<!-- Build JavaDocs -->
<!-- ================================================================== -->
<target name="docs">
<echo message="[docs] ========== Start Building (JavaDoc) =========="/>
<subant target="docs">
<filelist dir="." files="framework/build.xml"/>
</subant>
<subant target="docs" failonerror="${applications.present}">
<filelist dir="." files="applications/build.xml"/>
</subant>
<subant target="docs" failonerror="${specialpurpose.present}">
<filelist dir="." files="specialpurpose/build.xml"/>
</subant>
<subant target="docs">
<fileset dir="${basedir}/hot-deploy" casesensitive="no">
<include name="**/build.xml"/>
</fileset>
</subant>
<echo message="[docs] ========== Done Building (JavaDocs) =========="/>
</target>
<target name="docs-all" depends="build"
description="Build all javadoc into one tree for easier viewing by the community">
<echo message="[docs-all] ========== Start Building (JavaDoc) =========="/>
<mkdir dir="${site.dir}/javadocs"/>
<javadoc packagenames="org.ofbiz.*"
destdir="${site.dir}/javadocs"
maxmemory="256M"
windowtitle="Open for Business - API"
useexternalfile="yes">
<fileset dir="${basedir}" defaultexcludes="yes">
<include name="**/*.java"/>
<exclude name="**/ControlApplet.java"/>
<exclude name="**/ShipmentScaleApplet.java"/>
<exclude name="**/test/"/>
</fileset>
</javadoc>
<echo message="[docs-all] ========== Done Building (JavaDocs) =========="/>
</target>
<!-- ================================================================== -->
<!-- Contrib Targets -->
<!-- ================================================================== -->
<target name="copy-contrib">
<copy todir="${basedir}" overwrite="true" verbose="true">
<fileset dir="${basedir}/contrib" excludes="contrib/**,**/*.class"/>
</copy>
</target>
<target name="build-contrib" depends="copy-contrib,refresh"/>
<!-- ================================================================== -->
<!-- WebSite Targets -->
<!-- ================================================================== -->
<target name="build-website">
<antcall target="copy-dtds"/>
<antcall target="docs"/>
<antcall target="copy-apis"/>
</target>
<target name="copy-apis">
<mkdir dir="${site.dir}/api"/>
<mkdir dir="${site.dir}/api/framework"/>
<mkdir dir="${site.dir}/api/applications"/>
<mkdir dir="${site.dir}/api/specialpurpose"/>
<copy todir="${site.dir}/api/framework">
<fileset dir="${basedir}/framework" includes="**/build/javadocs/**"/>
</copy>
<copy todir="${site.dir}/api/applications">
<fileset dir="${basedir}/applications" includes="**/build/javadocs/**"/>
</copy>
<copy todir="${site.dir}/api/specialpurpose">
<fileset dir="${basedir}/specialpurpose" includes="**/build/javadocs/**"/>
</copy>
</target>
<target name="copy-dtds">
<mkdir dir="${site.dir}/dtds"/>
<copy todir="${site.dir}/dtds" flatten="true" overwrite="true">
<fileset dir="${basedir}" includes="**/*.dtd"/>
<fileset dir="${basedir}" includes="**/*.xsd"/>
</copy>
</target>
<!-- ================================================================== -->
<!-- Script Targets -->
<!-- ================================================================== -->
<target name="scriptfix">
<fixcrlf srcdir="${basedir}" eol="lf" eof="remove" includes="**/*.sh"/>
<fixcrlf srcdir="${basedir}" eol="crlf" includes="**/*.bat"/>
</target>
<!-- ================================================================== -->
<!-- Start OFBiz -->
<!-- ================================================================== -->
<target name="run" depends="build">
<java jar="ofbiz.jar" fork="true">
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${memory.max.param}"/>
</java>
</target>
<target name="run-pos" depends="build">
<java jar="ofbiz.jar" fork="true">
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${memory.max.param}"/>
<arg value="pos"/>
</java>
</target>
<target name="run-install" depends="build"
description="This loads all configured data; meant for generic OFBiz development, testing, demonstration, etc purposes">
<java jar="ofbiz.jar" fork="true">
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${memory.max.param}"/>
<arg value="install"/>
</java>
</target>
<target name="run-install-seed" depends="build"
description="This loads ONLY the seed data (not seed-initial, demo, ext* or anything else); meant for use after an update of the code to reload the seed data as it is generally maintained along with the code and needs to be in sync for operation">
<java jar="ofbiz.jar" fork="true">
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${memory.max.param}"/>
<arg value="install"/>
<arg value="readers=seed"/>
</java>
</target>
<target name="run-install-extseed" depends="build"
description="This loads seed, seed-initial and ext data; meant for manual/generic testing, development, or going into production with a derived system based on stock OFBiz where the ext data basically replaces the demo data">
<java jar="ofbiz.jar" fork="true">
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${memory.max.param}"/>
<arg value="install"/>
<arg value="readers=seed,seed-initial,ext"/>
</java>
</target>
<target name="run-install-exttest" depends="build"
description="This loads seed, seed-initial, ext and ext-test data; meant for automated testing with a derived system based on stock OFBiz">
<java jar="ofbiz.jar" fork="true">
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${memory.max.param}"/>
<arg value="install"/>
<arg value="readers=seed,seed-initial,ext,ext-test"/>
</java>
</target>
<target name="run-debug" depends="build">
<java jar="ofbiz.jar" fork="true">
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${memory.max.param}"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=NONE"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"/>
</java>
</target>
<target name="run-tests" depends="build">
<java jar="ofbiz.jar" fork="true">
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${memory.max.param}"/>
<arg value="test"/>
</java>
</target>
</project>