<commit_before><?xml version="1.0" encoding="UTF-8"?>

<project name="apps_config" basedir="." default="all">
    <import file="../common.xml" />

    <!-- the value for these properties are overriden if specified in the beginning of the app's build file before any tasks are defined -->
	<property name="classpath.ref" value="default.classpath" />
	<property name="manifest.classpath" value="../xal-core.jar ../xal-lib.jar ../xal-datasource.jar" />    
    <property name="mainclass.base" value="Main" />
    
    
    <target name="init">
        <dirname property="apps.src.root" file="${ant.file.apps_config}" />
        
        <property environment="env" />
        <property name="appname" value="${ant.project.name}" />
		<property name="app.package.prefix" value="xal.app" />
		<property name="mainclass" value="${app.package.prefix}.${appname}.${mainclass.base}" />
        <property name="app.ref" value="${appname}" />
        <property name="app.src.root" value="${apps.src.root}/${app.ref}" />
        <property name="apps.build.compile.root" value="${build.root}/compile/apps" />
        <property name="app.build.compile.root" value="${apps.build.compile.root}" />
        <property name="apps.build.jar.root" value="${build.jar.root}/apps" />
        <property name="app.build.jar" value="${apps.build.jar.root}/${appname}.jar" />
        <property name="app.relative.path" value="xal/app/${appname}" />
        <property name="apps.install.root" value="${install.root}/apps" />
        <property name="app.install.jar" value="${apps.install.root}/${appname}.jar" />
        
        <!-- determine whether building should be allowed -->
        <!-- don't build if the build is a batch build and this project explicitly excludes batch building -->
        <condition property="allows.build">
            <not>
                <and>
                    <isset property="batch.app.build" />
                    <isset property="exclude.batch.build" />
                </and>
            </not>
        </condition>
        
        <!-- determine whether deployment should be allowed -->
        <!-- don't deploy if this project explicitly excludes batch building -->
        <condition property="allows.install">
            <not>
                <isset property="exclude.install" />
            </not>
        </condition>
        
        <mkdir dir="${build.root}" />
        <mkdir dir="${apps.build.compile.root}" />
        
        <echo message="Conditionally processing ${appname}" />
    </target>


	<path id="default.classpath">
		<pathelement location="${build.root}/jar/xal-core.jar" />
		<pathelement location="${build.root}/jar/xal-lib.jar" />
		<pathelement location="${build.root}/jar/xal-datasource.jar" />
	</path>

	
    <target name="compile" depends="init" if="allows.build">
        <mkdir dir="${app.build.compile.root}"/>
        
        <javac srcdir="${app.src.root}/src" destdir="${app.build.compile.root}" debug="true" source="1.6" target="1.6" includeAntRuntime="no" deprecation="true">
			<classpath refid="${classpath.ref}"/>
        </javac>
        
        <copy todir="${app.build.compile.root}/${app.relative.path}/resources">
            <fileset dir="${app.src.root}/resources" />
        </copy>
    </target>

    
    <target name="jar" depends="init,compile" if="allows.build">
        <mkdir dir="${build.jar.root}" />
        <mkdir dir="${apps.build.jar.root}" />
        <jar jarfile="${app.build.jar}" compress="true" basedir="${app.build.compile.root}">
            <manifest>
              <attribute name="Manifest-Version" value="1.0" />
              <attribute name="Main-Class" value="${mainclass}" />
              <attribute name="Class-Path" value="${manifest.classpath}" />
            </manifest>
            
            <fileset dir=".">
                <include name="${app.relative.path}/**/*" />
            </fileset>
        </jar>
    </target>
    
    
    <target name="install" depends="all" if="allows.install">
        <copy file="${app.build.jar}" todir="${apps.install.root}" />
        <echo message="${appname} installed!"/>
    </target>
    
    
    <!-- Purge the application from the install root. -->
    <target name="purge-install" depends="init">
        <delete file="${app.install.jar}" quiet="true" />
        <echo message="Purged: ${app.install.jar}"/>
    </target>
    
    
    <target name="run" depends="init" description="Run application.">
    	<java jar="${app.build.jar}" fork="true">
	</java> 
    </target>
    
    
    <target name="all" depends="init,jar" description="Build everything." if="allows.build"><commit_msg>Fix the app jar task to include only items for the specified application.<commit_after><?xml version="1.0" encoding="UTF-8"?>

