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
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]"
-->
<!--
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 -->
<import file="webagents.xml" />
<tstamp>
</tstamp>
<os name="linux"/>
</condition>
<and>
<os name="sunos"/>
<and>
<os arch="sparc"/>
</and>
</and>
</condition>
<and>
<os name="sunos"/>
<and>
<os arch="x86"/>
</and>
</and>
</condition>
<os name="linux"/>
</condition>
<and>
<os name="sunos"/>
<and>
<os arch="x86"/>
</and>
</and>
</condition>
<os family="windows"/>
</condition>
<os name="hp-ux"/>
</condition>
<os name="aix"/>
</condition>
<os family="windows"/>
</condition>
<os family="windows" arch="amd64"/>
</condition>
<os family="windows" arch="amd64"/>
</condition>
</condition>
</condition>
<isset property="target.jdk"/>
</condition>
<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"/>
</and>
</condition>
</target>
<target name="check.build.varnish302">
<condition property="build.varnish302">
<and>
<os name="linux"/>
</and>
</condition>
</target>
<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>
<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>
<not>
</not>
</and>
</condition>
<condition property="build.debug64">
<and>
</and>
</condition>
<condition property="build.nondebug32">
<and>
<not>
</not>
<not>
</not>
</and>
</condition>
<condition property="build.nondebug64">
<and>
<not>
</not>
</and>
</condition>
<target name="gmake" depends="gmake1,gmake2,gmake3,gmake4">
<echo message="Dispatch to compile of agent c code"/>
</target>
<exec executable="gmake" failonerror="true">
<arg value="DEBUG=1" />
<arg value="${containername}" />
</exec>
</target>
<exec executable="gmake" failonerror="true">
<arg value="64=1" />
<arg value="DEBUG=1" />
<arg value="${containername}" />
</exec>
</target>
<exec executable="gmake" failonerror="true">
<arg value="${containername}" />
</exec>
</target>
<exec executable="gmake" failonerror="true">
<arg value="64=1" />
<arg value="${containername}" />
</exec>
</target>
<target name="nightly">
<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 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"/>
</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=" 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 <target-name>"/>
<echo message=" "/>
</target>
</project>