<commit_before><!--/*******************************************************************************
* This program and the accompanying materials are made available under the 
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
* which accompanies this distribution. 
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at 
* http://www.eclipse.org/org/documents/edl-v10.php.
*
*   Ant naming conventions:
*   - regardless of the actual OS platform,'/' is the directory separator
*     (Ant will convert as appropriate).
*   - multi-word properties use periods '.'
*   - multi-word targets use hyphens '-' 
*   - multi-word macros use underscores '_'
*   - multi-word macro attributes are concatinated
*     e.g. 'runpathref'  
*   - multi-word tasks (taskdef) names are concatinated
*     e.g. 'validateconnection'
*   - OS environment variables are in ALLCAPS and have 'env' as a prefix
*     e.g. ${env.XXX}.
*   - Ant properties are lower case.
*
* Contributors:
*     eric.gwin - initial API and implementation (checked in by tware)
#******************************************************************************/-->
<project name="EclipseLink Bootstrap Automated Builds" basedir="." default="nightly">

<!--                THIS FILE NEEDS TO BE KEPT MINIMAL                    -->
<!--          ONLY project specific info should be defined here           -->
<!-- Anything that may change on a future branch should be defined in the -->
<!--                    Branch specific Autobuild.xml                     -->

<echo message="---- Bootstrap ----"/>

    <target name="init">
        <condition property="_Win" value="true">
             <or>
                <equals arg1="${os.name}" arg2="Windows XP"/>
                <equals arg1="${os.name}" arg2="Windows NT"/>
            </or>
        </condition>

        <property name="build.compiler" value="javac1.5"/>
        <tstamp>
            <format property="build_date" pattern="yyyyMMdd"/>
            <format property="build_time" pattern="HHmm"/>
        </tstamp>
        <property environment="env"/>
        <!-- This needs to be here because if not set we need to check OS     -->
        <!-- and define appropriate default locations for svn                 -->
        <property name="svn.exec"        value="${env.SVN_EXEC}"/>

        <echo message="ANT_ARGS='${env.ANT_ARGS}'"/>
        <echo message="ANT_OPTS='${env.ANT_OPTS}'"/>
        <echo message=" "/>
        <echo message="build_date.build_time='${build_date}.${build_time}'"/>
        <echo message="java.version  ='${java.version}'"/>
        <echo message="os.name       ='${os.name}'"/>
        <echo message="os.arch       ='${os.arch}'"/>
        <echo message="os.version    ='${os.version}'"/>
        <echo message=" "/>
        <echo message="basedir       ='${basedir}'"/>
    </target>

    <!-- Set svn.exec to os appropriate value                                 -->
    <!--    (fallback in case env.SVN_EXEC not set)                           -->
    <target name="init-linux" unless="_Win" depends="init">
        <property name="svn.exec" value="/usr/local/bin/svn"/>
    </target>
    <target name="init-win" if="_Win" depends="init-linux">
        <property name="svn.exec" value="svn"/>
    </target>

    <!-- Setup properties needed if testing using a local repos on RedHat     -->
    <!--     (-D_RHB=1 defined on command-line)                              -->
    <target name="init-test" if="_LocalRepos" depends="init">
        <property name="svn.rw.protocol"   value="file:"/>
        <property name="svn.base.urlpath"  value="///var/svn/repos/eclipselink"/>
    </target>

    <!-- Setup properties needed if testing using a local repos on RedHat     -->
    <!--     (-D_RHB=1 defined on command-line)                              -->
    <target name="init-test2" if="_RHB" depends="init-test">
        <property name="svn.rw.protocol" value="http:"/>
    </target>

    <target name="properties-init" depends="init-win,init-test2">
        <echo message="svn.exec='${svn.exec}'"/>

        <!-- # Build environment definitions                                  -->
        <!-- #  build.root.dir is the directory the branch's build            -->
        <!-- #       files are in                                             -->
        <!-- #  branch.name will always be specified  on command-line         -->
        <!-- #       if used                                                  -->
        <!-- #  junit.lib and junit.dir are only specified here because they  -->
        <!-- #       need to be defined in ANT the same as in the CLASSPATH   -->
        <!-- #       that ANT is invoked with. (the junit used at runtime     -->
        <!-- #       must be defined in the classpath ANT is invoked with)    -->
        <property name="branch.name"     value=""/>
        <property name="build.root.dir"  value="${env.BRANCH_PATH}"/>
        <property name="build.deps.dir"  value="${env.BLD_DEPS_DIR}"/>
        <property name="log.dir"         value="${env.LOG_DIR}"/>
        <property name="junit.dir"       value="${env.JUNIT_HOME}"/>
        <property name="junit.lib"       value="${junit.dir}/junit.jar"/>
        <property name="branch.dir"      value="${branch.name}trunk"/>
        <property name="autobld.file"    value="autobuild.xml"/>

        <!-- #  Subversion definitions   (URLs, protocols & control files)    -->
        <!-- #                                                                -->
        <!-- #  svn.exec is set by init and depends upon the OS               -->
        <property name="svn.ro.protocol"     value="http:"/>
        <property name="svn.protocol"        value="svn:"/>
        <property name="svn.rw.protocol"     value="svn+ssh:"/>
        <property name="svn.base.urlpath"    value="//dev.eclipse.org/svnroot/rt/org.eclipse.persistence"/>
        <property name="svn.base.url"        value="${svn.rw.protocol}${svn.base.urlpath}"/>
        <property name="svn.branch.url"      value="${svn.base.url}/${branch.dir}"/>
        <property name="svn.build.url"       value="${svn.branch.url}/buildsystem"/>
        <property name="current.svnrev.file" value="${log.dir}/.current_svn_rev"/>
        <property name="latest.svnrev.file"  value="${log.dir}/.latest_svn_rev"/>
        <!-- available file="${latest.svnrev.file}" property="latest.svnrev.file.present"/ -->
    </target>

    <!-- Used for Build testing:  Set if "target" in .sh appended by ".test"  -->
    <target name="no-get-src" if="_DoNotUpdate" depends="properties-init">
        <echo message="Update of local source Skipped."/>
    </target>

    <target name="get-src" unless="_DoNotUpdate" depends="no-get-src">
        <echo message="** Begin of Source Retrieval **"/>
        <!-- the following arg makes the source retrieval "quiet". We really  -->
        <!-- should log the files that were updated, so commenting out.       -->
        <!--    <arg value="-q"/>                                             -->
        <exec executable="${svn.exec}" failonerror="true" logError="true" >
            <arg value="co"/>
            <arg value="${svn.branch.url}"/>
        </exec>
        <chmod file="${build.root.dir}/buildsystem/bootstrap.sh" perm="ug+x"/>
        <echo message="**  End of Source Retrieval  **"/>
    </target>

    <target name="build" depends="get-src" description="Trigger an automated build without testing or publish">
        <echo message="'build' target: Calling 'build-no-publish' target in '${build.root.dir}/${autobld.file}'"/>
        <ant antfile="${autobld.file}" dir="${build.root.dir}" target="build-no-publish"/>
        <!-- Untested: Possible way to call ant and specify a different logger.
        <java
                classname="org.apache.tools.ant.launch.Launcher"
                fork="true"
                maxmemory="128m"
                failonerror="true"
                dir="${build.root.dir}"
                timeout="4000000"
                taskname="startAnt"
        >
            <classpath>
                <pathelement location="${ant.home}/lib/ant-launcher.jar"/>
            </classpath>
            <arg value="-buildfile"/>
            <arg file="${autobld.file}"/><commit_msg>fix for multi-branch use.<commit_after><!--/*******************************************************************************
* This program and the accompanying materials are made available under the 
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
* which accompanies this distribution. 
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at 
* http://www.eclipse.org/org/documents/edl-v10.php.
*
*   Ant naming conventions:
*   - regardless of the actual OS platform,'/' is the directory separator
*     (Ant will convert as appropriate).
*   - multi-word properties use periods '.'
*   - multi-word targets use hyphens '-' 
*   - multi-word macros use underscores '_'
*   - multi-word macro attributes are concatinated
*     e.g. 'runpathref'  
*   - multi-word tasks (taskdef) names are concatinated
*     e.g. 'validateconnection'
*   - OS environment variables are in ALLCAPS and have 'env' as a prefix
*     e.g. ${env.XXX}.
*   - Ant properties are lower case.
*
* Contributors:
*     eric.gwin - initial API and implementation (checked in by tware)
#******************************************************************************/-->
<project name="EclipseLink Bootstrap Automated Builds" basedir="." default="nightly">

