<commit_before><?xml version="1.0"?>
<!-- *********************************************************** -->
<!-- ** Ant build script for OpenMRS                          ** -->
<!-- **                                                       ** -->
<!-- ** This file is provided for those that cannot use       ** -->
<!-- ** maven. Using "mvn" instead of "ant" is recommended    ** -->
<!-- **                                                       ** -->
<!-- *********************************************************** -->
<project name="OpenMRS-trunk" default="dist" xmlns:artifact="urn:maven-artifact-ant">

	<property environment="env"/>
	<property name="root.dir" value="."/>
	<property name="lib.dir" value="${root.dir}${file.separator}lib"/>
	<property name="maven.ant.tasks.jar" value="${lib.dir}${file.separator}maven-ant-tasks-2.1.1.jar"/>
	<property name="maven.ant.tasks.bootstrap.location" value="http://repo2.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.1/maven-ant-tasks-2.1.1.jar"/>
	<property name="maven.ant.contrib.jar" value="${lib.dir}${file.separator}ant-contrib-1.0b3.jar"/>
	<property name="maven.ant.contrib.bootstrap.location" value="http://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar"/>
	<available property="m2.home.exists" file="${env.M2_HOME}" type="dir"/>	

	<!-- This will download ant-contrib and maven-ant-tasks if needed. Requires Ant 1.8.0 for skipexisting -->
	<mkdir dir="${lib.dir}"/>
	<get src="${maven.ant.contrib.bootstrap.location}" dest="${maven.ant.contrib.jar}" skipexisting="true"/>
	<get src="${maven.ant.tasks.bootstrap.location}" dest="${maven.ant.tasks.jar}" skipexisting="true"/>

	<property file="build.properties"/>
	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement location="${maven.ant.contrib.jar}"/>
		</classpath>
	</taskdef>

	<!-- This will initialize all the maven ant tasks -->
	<target name="init-maven-tasks">
		<path id="maven.ant.tasks.classpath" path="${maven.ant.tasks.jar}" />
		<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven.ant.tasks.classpath" /> 
 	</target>

	<!-- Use existing maven install or built in maven? -->
	<target name="use-existing-maven-install" depends="init-maven-tasks" if="m2.home.exists">
		<macrodef name="maven">
			<attribute name="pom" default="pom.xml"/>
			<attribute name="dir" default="."/>
			<attribute name="options" default=""/>
			<sequential>
				<artifact:mvn mavenHome="${env.M2_HOME}" pom="@{pom}" fork="true" dir="@{dir}">
					<arg line="@{options}"/>
				</artifact:mvn>
			</sequential>
		</macrodef>
	</target>
	<target name="use-built-in-maven" depends="init-maven-tasks" unless="m2.home.exists">
		<macrodef name="maven">
			<attribute name="pom" default="pom.xml"/>
			<attribute name="dir" default="."/>
			<attribute name="options" default=""/>
			<sequential>
				<artifact:mvn pom="@{pom}" fork="true" dir="@{dir}">
					<arg line="@{options}"/>
				</artifact:mvn>
			</sequential>
		</macrodef>
	</target>
	<target name="init-maven-macro" depends="use-existing-maven-install,use-built-in-maven"/>

	<!-- Tasks forwarded to maven goals -->
	<target name="clean" depends="init-maven-macro">
		<maven options="clean"/>
	</target>

	<target name="package-all" depends="init-maven-macro" description="packages api, test, and web jars for use in modules">
		<maven options="install -DskipTests"/>
	</target>

	<target name="junit" depends="init-maven-macro" description="Run all junit tests">
		<maven options="org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test"/>
	</target>

	<target name="jetty-run" depends="package-all" description="Start a Jetty webserver with openmrs installed">
		<maven options="jetty:run" pom="webapp/pom.xml" dir="webapp"/>
	</target>

	<!-- Pure ant tasks -->
	<target name="dist" depends="package-all" description="create distributable war file" />
	
	<target name="war" depends="dist" description="create distributable war file" />
	
    <target name="create-installer" description="Create Openmrs windows installer (offline by default)" depends="package-all">
    	
        <!-- Installer properties -->
        <property name="dist.installer.dir" value="${dist.dir}/installer"/>
        <property name="java-setup" value="${installer-dependencies.dir}/${jdk.filename}"/>
        <property name="mysql-setup" value="${installer-dependencies.dir}/${mysql.filename}"/>
        <property name="tomcat-setup" value="${installer-dependencies.dir}/${tomcat.filename}"/>
		    	
        <condition property="makensis.command" value="C:\Program Files\NSIS\makensis" else="makensis">
            <os family="windows"></os>
        </condition>
        <if>
            <equals arg1="${installer.mode}" arg2="online"/>
            <then>
                <condition property="option.separator" value="/D" else="-D">
                    <os family="windows"></os>
                </condition>
            	
                <property name="installer.args"
                          value="${option.separator}TOMCAT_DOWNLOAD_URL=${tomcat.download.url} ${option.separator}MYSQL_DOWNLOAD_URL=${mysql.download.url} ${option.separator}JAVA_6_DOWNLOAD_URL=${jdk.download.url} ${option.separator}OPENMRS_WAR_DOWNLOAD_URL=${openmrs.download.url}"/>
            </then>
            <else>
                <property name="installer.args" value=""/>

                <macrodef name="download">
                    <attribute name="file" default="NOT SET"/>
                    <attribute name="message" default="Downloading.."/>
                    <attribute name="url" default="Downloading.."/>
                    <sequential>
                        <mkdir dir="${installer-dependencies.dir}"/>
                        <available file="@{file}" property="present"/>
                        <if>
                            <equals arg1="${present}" arg2="true"/>
                            <else>
                                <echo message="@{message}"/>
                                <get src="@{url}"
                                     dest="@{file}"/>
                            </else>
                        </if>
                    </sequential>
                </macrodef>

                <property name="installer.mode" value="offline"/>

                <download file="${java-setup}" message="Downloading Java" url="${jdk.download.url}"/>
                <download file="${mysql-setup}" message="Downloading MySQL" url="${mysql.download.url}"/>
                <download file="${tomcat-setup}" message="Downloading Tomcat" url="${tomcat.download.url}"/>

				<mkdir dir="${dist.installer.dir}"/>
                <copy todir="${dist.installer.dir}" overwrite="true">
                    <fileset dir="${installer-dependencies.dir}">
                        <include name="*"/>
                    </fileset>
                    <fileset file="${webapp.target}/${webapp.name}.war"/>
                </copy>
            </else>
        </if>

        <property name="nsis.script" value="${dist.installer.dir}/openmrs_${installer.mode}.nsi"/>

        <mkdir dir="${dist.installer.dir}"/>

        <copy todir="${dist.installer.dir}" overwrite="true">
            <fileset dir="${installer.script.dir}">
                <include name="*"/>
            </fileset>
        </copy>

        <exec executable="${makensis.command}" logError="true" failonerror="true">
            <arg line="${installer.args} ${nsis.script}"/>
        </exec>

        <delete>
            <fileset dir="${dist.installer.dir}" excludes="openmrs-installer.exe"/>
        </delete>
        <echo message="${installer.mode} installer has been generated successfully at ${dist.installer.dir} directory!"/>
    	
    </target>

    <target name="create-online-installer" description="Create online version of windows installer">
        <antcall target="create-installer">
            <param name="installer.mode" value="online"/>
        </antcall>
    </target>
    
