<commit_before><?xml version="1.0"?>

<project xmlns:antcontrib="antlib:net.sf.antcontrib"
         xmlns:artifact="antlib:org.apache.maven.artifact.ant"
         xmlns:ivy="antlib:org.apache.ivy.ant"
         name="Vaadin"
         basedir="../" default="package-all">

	<property name="project.root" value="."/>
    <!-- Import common targets  -->
    <import file="./common.xml" />

    <!--Call one of package-* targets unless you understand what you are doing. -->
    <target name="package-all" depends="clean-all, init, build, javadoc, internal-package-war, internal-package-liferay, differences" description="Build public packages.">
    </target>

    <target name="package-jar" depends="clean-result, init, vaadin.jar" description="Create vaadin-x.y.z.jar file.">
    </target>

    <target name="package-war" depends="clean-result, init, build, javadoc, internal-package-war, differences">
    </target>

    <target name="package-liferay-zip" depends="clean-result, init, build, internal-package-liferay">
    </target>
	
    <target name="init-deps" depends="common.init-deps" >
        <property name="ivy.resolved" value="1" />
        <ivy:resolve file="build/ivy/ivy.xml" resolveid="common" conf="ss.compile, cs.compile, ss.test.compile"/>
        <ivy:cachepath pathid="compile.classpath.server-side" conf="ss.compile"/>
        <ivy:cachepath pathid="compile.classpath.client-side" conf="cs.compile"/>
        <ivy:cachepath pathid="compile.classpath.server-side-tests" conf="ss.test.compile"/>
    </target>

    <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <target name="clean-result" depends="build.properties">

        <!-- Clean build result directory. -->
        <delete dir="${result-path}" includes="**/*" followsymlinks="false" defaultexcludes="false" includeemptydirs="true" failonerror="false"/>
    </target>

	<target name="build.properties">
        <property file="build/build.properties" />
		
        <property file="build/VERSION.properties" />
        <property file="build/GWT-VERSION.properties" />

		<!-- result source and classes folders -->
		<property name="result-src-core" value="${result-path}/src/core"/>
		<property name="result-src-junit" value="${result-path}/src/junit"/>
		<property name="result-src-testbench" value="${result-path}/src/testbench"/>
		<property name="result-classes-core" value="${result-path}/classes/core"/>
		<property name="result-classes-junit" value="${result-path}/classes/junit"/>
		<property name="result-classes-testbench" value="${result-path}/classes/testbench"/>
		<!-- Folder where Emma instrumented classes are placed (if Emma is used)-->
		<property name="result-classes-core-for-emma-war" value="${result-path}/classes/emma-war"/>
		<property name="result-classes-core-for-emma-junit" value="${result-path}/classes/emma-junit"/>

	</target>
    <target name="clean-all" depends="clean-result">
    </target>

    <!-- ================================================================== -->
    <!-- Check versions.                                                    -->
    <!-- ================================================================== -->

    <!-- Java compiler version. -->
    <target name="check-java-version">
      <condition property="java.version.matches">
        <or>
          <equals arg1="${ant.java.version}" arg2="1.5"/>
          <isset property="ignoreversion"/>
        </or>
      </condition>
      <fail unless="java.version.matches" message="Java version is ${ant.java.version}, but Vaadin must be compiled with genuine Java 1.5 compiler. Use -Dignoreversion=1 for ant to ignore the version check."/>
      <echo>Java version is ${ant.java.version} as required.</echo>
    </target>

    <!-- ================================================================== -->
    <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <!-- ================================================================== -->

     <target name="init" depends="init-deps, build.properties">
        <!-- Current timestamp in different formats. -->
        <tstamp>
            <format property="build.date" pattern="yyyy-MM-dd"/>
        </tstamp>
        <tstamp>
            <format property="build.date.compact" pattern="yyyyMMdd"/>
        </tstamp>

        <antcontrib:propertyregex property="version.major" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\1"/>
        <antcontrib:propertyregex property="version.minor" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\2"/>
        <antcontrib:propertyregex property="version.revision" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\3"/>

        <!-- Default full version name. -->
        <!-- Nightly and other TeamCity builds will define their own. -->
        <property name="version.full" value="${version}.dev-${build.date.compact}"/>
        <echo>Base Version: ${version}</echo>
        <echo>Full Version: ${version.full}</echo>

        <!-- Other properties -->
        <property file="build/html-style.properties" />

        <echo>Vaadin package is: ${vaadin-package}</echo>

        <!-- Create result dir unless already exists -->
        <mkdir dir="${result-path}" />

        <!-- Create dirs that might be used by the test coverage generation -->
    	<mkdir dir="${result-classes-core-for-emma-war}" />
    	<mkdir dir="${result-classes-core-for-emma-junit}" />
    	<mkdir dir="${result-path}/coverage" />

        <echo>We are using gwt version ${gwt-version}.</echo>

        <!-- Destination files -->
        <property name="base-name" value="${product-file}-${version.full}" />
        <property name="lib-jar-name" value="${base-name}.jar" />
        <property name="lib-sources-jar-name" value="${base-name}-sources.jar" />
        <property name="lib-javadoc-jar-name" value="${base-name}-javadoc.jar" />
        <property name="test-war-filename" value="${product-file}-tests-${version.full}.war"/>

        <echo message="Prepared to build ${product-file} version ${version.full} packages" />

        <!-- Output directory -->
        <property name="output-dir" value="${result-path}/${base-name}" />
        <mkdir dir="${output-dir}" />

        <!-- Where widgetsets are written to.                             -->
        <!-- When not building a package, widgetsets should be written to -->
        <!-- WebContent/VAADIN/widgetsets, which needs to be set in       -->
        <!-- init-nonpackage target before calling this main init target. -->
        <property name="widgetsets-output-dir" value="${output-dir}/WebContent/VAADIN/widgetsets" />
        
     	<!-- Build helpers -->
     	<property name="buildhelpers-src" value="build/buildhelpers" />
     	<property name="buildhelpers-classes" value="${result-path}/buildhelpers/classes" />

        <!-- Create Output Directory Hierarchy -->
        <mkdir dir="${output-dir}/WebContent" />
        <mkdir dir="${output-dir}/WebContent/demo" />
        <mkdir dir="${output-dir}/WebContent/docs" />
        <mkdir dir="${output-dir}/WebContent/docs/api" />
        <mkdir dir="${output-dir}/WebContent/tests" />
        <mkdir dir="${output-dir}/WebContent/WEB-INF" />
        <mkdir dir="${output-dir}/WebContent/WEB-INF/lib" />
        <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
    </target>

    <target name="internal-package-war">
        <echo>Building Test WAR</echo>

        <echo>Adding test class files and resources and launcher configuration.</echo>
        <copy todir="${output-dir}/WebContent/WEB-INF/classes">
            <fileset dir="${result-classes-testbench}">
                <include name="${vaadin-package}/tests/**/*" />
                <include name="${vaadin-package}/launcher/**" />
            </fileset>
            <fileset dir="${result-classes-junit}">
            	<!-- VaadinClasses and data classes are used by TestBench tests also -->
            </fileset>
            <!-- test resources -->
            <fileset dir="tests/testbench">
                <include name="${vaadin-package}/tests/**/*" />
                <!-- Pre-processed versions of these copied above -->
                <exclude name="**/*.java" />
                <exclude name="**/*.html" />
                <exclude name="**/*.css" />
                <exclude name="**/*.xml" />
            </fileset>

        	<!-- Include files required by the DemoLauncher/DevelopmentServerLauncher -->
            <fileset dir="tests/testbench">
        		<include name="${vaadin-package}/launcher/jetty-webdefault.xml" />
        		<include name="${vaadin-package}/launcher/keystore" />
            </fileset>
        </copy>

        <war warfile="${result-path}/${test-war-filename}"> 
            <fileset dir="${output-dir}/WebContent">
                <!-- Already in JAR -->
            	<!-- Not excluded because used from WAR by portal integration tests
                <exclude name="VAADIN/themes/base/**/*" />
                <exclude name="VAADIN/themes/chameleon/**/*" />
                <exclude name="VAADIN/themes/liferay/**/*" />
                <exclude name="VAADIN/themes/reindeer/**/*" />
                <exclude name="VAADIN/themes/runo/**/*" />
                <exclude name="VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
                -->

                <!-- Not needed for testing -->
                <exclude name="docs/**/*" />
                <exclude name="docs" />
                
                <include name="**/*" />
            </fileset>
        </war>
    </target>

    <target name="internal-package-liferay" depends="internal-package-war"><commit_msg>Exclude gwt-unitCache which is too large for GAE<commit_after><?xml version="1.0"?>

