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

<!--
    @xml.file.header
    _________        _____ __________________        _____
    __  ____/___________(_)______  /__  ____/______ ____(_)_______
    _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
    / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
    \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
-->

<project name="GridGain Development Build" basedir=".">
    <description>
        GridGain build script.
    </description>

    <property environment="env"/>

    <condition property="tmp.dir" value="${TMP_DIR}" else="${java.io.tmpdir}">
        <isset property="TMP_DIR"/>
    </condition>

    <condition property="gridgain.home" value="${GG_HOME}">
        <isset property="GG_HOME"/>
    </condition>
    <condition property="gridgain.home" value="${env.GRIDGAIN_HOME}">
        <and>
            <not>
                <isset property="gridgain.home"/>
            </not>
            <isset property="env.GRIDGAIN_HOME"/>
        </and>
    </condition>

    <condition property="jdk.home" value="${env.JAVA_HOME}">
        <isset property="env.JAVA_HOME"/>
    </condition>

    <fail unless="gridgain.home"
          message="Please specify Ant property GG_HOME (environment variable GRIDGAIN_HOME will also work)."/>
    <fail unless="jdk.home" message="Please specify JAVA_HOME environment variable."/>

    <property name="tmp.src" value="${tmp.dir}/src"/>
    <property name="tmp.dist" value="${tmp.dir}/dist"/>
    <property name="tmp.cls" value="${tmp.dir}/classes"/>

    <property name="dir.core" value="${gridgain.home}/modules/core"/>
    <property name="dir.client" value="${gridgain.home}/modules/clients"/>
    <property name="dir.router" value="${gridgain.home}/modules/router"/>
    <property name="dir.jdbc" value="${gridgain.home}/modules/jdbc-driver"/>
    <property name="dir.scalar" value="${gridgain.home}/modules/scalar"/>
    <property name="dir.visor-console" value="${gridgain.home}/modules/visor-console"/>

    <property name="dir.core.src" value="${dir.core}/java"/>
    <property name="dir.client.src" value="${dir.client}/java/src"/>
    <property name="dir.router.src" value="${dir.router}/src"/>
    <property name="dir.jdbc.src" value="${dir.jdbc}/src"/>
    <property name="dir.scalar.src" value="${dir.scalar}/src"/>
    <property name="dir.visor-console.src" value="${dir.visor-console}/src"/>
    <property name="dir.libs" value="${gridgain.home}/libs"/>
    <property name="dir.libs.rel" value="target/libs"/>

    <property name="jar.dev" value="gridgain.jar"/>

    <target name="mk.collect.libs">
        <echo message=""/>
        <echo message="mk.collect.libs"/>

        <exec executable="mvn" dir="${gridgain.home}" failonerror="yes" >
            <arg line="clean install"/>
        </exec>

        <delete dir="${dir.libs}"/>
        <mkdir dir="${dir.libs}"/>

        <copy todir="${dir.libs}">
            <fileset dir="${dir.core}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.client}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.router}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.jdbc}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.scalar}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.visor-console}/${dir.libs.rel}"/>
        </copy>

        <path id="libs.gg">
            <fileset dir="${dir.libs}">
                <include name="*.jar"/>
            </fileset>
        </path>
    </target>

    <!--
        Build GridGain development JAR.
    -->
    <target name="mk.dev.jar" depends="mk.collect.libs">
        <echo message=""/>
        <echo message="mk.dev.jar"/>

        <delete dir="${tmp.src}"/>
        <mkdir dir="${tmp.src}"/>

        <!-- Copy Java sources. -->
        <copy todir="${tmp.src}">
            <fileset dir="${dir.core.src}"/>
        </copy>
        <copy todir="${tmp.src}">
            <fileset dir="${dir.client.src}"/>
        </copy>
        <copy todir="${tmp.src}">
            <fileset dir="${dir.router.src}"/>
        </copy>
        <copy todir="${tmp.src}">
            <fileset dir="${dir.jdbc.src}"/>
        </copy>

        <!-- Build directly from sources. -->
        <gg.jar
            java.src.dir="${tmp.src}"<commit_msg># GG-7646 Add info target for os build.xml<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!--
    @xml.file.header
    _________        _____ __________________        _____
    __  ____/___________(_)______  /__  ____/______ ____(_)_______
    _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
    / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
    \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
-->