<!--                THIS FILE NEEDS TO BE KEPT MINIMAL                    -->
<!--          ONLY project specific info should be defined here           -->
<!-- Anything that may change on a future branch should be defined in the -->
<!--                    Branch specific Autobuild.xml                     -->

<echo message="---- Bootstrap ----"/>

    <target name="init">
        <condition property="_Win" value="true">
             <or>
                <equals arg1="${os.name}" arg2="Windows XP"/>
                <equals arg1="${os.name}" arg2="Windows NT"/>
            </or>
        </condition>

        <property name="build.compiler" value="javac1.5"/>
        <tstamp>
            <format property="build_date" pattern="yyyyMMdd"/>
            <format property="build_time" pattern="HHmm"/>
        </tstamp>
        <property environment="env"/>
        <!-- This needs to be here because if not set we need to check OS     -->
        <!-- and define appropriate default locations for svn                 -->
        <property name="svn.exec"        value="${env.SVN_EXEC}"/>

        <echo message="ANT_ARGS='${env.ANT_ARGS}'"/>
        <echo message="ANT_OPTS='${env.ANT_OPTS}'"/>
        <echo message=" "/>
        <echo message="build_date.build_time='${build_date}.${build_time}'"/>
        <echo message="java.version  ='${java.version}'"/>
        <echo message="os.name       ='${os.name}'"/>
        <echo message="os.arch       ='${os.arch}'"/>
        <echo message="os.version    ='${os.version}'"/>
        <echo message=" "/>
        <echo message="basedir       ='${basedir}'"/>
    </target>

    <!-- Set svn.exec to os appropriate value                                 -->
    <!--    (fallback in case env.SVN_EXEC not set)                           -->
    <target name="init-linux" unless="_Win" depends="init">
        <property name="svn.exec" value="/usr/local/bin/svn"/>
    </target>
    <target name="init-win" if="_Win" depends="init-linux">
        <property name="svn.exec" value="svn"/>
    </target>

    <!-- Setup properties needed if testing using a local repos on RedHat     -->
    <!--     (-D_RHB=1 defined on command-line)                              -->
    <target name="init-test" if="_LocalRepos" depends="init">
        <property name="svn.rw.protocol"   value="file:"/>
        <property name="svn.base.urlpath"  value="///var/svn/repos/eclipselink"/>
    </target>

    <!-- Setup properties needed if testing using a local repos on RedHat     -->
    <!--     (-D_RHB=1 defined on command-line)                              -->
    <target name="init-test2" if="_RHB" depends="init-test">
        <property name="svn.rw.protocol" value="http:"/>
    </target>

    <target name="properties-init" depends="init-win,init-test2">
        <echo message="svn.exec='${svn.exec}'"/>

        <!-- # Build environment definitions                                  -->
        <!-- #  build.root.dir is the directory the branch's build            -->
        <!-- #       files are in                                             -->
        <!-- #  branch.name will always be specified  on command-line         -->
        <!-- #       if used                                                  -->
        <!-- #  junit.lib and junit.dir are only specified here because they  -->
        <!-- #       need to be defined in ANT the same as in the CLASSPATH   -->
        <!-- #       that ANT is invoked with. (the junit used at runtime     -->
        <!-- #       must be defined in the classpath ANT is invoked with)    -->
        <property name="branch.name"     value=""/>
        <property name="build.root.dir"  value="${env.BRANCH_PATH}"/>
        <property name="build.deps.dir"  value="${env.BLD_DEPS_DIR}"/>
        <property name="log.dir"         value="${env.LOG_DIR}"/>
        <property name="junit.dir"       value="${env.JUNIT_HOME}"/>
        <property name="junit.lib"       value="${junit.dir}/junit.jar"/>
        <property name="branch.dir"      value="${branch.name}trunk"/>
        <property name="autobld.file"    value="autobuild.xml"/>

        <!-- #  Subversion definitions   (URLs, protocols & control files)    -->
        <!-- #                                                                -->
        <!-- #  svn.exec is set by init and depends upon the OS               -->
        <property name="svn.ro.protocol"     value="http:"/>
        <property name="svn.protocol"        value="svn:"/>
        <property name="svn.rw.protocol"     value="svn+ssh:"/>
        <property name="svn.base.urlpath"    value="//dev.eclipse.org/svnroot/rt/org.eclipse.persistence"/>
        <property name="svn.base.url"        value="${svn.rw.protocol}${svn.base.urlpath}"/>
        <property name="svn.branch.url"      value="${svn.base.url}/${branch.dir}"/>
        <property name="svn.build.url"       value="${svn.branch.url}/buildsystem"/>
        <property name="current.svnrev.file" value="${log.dir}/.current_svn_rev"/>
        <property name="latest.svnrev.file"  value="${log.dir}/.latest_svn_rev"/>
        <!-- available file="${latest.svnrev.file}" property="latest.svnrev.file.present"/ -->
    </target>

    <!-- Used for Build testing:  Set if "target" in .sh appended by ".test"  -->
    <target name="no-get-src" if="_DoNotUpdate" depends="properties-init">
        <echo message="Update of local source Skipped."/>
    </target>

    <target name="get-src" unless="_DoNotUpdate" depends="no-get-src">
        <echo message="** Begin of Source Retrieval **"/>
        <echo message="** From: ${svn.branch.url}"/>
        <echo message="** Root: ${build.root.dir}"/>
        <mkdir dir="${build.root.dir}"/>
        <!-- the following arg makes the source retrieval "quiet". We really  -->
        <!-- should log the files that were updated, so commenting out.       -->
        <!--    <arg value="-q"/>                                             -->
        <exec executable="${svn.exec}" dir="${build.root.dir}/.." failonerror="true" logError="true" >
            <arg value="co"/>
            <arg value="${svn.branch.url}"/>
        </exec>
        <chmod file="${build.root.dir}/buildsystem/bootstrap.sh" perm="ug+x"/>
        <echo message="**  End of Source Retrieval  **"/>
    </target>

    <target name="build" depends="get-src" description="Trigger an automated build without testing or publish">
        <echo message="'build' target: Calling 'build-no-publish' target in '${build.root.dir}/${autobld.file}'"/>
        <ant antfile="${autobld.file}" dir="${build.root.dir}" target="build-no-publish"/>
        <!-- Untested: Possible way to call ant and specify a different logger.
        <java
                classname="org.apache.tools.ant.launch.Launcher"
                fork="true"
                maxmemory="128m"
                failonerror="true"
                dir="${build.root.dir}"
                timeout="4000000"
                taskname="startAnt"
        >
            <classpath>
                <pathelement location="${ant.home}/lib/ant-launcher.jar"/>
            </classpath>
            <arg value="-buildfile"/>
            <arg file="${autobld.file}"/>
{'fraction_non_alphanumeric': 0.17654715418293693, 'fraction_numerical': 0.0033132173707253578, 'mean_word_length': 2.0007101011894193, 'pattern_counts': {'":': 0, '<': 232, '<?xml version=': 0, '>': 230, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2100099', 'n_tokens_mistral': 4733, 'n_tokens_neox': 4554, 'n_words': 1173}