build.xml revision 1bed1e203acaf911cbb9635756652870ede766ff
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
The contents of this file are subject to the terms
of the Common Development and Distribution License
(the License). You may not use this file except in
compliance with the License.
You can obtain a copy of the License at
https://opensso.dev.java.net/public/CDDLv1.0.html or
opensso/legal/CDDLv1.0.txt
See the License for the specific language governing
permission and limitations under the License.
When distributing Covered Code, include this CDDL
Header Notice in each file and include the License file
at opensso/legal/CDDLv1.0.txt.
If applicable, add the following below the CDDL Header,
with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
$Id: build.xml,v 1.24 2010/02/05 00:56:01 leiming Exp $
Portions Copyrighted 2010-2015 ForgeRock AS.
-->
<project name="open-source-web-agents" default="usage">
<description>Open Web Single Sign-On Web Agents</description>
<!-- overridable properties -->
<!-- build.debug is used for c code. valid values are: optimize, full -->
<property name="build.debug" value="optimize"/>
<property name="webagents.base.dir" value="."/>
<property name="webagents.built.dir" value="${webagents.base.dir}/build"/>
<property name="prd.nightly.dist.dir" value="${webagents.base.dir}/dist"/>
<property name="target.jdk.set" value="1.6"/>
<property name="build.sysclasspath" value="ignore"/>
<tstamp>
<format property="nightly.date" pattern="yyyyMMdd" />
</tstamp>
<condition property="build.os" value="Linux">
<os name="linux"/>
</condition>
<condition property="build.os" value="SunOS_sparc">
<and>
<os name="sunos"/>
<and>
<os arch="sparc"/>
</and>
</and>
</condition>
<condition property="build.os" value="SunOS_x86">
<and>
<os name="sunos"/>
<and>
<os arch="x86"/>
</and>
</and>
</condition>
<condition property="build.os.ext" value="Linux">
<os name="linux"/>
</condition>
<condition property="build.os.ext" value="SunOS_i86pc">
<and>
<os name="sunos"/>
<and>
<os arch="x86"/>
</and>
</and>
</condition>
<condition property="build.os" value="WINNT">
<os family="windows"/>
</condition>
<condition property="build.os" value="HP-UX">
<os name="hp-ux"/>
</condition>
<condition property="build.os" value="AIX">
<os name="aix"/>
</condition>
<condition property="build.os" value="MacOSX">
<and>
<os family="mac"/>
<os family="unix"/>
</and>
</condition>
<condition property="iis.build.ok" value="true">
<os family="windows"/>
</condition>
<condition property="winnt.lib.ext" value="_64" else="">
<os family="windows" arch="amd64"/>
</condition>
<condition property="winnt.ext" value="_x64" else="">
<os family="windows" arch="amd64"/>
</condition>
<condition property="build.type.suffix" value="_64" else="">
<equals arg1="${build.type}" arg2="64"/>
</condition>
<condition property="build.type.is64Bit" value="1" else="">
<equals arg1="${build.type}" arg2="64"/>
</condition>
<condition property="build.type.isDebug" value="1" else="">
<equals arg1="${DEBUG}" arg2="1"/>
</condition>
<condition property="target.jdk.set" value="${target.jdk}">
<isset property="target.jdk"/>
</condition>
<condition property="target.jdk.set" value="1.5">
<not>
<isset property="target.jdk"/>
</not>
</condition>
<!-- agent version number appended to end of agent zip file name -->
<property name="agentversion" value="4.0.0"/>
<target name="clean">
<antcall target="cleandispatch" />
<antcall target="cleandistribution" />
</target>
<target name="cleandispatch">
<echo message="Dispatch to clean"/>
<exec executable="gmake" failonerror="true">
<arg value="clean" />
</exec>
</target>
<target name="cleandistribution">
<echo message="Remove product distribution folder"/>
<delete dir="${prd.nightly.dist.dir}"/>
</target>
<target name="all_Linux">
<antcall target="apache22" />
<antcall target="postNightlyBuildStep" inheritRefs="true"/>
<antcall target="apache24" />
<antcall target="postNightlyBuildStep" inheritRefs="true"/>
<!-- <antcall target="varnish" /> -->
</target>
<target name="all_AIX">
<antcall target="apache22" />
<antcall target="postNightlyBuildStep" inheritRefs="true"/>
<antcall target="apache24" />
<antcall target="postNightlyBuildStep" inheritRefs="true"/>
</target>
<target name="all_Solaris">
<antcall target="apache22" />
<antcall target="postNightlyBuildStep" inheritRefs="true"/>
<antcall target="apache24" />
<antcall target="postNightlyBuildStep" inheritRefs="true"/>
</target>
<target name="all_Windows">
<antcall target="apache22" />
<antcall target="postNightlyBuildStep" inheritRefs="true"/>
<antcall target="apache24" />
<antcall target="postNightlyBuildStep" inheritRefs="true"/>
<antcall target="iis7" />
<antcall target="postNightlyBuildStep" inheritRefs="true"/>
</target>
<target name="apache22">
<echo message="Dispatch to Apache 22"/>
<property name="containername" value="apache22zip"/>
<antcall target="gmake" inheritRefs="true"/>
</target>
<target name="apache24">
<echo message="Dispatch to Apache 24"/>
<property name="containername" value="apachezip"/>
<antcall target="gmake" inheritRefs="true"/>
</target>
<target name="iis7">
<echo message="Dispatch to IIS7"/>
<property name="containername" value="iiszip"/>
<antcall target="gmake" inheritRefs="true"/>
</target>
<target name="check.build.varnish">
<condition property="build.varnish">
<and>
<os name="linux"/>
<equals arg1="${build.type}" arg2="64"/>
</and>
</condition>
</target>
<target name="varnish" depends="check.build.varnish" if="build.varnish">
<echo message="Dispatch to Varnish"/>
<property name="containername" value="varnish"/>
<antcall target="gmake" inheritRefs="true"/>
</target>
<target name="gmake">
<echo message="Dispatch to compile of agent c code"/>
<exec executable="gmake" failonerror="true">
<arg value="64=${build.type.is64Bit}" />
<arg value="DEBUG=${build.type.isDebug}" />
<arg value="${containername}" />
</exec>
</target>
<target name="upgradesvn">
<echo message="Run 'svn upgrade' so 'svn info' won't fail horribly because of 'working copy is too old' messages"/>
<exec executable="svn" failonerror="false">
<arg value="upgrade" />
</exec>
</target>
<target name="nightly_Linux">
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.2-${build.os}-${build.type}-build_date.js" append="false">var apache_v22_${build.os}${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.4-${build.os}-${build.type}-build_date.js" append="false">var apache_v24_${build.os}${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Varnish-v3.0.3-${build.os}-${build.type}-build_date.js" append="false">var varnish_v303_${build.os}${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<antcall target="all_Linux" inheritRefs="true"/>
</target>
<target name="nightly_Solaris">
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.2-${build.os}-${build.type}-build_date.js" append="false">var apache_v22_${build.os}${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.4-${build.os}-${build.type}-build_date.js" append="false">var apache_v24_${build.os}${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<antcall target="all_Solaris" inheritRefs="true"/>
</target>
<target name="nightly_AIX6">
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.2-${build.os}6-${build.type}-build_date.js" append="false">var apache_v22_${build.os}6${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.4-${build.os}6-${build.type}-build_date.js" append="false">var apache_v24_${build.os}6${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<antcall target="all_AIX" inheritRefs="true"/>
</target>
<target name="nightly_AIX7">
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.2-${build.os}7-${build.type}-build_date.js" append="false">var apache_v22_${build.os}7${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.4-${build.os}7-${build.type}-build_date.js" append="false">var apache_v24_${build.os}7${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<antcall target="all_AIX" inheritRefs="true"/>
</target>
<target name="nightly_Windows">
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.2-${build.os}-${build.type}-build_date.js" append="false">var apache_v22_${build.os}${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/Apache-v2.4-${build.os}-${build.type}-build_date.js" append="false">var apache_v24_${build.os}${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<echo file="${prd.nightly.dist.dir}/webagents/${nightly.date}/IIS-v7-${build.os}-${build.type}-build_date.js" append="false">var iis_v7_${build.os}${build.type.suffix}_build_date = "${nightly.date}";
</echo>
<antcall target="all_Windows" inheritRefs="true"/>
</target>
<target name="postNightlyBuildStep">
<copy todir="${prd.nightly.dist.dir}/webagents/${nightly.date}">
<fileset dir="${webagents.built.dir}" >
<include name="*.zip"/>
</fileset>
</copy>
</target>
<target name="usage">
<echo message=" "/>
<echo message=" Following targets are available for Web Agents:"/>
<echo message=" "/>
<echo message=" all_Linux : builds all the Linux Web agents"/>
<echo message=" all_AIX : builds all the AIX Web agents"/>
<echo message=" all_Windows : builds all the Windows Web agents"/>
<echo message=" all_Solaris : builds all the relevant Solaris Web agents"/>
<echo message=" clean : deletes all the generated files"/>
<echo message=" upgradesvn : this is a fudge to avoid 'workspace is too old' messages when 'svn info' is run"/>
<echo message=" apache22 : builds the Apache Web Server 2.2.x agent"/>
<echo message=" apache24 : builds the Apache Web Server 2.4.x agent"/>
<echo message=" iis7 : builds the Microsoft Internet Information Services 7 agent"/>
<echo message=" varnish : builds the Varnish Cache Server 3.0.3 agent"/>
<echo message=" usage : displays this usage message"/>
<echo message=" "/>
<echo message=" To run a target, issue the following command:"/>
<echo message=" "/>
<echo message=" ant &lt;target-name&gt;"/>
<echo message=" "/>
</target>
</project>