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

<!-- This is the build file for the Spiffy UI Framwork Application.  This application
     uses almost every part of the Spiffy UI framework and has many performance improvements.
-->
<project name="Spiffy UI Framework Application" xmlns:ivy="antlib:org.apache.ivy.ant" default="all" basedir=".">
    <target name="all" depends="setup" description="Build, compile, and package the entire application">
        <!-- This application will call the Spiffy UI framework build.
             It is possible to build the framework separately, but building
             it in the context of this application is the most common way
             of building it. -->
        <subant antfile="build.xml" buildpath="${build.base}/../spiffyui/build/" />
        
        <antcall target="app"/>
    </target>
    
    <target name="framework.compile.check">
        <condition property="is.framework.compiled" else="is.framework.not.compiled">
            <available file="${spiffyui}/dist"/>
        </condition>
    </target>
    
    <target name="framework.nocompileError" if="is.framework.not.compiled">
        <fail message="You must compile the framework with the all target before calling the client target." />
    </target>
    
    <target name="app" depends="setup,resolve,framework.compile.check,framework.nocompileError" 
            description="Build, compile, and package just the Spiffy UI application">
        <!-- Now that we've built the Spiffy UI framework we can import 
             the Ant tasks available in that framework. -->
        <taskdef resource="tasks.properties">
            <classpath>
                <fileset dir="${spiffyui}/build/lib" includes="*.jar"/>
                <fileset dir="${spiffyui}/dist" includes="*.jar"/>
            </classpath>
        </taskdef>
        
    	<antcall target="zip-template"/>
    	
        <antcall target="addVersionInfo"/>
        
        <antcall target="HTMLProps"/>
        
        <antcall target="gwt-compile">
            <param name="gwttarget" value="org.spiffyui.spsample.index"/>
        </antcall>
        
        <antcall target="compile"/>
        
        <antcall target="js-min" />
        
        <antcall target="css-min" />
        
        <antcall target="package" />
    </target>
    
    <target name="clearcache" description="Clear the Apache Ivy cache" depends="setup,ivySettings" unless="build.from.maven">
        <ivy:cleancache />
    </target>
    
    <target name="ivySettings" unless="build.from.maven">
        <ivy:settings file="${build}/ivysettings.xml" />
    </target>
    
    <target name="resolve" description="Retrieve dependencies with Apache Ivy" depends="ivySettings" unless="build.from.maven">
        <ivy:retrieve log="download-only" />
    </target>
    
    <property name="ivy.install.version" value="2.1.0-rc2" />
    <condition property="ivy.home" value="${env.IVY_HOME}">
      <isset property="env.IVY_HOME" />
    </condition>
    <property name="ivy.home" value="${user.home}/.ant" />
    <property name="ivy.jar.dir" value="${ivy.home}/lib" />
    <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />

    <target name="download-ivy" unless="hasDownloadedIvy">
        <property name="hasDownloadedIvy" value="true" />

        <mkdir dir="${ivy.jar.dir}"/>
        <!-- download Ivy from web site so that it can be used even without any special installation -->
        <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" 
             dest="${ivy.jar.file}" usetimestamp="true"/>
    </target>

    <target name="init-ivy" depends="download-ivy">
      <!-- try to load ivy here from ivy home, in case the user has not already dropped
              it into ant's lib dir (note that the latter copy will always take precedence).
              We will not fail as long as local lib dir exists (it may be empty) and
              ivy is in at least one of ant's lib dir or the local lib dir. -->
        <path id="ivy.lib.path">
            <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
        </path>
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
                 uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
    </target>
    
    <target name="setup" description="Setup build dependencies and properties and get Subversion information" depends="init-ivy" unless="hasSetup">
        <!-- The setup task doesn't take very much time, but it
             does send some output to the console.  We use this 
             property to make sure we only run it once. 
        --><commit_msg>We are now skipping the download of Ivy if the JAR already exists locally.<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!-- This is the build file for the Spiffy UI Framwork Application.  This application
     uses almost every part of the Spiffy UI framework and has many performance improvements.
