blob: 6f8fe530c43ed212727afe3a5c31e14e2c286cfa [file] [log] [blame]
<?xml version="1.0"?>
<!--
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="qa-regress.war/build.xml" default="main" basedir="../.."> <!-- flex/qa -->
<property environment="env"/>
<property name="qa.dir" value="${basedir}" />
<property name="blazeds.dir" value="${qa.dir}/.."/>
<property file="${qa.dir}/local.properties"/>
<property file="${qa.dir}/build.properties" />
<property file="${blazeds.dir}/build.properties"/>
<property name="blazeds.dir.frameworks.dir" value="${blazeds.dir}/frameworks"/>
<property name="qa.war" value="${qa.dir}/apps/qa-regress"/>
<property name="dist.dir" value="${blazeds.dir}/dist"/>
<property name="src.dir" value="${qa.war}/WEB-INF/src"/>
<property name="config.dir" value="${qa.war}/WEB-INF/flex"/>
<property name="config.file" value="flex-config.xml"/>
<property name="config.sourcedir" location="${qa.dir}/resources/config" />
<property name="classes.dir" value="${qa.war}/WEB-INF/classes"/>
<property name="nowarn" value="on" />
<property name="server" value="${build.number}"/>
<condition property="template.dir" value="client-side-detection-with-history">
<equals arg1="${sdk.version}" arg2="3"/>
</condition>
<condition property="qa-regress.war.file" value="qa-regress-sdk3.war">
<equals arg1="${sdk.version}" arg2="3"/>
</condition>
<property name="template.dir" value=""/>
<property name="qa-regress.war.file" value="qa-regress.war"/>
<condition property="flextasks.dir" value="${FLEX_HOME}/ant/lib">
<available file="${FLEX_HOME}/ant/lib/flexTasks.jar" />
</condition>
<property name="flextasks.dir" value="${FLEX_HOME}/lib" />
<path id="classpath">
<fileset dir="${qa.war}/WEB-INF/lib" includes="**/*.jar"/>
<fileset dir="${flextasks.dir}" includes="flexTasks.jar"/>
<pathelement location="${jms.jar}"/>
<pathelement location="${servlet.jar}"/>
<pathelement location="${xalan.jar}"/>
</path>
<path id="qa.classpath">
<fileset dir="${qa.dir}/lib" includes="**/*.jar"/>
<fileset dir="${blazeds.dir}/lib" includes="**/*.jar"/>
<!--fileset dir="${ANT_HOME}/lib" includes="**/*.jar"/>
<fileset dir="${FLEX_HOME}/ant/lib" includes="flexTasks.jar"/-->
<fileset dir="${FLEX_HOME}/lib/external" includes="xercesImpl.jar"/>
<pathelement location="${qa.dir}/classes" />
</path>
<target name="main" depends="clean,compile,generate-config-files"/>
<target name="prepare" depends="compile-qasource">
<mkdir dir="${qa.war}/WEB-INF/lib"/>
<mkdir dir="${qa.war}/WEB-INF/classes"/>
<delete file="${qa.war}/WEB-INF/flex/cache.dep" quiet="true"/>
</target>
<target name="compile-qasource" >
<ant antfile="${qa.dir}/src/build.xml" inheritall="false">
<property name="qa.dir" location="${qa.dir}" />
<property name="sdk.dir" location="${sdk.dir}" />
<property name="blazeds.dir" location="${blazeds.dir}" />
</ant>
</target>
<target name="copy-webtier" description="copy QE webtier resources" >
<copy todir="${qa.war}/WEB-INF">
<fileset dir="${qa.dir}/resources/webtier/qa/">
<include name="web.xml*"/>
</fileset>
</copy>
<copy todir="${qa.war}/WEB-INF/src" overwrite="true">
<fileset dir="${qa.dir}/resources/webtier/qa/src">
<include name="**/*"/>
</fileset>
</copy>
<copy todir="${qa.war}/WEB-INF/lib">
<fileset dir="${qa.dir}/lib/" includes="ant.jar,ant-launcher.jar"/>
</copy>
<!--copy ant flexTask for the mxml servlet -->
<copy todir="${qa.war}/WEB-INF/lib">
<fileset dir="${blazeds.dir}/lib">
<include name="flexTasks.jar"/>
</fileset>
</copy>
</target>
<target name="webtier-clean" >
<!-- Don't delete spring version of web.xml" -->
<delete quiet="true">
<fileset dir="${qa.war}/WEB-INF" includes="web.xml*" excludes="web.xml.spring"/>
</delete>
<delete quiet="true">
<fileset dir="${qa.war}/WEB-INF/lib" includes="ant.jar,ant-launcher.jar,flexTasks.jar"/>
</delete>
</target>
<target name="copy-resources" depends="copy-webtier">
<condition property="runtype.spring" value="true">
<equals arg1="${runtype}" arg2="spring" />
</condition>
<antcall target="copy.if.spring" />
<!-- copy to the WEB-INF/flex directory -->
<copy todir="${qa.war}/WEB-INF/flex">
<fileset dir="${blazeds.dir.frameworks.dir}">
<include name="*-manifest.xml"/>
<include name="flash-unicode-table.xml"/>
<include name="flex-sdk-description.xml"/>
<include name="*.ser"/>
<include name="locale/**/*"/>
<include name="themes/**/*"/>
</fileset>
</copy>
<!-- copy swcs to the WEB-INF/flex/libs directory -->
<copy todir="${qa.war}/WEB-INF/flex/libs">
<fileset dir="${blazeds.dir.frameworks.dir}/libs" includes="**/*.swc"/>
</copy>
<!-- copy template file to the history directory -->
<copy todir="${qa.war}/history" flatten="true">
<fileset dir="${blazeds.dir}/templates/${template.dir}" includes="**/*.js,**/*.css,**/historyFrame.html"/>
</copy>
<!-- copy qa swcs to the WEB-INF/flex/libs directory
<copy todir="${qa.war}/WEB-INF/flex/libs">
<fileset dir="${qa.dir}/frameworks/libs" includes="${qa.libs}"/>
</copy>
-->
<!-- copy to the lib directory -->
<copy todir="${qa.war}/WEB-INF/lib">
<fileset dir="${blazeds.dir}/lib" includes="${webapp.lib},${webtier.lib},${jgroups.jars}" />
<fileset dir="${qa.dir}/lib" includes="${axis.jars},${qa-services.jars}"/>
<fileset dir="${blazeds.dir}/lib/spring" includes="**/*" />
</copy>
<!-- copy to the classes directory -->
<copy todir="${qa.war}/WEB-INF/classes">
<fileset dir="${qa.war}/WEB-INF/src">
<include name="**/*.xml"/>
</fileset>
<fileset dir="${blazeds.dir}/lib" includes="${webapp.classes}" />
</copy>
<!-- copy httpunit and xalan jars which are used by mxunit to the qa.dir/lib directory -->
<copy todir="${qa.dir}/lib">
<fileset dir="${blazeds.dir}/lib" includes="${httpclient.jars}"/>
<fileset dir="${blazeds.dir}/lib" includes="xalan.jar"/>
</copy>
<!-- create version.properties -->
<propertyfile file="${qa.war}/WEB-INF/flex/version.properties">
<entry key="build" value="${manifest.Implementation-Version}.${build.number}"/>
<entry key="minimumSDKVersion" value="${min.sdk.version}"/>
</propertyfile>
</target>
<target name="copy.if.spring" if="runtype.spring" >
<!-- replace web.xml with web.xml.spring -->
<copy file="${qa.war}/WEB-INF/web.xml" tofile="${qa.war}/WEB-INF/web.xml.orig"/>
<delete file="${qa.war}/WEB-INF/web.xml"/>
<copy file="${qa.war}/WEB-INF/web.xml.spring" tofile="${qa.war}/WEB-INF/web.xml"/>
</target>
<target name="copy.automation.resources" description="Copy QA Resources..." >
<!-- delete old folders -->
<delete>
<fileset dir="${qa.war}">
<include name="features/*"/>
<include name="lib/*"/>
</fileset>
</delete>
<delete dir="${qa.war}/WEB-INF/flex/qa_classes"/>
<!-- copy frameworks -->
<copy todir="${qa.war}">
<fileset dir="${qa.dir}">
<include name="features/*"/>
<include name="lib/*"/>
<exclude name="lib/tools/"/>
</fileset>
</copy>
</target>
<target name="run-depend" if="src.depend">
<echo message="Removing class files that changed and dependent class files."/>
<depend cache="${classes.dir}" srcdir="${src.dir}" destdir="${classes.dir}"/>
</target>
<target name="compile" depends="prepare,run-depend,copy-resources" description="compile">
<echo message="${xalan.jar}"/>
<echo message="compiling sources with 1.5 "/>
<javac source="1.5" deprecation="off" debug="true" nowarn="${nowarn}" destdir="${classes.dir}" srcdir="${src.dir}" classpathref="classpath" />
<copy todir="${classes.dir}">
<fileset dir="${src.dir}" includes="**/*.xml,**/*.p4,**/*.jpg" />
</copy>
</target>
<target name="generate-config-files" description="--> Merge local .mod.xml files with original config files. Override 'config.sourcedir' to specify a different source location for the original config files." >
<taskdef name="MergeXML" classname="tools.ant.MergeXML">
<classpath refid="qa.classpath"/>
</taskdef>
<delete dir="${config.dir}/mergeGenerated" quiet="true"/>
<mkdir dir="${config.dir}/mergeGenerated" />
<!-- Merge mods and local overrides into flex-config.xml -->
<MergeXML baseFile="${config.sourcedir}/flex-config.xml"
importFile="${config.dir}/flex-config.mods.xml"
destinationFile="${config.dir}/mergeGenerated/flex-config.aftermods.xml"/>
<MergeXML baseFile="${config.dir}/mergeGenerated/flex-config.aftermods.xml"
importFile="${config.dir}/flex-config.mods.local.xml"
destinationFile="${config.dir}/flex-config.xml"/>
<!-- Merge mods and local overrides into air-config.xml -->
<MergeXML baseFile="${config.sourcedir}/air-config.xml"
importFile="${config.dir}/flex-config.mods.xml"
destinationFile="${config.dir}/mergeGenerated/air-config.aftermods.xml"/>
<MergeXML baseFile="${config.dir}/mergeGenerated/air-config.aftermods.xml"
importFile="${config.dir}/flex-config.mods.local.xml"
destinationFile="${config.dir}/air-config.xml"/>
<!-- Merge mods and local overrides into services-config.xml -->
<MergeXML baseFile="${config.sourcedir}/services-config.xml"
importFile="${config.dir}/services-config.mods.xml"
destinationFile="${config.dir}/mergeGenerated/services-config.aftermods.xml"/>
<MergeXML baseFile="${config.dir}/mergeGenerated/services-config.aftermods.xml"
importFile="${config.dir}/services-config.mods.local.xml"
destinationFile="${config.dir}/services-config.xml"/>
<!-- Create services-config.xml for class deserialization validator testing -->
<MergeXML baseFile="${config.dir}/services-config.xml"
importFile="${config.dir}/services-config.mods.validators.xml"
destinationFile="${config.dir}/services-config.validators.xml"/>
<!-- Merge mods and local overrides into proxy-config.xml -->
<MergeXML baseFile="${config.sourcedir}/proxy-config.xml"
importFile="${config.dir}/proxy-config.mods.xml"
destinationFile="${config.dir}/mergeGenerated/proxy-config.aftermods.xml"/>
<MergeXML baseFile="${config.dir}/mergeGenerated/proxy-config.aftermods.xml"
importFile="${config.dir}/proxy-config.mods.local.xml"
destinationFile="${config.dir}/proxy-config.xml"/>
<!-- Merge mods and local overrides into remoting-config.xml -->
<MergeXML baseFile="${config.sourcedir}/remoting-config.xml"
importFile="${config.dir}/remoting-config.mods.xml"
destinationFile="${config.dir}/mergeGenerated/remoting-config.aftermods.xml"/>
<MergeXML baseFile="${config.dir}/mergeGenerated/remoting-config.aftermods.xml"
importFile="${config.dir}/remoting-config.mods.local.xml"
destinationFile="${config.dir}/remoting-config.xml"/>
<!-- Merge mods and local overrides into messaging-config.xml -->
<MergeXML baseFile="${config.sourcedir}/messaging-config.xml"
importFile="${config.dir}/messaging-config.mods.xml"
destinationFile="${config.dir}/mergeGenerated/messaging-config.aftermods.xml"/>
<MergeXML baseFile="${config.dir}/mergeGenerated/messaging-config.aftermods.xml"
importFile="${config.dir}/messaging-config.mods.local.xml"
destinationFile="${config.dir}/messaging-config.xml"/>
<delete dir="${config.dir}/mergeGenerated" quiet="true"/>
<condition property="runtype.validators" value="true">
<equals arg1="${runtype}" arg2="validators" />
</condition>
<antcall target="copy.if.validators" />
</target>
<target name="copy.if.validators" if="runtype.validators" >
<!-- replace services-config.xml with services-config.validators.xml for class deserialization validator testing -->
<copy file="${qa.war}/WEB-INF/flex/services-config.xml" tofile="${qa.war}/WEB-INF/flex/services-config.xml.orig"/>
<delete file="${qa.war}/WEB-INF/flex/services-config.xml"/>
<copy file="${qa.war}/WEB-INF/flex/services-config.validators.xml" tofile="${qa.war}/WEB-INF/flex/services-config.xml"/>
</target>
<target name="generate-deployable-config-files" depends="generate-config-files"
description="--> Remove relative paths from config files. Override 'config.sourcedir' to specify a different source location for the original config files." >
<property name="config.sourcedir" location="${qa.dir}/resources/config" />
<taskdef name="MergeXML" classname="tools.ant.MergeXML">
<classpath refid="qa.classpath"/>
</taskdef>
<mkdir dir="${config.dir}/previousConfigs" />
<move file="${config.dir}/flex-config.xml" toDir="${config.dir}/previousConfigs" overwrite="true" failonerror="false"/>
<!-- Remove relative paths from flex-config.xml -->
<MergeXML baseFile="${config.dir}/previousConfigs/flex-config.xml"
importFile="${config.dir}/flex-config.mods.deployable.xml"
destinationFile="${config.dir}/flex-config.xml"/>
<delete dir="${config.dir}/previousConfigs" quiet="true"/>
</target>
<target name="package-qa-sdk" description="used for precompilation by deployed wars">
<copy file="${qa.dir}/lib/browserServer.jar" tofile="${blazeds.dir}/lib/browserServer.jar" overwrite="true"/>
<!-- create sdk 4 zip for qa -->
<zip destfile="${dist.dir}/qa-sdk-4.zip" duplicate="preserve">
<zipfileset src="${blazeds.dir}/resources/flex_sdk/flex_sdk_4.zip">
<include name="ant/lib/*.jar"/>
<include name="bin/**/*"/>
<include name="runtimes/**/*"/>
<include name="frameworks/**/*"/>
<exclude name="frameworks/libs/rpc.swc"/>
<exclude name="frameworks/flash-integration/"/>
<exclude name="frameworks/javascript/"/>
<exclude name="frameworks/libs/air/"/>
<exclude name="frameworks/libs/player/"/>
<exclude name="frameworks/local-swcs/"/>
<exclude name="frameworks/projects/"/>
<include name="lib/*.jar"/>
</zipfileset>
<fileset dir="${qa.dir}">
<include name="lib/browserServer.jar"/>
</fileset>
<zipfileset dir="${qa.war}/WEB-INF/flex" prefix="frameworks">
<include name="libs/**/*.swc"/>
<include name="locale/**/*.swc"/>
</zipfileset>
</zip>
<!-- create sdk 3 zip for qa -->
<!-- <zip destfile="${dist.dir}/qa-sdk-3.zip" duplicate="preserve">
<zipfileset src="${blazeds.dir}/resources/flex_sdk/flex_sdk_3.zip">
<include name="ant/lib/*.jar"/>
<include name="bin/**/*"/>
<include name="runtimes/**/*"/>
<include name="frameworks/**/*"/>
<exclude name="frameworks/flash-integration/"/>
<exclude name="frameworks/libs/rpc.swc"/>
<exclude name="frameworks/javascript/"/>
<exclude name="frameworks/libs/air/"/>
<exclude name="frameworks/libs/player/"/>
<exclude name="frameworks/local-swcs/"/>
<exclude name="frameworks/projects/"/>
<include name="lib/*.jar"/>
</zipfileset>
<fileset dir="${qa.dir}">
<include name="lib/browserServer.jar"/>
</fileset>
<zipfileset dir="${qa.war}/WEB-INF/flex" prefix="frameworks">
<include name="libs/**/*.swc"/>
<include name="locale/**/*.swc"/>
</zipfileset>
</zip> -->
</target>
<target name="package" depends="copy.automation.resources,generate-deployable-config-files,package-qa-sdk" description=" Creates distribution war file">
<war file="${dist.dir}/${qa-regress.war.file}"
webxml="${qa.war}/WEB-INF/web.xml">
<manifest>
<attribute name="Sealed" value="${manifest.sealed}"/>
<attribute name="Implementation-Title" value="${manifest.Implementation-Title} - QA Regressions Application"/>
<attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${label}"/>
<attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/>
</manifest>
<fileset dir="${qa.war}" excludes="WEB-INF/flex/*.mods.*,build.xml,WEB-INF/jsp/**/*,WEB-INF/sessions/**/*"/>
</war>
</target>
<target name="clean" depends="webtier-clean" description="--> Removes jars and classes">
<delete quiet="true">
<fileset dir="${blazeds.dir}/lib" includes="browserServer.jar"/>
</delete>
<delete quiet="true">
<fileset dir="${qa.war}/WEB-INF/lib" includes="**/*"/>
</delete>
<delete quiet="true">
<fileset dir="${qa.war}/WEB-INF/flex/jars" includes="**/*"/>
</delete>
<delete quiet="true" includeEmptyDirs="true">
<fileset dir="${qa.war}/WEB-INF/flex/locale" includes="**/*"/>
</delete>
<delete quiet="true" includeEmptyDirs="true">
<fileset dir="${qa.war}/WEB-INF/flex/libs" includes="**/*"/>
</delete>
<delete quiet="true" includeEmptyDirs="true">
<fileset dir="${qa.war}/WEB-INF/flex" includes="cache.dep,*.ser,*-manifest.xml,flash-unicode-table.xml,flex-sdk-description.xml,services-config.validators.xml,version.properties"/>
</delete>
<delete quiet="true" includeEmptyDirs="true">
<fileset dir="${qa.war}/history" includes="**/*"/>
</delete>
<!-- generated config files -->
<delete quiet="true" >
<fileset dir="${qa.war}/WEB-INF/flex" includes="services-config.xml,proxy-config.xml,remoting-config.xml,messaging-config.xml,flex-config.xml,services-config.orig.xml,air-config.xml"/>
<fileset dir="${qa.war}/WEB-INF" includes="web.xml.deployable,web.xml,web.xml.spring"/>
</delete>
<delete quiet="true">
<fileset dir="${classes.dir}" includes="**/*.class"/>
</delete>
<delete quiet="true" file="${dist.dir}/${qa-regress.war.file}"/>
<delete quiet="true" file="${dist.dir}/qa-sdk-4.zip"/>
<delete quiet="true" file="${dist.dir}/qa-sdk-3.zip"/>
<delete quiet="true" includeEmptyDirs="true">
<fileset dir="${qa.dir}/lib" includes="${httpclient.jars}"/>
<fileset dir="${qa.dir}/lib" includes="${xalan.jar}"/>
</delete>
<delete quiet="true" dir="${qa.war}/WEB-INF/flex/libs"/>
<delete quiet="true" dir="${qa.war}/WEB-INF/flex/locale"/>
<delete quiet="true" dir="${qa.war}/WEB-INF/flex/themes"/>
<delete quiet="true" dir="${qa.war}/WEB-INF/lib"/>
<delete quiet="true" dir="${qa.war}/history"/>
<delete quiet="true" dir="${classes.dir}"/>
<delete quiet="true" dir="${qa.war}/WEB-INF/src/qa/utils"/>
</target>
<target name="generated-clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${qa.war}" includes="**/generated/*" />
</delete>
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${qa.war}" includes="**/generated" />
</delete>
</target>
</project>