<project name="apps_config" basedir="." default="all">
    <import file="../common.xml" />

    <!-- the value for these properties are overriden if specified in the beginning of the app's build file before any tasks are defined -->
	<property name="classpath.ref" value="default.classpath" />
	<property name="manifest.classpath" value="../xal-core.jar ../xal-lib.jar ../xal-datasource.jar" />    
    <property name="mainclass.base" value="Main" />
    
    
    <target name="init">
        <dirname property="apps.src.root" file="${ant.file.apps_config}" />
        
        <property environment="env" />
        <property name="appname" value="${ant.project.name}" />
		<property name="app.package.prefix" value="xal.app" />
		<property name="mainclass" value="${app.package.prefix}.${appname}.${mainclass.base}" />
        <property name="app.ref" value="${appname}" />
        <property name="app.src.root" value="${apps.src.root}/${app.ref}" />
        <property name="apps.build.compile.root" value="${build.root}/compile/apps" />
        <property name="app.build.compile.root" value="${apps.build.compile.root}" />
        <property name="apps.build.jar.root" value="${build.jar.root}/apps" />
        <property name="app.build.jar" value="${apps.build.jar.root}/${appname}.jar" />
        <property name="app.relative.path" value="xal/app/${appname}" />
        <property name="apps.install.root" value="${install.root}/apps" />
        <property name="app.install.jar" value="${apps.install.root}/${appname}.jar" />
        
        <!-- determine whether building should be allowed -->
        <!-- don't build if the build is a batch build and this project explicitly excludes batch building -->
        <condition property="allows.build">
            <not>
                <and>
                    <isset property="batch.app.build" />
                    <isset property="exclude.batch.build" />
                </and>
            </not>
        </condition>
        
        <!-- determine whether deployment should be allowed -->
        <!-- don't deploy if this project explicitly excludes batch building -->
        <condition property="allows.install">
            <not>
                <isset property="exclude.install" />
            </not>
        </condition>
        
        <mkdir dir="${build.root}" />
        <mkdir dir="${apps.build.compile.root}" />
        
        <echo message="Conditionally processing ${appname}" />
    </target>


	<path id="default.classpath">
		<pathelement location="${build.root}/jar/xal-core.jar" />
		<pathelement location="${build.root}/jar/xal-lib.jar" />
		<pathelement location="${build.root}/jar/xal-datasource.jar" />
	</path>

	
    <target name="compile" depends="init" if="allows.build">
        <mkdir dir="${app.build.compile.root}"/>
        
        <javac srcdir="${app.src.root}/src" destdir="${app.build.compile.root}" debug="true" source="1.6" target="1.6" includeAntRuntime="no" deprecation="true">
			<classpath refid="${classpath.ref}"/>
        </javac>
        
        <copy todir="${app.build.compile.root}/${app.relative.path}/resources">
            <fileset dir="${app.src.root}/resources" />
        </copy>
    </target>

    
    <target name="jar" depends="init,compile" if="allows.build">
        <mkdir dir="${build.jar.root}" />
        <mkdir dir="${apps.build.jar.root}" />
        <jar jarfile="${app.build.jar}" compress="true" basedir="${app.build.compile.root}" includes="${app.relative.path}/**/*">
            <manifest>
              <attribute name="Manifest-Version" value="1.0" />
              <attribute name="Main-Class" value="${mainclass}" />
              <attribute name="Class-Path" value="${manifest.classpath}" />
            </manifest>
        </jar>
    </target>
    
    
    <target name="install" depends="all" if="allows.install">
        <copy file="${app.build.jar}" todir="${apps.install.root}" />
        <echo message="${appname} installed!"/>
    </target>
    
    
    <!-- Purge the application from the install root. -->
    <target name="purge-install" depends="init">
        <delete file="${app.install.jar}" quiet="true" />
        <echo message="Purged: ${app.install.jar}"/>
    </target>
    
    
    <target name="run" depends="init" description="Run application.">
    	<java jar="${app.build.jar}" fork="true">
	</java> 
    </target>
    
    
    <target name="all" depends="init,jar" description="Build everything." if="allows.build">
{'fraction_non_alphanumeric': 0.1890928725701944, 'fraction_numerical': 0.0019438444924406047, 'mean_word_length': 2.5333842045020982, 'pattern_counts': {'":': 0, '<': 170, '<?xml version=': 2, '>': 170, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '5851304', 'n_tokens_mistral': 2732, 'n_tokens_neox': 2642, 'n_words': 517}