<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2008-2009 The Kuali Foundation
 
 Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
 
 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="Kuali Rice" default="dist-all" xmlns:artifact="antlib:org.apache.maven.artifact.ant" xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
	<target name="echo-properties" depends="init" description="print build environment properties to console">
	   <echoproperties/>
	</target>

	<target name="init">
		<path id="maven-ant-tasks.classpath" path="scripts/maven-ant-tasks/maven-ant-tasks-2.0.10.jar" />
		<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
		           uri="antlib:org.apache.maven.artifact.ant"
		           classpathref="maven-ant-tasks.classpath" />
				<property file="${user.home}/kuali-build.properties" />
		<artifact:pom id="maven.project" file="pom.xml" />
		<artifact:pom id="rice-web" file="web/pom.xml" />
		<property name="rice.environment" value="dev"/>
		<property name="rice.app.code" value="kr"/>
		<echo>The Kuali Rice version is ${maven.project.version}</echo>
        <!-- echo>${maven.project.dependencyManagement.dependencies}</echo -->
		<property name="dist.build.dir" value="target/ant-build"/>
		<property name="dist.server.dir" value="${dist.build.dir}/dist-server"/>
		<property name="dist.war.dir" value="${dist.build.dir}/dist-war"/>
		<property name="dist.war.lib.dir" value="${dist.war.dir}/WEB-INF/lib"/>
		<property name="webapp.src.dir" value="web/src/main/webapp"/>
		<property name="war.config.src.dir" value="web/src/main/config/standalone-config"/>
		<property name="dist.binary.dir" value="${dist.build.dir}/dist-binary/rice-${maven.project.version}-bin"/>
		<property name="dist.binary.lib.dir" value="${dist.binary.dir}/lib"/>
		<property name="dist.binary.webcontent.dir" value="${dist.binary.dir}/webcontent"/>
		<property name="dist.binary.config.dir" value="${dist.binary.dir}/config"/>
		<property name="dist.server.config.dir" value="${dist.server.dir}/config"/>
		<property name="dist.src.dir" value="${dist.build.dir}/dist-src/rice-${maven.project.version}-src"/>
		
		<property name="dist.impex.dir" value="${dist.build.dir}/database-impex"/>
		<property name="dist.dataset.dir" value="${dist.build.dir}/datasets"/>
		<property name="dist.dba.server.dataset.dir" value="${basedir}/${dist.dataset.dir}/dba-server-dataset"/>
		<property name="dist.demo.server.dataset.dir" value="${basedir}/${dist.dataset.dir}/demo-server-dataset"/>
		<property name="dist.bootstrap.server.dataset.dir" value="${basedir}/${dist.dataset.dir}/bootstrap-server-dataset"/>
		<property name="dist.dba.client.dataset.dir" value="${basedir}/${dist.dataset.dir}/dba-client-dataset"/>
		<property name="dist.demo.client.dataset.dir" value="${basedir}/${dist.dataset.dir}/demo-client-dataset"/>
		<property name="dist.bootstrap.client.dataset.dir" value="${basedir}/${dist.dataset.dir}/bootstrap-client-dataset"/>
		<condition property="dist.server.datasets.exist">
			<and>
				<available file="${dist.dba.server.dataset.dir}"/>
				<available file="${dist.demo.server.dataset.dir}"/>
				<available file="${dist.bootstrap.server.dataset.dir}"/>
			</and>
		</condition>
		<condition property="dist.client.datasets.exist">
			<and>
				<available file="${dist.dba.client.dataset.dir}"/>
				<available file="${dist.demo.client.dataset.dir}"/>
				<available file="${dist.bootstrap.client.dataset.dir}"/>
			</and>
		</condition>
		
		<property name="oracle.driver.version" value="10.2.0.3.0"/>
		<property name="default.jta.excludes" value="**/xapool*.jar, **/jotm*.jar, **/connector*.jar, **/howl*.jar, **/jta*.jar, **/jts*.jar, **/ow_carol*.jar, **/carol.properties"/>		
		<property environment="env"/>
	    <!-- if the M2_HOME is already defined in the environment, use it -->
		<property name="maven.home.directory" value="${env.M2_HOME}"/>
		<!-- default environment.path.variable to 'PATH' variable from the local environment -->
		<condition property="environment.path.variable" value="${env.PATH}">
			<isset property="env.PATH"/>
		</condition>
        <!-- if the PATH variable is not found try 'Path' for Vista/XP systems -->
        <property name="environment.path.variable" value="${env.Path}"/>
		<mkdir dir="${dist.build.dir}"/>
	</target>

	<target name="init-jta-excludes" if="webapp.exclude.jta" depends="init" >
		<property name="jta.excludes" value="${default.jta.excludes}"/>
	</target>
	
	<target name="clean" description="Cleans the temporary build files." depends="init">
		<maven goals="clean"/>
	</target>
	
	<target name="update-eclipse-classpath" depends="init" description="Updates Eclipse classpath">
	    <maven goals="install eclipse:eclipse" options="-DdownloadSources=true -DskipTests=true"/>
		<antcall target="merge-module-classpaths"/>
    </target>
	
	<target name="package-test-files" depends="init" description="Updates Eclipse classpath">
	    <maven goals="test-compile" />
		<jar destfile="target/kewTests.jar"
	         basedir="kew/target/test-classes" />
	</target>
	
	<target name="merge-module-classpaths" depends="init">
		<dirname property="project.dir" file="${ant.file}"/>
		<java classname="org.codehaus.groovy.tools.GroovyStarter">
            <arg value="--main"/>
			<arg value="groovy.ui.GroovyMain"/>
            <arg value="${project.dir}/scripts/merge_module_classpaths.groovy"/>
			<arg value="${project.dir}"/>
			<classpath>
                <fileset dir="${project.dir}/scripts/">
                    <include name="groovy-*/lib/*.jar" />
                </fileset>
            </classpath>
        </java>
	</target>

	<target name="install-oracle-jar" depends="init">
		<property name="drivers.directory" location="/java/drivers" />
		<property name="oracle.driver.jar"  location="${drivers.directory}/ojdbc14.jar"/>
		<maven goals="install:install-file" options="-DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=${oracle.driver.version} -Dpackaging=jar -Dfile=${oracle.driver.jar}"/>
	</target>
	
	<target name="retrieve-maven-dependencies" depends="install-oracle-jar">
        <maven goals="install" options="-DskipTests=true"/>
	</target>

	<target name="mysql-liquibase-update">
		<path id="liquibase.class.path" path="scripts/upgrades/1.0.1 to 1.0.1.1/liquibase/liquibase-1.9.5.jar" />
		<path id="mysql.class.path" path="scripts/upgrades/1.0.1 to 1.0.1.1/liquibase/mysql-connector-java-5.1.5.jar" />
		<taskdef name="updateDatabase" classname="liquibase.ant.DatabaseUpdateTask" classpathref="liquibase.class.path" />
		<updateDatabase changeLogFile="scripts/upgrades/1.0.1 to 1.0.1.1/liquibase/update.xml" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://172.25.27.79:3306/rice093dev" username="rice093dev" password="<PASSWORD>" dropFirst="false" classpathref="mysql.class.path" />
	</target>
	
	<target name="install-rice-jars" depends="init">
		<echo message="${environment.path.variable}"/>
		<maven goals="install" options="-e -Dmaven.test.skip=true" />
	</target>

	<target name="prepare-lib" depends="install-rice-jars">
		<artifact:install file="pom.xml">
			<pom refid="maven.project" />
		</artifact:install>
	</target>

    <!-- unzip src is made when prepare-lib dep calls install-rice-jars -->	
	<target name="dist-war" depends="init-jta-excludes, prepare-lib" description="Builds and packages the Rice server distribution">
		<echo>jta.excludes: ${jta.excludes}</echo>

		<unzip src="web/target/rice-web-${maven.project.version}.war" dest="${dist.war.dir}"/>
		<copy todir="${dist.war.dir}">
			<fileset dir="${war.config.src.dir}"/>
		</copy>
		<!-- change the environment code appropriately -->
		<replaceregexp match="\b(dev|snd|unt|reg|stg|trn|prd)\b" replace="${rice.environment}" byline="true" flags="g"><commit_msg>KULRICE-3746: Removed liquibase test code.  Moved to a liquibase branch<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2008-2009 The Kuali Foundation
 
 Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
 
 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="Kuali Rice" default="dist-all" xmlns:artifact="antlib:org.apache.maven.artifact.ant" xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
	<target name="echo-properties" depends="init" description="print build environment properties to console">
	   <echoproperties/>
	</target>

	<target name="init">
		<path id="maven-ant-tasks.classpath" path="scripts/maven-ant-tasks/maven-ant-tasks-2.0.10.jar" />
		<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
		           uri="antlib:org.apache.maven.artifact.ant"
		           classpathref="maven-ant-tasks.classpath" />
				<property file="${user.home}/kuali-build.properties" />
		<artifact:pom id="maven.project" file="pom.xml" />
		<artifact:pom id="rice-web" file="web/pom.xml" />
		<property name="rice.environment" value="dev"/>
		<property name="rice.app.code" value="kr"/>
		<echo>The Kuali Rice version is ${maven.project.version}</echo>
        <!-- echo>${maven.project.dependencyManagement.dependencies}</echo -->
		<property name="dist.build.dir" value="target/ant-build"/>
		<property name="dist.server.dir" value="${dist.build.dir}/dist-server"/>
		<property name="dist.war.dir" value="${dist.build.dir}/dist-war"/>
		<property name="dist.war.lib.dir" value="${dist.war.dir}/WEB-INF/lib"/>
		<property name="webapp.src.dir" value="web/src/main/webapp"/>
		<property name="war.config.src.dir" value="web/src/main/config/standalone-config"/>
		<property name="dist.binary.dir" value="${dist.build.dir}/dist-binary/rice-${maven.project.version}-bin"/>
		<property name="dist.binary.lib.dir" value="${dist.binary.dir}/lib"/>
		<property name="dist.binary.webcontent.dir" value="${dist.binary.dir}/webcontent"/>
		<property name="dist.binary.config.dir" value="${dist.binary.dir}/config"/>
		<property name="dist.server.config.dir" value="${dist.server.dir}/config"/>
		<property name="dist.src.dir" value="${dist.build.dir}/dist-src/rice-${maven.project.version}-src"/>
		
		<property name="dist.impex.dir" value="${dist.build.dir}/database-impex"/>
		<property name="dist.dataset.dir" value="${dist.build.dir}/datasets"/>
		<property name="dist.dba.server.dataset.dir" value="${basedir}/${dist.dataset.dir}/dba-server-dataset"/>
		<property name="dist.demo.server.dataset.dir" value="${basedir}/${dist.dataset.dir}/demo-server-dataset"/>
		<property name="dist.bootstrap.server.dataset.dir" value="${basedir}/${dist.dataset.dir}/bootstrap-server-dataset"/>
		<property name="dist.dba.client.dataset.dir" value="${basedir}/${dist.dataset.dir}/dba-client-dataset"/>
		<property name="dist.demo.client.dataset.dir" value="${basedir}/${dist.dataset.dir}/demo-client-dataset"/>
		<property name="dist.bootstrap.client.dataset.dir" value="${basedir}/${dist.dataset.dir}/bootstrap-client-dataset"/>
		<condition property="dist.server.datasets.exist">
			<and>
				<available file="${dist.dba.server.dataset.dir}"/>
				<available file="${dist.demo.server.dataset.dir}"/>
				<available file="${dist.bootstrap.server.dataset.dir}"/>
			</and>
		</condition>
		<condition property="dist.client.datasets.exist">
			<and>
				<available file="${dist.dba.client.dataset.dir}"/>
				<available file="${dist.demo.client.dataset.dir}"/>
				<available file="${dist.bootstrap.client.dataset.dir}"/>
			</and>
		</condition>
		
		<property name="oracle.driver.version" value="10.2.0.3.0"/>
		<property name="default.jta.excludes" value="**/xapool*.jar, **/jotm*.jar, **/connector*.jar, **/howl*.jar, **/jta*.jar, **/jts*.jar, **/ow_carol*.jar, **/carol.properties"/>		
		<property environment="env"/>
	    <!-- if the M2_HOME is already defined in the environment, use it -->
		<property name="maven.home.directory" value="${env.M2_HOME}"/>
		<!-- default environment.path.variable to 'PATH' variable from the local environment -->
		<condition property="environment.path.variable" value="${env.PATH}">
			<isset property="env.PATH"/>
		</condition>
        <!-- if the PATH variable is not found try 'Path' for Vista/XP systems -->
        <property name="environment.path.variable" value="${env.Path}"/>
		<mkdir dir="${dist.build.dir}"/>
	</target>

	<target name="init-jta-excludes" if="webapp.exclude.jta" depends="init" >
		<property name="jta.excludes" value="${default.jta.excludes}"/>
	</target>
	
	<target name="clean" description="Cleans the temporary build files." depends="init">
		<maven goals="clean"/>
	</target>
	
	<target name="update-eclipse-classpath" depends="init" description="Updates Eclipse classpath">
	    <maven goals="install eclipse:eclipse" options="-DdownloadSources=true -DskipTests=true"/>
		<antcall target="merge-module-classpaths"/>
    </target>
	
	<target name="package-test-files" depends="init" description="Updates Eclipse classpath">
	    <maven goals="test-compile" />
		<jar destfile="target/kewTests.jar"
	         basedir="kew/target/test-classes" />
	</target>
	
	<target name="merge-module-classpaths" depends="init">
		<dirname property="project.dir" file="${ant.file}"/>
		<java classname="org.codehaus.groovy.tools.GroovyStarter">
            <arg value="--main"/>
			<arg value="groovy.ui.GroovyMain"/>
            <arg value="${project.dir}/scripts/merge_module_classpaths.groovy"/>
			<arg value="${project.dir}"/>
			<classpath>
                <fileset dir="${project.dir}/scripts/">
                    <include name="groovy-*/lib/*.jar" />
                </fileset>
            </classpath>
        </java>
	</target>

	<target name="install-oracle-jar" depends="init">
		<property name="drivers.directory" location="/java/drivers" />
		<property name="oracle.driver.jar"  location="${drivers.directory}/ojdbc14.jar"/>
		<maven goals="install:install-file" options="-DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=${oracle.driver.version} -Dpackaging=jar -Dfile=${oracle.driver.jar}"/>
	</target>
	
	<target name="retrieve-maven-dependencies" depends="install-oracle-jar">
        <maven goals="install" options="-DskipTests=true"/>
	</target>	
	
	<target name="install-rice-jars" depends="init">
		<echo message="${environment.path.variable}"/>
		<maven goals="install" options="-e -Dmaven.test.skip=true" />
	</target>

	<target name="prepare-lib" depends="install-rice-jars">
		<artifact:install file="pom.xml">
			<pom refid="maven.project" />
		</artifact:install>
	</target>

    <!-- unzip src is made when prepare-lib dep calls install-rice-jars -->	
	<target name="dist-war" depends="init-jta-excludes, prepare-lib" description="Builds and packages the Rice server distribution">
		<echo>jta.excludes: ${jta.excludes}</echo>

		<unzip src="web/target/rice-web-${maven.project.version}.war" dest="${dist.war.dir}"/>
		<copy todir="${dist.war.dir}">
			<fileset dir="${war.config.src.dir}"/>
		</copy>
		<!-- change the environment code appropriately -->
		<replaceregexp match="\b(dev|snd|unt|reg|stg|trn|prd)\b" replace="${rice.environment}" byline="true" flags="g">
{'fraction_non_alphanumeric': 0.19112649465072373, 'fraction_numerical': 0.006922592825676526, 'mean_word_length': 4.427254098360656, 'pattern_counts': {'":': 0, '<': 250, '<?xml version=': 2, '>': 250, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 15}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6659721', 'n_tokens_mistral': 5482, 'n_tokens_neox': 4964, 'n_words': 897}