-->
<project name="Spiffy UI Framework Application" xmlns:ivy="antlib:org.apache.ivy.ant" default="all" basedir=".">
    <target name="all" depends="setup" description="Build, compile, and package the entire application">
        <!-- This application will call the Spiffy UI framework build.
             It is possible to build the framework separately, but building
             it in the context of this application is the most common way
             of building it. -->
        <subant antfile="build.xml" buildpath="${build.base}/../spiffyui/build/" />
        
        <antcall target="app"/>
    </target>
    
    <target name="framework.compile.check">
        <condition property="is.framework.compiled" else="is.framework.not.compiled">
            <available file="${spiffyui}/dist"/>
        </condition>
    </target>
    
    <target name="framework.nocompileError" if="is.framework.not.compiled">
        <fail message="You must compile the framework with the all target before calling the client target." />
    </target>
    
    <target name="app" depends="setup,resolve,framework.compile.check,framework.nocompileError" 
            description="Build, compile, and package just the Spiffy UI application">
        <!-- Now that we've built the Spiffy UI framework we can import 
             the Ant tasks available in that framework. -->
        <taskdef resource="tasks.properties">
            <classpath>
                <fileset dir="${spiffyui}/build/lib" includes="*.jar"/>
                <fileset dir="${spiffyui}/dist" includes="*.jar"/>
            </classpath>
        </taskdef>
        
    	<antcall target="zip-template"/>
    	
        <antcall target="addVersionInfo"/>
        
        <antcall target="HTMLProps"/>
        
        <antcall target="gwt-compile">
            <param name="gwttarget" value="org.spiffyui.spsample.index"/>
        </antcall>
        
        <antcall target="compile"/>
        
        <antcall target="js-min" />
        
        <antcall target="css-min" />
        
        <antcall target="package" />
    </target>
    
    <target name="clearcache" description="Clear the Apache Ivy cache" depends="setup,ivySettings" unless="build.from.maven">
        <ivy:cleancache />
    </target>
    
    <target name="ivySettings" unless="build.from.maven">
        <ivy:settings file="${build}/ivysettings.xml" />
    </target>
    
    <target name="resolve" description="Retrieve dependencies with Apache Ivy" depends="ivySettings" unless="build.from.maven">
        <ivy:retrieve log="download-only" />
    </target>
    
    <property name="ivy.install.version" value="2.1.0-rc2" />
    <condition property="ivy.home" value="${env.IVY_HOME}">
      <isset property="env.IVY_HOME" />
    </condition>
    <property name="ivy.home" value="${user.home}/.ant" />
    <property name="ivy.jar.dir" value="${ivy.home}/lib" />
    <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />

    <target name="download-ivy" unless="hasDownloadedIvy">
        <property name="hasDownloadedIvy" value="true" />

        <mkdir dir="${ivy.jar.dir}"/>
        <!-- download Ivy from web site so that it can be used even without any special installation -->
        <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" 
             dest="${ivy.jar.file}" usetimestamp="true" skipexisting="true"/>
    </target>

    <target name="init-ivy" depends="download-ivy">
      <!-- try to load ivy here from ivy home, in case the user has not already dropped
              it into ant's lib dir (note that the latter copy will always take precedence).
              We will not fail as long as local lib dir exists (it may be empty) and
              ivy is in at least one of ant's lib dir or the local lib dir. -->
        <path id="ivy.lib.path">
            <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
        </path>
        <taskdef resource="org/apache/ivy/ant/antlib.xml"
                 uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
    </target>
    
    <target name="setup" description="Setup build dependencies and properties and get Subversion information" depends="init-ivy" unless="hasSetup">
        <!-- The setup task doesn't take very much time, but it
             does send some output to the console.  We use this 
             property to make sure we only run it once. 
        -->
{'fraction_non_alphanumeric': 0.1366959838931864, 'fraction_numerical': 0.0019073858217653916, 'mean_word_length': 2.54812030075188, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 2, '>': 135, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4296080', 'n_tokens_mistral': 2706, 'n_tokens_neox': 2649, 'n_words': 756}