</project><commit_msg>Removed old unused installer target<commit_after><?xml version="1.0"?>
<!-- *********************************************************** -->
<!-- ** Ant build script for OpenMRS                          ** -->
<!-- **                                                       ** -->
<!-- ** This file is provided for those that cannot use       ** -->
<!-- ** maven. Using "mvn" instead of "ant" is recommended    ** -->
<!-- **                                                       ** -->
<!-- *********************************************************** -->
<project name="OpenMRS-trunk" default="dist" xmlns:artifact="urn:maven-artifact-ant">

	<property environment="env"/>
	<property name="root.dir" value="."/>
	<property name="lib.dir" value="${root.dir}${file.separator}lib"/>
	<property name="maven.ant.tasks.jar" value="${lib.dir}${file.separator}maven-ant-tasks-2.1.1.jar"/>
	<property name="maven.ant.tasks.bootstrap.location" value="http://repo2.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.1/maven-ant-tasks-2.1.1.jar"/>
	<property name="maven.ant.contrib.jar" value="${lib.dir}${file.separator}ant-contrib-1.0b3.jar"/>
	<property name="maven.ant.contrib.bootstrap.location" value="http://repo1.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar"/>
	<available property="m2.home.exists" file="${env.M2_HOME}" type="dir"/>	

	<!-- This will download ant-contrib and maven-ant-tasks if needed. Requires Ant 1.8.0 for skipexisting -->
	<mkdir dir="${lib.dir}"/>
	<get src="${maven.ant.contrib.bootstrap.location}" dest="${maven.ant.contrib.jar}" skipexisting="true"/>
	<get src="${maven.ant.tasks.bootstrap.location}" dest="${maven.ant.tasks.jar}" skipexisting="true"/>

	<property file="build.properties"/>
	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement location="${maven.ant.contrib.jar}"/>
		</classpath>
	</taskdef>

	<!-- This will initialize all the maven ant tasks -->
	<target name="init-maven-tasks">
		<path id="maven.ant.tasks.classpath" path="${maven.ant.tasks.jar}" />
		<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven.ant.tasks.classpath" /> 
 	</target>

	<!-- Use existing maven install or built in maven? -->
	<target name="use-existing-maven-install" depends="init-maven-tasks" if="m2.home.exists">
		<macrodef name="maven">
			<attribute name="pom" default="pom.xml"/>
			<attribute name="dir" default="."/>
			<attribute name="options" default=""/>
			<sequential>
				<artifact:mvn mavenHome="${env.M2_HOME}" pom="@{pom}" fork="true" dir="@{dir}">
					<arg line="@{options}"/>
				</artifact:mvn>
			</sequential>
		</macrodef>
	</target>
	<target name="use-built-in-maven" depends="init-maven-tasks" unless="m2.home.exists">
		<macrodef name="maven">
			<attribute name="pom" default="pom.xml"/>
			<attribute name="dir" default="."/>
			<attribute name="options" default=""/>
			<sequential>
				<artifact:mvn pom="@{pom}" fork="true" dir="@{dir}">
					<arg line="@{options}"/>
				</artifact:mvn>
			</sequential>
		</macrodef>
	</target>
	<target name="init-maven-macro" depends="use-existing-maven-install,use-built-in-maven"/>

	<!-- Tasks forwarded to maven goals -->
	<target name="clean" depends="init-maven-macro">
		<maven options="clean"/>
	</target>

	<target name="package-all" depends="init-maven-macro" description="packages api, test, and web jars for use in modules">
		<maven options="install -DskipTests"/>
	</target>

	<target name="junit" depends="init-maven-macro" description="Run all junit tests">
		<maven options="org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test"/>
	</target>

	<target name="jetty-run" depends="package-all" description="Start a Jetty webserver with openmrs installed">
		<maven options="jetty:run" pom="webapp/pom.xml" dir="webapp"/>
	</target>

	<!-- Pure ant tasks -->
	<target name="dist" depends="package-all" description="create distributable war file" />
	
	<target name="war" depends="dist" description="create distributable war file" />
    
</project>
{'fraction_non_alphanumeric': 0.20690507580751483, 'fraction_numerical': 0.006179960448253131, 'mean_word_length': 2.9754339993449066, 'pattern_counts': {'":': 0, '<': 223, '<?xml version=': 2, '>': 223, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 27, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2031178', 'n_tokens_mistral': 3905, 'n_tokens_neox': 3547, 'n_words': 652}