build.xml revision 8a4b0b791bf38ef8389a6501a586d8ab554e3711
<!--
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="prd.nightly.dist.dir" value="dist"/>
<property name="target.jdk.set" value="1.6"/>
<property name="build.sysclasspath" value="ignore"/>
<import file="webagents.xml" />
<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="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.suffix.sdk" value="_64bit" else="">
<equals arg1="${build.type}" arg2="64"/>
</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="3.5.0-SNAPSHOT"/>
<target name="preparebuild">
<mkdir dir="${webagents.built.dir}"/>
<mkdir dir="${webagents.dist.dir}"/>
<mkdir dir="${webagents.drop.dir}"/>
</target>
<target name="clean">
<echo message="Dispatch to clean"/>
<ant antfile="${webagents.basedir}/build_agent.xml"
target="clean" inheritRefs="true"/>
<exec executable="gmake" failonerror="true">
<arg value="clean" />
</exec>
</target>
<target name="all">
<antcall target="apache22" />
<antcall target="apache24" />
<antcall target="sjsws" />
<antcall target="varnish" />
<antcall target="varnish302" />
<antcall target="sdk" />
</target>
<target name="sjsws" depends="preparebuild">
<echo message="Dispatch to SJSWS"/>
<property name="containername" value="sjsws"/>
<antcall target="gmake" inheritRefs="true"/>
<ant antfile="${webagents.basedir}/build_agent.xml"
target="all" inheritRefs="true"/>
</target>
<target name="apache22" depends="preparebuild">
<echo message="Dispatch to Apache 22"/>
<property name="containername" value="apache22"/>
<antcall target="gmake" inheritRefs="true"/>
<ant antfile="${webagents.basedir}/build_agent.xml"
target="all" inheritRefs="true"/>
</target>
<target name="apache24" depends="preparebuild">
<echo message="Dispatch to Apache 24"/>
<property name="containername" value="apache24"/>
<antcall target="gmake" inheritRefs="true"/>
<ant antfile="${webagents.basedir}/build_agent.xml"
target="all" inheritRefs="true"/>
</target>
<target name="check.build.varnish">
<condition property="build.varnish">
<!-- <and>
<or>
<os name="linux"/>
<os name="sunos"/>
</or>
<not>
<os name="sunos" arch="sparc"/>
</not>
</and> -->
<and>
<os name="linux"/>
<equals arg1="${build.type}" arg2="64"/>
</and>
</condition>
</target>
<target name="check.build.varnish302">
<condition property="build.varnish302">
<and>
<os name="linux"/>
<equals arg1="${build.type}" arg2="64"/>
</and>
</condition>
</target>
<target name="varnish" depends="preparebuild,check.build.varnish" if="build.varnish">
<echo message="Dispatch to Varnish"/>
<property name="containername" value="varnish"/>
<antcall target="gmake" inheritRefs="true"/>
<ant antfile="${webagents.basedir}/build_agent.xml"
target="varnish" inheritRefs="true"/>
</target>
<target name="varnish302" depends="preparebuild,check.build.varnish302" if="build.varnish302">
<echo message="Dispatch to Varnish 3.0.2"/>
<property name="containername" value="varnish302"/>
<antcall target="gmake" inheritRefs="true"/>
<ant antfile="${webagents.basedir}/build_agent.xml"
target="varnish302" inheritRefs="true"/>
</target>
<condition property="build.debug32">
<and>
<equals arg1="${build.debug}" arg2="full"/>
<not>
<equals arg1="${build.type}" arg2="64"/>
</not>
</and>
</condition>
<condition property="build.debug64">
<and>
<equals arg1="${build.debug}" arg2="full"/>
<equals arg1="${build.type}" arg2="64"/>
</and>
</condition>
<condition property="build.nondebug32">
<and>
<not>
<equals arg1="${build.debug}" arg2="full"/>
</not>
<not>
<equals arg1="${build.type}" arg2="64"/>
</not>
</and>
</condition>
<condition property="build.nondebug64">
<and>
<not>
<equals arg1="${build.debug}" arg2="full"/>
</not>
<equals arg1="${build.type}" arg2="64"/>
</and>
</condition>
<target name="gmake" depends="gmake1,gmake2,gmake3,gmake4">
<echo message="Dispatch to compile of agent c code"/>
</target>
<target name="gmake1" if="build.debug32">
<exec executable="gmake" failonerror="true">
<arg value="DEBUG=1" />
<arg value="${containername}" />
</exec>
</target>
<target name="gmake2" if="build.debug64">
<exec executable="gmake" failonerror="true">
<arg value="64=1" />
<arg value="DEBUG=1" />
<arg value="${containername}" />
</exec>
</target>
<target name="gmake3" if="build.nondebug32">
<exec executable="gmake" failonerror="true">
<arg value="${containername}" />
</exec>
</target>
<target name="gmake4" if="build.nondebug64">
<exec executable="gmake" failonerror="true">
<arg value="64=1" />
<arg value="${containername}" />
</exec>
</target>
<target name="nightly">
<filter token="DATE" value="${nightly.date}" />
<filter token="OS" value="${build.os}" />
<filter token="BIT" value="${build.type.suffix}" />
<filter token="ARCH" value="${build.type.suffix}" />
<filter token="BUILD_DATE" value="${nightly.date}" />
<copy file="${webagents.basedir}/agents/source/apache22/build_date.js.template"
tofile="${webagents.dist.dir}/apache_v22_${build.os}${build.type.suffix}_build_date.js" filtering="true"/>
<copy file="${webagents.basedir}/agents/source/apache24/build_date.js.template"
tofile="${webagents.dist.dir}/apache_v24_${build.os}${build.type.suffix}_build_date.js" filtering="true"/>
<copy file="${webagents.basedir}/agents/source/sjsws/build_date.js.template"
tofile="${webagents.dist.dir}/sjsws_v70_${build.os}${build.type.suffix}_build_date.js" filtering="true"/>
<copy file="${webagents.basedir}/agents/source/varnish/build_date.js.template"
tofile="${webagents.dist.dir}/varnish_v30_${build.os}${build.type.suffix}_build_date.js" filtering="true"/>
<antcall target="all" inheritRefs="true"/>
<antcall target="postnightly" inheritRefs="true"/>
</target>
<target name="postnightly">
<copy todir="${prd.nightly.dist.dir}/webagents/${nightly.date}">
<fileset dir="${webagents.dist.dir}" />
</copy>
</target>
<target name="sdk">
<echo message="Dispatch to archive OpenAM C-SDK"/>
<delete file="${webagents.drop.dir}/common_3_0_${build.os}${build.type.suffix.sdk}.zip" quiet="true"/>
<copy file="${webagents.basedir}/am/source/samples/README.TXT" tofile="${webagents.built.dir}/README.TXT" overwrite="true"/>
<copy file="${webagents.basedir}/conf/OpenSSOAgentBootstrap.template" tofile="${webagents.built.dir}/OpenSSOAgentBootstrap.template" overwrite="true"/>
<copy file="${webagents.basedir}/conf/OpenSSOAgentConfiguration.template" tofile="${webagents.built.dir}/OpenSSOAgentConfiguration.template" overwrite="true"/>
<replaceregexp file="${webagents.built.dir}/README.TXT"
match="AGENT_VER" replace="${agentversion}" byline="true"/>
<replaceregexp file="${webagents.built.dir}/OpenSSOAgentBootstrap.template"
match="AGENT_VER" replace="${agentversion}" byline="true"/>
<replaceregexp file="${webagents.built.dir}/OpenSSOAgentConfiguration.template"
match="AGENT_VER" replace="${agentversion}" byline="true"/>
<zip file="${webagents.drop.dir}/common_3_0_${build.os}${build.type.suffix.sdk}.zip">
<zipfileset prefix="bin" dir="${webagents.basedir}/am/source/" includes="crypt_util"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_auth.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_log.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_map.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_notify.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_policy.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_properties.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_sso.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_string_set.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_types.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_utils.h"/>
<zipfileset prefix="include" dir="${webagents.basedir}/am/source/" includes="am_web.h"/>
<zipfileset prefix="lib" dir="${webagents.basedir}/am/source/" includes="libamsdk.so.3"/>
<zipfileset dir="${webagents.built.dir}" includes="OpenSSOAgentBootstrap.template" fullpath="config/OpenSSOAgentBootstrap.template.orig"/>
<zipfileset dir="${webagents.built.dir}" includes="OpenSSOAgentConfiguration.template" fullpath="config/OpenSSOAgentConfiguration.template.orig"/>
<zipfileset prefix="samples" dir="${webagents.basedir}/am/source/samples" includes="**/am_*.c"/>
<zipfileset prefix="samples" dir="${webagents.built.dir}/" includes="README.TXT"/>
<zipfileset prefix="samples" dir="${webagents.basedir}/am/source/samples" includes="Makefile"/>
</zip>
<delete file="${webagents.drop.dir}/common_3_0_${build.os}${build.type.suffix.sdk}_build_date.js" quiet="true"/>
<echo file="${webagents.drop.dir}/common_3_0_${build.os}${build.type.suffix.sdk}_build_date.js">document.write("${nightly.date}");</echo>
</target>
<target name="usage">
<echo message=" "/>
<echo message=" Following targets are available for Web Agents:"/>
<echo message=" "/>
<echo message=" all : builds all the Web agents"/>
<echo message=" clean : deletes all the generated files"/>
<echo message=" sjsws : builds the Sun Java System Web Server 6.1/7.0 agent"/>
<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=" varnish : builds the Varnish Cache Server 3.0.x agent"/>
<echo message=" varnish302 : builds the Varnish Cache Server 3.0.2 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>