123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: disp
- (C) Copyright IBM Corp. 2005 2022
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- *****************************************************************************************************************
- This build script supports the following parameters:
- Command line options from build.bat (build.sh) :
- expand_location Specify the expand location, e.g. -Dexpand_location=e:\crnroot\expand. Default value is "temp/expand"
- context_root Specify the context root for ear file , e.g. -Dcontext_root=mygateway. Default value is "p2pd"
- ear_name Specify the ear file name if build ear file, e.g. -Dear_name=e:\crnroot\myp2pd.ear. Default value is "p2pd.ear"
- war_name Specify the war file name if build war file, e.g. -Dwar_name=e:\crnroot\myp2pd.war. Default value is "p2pd.war"
- cogroot_path Specify the path to the Cognos install if it's not the current install, e.g. -Dcogroot_path=e:\ibm_cog_install. Default value is the current install path.
- appserver_type Specify the type of application server, e.g. -Dappserver_type=jboss. Default value is "other"
- accepted values are :
- jboss Perform actions for a Red Hat JBoss application server
- sap Perform actions for a SAP NetWeaver application server
- sjsas Perform actions for a Sun Java Systems application server
- other(default) Perform actions for any other application server
- Default target:
- war
- Available targets:
- ear Build ear file including the content in webcontent folder.
- ear_without_webcontent Build war file without including the content in webcontent folder
- war Build war file including the content in webcontent folder.
- war_without_webcontent Build war file without including the content in webcontent folder
- expand Expand the content (including the webcontent folder) to a folder instead of building a war file
- expand_without_webcontent Expand the content(without including the webcontent folder) to a folder instead of building a war file
- Note the basedir of this project is (/crn_install_root).
- *****************************************************************************************************************
- -->
- <project name="CognosReportNetJ2EE" default="war" basedir="../..">
- <property name="expand_location" value="temp/expand" />
- <property name="context_root" value="p2pd" />
- <property name="ear_name" value="p2pd.ear" />
- <property name="war_name" value="p2pd.war" />
- <property name="appserver_type" value="other"/>
- <property name="is_${appserver_type}" value="true"/>
- <property name="cogroot_path" value="${basedir}"/>
- <property name="cogroot_link_file" value="webapps/p2pd/WEB-INF/classes/cogroot.link"/>
- <target name="checkCogRootLinkExists">
- <available file="${cogroot_link_file}" property="cogroot_link_file.exists"/>
- </target>
- <target name="chmodCogRootLink" depends="checkCogRootLinkExists" if="cogroot_link_file.exists">
- <chmod file="${cogroot_link_file}" perm="u+w"/>
- </target>
- <!-- create cogroot.link if it doesn't exist -->
- <target name="genCogRootLink" depends="chmodCogRootLink">
- <echo file="${cogroot_link_file}" append="false">${cogroot_path}</echo>
- </target>
-
- <target name="clean" depends="clean_war">
- <delete quiet="true" file="temp/war/p2pd.ear"/>
- </target>
- <target name="clean_war" depends="clean_jboss, clean_sap">
- <delete quiet="true" dir="temp/war/p2pd"/>
- <delete quiet="true" file="temp/war/p2pd.war"/>
- </target>
- <target name="CMcheck">
- <available property="webXMLName" value="web.xml.withCM" file="webapps/p2pd/WEB-INF/lib/CognosCM.jar"/>
- <property name="webXMLName" value="web.xml.noCM"/>
- </target>
- <target name="clean_jboss" if="is_jboss">
- <delete quiet="true" file="webapps/p2pd/WEB-INF/jboss-classloading.xml"/>
- <delete quiet="true" file="webapps/p2pd/WEB-INF/jboss-scanning.xml"/>
- </target>
- <target name="clean_sap" if="is_sap">
- <delete quiet="true" file="webapps/p2pd/WEB-INF/web-j2ee-engine.xml"/>
- </target>
- <target name="exclude_files_jboss">
- <delete quiet="true" file="temp/war/p2pd/lib/commons-logging-1.1.jar"/>
- <delete quiet="true" file="temp/war/p2pd/lib/commons-logging-api-1.1.jar"/>
- <delete quiet="true" file="temp/war/p2pd/lib/xalan.jar"/>
- <delete quiet="true" file="temp/war/p2pd/lib/xbean.jar"/>
- </target>
- <target name="exclude_files_sjsas">
- <delete quiet="true" file="temp/war/p2pd/lib/derbyclient.jar"/>
- </target>
- <target name="exclude_files_sap"/>
- <target name="exclude_files_other"/>
- <target name="move_files_jboss" if="is_jboss">
- <copy file="war/p2pd/jboss5/WEB-INF/jboss-classloading.xml" todir="webapps/p2pd/WEB-INF" overwrite="true"/>
- <copy file="war/p2pd/jboss5/WEB-INF/jboss-scanning.xml" todir="webapps/p2pd/WEB-INF" overwrite="true"/>
- <replace
- file="webapps/p2pd/WEB-INF/jboss-classloading.xml"
- token="p2pd"
- value="${context_root}">
- </replace>
- </target>
- <target name="move_files_sap" if="is_sap">
- <copy file="war/p2pd/sap/WEB-INF/web-j2ee-engine.xml" todir="webapps/p2pd/WEB-INF" overwrite="true"/>
- </target>
- <target name="move_files" depends="genCogRootLink, clean, move_files_jboss, move_files_sap">
- <copy todir="temp/war/p2pd/lib">
- <fileset dir="webapps/p2pd/WEB-INF/lib"/>
- <fileset dir="tomcat/lib">
- <include name="jcam_jni.jar"/>
- </fileset>
- </copy>
- <copy file="cmplst.txt" todir="webapps/p2pd/WEB-INF" overwrite="true"/>
- <move file="temp/war/p2pd/lib/jakarta-oro-2.0.8.jar" tofile="temp/war/p2pd/lib/jakarta-oro.jar"/>
- <move file="temp/war/p2pd/lib/log4j-over-slf4j-1.7.35.jar" tofile="temp/war/p2pd/lib/log4j.jar"/>
- <move file="temp/war/p2pd/lib/logkit-1.2.jar" tofile="temp/war/p2pd/lib/logkit.jar"/>
- <move file="temp/war/p2pd/lib/velocity-1.1.jar" tofile="temp/war/p2pd/lib/velocity.jar"/>
- <antcall target="exclude_files_${appserver_type}"/>
- </target>
- <target name="war" depends="gen_war">
- <move file="temp/war/p2pd.war" tofile="${war_name}" overwrite="true"/>
- <antcall target="clean_war"/>
- </target>
- <target name="gen_war" depends="genCogRootLink, move_files, CMcheck">
-
- <war warfile="temp/war/p2pd.war" webxml="webapps/p2pd/WEB-INF/${webXMLName}">
- <zipfileset dir="webcontent" prefix="servlet">
- <exclude name="index.html"/>
- <exclude name="default.html"/>
- </zipfileset>
- <fileset dir="war/p2pd" includes="index.html"/>
- <fileset dir="webapps/p2pd" includes="version.xml"/>
- <classes dir="webapps/p2pd/WEB-INF/classes" includes="*.*"/>
- <lib dir="temp/war/p2pd/lib"/>
- <webinf dir="webapps/p2pd/WEB-INF">
- <exclude name="*classes/*"/>
- <exclude name="*lib/**"/>
- <exclude name="web.xml"/>
- <exclude name="web.xml.noCM"/>
- <exclude name="PogoLogkitConfig.xml"/>
- </webinf>
- </war>
- </target>
- <!-- generate war without docs and samples -->
- <target name="war_without_docsamples" depends="gen_war_without_docsamples">
- <move file="temp/war/p2pd.war" tofile="${war_name}" overwrite="true"/>
- <antcall target="clean_war"/>
- </target>
- <!-- generate ear without docs and samples -->
- <target name="ear_without_docsamples" depends="gen_war_without_docsamples">
- <delete quiet="true" file="${ear_name}"/>
- <filter token="p2pd" value="${context_root}"/>
- <filter token="p2pdwar" value="p2pd.war"/>
- <copy file="war/p2pd/application.xml.template" tofile="war/p2pd/application.xml" filtering="true" overwrite="true"/>
- <ear earfile="temp/war/p2pd.ear" appxml="war/p2pd/application.xml">
- <fileset dir="temp/war" includes="p2pd.war"/>
- </ear>
- <move file="temp/war/p2pd.ear" tofile="${ear_name}" overwrite="true"/>
- <antcall target="clean"/>
- </target>
- <!-- generate war without docs and samples -->
- <target name="gen_war_without_docsamples" depends="genCogRootLink, move_files, CMcheck">
- <war warfile="temp/war/p2pd.war" webxml="webapps/p2pd/WEB-INF/${webXMLName}">
- <zipfileset dir="webcontent" prefix="servlet">
- <exclude name="index.html"/>
- <exclude name="default.html"/>
- <exclude name="samples/**"/>
- <exclude name="documentation/**"/>
- </zipfileset>
- <fileset dir="war/p2pd" includes="index.html"/>
- <fileset dir="webapps/p2pd" includes="version.xml"/>
- <classes dir="webapps/p2pd/WEB-INF/classes" includes="*.*"/>
- <lib dir="temp/war/p2pd/lib"/>
- <webinf dir="webapps/p2pd/WEB-INF">
- <exclude name="*classes/*"/>
- <exclude name="*lib/**"/>
- <exclude name="web.xml"/>
- <exclude name="web.xml.noCM"/>
- <exclude name="PogoLogkitConfig.xml"/>
- </webinf>
- </war>
- </target>
- <!-- war_without_webcontent -->
- <target name="war_without_webcontent" depends="gen_war_without_webcontent">
- <move file="temp/war/p2pd.war" tofile="${war_name}" overwrite="true"/>
- <antcall target="clean_war"/>
- </target>
- <target name="gen_war_without_webcontent" depends="genCogRootLink, move_files, CMcheck">
- <war warfile="temp/war/p2pd.war" webxml="webapps/p2pd/WEB-INF/${webXMLName}">
- <classes dir="webapps/p2pd/WEB-INF/classes" includes="*.*"/>
- <lib dir="temp/war/p2pd/lib"/>
- <fileset dir="webapps/p2pd" includes="version.xml"/>
- <webinf dir="webapps/p2pd/WEB-INF">
- <exclude name="*classes/*"/>
- <exclude name="*lib/**"/>
- <exclude name="web.xml"/>
- <exclude name="web.xml.noCM"/>
- <exclude name="PogoLogkitConfig.xml"/>
- </webinf>
- </war>
- </target>
- <target name="ear" depends="gen_war">
- <delete quiet="true" file="${ear_name}"/>
- <filter token="p2pd" value="${context_root}"/>
- <filter token="p2pdwar" value="p2pd.war"/>
- <copy file="war/p2pd/application.xml.template" tofile="war/p2pd/application.xml" filtering="true" overwrite="true"/>
- <ear earfile="temp/war/p2pd.ear" appxml="war/p2pd/application.xml">
- <fileset dir="temp/war" includes="p2pd.war"/>
- </ear>
- <move file="temp/war/p2pd.ear" tofile="${ear_name}" overwrite="true"/>
- <antcall target="clean"/>
- </target>
- <target name="ear_without_webcontent" depends="gen_war_without_webcontent">
- <delete quiet="true" file="${ear_name}"/>
- <filter token="p2pd" value="${context_root}"/>
- <filter token="p2pdwar" value="p2pd.war"/>
- <copy file="war/p2pd/application.xml.template" tofile="war/p2pd/application.xml" filtering="true" overwrite="true"/>
- <ear earfile="temp/war/p2pd.ear" appxml="war/p2pd/application.xml">
- <fileset dir="temp/war" includes="p2pd.war"/>
- </ear>
- <move file="temp/war/p2pd.ear" tofile="${ear_name}" overwrite="true"/>
- <antcall target="clean"/>
- </target>
- <target name="expand" depends="genCogRootLink, move_files, CMcheck">
- <copy todir="${expand_location}">
- <fileset dir="webapps/p2pd" includes="version.xml"/>
- </copy>
- <copy todir="${expand_location}/servlet">
- <fileset dir="webcontent">
- <exclude name="index.html"/>
- <exclude name="default.html"/>
- </fileset>
- </copy>
- <copy todir="${expand_location}">
- <fileset dir="war/p2pd" includes="index.html"/>
- </copy>
- <copy todir="${expand_location}/WEB-INF/classes">
- <fileset dir="webapps/p2pd/WEB-INF/classes"/>
- </copy>
- <copy todir="${expand_location}/WEB-INF/lib">
- <fileset dir="temp/war/p2pd/lib"/>
- </copy>
- <copy todir="${expand_location}/WEB-INF">
- <fileset dir="webapps/p2pd/WEB-INF">
- <include name="${webXMLName}"/>
- </fileset>
- </copy>
- <move file="${expand_location}/WEB-INF/${webXMLName}" tofile="${expand_location}/WEB-INF/web.xml"/>
- <copy todir="${expand_location}/WEB-INF">
- <fileset dir="webapps/p2pd/WEB-INF">
- <exclude name="*classes/*"/>
- <exclude name="*lib/**"/>
- <exclude name="web.xml"/>
- <exclude name="web.xml.noCM"/>
- <exclude name="PogoLogkitConfig.xml"/>
- </fileset>
- </copy>
- <antcall target="clean"/>
- </target>
- <target name="expand_without_webcontent" depends="genCogRootLink, move_files, CMcheck">
- <copy todir="${expand_location}">
- <fileset dir="webapps/p2pd" includes="version.xml"/>
- </copy>
- <copy todir="${expand_location}/WEB-INF/classes">
- <fileset dir="webapps/p2pd/WEB-INF/classes"/>
- </copy>
- <copy todir="${expand_location}/WEB-INF/lib">
- <fileset dir="temp/war/p2pd/lib"/>
- </copy>
- <copy todir="${expand_location}/WEB-INF">
- <fileset dir="webapps/p2pd/WEB-INF">
- <include name="${webXMLName}"/>
- </fileset>
- </copy>
- <move file="${expand_location}/WEB-INF/${webXMLName}" tofile="${expand_location}/WEB-INF/web.xml"/>
- <copy todir="${expand_location}/WEB-INF">
- <fileset dir="webapps/p2pd/WEB-INF">
- <exclude name="*classes/*"/>
- <exclude name="*lib/**"/>
- <exclude name="web.xml"/>
- <exclude name="web.xml.noCM"/>
- <exclude name="PogoLogkitConfig.xml"/>
- </fileset>
- </copy>
- <antcall target="clean"/>
- </target>
- <target name="expand_without_docsamples" depends="genCogRootLink, move_files, CMcheck">
- <copy todir="${expand_location}/servlet">
- <fileset dir="webcontent">
- <exclude name="index.html"/>
- <exclude name="default.html"/>
- <exclude name="samples/**"/>
- <exclude name="documentation/**"/>
- </fileset>
- </copy>
- <copy todir="${expand_location}">
- <fileset dir="webapps/p2pd" includes="version.xml"/>
- </copy>
- <copy todir="${expand_location}">
- <fileset dir="war/p2pd" includes="index.html"/>
- </copy>
- <copy todir="${expand_location}/WEB-INF/classes">
- <fileset dir="webapps/p2pd/WEB-INF/classes"/>
- </copy>
- <copy todir="${expand_location}/WEB-INF/lib">
- <fileset dir="temp/war/p2pd/lib"/>
- </copy>
- <copy todir="${expand_location}/WEB-INF">
- <fileset dir="webapps/p2pd/WEB-INF">
- <include name="${webXMLName}"/>
- </fileset>
- </copy>
- <move file="${expand_location}/WEB-INF/${webXMLName}" tofile="${expand_location}/WEB-INF/web.xml"/>
- <copy todir="${expand_location}/WEB-INF">
- <fileset dir="webapps/p2pd/WEB-INF">
- <exclude name="*classes/*"/>
- <exclude name="*lib/**"/>
- <exclude name="web.xml"/>
- <exclude name="web.xml.noCM"/>
- <exclude name="PogoLogkitConfig.xml"/>
- </fileset>
- </copy>
- <antcall target="clean"/>
- </target>
- </project>
|