<project xmlns:antcontrib="antlib:net.sf.antcontrib"
         xmlns:artifact="antlib:org.apache.maven.artifact.ant"
         xmlns:ivy="antlib:org.apache.ivy.ant"
         name="Vaadin"
         basedir="../" default="package-all">

	<property name="project.root" value="."/>
    <!-- Import common targets  -->
    <import file="./common.xml" />

    <!--Call one of package-* targets unless you understand what you are doing. -->
    <target name="package-all" depends="clean-all, init, build, javadoc, internal-package-war, internal-package-liferay, differences" description="Build public packages.">
    </target>

    <target name="package-jar" depends="clean-result, init, vaadin.jar" description="Create vaadin-x.y.z.jar file.">
    </target>

    <target name="package-war" depends="clean-result, init, build, javadoc, internal-package-war, differences">
    </target>

    <target name="package-liferay-zip" depends="clean-result, init, build, internal-package-liferay">
    </target>
	
    <target name="init-deps" depends="common.init-deps" >
        <property name="ivy.resolved" value="1" />
        <ivy:resolve file="build/ivy/ivy.xml" resolveid="common" conf="ss.compile, cs.compile, ss.test.compile"/>
        <ivy:cachepath pathid="compile.classpath.server-side" conf="ss.compile"/>
        <ivy:cachepath pathid="compile.classpath.client-side" conf="cs.compile"/>
        <ivy:cachepath pathid="compile.classpath.server-side-tests" conf="ss.test.compile"/>
    </target>

    <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <target name="clean-result" depends="build.properties">

        <!-- Clean build result directory. -->
        <delete dir="${result-path}" includes="**/*" followsymlinks="false" defaultexcludes="false" includeemptydirs="true" failonerror="false"/>
    </target>

	<target name="build.properties">
        <property file="build/build.properties" />
		
        <property file="build/VERSION.properties" />
        <property file="build/GWT-VERSION.properties" />

		<!-- result source and classes folders -->
		<property name="result-src-core" value="${result-path}/src/core"/>
		<property name="result-src-junit" value="${result-path}/src/junit"/>
		<property name="result-src-testbench" value="${result-path}/src/testbench"/>
		<property name="result-classes-core" value="${result-path}/classes/core"/>
		<property name="result-classes-junit" value="${result-path}/classes/junit"/>
		<property name="result-classes-testbench" value="${result-path}/classes/testbench"/>
		<!-- Folder where Emma instrumented classes are placed (if Emma is used)-->
		<property name="result-classes-core-for-emma-war" value="${result-path}/classes/emma-war"/>
		<property name="result-classes-core-for-emma-junit" value="${result-path}/classes/emma-junit"/>

	</target>
    <target name="clean-all" depends="clean-result">
    </target>

    <!-- ================================================================== -->
    <!-- Check versions.                                                    -->
    <!-- ================================================================== -->

    <!-- Java compiler version. -->
    <target name="check-java-version">
      <condition property="java.version.matches">
        <or>
          <equals arg1="${ant.java.version}" arg2="1.5"/>
          <isset property="ignoreversion"/>
        </or>
      </condition>
      <fail unless="java.version.matches" message="Java version is ${ant.java.version}, but Vaadin must be compiled with genuine Java 1.5 compiler. Use -Dignoreversion=1 for ant to ignore the version check."/>
      <echo>Java version is ${ant.java.version} as required.</echo>
    </target>

    <!-- ================================================================== -->
    <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - -->
    <!-- ================================================================== -->

     <target name="init" depends="init-deps, build.properties">
        <!-- Current timestamp in different formats. -->
        <tstamp>
            <format property="build.date" pattern="yyyy-MM-dd"/>
        </tstamp>
        <tstamp>
            <format property="build.date.compact" pattern="yyyyMMdd"/>
        </tstamp>

        <antcontrib:propertyregex property="version.major" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\1"/>
        <antcontrib:propertyregex property="version.minor" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\2"/>
        <antcontrib:propertyregex property="version.revision" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\3"/>

        <!-- Default full version name. -->
        <!-- Nightly and other TeamCity builds will define their own. -->
        <property name="version.full" value="${version}.dev-${build.date.compact}"/>
        <echo>Base Version: ${version}</echo>
        <echo>Full Version: ${version.full}</echo>

        <!-- Other properties -->
        <property file="build/html-style.properties" />

        <echo>Vaadin package is: ${vaadin-package}</echo>

        <!-- Create result dir unless already exists -->
        <mkdir dir="${result-path}" />

        <!-- Create dirs that might be used by the test coverage generation -->
    	<mkdir dir="${result-classes-core-for-emma-war}" />
    	<mkdir dir="${result-classes-core-for-emma-junit}" />
    	<mkdir dir="${result-path}/coverage" />

        <echo>We are using gwt version ${gwt-version}.</echo>

        <!-- Destination files -->
        <property name="base-name" value="${product-file}-${version.full}" />
        <property name="lib-jar-name" value="${base-name}.jar" />
        <property name="lib-sources-jar-name" value="${base-name}-sources.jar" />
        <property name="lib-javadoc-jar-name" value="${base-name}-javadoc.jar" />
        <property name="test-war-filename" value="${product-file}-tests-${version.full}.war"/>

        <echo message="Prepared to build ${product-file} version ${version.full} packages" />

        <!-- Output directory -->
        <property name="output-dir" value="${result-path}/${base-name}" />
        <mkdir dir="${output-dir}" />

        <!-- Where widgetsets are written to.                             -->
        <!-- When not building a package, widgetsets should be written to -->
        <!-- WebContent/VAADIN/widgetsets, which needs to be set in       -->
        <!-- init-nonpackage target before calling this main init target. -->
        <property name="widgetsets-output-dir" value="${output-dir}/WebContent/VAADIN/widgetsets" />
        
     	<!-- Build helpers -->
     	<property name="buildhelpers-src" value="build/buildhelpers" />
     	<property name="buildhelpers-classes" value="${result-path}/buildhelpers/classes" />

        <!-- Create Output Directory Hierarchy -->
        <mkdir dir="${output-dir}/WebContent" />
        <mkdir dir="${output-dir}/WebContent/demo" />
        <mkdir dir="${output-dir}/WebContent/docs" />
        <mkdir dir="${output-dir}/WebContent/docs/api" />
        <mkdir dir="${output-dir}/WebContent/tests" />
        <mkdir dir="${output-dir}/WebContent/WEB-INF" />
        <mkdir dir="${output-dir}/WebContent/WEB-INF/lib" />
        <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
    </target>

    <target name="internal-package-war">
        <echo>Building Test WAR</echo>

        <echo>Adding test class files and resources and launcher configuration.</echo>
        <copy todir="${output-dir}/WebContent/WEB-INF/classes">
            <fileset dir="${result-classes-testbench}">
                <include name="${vaadin-package}/tests/**/*" />
                <include name="${vaadin-package}/launcher/**" />
            </fileset>
            <fileset dir="${result-classes-junit}">
            	<!-- VaadinClasses and data classes are used by TestBench tests also -->
            </fileset>
            <!-- test resources -->
            <fileset dir="tests/testbench">
                <include name="${vaadin-package}/tests/**/*" />
                <!-- Pre-processed versions of these copied above -->
                <exclude name="**/*.java" />
                <exclude name="**/*.html" />
                <exclude name="**/*.css" />
                <exclude name="**/*.xml" />
            </fileset>

        	<!-- Include files required by the DemoLauncher/DevelopmentServerLauncher -->
            <fileset dir="tests/testbench">
        		<include name="${vaadin-package}/launcher/jetty-webdefault.xml" />
        		<include name="${vaadin-package}/launcher/keystore" />
            </fileset>
        </copy>

        <war warfile="${result-path}/${test-war-filename}"> 
            <fileset dir="${output-dir}/WebContent">
            	<exclude name="VAADIN/gwt-unitCache" />
                <!-- Already in JAR -->
            	<!-- Not excluded because used from WAR by portal integration tests
                <exclude name="VAADIN/themes/base/**/*" />
                <exclude name="VAADIN/themes/chameleon/**/*" />
                <exclude name="VAADIN/themes/liferay/**/*" />
                <exclude name="VAADIN/themes/reindeer/**/*" />
                <exclude name="VAADIN/themes/runo/**/*" />
                <exclude name="VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
                -->

                <!-- Not needed for testing -->
                <exclude name="docs/**/*" />
                <exclude name="docs" />
                
                <include name="**/*" />
            </fileset>
        </war>
    </target>

    <target name="internal-package-liferay" depends="internal-package-war">
{'fraction_non_alphanumeric': 0.21383809328128212, 'fraction_numerical': 0.0013355249640435586, 'mean_word_length': 2.4617709815078235, 'pattern_counts': {'":': 0, '<': 334, '<?xml version=': 2, '>': 334, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4068734', 'n_tokens_mistral': 5652, 'n_tokens_neox': 5346, 'n_words': 1036}