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

<project name="mapguide-rest" default="dist">
    <property name="app.version" value="master" />

    <!-- ============================================  -->
    <!-- Target: prepare                               -->
    <!-- ============================================  -->
    <target name="prepare">
        <mkdir dir="./build" />
        <mkdir dir="./dist" />
    </target>

    <!-- ============================================  -->
    <!-- Target: clean                                 -->
    <!-- ============================================  -->
    <target name="clean">
        <echo msg="Cleaning build directory..." />
        <delete dir="./build" includeemptydirs="true" />
        <delete dir="./dist" includeemptydirs="true" />
    </target>

    <!-- ============================================  -->
    <!-- Target: docgen                                -->
    <!-- ============================================  -->
    <target name="docgen">
        <!-- NOTE: Window-ism. Can't use '/' here. Ugh! -->
        <exec command="vendor\bin\swagger .\app\routes -o .\doc\data" dir="." logoutput="true" checkReturn="true" level="debug" />
    </target>

    <!-- ============================================  -->
    <!-- Target: build                                 -->
    <!-- ============================================  -->
    <target name="build" depends="prepare, docgen">
        <echo msg="Copying files to build directory..." />

        <copy todir="./build/app" overwrite="true">
            <fileset dir="./app">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/assets" overwrite="true">
            <fileset dir="./assets">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/cache" overwrite="true">
            <fileset dir="./cache">
                <include name="readme.txt" />
            </fileset>
        </copy>
        <copy todir="./build/conf" overwrite="true">
            <fileset dir="./conf">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/doc" overwrite="true">
            <fileset dir="./doc">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/sampleapps" overwrite="true">
            <fileset dir="./sampleapps">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/vendor" overwrite="true">
            <fileset dir="./vendor">
                <include name="**/*" />
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy file=".htaccess" tofile="./build/.htaccess" overwrite="true" />
        <copy file="index.php" tofile="./build/index.php" overwrite="true" />
        <copy file="LICENSE" tofile="./build/LICENSE" overwrite="true" />
        <copy file="changelog.txt" tofile="./build/changelog.txt" overwrite="true" />
        <copy file="README.md" tofile="./build/README.md" overwrite="true" />
        <copy file="web.config.iis" tofile="./build/web.config" overwrite="true" />
    </target>

    <!-- ============================================  -->
    <!-- (DEFAULT)  Target: dist                       -->
    <!-- ============================================  -->
    <target name="dist" depends="build">
        <echo msg="Creating dist archive..." />

        <zip destfile="./dist/mapguide-rest-${app.version}.zip">
            <fileset dir="./build">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </zip>
    </target>
</project>
<commit_msg>#138: Add unit and integration test targets to phing build file<commit_after><?xml version="1.0" encoding="UTF-8"?>

<project name="mapguide-rest" default="dist">
    <property name="app.version" value="master" />

    <!-- ============================================  -->
    <!-- Target: prepare                               -->
    <!-- ============================================  -->
    <target name="prepare">
        <mkdir dir="./build" />
        <mkdir dir="./dist" />
    </target>

    <!-- ============================================  -->
    <!-- Target: clean                                 -->
    <!-- ============================================  -->
    <target name="clean">
        <echo msg="Cleaning build directory..." />
        <delete dir="./build" includeemptydirs="true" />
        <delete dir="./dist" includeemptydirs="true" />
    </target>

    <!-- ============================================  -->
    <!-- Target: docgen                                -->
    <!-- ============================================  -->
    <target name="docgen">
        <!-- NOTE: Window-ism. Can't use '/' here. Ugh! -->
        <exec command="vendor\bin\swagger .\app\routes -o .\doc\data" dir="." logoutput="true" checkReturn="true" level="debug" />
    </target>

    <!-- ============================================  -->
    <!-- Target: unit_test                             -->
    <!-- ============================================  -->
    <target name="unit_test">
        <!-- NOTE: Window-ism -->
        <exec command="vendor\bin\phpunit test" dir="." logoutput="true" checkReturn="true" />
    </target>

    <!-- ============================================  -->
    <!-- Target: integration_test                      -->
    <!-- ============================================  -->
    <target name="integration_test">
        <!-- NOTE: Window-ism -->
        <exec command="vendor\bin\paratest --phpunit vendor\bin\phpunit integration_test" dir="." logoutput="true" checkReturn="true" />
    </target>

    <!-- ============================================  -->
    <!-- Target: build                                 -->
    <!-- ============================================  -->
    <target name="build" depends="prepare, docgen">
        <echo msg="Copying files to build directory..." />

        <copy todir="./build/app" overwrite="true">
            <fileset dir="./app">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/assets" overwrite="true">
            <fileset dir="./assets">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/cache" overwrite="true">
            <fileset dir="./cache">
                <include name="readme.txt" />
            </fileset>
        </copy>
        <copy todir="./build/conf" overwrite="true">
            <fileset dir="./conf">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/doc" overwrite="true">
            <fileset dir="./doc">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/sampleapps" overwrite="true">
            <fileset dir="./sampleapps">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy todir="./build/vendor" overwrite="true">
            <fileset dir="./vendor">
                <include name="**/*" />
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </copy>
        <copy file=".htaccess" tofile="./build/.htaccess" overwrite="true" />
        <copy file="index.php" tofile="./build/index.php" overwrite="true" />
        <copy file="LICENSE" tofile="./build/LICENSE" overwrite="true" />
        <copy file="changelog.txt" tofile="./build/changelog.txt" overwrite="true" />
        <copy file="README.md" tofile="./build/README.md" overwrite="true" />
        <copy file="web.config.iis" tofile="./build/web.config" overwrite="true" />
    </target>

    <!-- ============================================  -->
    <!-- (DEFAULT)  Target: dist                       -->
    <!-- ============================================  -->
    <target name="dist" depends="build">
        <echo msg="Creating dist archive..." />

        <zip destfile="./dist/mapguide-rest-${app.version}.zip">
            <fileset dir="./build">
                <include name="**/*.*" />
                <include name="*" />
            </fileset>
        </zip>
    </target>
</project>

{'fraction_non_alphanumeric': 0.30458006591658143, 'fraction_numerical': 0.0010228435049437436, 'mean_word_length': 1.7707808564231737, 'pattern_counts': {'":': 0, '<': 201, '<?xml version=': 2, '>': 201, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2172280', 'n_tokens_mistral': 2385, 'n_tokens_neox': 2238, 'n_words': 416}