<commit_before><?xml version="1.0" encoding="utf-8" ?>
<!--
$Id: install.xml 4757 2008-05-15 20:43:31Z zengje $
$HeadURL: http://gforge.nci.nih.gov/svnroot/cagwas/trunk/software/install.xml $
-->
<project name="cagwas-installer" default="upgrade" basedir="." 
	xmlns:ivy="antlib:org.apache.ivy.ant"
	>
	<description>
		This build file is part of the bda-build-templates project. This is the master install file for the project.  It should be placed in project/software.  This script is copied into the distribution and  executed from the extracted distribution.  It is run by typing "ant" from the master project build.xml or from command line. This script has two flows install and upgrade.
		Install will do the following
 			* Install binaries
			* Configure binaries
			* Install application
			* Configure application
			* Re-create database
			* Upgrade database
		Upgrade will do the following
			* Install application
			* Configure application
			* Upgrade database
		The script includes target that may not be used by all projects, but are included in here becaue it is a template. This script has targets to deal with the following, you can delete targets you don't want to work with
		Application servers (option for grid services also)
			* JBoss
		Databases
			* MySQL
			* PostgreSQL
			* Oracle
		This script requires java and ant to run. Every thing else it needs is included in the distribution.
	</description>

	<!-- Properties file related properties and tasks -->
	<property environment="env" />
	<property file="local.properties"/>
	<property file="project.properties"/>
	<!-- load the properties file -->
	<property name="properties.file" value="${basedir}/install.properties"/>
	<echo message="Using properties file of ${properties.file}."/>
	<available file="${properties.file}" property="properties.file.exists" />
	<fail unless="properties.file.exists" message="The properties.file ${properties.file} does not exist, please make sure that you pass in an accurate file name with the 'ant -Dproperties.file=somepath/somefile', otherwise the build will fail."/>
	<replaceregexp file="${properties.file}" byline="true" match="^([\w\d.]+)=(.*[\w\d\/\{\}\\]+)[ \t]+\r*$" replace="\1=\2"/>
	<replaceregexp file="${properties.file}" byline="true" match="^([\w\d.]+)=[ \t]+(.*[\w\d\/\{\}\\]+)\r*$" replace="\1=\2"/>
	<property file="${properties.file}" />

	<!-- Generic properties -->
	<property name="project.name" value="cagwas"/>
	<property name="env.name" value="local"/>	
	<property name="log.dir" value="${basedir}/logs" />
	<property name="working.dir" value="${basedir}/working" />
	<property name="temp.dir" value="${working.dir}/temp" />


	<!-- Install Time properties -->
	<!-- Source and target directories -->
	<property name="bda-utils.dir" value="bda-utils" />
	<property name="tools.dir" value="${basedir}/${tools.dist.relative.dir}" />
	<property name="common.dir.src" value="${basedir}/${common.dist.relative.dir}" />
	<property name="grid.resource.dir" value="${basedir}/${grid.dist.relative.dir}" />
	<property name="grid.application.dir" value="${working.dir}/grid-application" />
	<property name="common.dir.dest" value="${working.dir}/${common.dist.relative.dir}" />
	<property name="db.dir.src" value="${basedir}/${db.dist.relative.dir}" />
	<property name="db.dir.dest" value="${working.dir}/${db.dist.relative.dir}" />
	<property name="db-install.dir.dest" value="${working.dir}/${db-install.dist.relative.dir}" />
	<property name="db-upgrade.dir.dest" value="${working.dir}/${db-upgrade.dist.relative.dir}" />
	<property name="jboss-conf.dir.dest" value="${working.dir}/${jboss-conf.dist.relative.dir}" />

	<!-- Jboss binding configurtion related properties -->
	<property name="jboss.binding.template.location" value="${bda-utils.dir}/resource/${jboss.template.relative.dir}/bindings.xml"/>
	<property name="jboss.service.template.location" value="${bda-utils.dir}/resource/${jboss.template.relative.dir}/jboss-service.xml"/>

	<!-- *-ds.xml and WAR -->
	<property name="cagwas.dir.dist" value="${basedir}/${cagwas.dist.relative.dir}" />
	<property name="cagwas.ds.file" value="cagwas-ds.xml" />
	<property name="cagwas-csm.ds.file" value="cagwas-csm-ds.xml" />
	<property name="cagwas.name" value="cagwas" />
	<property name="cagwas.war.file" value="cagwas.war" />
	<property name="cgom-cagwas.war.file" value="cgom-cagwas.war" />
	<!-- Added to make sure that it works with both absolute and relative paths, this property is handed to sub-project scripts in absolute format. -->
	<property name="jar-signing.keystore.abs-location" location="${jar-signing.keystore.location}"/>
	

	<!-- Grid related properties -->
	<property name="grid.artifact.file" value="wsrf.war" />
	<property name="grid.dir.dest" value="wsrf.war" />
	<property name="grid.application.name" value="CAGWAS" />

	<!-- Paths -->
	<path id="bda-utils.classpath">
		<fileset dir="${bda-utils.dir}">
			<include name="**/*.jar" />
		</fileset>
	</path>
	<!-- Task definitions -->
	<taskdef uri="antlib:org.apache.ant.antunit" resource="org/apache/ant/antunit/antlib.xml" classpathref="bda-utils.classpath"/>
	<taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="bda-utils.classpath"/>
	<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="bda-utils.classpath"/>
	<taskdef resource="liquibasetasks.properties" classpathref="bda-utils.classpath"/>
	<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="bda-utils.classpath"/>

	<!-- Includes-->
	<import file="${bda-utils.dir}/bda-build-utils-${bda.version}.xml" />

	<!-- Clean/make working dir -->
	<delete dir="${working.dir}" failonerror="false"/>
	<mkdir dir="${working.dir}"/>

	<!-- Start logging --> 
	<property name="install-logs.dir" location="${log.dir}"/>
	<mkdir dir="${install-logs.dir}"/>
	<tstamp>
		<format property="install.time" pattern="yyyy-MM-dd-HH-mm" />
	</tstamp>
	<record name="${install-logs.dir}/install-${install.time}.log" action="start"/>
	
	<!-- Targets begin -->
	
	<target name="common:init:pre">
		<!-- Set application.base.path based on platform -->
		<condition property="application.base.path" value="${application.base.path.linux}">
			<or>
				<os family="unix" />
				<os family="mac" />
			</or>
		</condition>

		<condition property="application.base.path" value="${application.base.path.windows}">
			<os family="windows" />
		</condition>
		<echo message="application.base.path=${application.base.path}"/>
		<property name="jboss.home" value="${application.base.path}/${jboss.relative.path}"/>
		<jboss-version
			/>
	</target>

	<target name="install:jboss:init" depends="common:init:pre">
		<!-- determine if port configurations or port lists are being called -->
		<if>
			<isset property="jboss.ncicb-standard.port-config"/>
			<then>
				<!-- Read some port properties from standard bindings file -->
				<echo message="Using JBoss NCICB Standard port configurations"/>
				<property name="jboss.server.binding.template.location" value="${basedir}/${jboss-bindings.file}"/>
				<jboss-read-ports
					jboss.server.bindingfile.location="${jboss.server.binding.template.location}"
					/>
				<echo message="http -${jboss.server.port} "/>
				<echo message="http -${jboss.server.jndi.port} "/>
				<properties-exist
					properties.list="jboss.server.jndi.port,jboss.server.port,jboss.server.ports.name"
					/>
				<!-- Make sure there are not unexpanded tokens and that the jboss.server.ports.name is a configuration in the bindings file. -->
				<jboss-bindings-validate
					jboss.server.bindingfile.location="${jboss.server.binding.template.location}"
					/>

			</then>
			<else>
				<!-- else ensure that all ports are set, since these will be removed from install-properties.template we will verify here.  They have to be removed so the validator works with or without the properties or we have to change the format of the file. -->
				<echo message="Using custom JBoss port configurations"/>
				<property name="jboss.server.binding.template.location" value="${bda-utils.dir}/resource/${jboss.binaries.relative.dir}/bindings.xml"/>
				<properties-exist
					properties.list="jboss.server.jndi.port,jboss.server.port,jboss.cobraorb.port,jboss.hajndi.port,jboss.hajrmi.port,jboss.jmx-rmi.port,jboss.messaging.port,jboss.pooledha.port,jboss.server.bind.port,jboss.server.rmi.port,jboss.service.rmiobject.port,jboss.snmp.port,jboss.snmp-trapd.port,jboss.web.service.port,jboss.unifiedinvoker.port,jboss.hajndi.auto.port,jboss.ssl.port,jboss.jms2.netty.port,jboss.jms2.netty-ssl.port,jboss.transaction.recovery.port,jboss.transaction.status.port,jboss.transaction.processid.port"
					/>
			</else>
		</if>
	</target>
	<target name="common:jboss:init" depends="common:init:pre" unless="exclude.jboss">
		<property name="jboss.ssl.enable" value="false"/>
		<property name="jboss.home" value="${application.base.path}/${jboss.relative.path}"/>
		<jboss-version
			/>
		<if>
			<equals arg1="${jboss.http-connector.remove}" arg2="true"/>
			<then>
				<property name="jboss.application.url" value="http://${jboss.server.hostname}:${jboss.server.port}/${cagwas.name}"/>
			</then>
			<else>
				<property name="jboss.application.url" value="https://${jboss.server.hostname}:${jboss.grid.secure.port}/${cagwas.name}"/>
			</else>
		</if>
		<available file="${jboss.home}/server/${jboss.server.name}/conf/jboss-service.xml" property="jboss.exists"/>
		<basename file="${jboss.ssl.keystore.location}" property="jboss.ssl.keystore.file"/>
		<dirname file="${jboss.ssl.keystore.location}" property="jboss.ssl.keystore.dir"/>
		<basename file="${jboss.grid.secure.cert.location}" property="jboss.grid.secure.cert.file"/>
		<dirname file="${jboss.grid.secure.cert.location}" property="jboss.grid.secure.dir"/>
		<basename file="${jboss.grid.secure.key.location}" property="jboss.grid.secure.key.file"/>
		<property name="jboss.socket.ports" value="${jboss.server.port},${jboss.server.rmi.port},${jboss.server.jndi.port},${jboss.service.rmiobject.port},${jboss.jms.port},${jboss.web.service.port}"/>
	</target>

	<target name="common:init" depends="common:init:pre">
		<!-- cagwas can use either Oracle or MySQL or PostgreSQL as its database platform, this is controled by the database.type property.  Based on the value of this property sent several variables for use during install -->
		<echoproperties prefix="database"/><commit_msg>remove the property check on unused ports<commit_after><?xml version="1.0" encoding="utf-8" ?>