<project name="GridGain Development Build" basedir=".">
    <description>
        GridGain build script.
    </description>

    <property environment="env"/>

    <condition property="tmp.dir" value="${TMP_DIR}" else="${java.io.tmpdir}">
        <isset property="TMP_DIR"/>
    </condition>

    <condition property="gridgain.home" value="${GG_HOME}">
        <isset property="GG_HOME"/>
    </condition>
    <condition property="gridgain.home" value="${env.GRIDGAIN_HOME}">
        <and>
            <not>
                <isset property="gridgain.home"/>
            </not>
            <isset property="env.GRIDGAIN_HOME"/>
        </and>
    </condition>

    <condition property="jdk.home" value="${env.JAVA_HOME}">
        <isset property="env.JAVA_HOME"/>
    </condition>

    <fail unless="gridgain.home"
          message="Please specify Ant property GG_HOME (environment variable GRIDGAIN_HOME will also work)."/>
    <fail unless="jdk.home" message="Please specify JAVA_HOME environment variable."/>

    <property name="tmp.src" value="${tmp.dir}/src"/>
    <property name="tmp.dist" value="${tmp.dir}/dist"/>
    <property name="tmp.cls" value="${tmp.dir}/classes"/>

    <property name="dir.core" value="${gridgain.home}/modules/core"/>
    <property name="dir.client" value="${gridgain.home}/modules/clients"/>
    <property name="dir.router" value="${gridgain.home}/modules/router"/>
    <property name="dir.jdbc" value="${gridgain.home}/modules/jdbc-driver"/>
    <property name="dir.scalar" value="${gridgain.home}/modules/scalar"/>
    <property name="dir.visor-console" value="${gridgain.home}/modules/visor-console"/>

    <property name="dir.core.src" value="${dir.core}/java"/>
    <property name="dir.client.src" value="${dir.client}/java/src"/>
    <property name="dir.router.src" value="${dir.router}/src"/>
    <property name="dir.jdbc.src" value="${dir.jdbc}/src"/>
    <property name="dir.scalar.src" value="${dir.scalar}/src"/>
    <property name="dir.visor-console.src" value="${dir.visor-console}/src"/>
    <property name="dir.libs" value="${gridgain.home}/libs"/>
    <property name="dir.libs.rel" value="target/libs"/>

    <property name="jar.dev" value="gridgain.jar"/>

    <macrodef name="logo">
        <sequential>
            <echo message=""/>
            <echo message="      _____     _     _______      _     "/>
            <echo message="     / ___/____(_)___/ / ___/___ _(_)___ "/>
            <echo message="    / (_ // __/ // _  / (_ // _ `/ // _ \"/>
            <echo message="    \___//_/ /_/ \_,_/\___/ \_,_/_//_//_/"/>
            <echo message="             IN-MEMORY COMPUTING"/>
            <echo message=""/>
            <echo message="    GRIDGAIN_HOME : ${gridgain.home}"/>
            <echo message="    JAVA_HOME     : ${jdk.home}"/>
            <echo message="    TMP_DIR       : ${tmp.dir}"/>
            <echo message=""/>
        </sequential>
    </macrodef>

    <target name="info">
        <logo/>
        <echo message="    Run mk.dev.jar target for building development jar."/>
    </target>

    <target name="mk.collect.libs" depends="info">
        <echo message=""/>
        <echo message="mk.collect.libs"/>

        <exec executable="mvn" dir="${gridgain.home}" failonerror="yes" >
            <arg line="clean install"/>
        </exec>

        <delete dir="${dir.libs}"/>
        <mkdir dir="${dir.libs}"/>

        <copy todir="${dir.libs}">
            <fileset dir="${dir.core}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.client}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.router}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.jdbc}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.scalar}/${dir.libs.rel}"/>
        </copy>

        <copy todir="${dir.libs}" overwrite="no">
            <fileset dir="${dir.visor-console}/${dir.libs.rel}"/>
        </copy>

        <path id="libs.gg">
            <fileset dir="${dir.libs}">
                <include name="*.jar"/>
            </fileset>
        </path>
    </target>

    <!--
        Build GridGain development JAR.
    -->
    <target name="mk.dev.jar" depends="info, mk.collect.libs">
        <echo message=""/>
        <echo message="mk.dev.jar"/>

        <delete dir="${tmp.src}"/>
        <mkdir dir="${tmp.src}"/>

        <!-- Copy Java sources. -->
        <copy todir="${tmp.src}">
            <fileset dir="${dir.core.src}"/>
        </copy>
        <copy todir="${tmp.src}">
            <fileset dir="${dir.client.src}"/>
        </copy>
        <copy todir="${tmp.src}">
            <fileset dir="${dir.router.src}"/>
        </copy>
        <copy todir="${tmp.src}">
            <fileset dir="${dir.jdbc.src}"/>
        </copy>

        <!-- Build directly from sources. -->
        <gg.jar
            java.src.dir="${tmp.src}"
{'fraction_non_alphanumeric': 0.20869051138043157, 'fraction_numerical': 0.0009853187506158243, 'mean_word_length': 2.1375579598145285, 'pattern_counts': {'":': 0, '<': 214, '<?xml version=': 2, '>': 212, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 5, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3124451', 'n_tokens_mistral': 3321, 'n_tokens_neox': 3170, 'n_words': 510}