<!--
$Id: install.xml 4757 2008-05-15 20:43:31Z zengje $
$HeadURL: http://gforge.nci.nih.gov/svnroot/cagwas/trunk/software/install.xml $
-->
<project name="cagwas-installer" default="upgrade" basedir="." 
	xmlns:ivy="antlib:org.apache.ivy.ant"
	>
	<description>
		This build file is part of the bda-build-templates project. This is the master install file for the project.  It should be placed in project/software.  This script is copied into the distribution and  executed from the extracted distribution.  It is run by typing "ant" from the master project build.xml or from command line. This script has two flows install and upgrade.
		Install will do the following
 			* Install binaries
			* Configure binaries
			* Install application
			* Configure application
			* Re-create database
			* Upgrade database
		Upgrade will do the following
			* Install application
			* Configure application
			* Upgrade database
		The script includes target that may not be used by all projects, but are included in here becaue it is a template. This script has targets to deal with the following, you can delete targets you don't want to work with
		Application servers (option for grid services also)
			* JBoss
		Databases
			* MySQL
			* PostgreSQL
			* Oracle
		This script requires java and ant to run. Every thing else it needs is included in the distribution.
	</description>

	<!-- Properties file related properties and tasks -->
	<property environment="env" />
	<property file="local.properties"/>
	<property file="project.properties"/>
	<!-- load the properties file -->
	<property name="properties.file" value="${basedir}/install.properties"/>
	<echo message="Using properties file of ${properties.file}."/>
	<available file="${properties.file}" property="properties.file.exists" />
	<fail unless="properties.file.exists" message="The properties.file ${properties.file} does not exist, please make sure that you pass in an accurate file name with the 'ant -Dproperties.file=somepath/somefile', otherwise the build will fail."/>
	<replaceregexp file="${properties.file}" byline="true" match="^([\w\d.]+)=(.*[\w\d\/\{\}\\]+)[ \t]+\r*$" replace="\1=\2"/>
	<replaceregexp file="${properties.file}" byline="true" match="^([\w\d.]+)=[ \t]+(.*[\w\d\/\{\}\\]+)\r*$" replace="\1=\2"/>
	<property file="${properties.file}" />

	<!-- Generic properties -->
	<property name="project.name" value="cagwas"/>
	<property name="env.name" value="local"/>	
	<property name="log.dir" value="${basedir}/logs" />
	<property name="working.dir" value="${basedir}/working" />
	<property name="temp.dir" value="${working.dir}/temp" />


	<!-- Install Time properties -->
	<!-- Source and target directories -->
	<property name="bda-utils.dir" value="bda-utils" />
	<property name="tools.dir" value="${basedir}/${tools.dist.relative.dir}" />
	<property name="common.dir.src" value="${basedir}/${common.dist.relative.dir}" />
	<property name="grid.resource.dir" value="${basedir}/${grid.dist.relative.dir}" />
	<property name="grid.application.dir" value="${working.dir}/grid-application" />
	<property name="common.dir.dest" value="${working.dir}/${common.dist.relative.dir}" />
	<property name="db.dir.src" value="${basedir}/${db.dist.relative.dir}" />
	<property name="db.dir.dest" value="${working.dir}/${db.dist.relative.dir}" />
	<property name="db-install.dir.dest" value="${working.dir}/${db-install.dist.relative.dir}" />
	<property name="db-upgrade.dir.dest" value="${working.dir}/${db-upgrade.dist.relative.dir}" />
	<property name="jboss-conf.dir.dest" value="${working.dir}/${jboss-conf.dist.relative.dir}" />

	<!-- Jboss binding configurtion related properties -->
	<property name="jboss.binding.template.location" value="${bda-utils.dir}/resource/${jboss.template.relative.dir}/bindings.xml"/>
	<property name="jboss.service.template.location" value="${bda-utils.dir}/resource/${jboss.template.relative.dir}/jboss-service.xml"/>

	<!-- *-ds.xml and WAR -->
	<property name="cagwas.dir.dist" value="${basedir}/${cagwas.dist.relative.dir}" />
	<property name="cagwas.ds.file" value="cagwas-ds.xml" />
	<property name="cagwas-csm.ds.file" value="cagwas-csm-ds.xml" />
	<property name="cagwas.name" value="cagwas" />
	<property name="cagwas.war.file" value="cagwas.war" />
	<property name="cgom-cagwas.war.file" value="cgom-cagwas.war" />
	<!-- Added to make sure that it works with both absolute and relative paths, this property is handed to sub-project scripts in absolute format. -->
	<property name="jar-signing.keystore.abs-location" location="${jar-signing.keystore.location}"/>
	

	<!-- Grid related properties -->
	<property name="grid.artifact.file" value="wsrf.war" />
	<property name="grid.dir.dest" value="wsrf.war" />
	<property name="grid.application.name" value="CAGWAS" />

	<!-- Paths -->
	<path id="bda-utils.classpath">
		<fileset dir="${bda-utils.dir}">
			<include name="**/*.jar" />
		</fileset>
	</path>
	<!-- Task definitions -->
	<taskdef uri="antlib:org.apache.ant.antunit" resource="org/apache/ant/antunit/antlib.xml" classpathref="bda-utils.classpath"/>
	<taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" classpathref="bda-utils.classpath"/>
	<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="bda-utils.classpath"/>
	<taskdef resource="liquibasetasks.properties" classpathref="bda-utils.classpath"/>
	<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="bda-utils.classpath"/>

	<!-- Includes-->
	<import file="${bda-utils.dir}/bda-build-utils-${bda.version}.xml" />

	<!-- Clean/make working dir -->
	<delete dir="${working.dir}" failonerror="false"/>
	<mkdir dir="${working.dir}"/>

	<!-- Start logging --> 
	<property name="install-logs.dir" location="${log.dir}"/>
	<mkdir dir="${install-logs.dir}"/>
	<tstamp>
		<format property="install.time" pattern="yyyy-MM-dd-HH-mm" />
	</tstamp>
	<record name="${install-logs.dir}/install-${install.time}.log" action="start"/>
	
	<!-- Targets begin -->
	
	<target name="common:init:pre">
		<!-- Set application.base.path based on platform -->
		<condition property="application.base.path" value="${application.base.path.linux}">
			<or>
				<os family="unix" />
				<os family="mac" />
			</or>
		</condition>

		<condition property="application.base.path" value="${application.base.path.windows}">
			<os family="windows" />
		</condition>
		<echo message="application.base.path=${application.base.path}"/>
		<property name="jboss.home" value="${application.base.path}/${jboss.relative.path}"/>
		<jboss-version
			/>
	</target>

	<target name="install:jboss:init" depends="common:init:pre">
		<!-- determine if port configurations or port lists are being called -->
		<if>
			<isset property="jboss.ncicb-standard.port-config"/>
			<then>
				<!-- Read some port properties from standard bindings file -->
				<echo message="Using JBoss NCICB Standard port configurations"/>
				<property name="jboss.server.binding.template.location" value="${basedir}/${jboss-bindings.file}"/>
				<jboss-read-ports
					jboss.server.bindingfile.location="${jboss.server.binding.template.location}"
					/>
				<echo message="http -${jboss.server.port} "/>
				<echo message="http -${jboss.server.jndi.port} "/>
				<properties-exist
					properties.list="jboss.server.jndi.port,jboss.server.port,jboss.server.ports.name"
					/>
				<!-- Make sure there are not unexpanded tokens and that the jboss.server.ports.name is a configuration in the bindings file. -->
				<jboss-bindings-validate
					jboss.server.bindingfile.location="${jboss.server.binding.template.location}"
					/>

			</then>
			<else>
				<!-- else ensure that all ports are set, since these will be removed from install-properties.template we will verify here.  They have to be removed so the validator works with or without the properties or we have to change the format of the file. -->
				<echo message="Using custom JBoss port configurations"/>
				<property name="jboss.server.binding.template.location" value="${bda-utils.dir}/resource/${jboss.binaries.relative.dir}/bindings.xml"/>
				<properties-exist
					properties.list="jboss.server.jndi.port,jboss.server.port,jboss.cobraorb.port,jboss.hajndi.port,jboss.hajrmi.port,jboss.jmx-rmi.port,jboss.messaging.port,jboss.pooledha.port,jboss.server.bind.port,jboss.server.rmi.port,jboss.service.rmiobject.port,jboss.snmp.port,jboss.snmp-trapd.port,jboss.web.service.port"
					/>
			</else>
		</if>
	</target>
	<target name="common:jboss:init" depends="common:init:pre" unless="exclude.jboss">
		<property name="jboss.ssl.enable" value="false"/>
		<property name="jboss.home" value="${application.base.path}/${jboss.relative.path}"/>
		<jboss-version
			/>
		<if>
			<equals arg1="${jboss.http-connector.remove}" arg2="true"/>
			<then>
				<property name="jboss.application.url" value="http://${jboss.server.hostname}:${jboss.server.port}/${cagwas.name}"/>
			</then>
			<else>
				<property name="jboss.application.url" value="https://${jboss.server.hostname}:${jboss.grid.secure.port}/${cagwas.name}"/>
			</else>
		</if>
		<available file="${jboss.home}/server/${jboss.server.name}/conf/jboss-service.xml" property="jboss.exists"/>
		<basename file="${jboss.ssl.keystore.location}" property="jboss.ssl.keystore.file"/>
		<dirname file="${jboss.ssl.keystore.location}" property="jboss.ssl.keystore.dir"/>
		<basename file="${jboss.grid.secure.cert.location}" property="jboss.grid.secure.cert.file"/>
		<dirname file="${jboss.grid.secure.cert.location}" property="jboss.grid.secure.dir"/>
		<basename file="${jboss.grid.secure.key.location}" property="jboss.grid.secure.key.file"/>
		<property name="jboss.socket.ports" value="${jboss.server.port},${jboss.server.rmi.port},${jboss.server.jndi.port},${jboss.service.rmiobject.port},${jboss.jms.port},${jboss.web.service.port}"/>
	</target>

	<target name="common:init" depends="common:init:pre">
		<!-- cagwas can use either Oracle or MySQL or PostgreSQL as its database platform, this is controled by the database.type property.  Based on the value of this property sent several variables for use during install -->
		<echoproperties prefix="database"/>
{'fraction_non_alphanumeric': 0.18303722709009052, 'fraction_numerical': 0.0027109454422229754, 'mean_word_length': 4.511739594450374, 'pattern_counts': {'":': 0, '<': 281, '<?xml version=': 2, '>': 281, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 28}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3798494', 'n_tokens_mistral': 7231, 'n_tokens_neox': 6582, 'n_words': 1347}