<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="PHP Depend" basedir=".">

    <!--
        Include local project properties.
    -->
    <property file="build.properties" />

    <!--
        Import common build targets
    -->
    <import file="${basedir}/setup/src/main/xml/base.xml" />

    <!--
        Updates the internal used case version number.
    -->
    <target name="pdepend:update-version">
        <exec executable="${commons.executable.php}" failonerror="true">
            <arg value="${basedir}/scripts/update-version.php" />
        </exec>
    </target>

    <!--
        We use the phar archive after hook to validate that a newly created
        phar archive works as expected.

        Parameters:
            ${-package:phar:filename}  Name of the created phar file.
    -->
    <target name="-pdepend:package:phar:after~hooked" extensionOf="-package:phar:after~hook">
        <antcall target="-package-execute">
            <param name="-package.includepath" value="${commons:tmpdir}"/>
            <param name="-package.executable" value="${-package:phar:filename}" />
        </antcall>
    </target>

    <!--
        We use the pear archive after hook to validate that a clean PHP_Depend
        PEAR installation works as expected.
    -->
    <target name="-pdepend:package:pear:after~hooked" extensionOf="-package:pear:after~hook">
        <antcall target="-package-execute">
            <param name="-package.includepath" value="${common-pear-root-dir}"/>
            <param name="-package.executable" value="${common-pear-bin-dir}/pdepend" />
        </antcall>
    </target>

    <!--
        Will execute the code contained in one of the package files.

        Parameters
            ${-package.includepath} The used include path.
            ${-package.executable}  The projects executable
    -->
    <target name="-package-execute">
        <echo message="Executing:" level="verbose" />
        <echo message="  ${-package.executable} --summary-xml... PDepend/Source" level="verbose" />

        <exec dir="${commons.srcdir.php}" 
              executable="${commons.executable.php}" 
              failonerror="true">

            <arg value="-d" />
            <arg value="include_path=${-package.includepath}" />
            <arg value="${-package.executable}" />
            <arg value="--summary-xml=${commons:tmpdir}/summary.xml" />
            <arg value="--jdepend-xml=${commons:tmpdir}/jdepend.xml" />
            <arg value="--jdepend-chart=${commons:tmpdir}/jdepend.svg" />
            <arg value="--overview-pyramid=${commons:tmpdir}/pyramid.svg" />
            <arg value="--coderank-mode=inheritance,property,method" />
            <arg value="PDepend/Source" />
        </exec>
    </target>

    <target name="do-copy-files-for-xyz-archive">
        <move todir="${output.dir}/src/main/php">
            <fileset dir="${output.dir}/" includes="PDepend/**/*.*" />
        </move>
        <copy todir="${output.dir}/src/main/resources">
            <fileset dir="${commons.srcdir.resource}" includes="**/*.*" />
        </copy>
    </target>

    <!--
        UTILIZED EXTENSION POINTS
    -->

    <!--
        This extension of the initialize phase triggers an update of the
        internally used case identifier.
    -->
    <target name="-pdepend:initialize:main~hooked"
            depends="pdepend:update-version"
            extensionOf="-initialize:main~hook" />

    <target name="-pdepend:news:initialize:main~hooked"
            extensionOf="-initialize:main~hook"
            if="release">

        <property name="release.news.dir" location="${basedir}/src/site/rst/news/" />
        <property name="release.news.xml" location="${release.news.dir}/.blog.xml" />
        <property name="release.news.rst" location="${release.news.dir}/pdepend-${project.version}-released.rst" />

        <property name="release.news.resource.dir" location="${basedir}/src/site/resources/news" />
        <property name="release.news.resource.rst" location="${release.news.resource.dir}/release.rst.in" />
        <property name="release.news.resource.xsl" location="${release.news.resource.dir}/stylesheet.xsl" />

        <tempfile property="release.news.xml.out" deleteonexit="true" />

        <fail message="Cannot overwrite existing blog post '${release.news.rst}'.">
            <condition>
                <available file="${release.news.rst}" />
            </condition>
        </fail>

        <xslt basedir="${release.news.dir}"
              destdir="${release.news.dir}"
              style="${release.news.resource.xsl}"
              in="${release.news.xml}"
              out="${release.news.xml.tmp}"
              includes="${release.news.xml}">

            <param name="project.version" expression="${project.version}" />
        </xslt>

        <copy file="${release.news.resource.rst}" tofile="${release.news.rst}">
            <filterset>
                <filter token="PROJECT_VERSION" value="${project.version}" />
            </filterset>
        </copy>

        <move file="${release.news.xml.tmp}" tofile="${release.news.xml}" />

        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="add" />
            <arg line="${release.news.rst}" />
            <arg line="${release.news.xml}" />
        </exec>

        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="commit" />
            <arg line="-m" />
            <arg line="'Blog post about release ${project.version} added.'" />
        </exec>
    </target>

    <target name="-pdepend:deploy:after~hooked" extensionOf="-deploy:after~hook" if="release">
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="pull" />
        </exec>
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="push" />
            <arg line="--all" />
        </exec>

        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="tag" />
            <arg line="${project.version}" />
        </exec>
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="push" />
            <arg line="--tags" />
        </exec>

        <property name="project.web.release.dir" value="${project.web.root}/static.${project.uri}/php/${project.version}" />

        <exec dir="${commons:builddir}" executable="ssh" failonerror="true">
            <arg line="${remote.shell.credentials}" />
            <arg line="mkdir '${project.web.release.dir}'" />
        </exec>
        <exec dir="${commons:builddir}" executable="scp" failonerror="true">
            <arg line="dist/${project.name}-${project.version}.phar" />
            <arg line="${remote.shell.credentials}:${project.web.release.dir}/${project.name}.phar" />
        </exec>
        <exec dir="${commons:builddir}" executable="scp" failonerror="true">
            <arg line="dist/${project.name}-${project.version}.bz2.phar" />
            <arg line="${remote.shell.credentials}:${project.web.release.dir}/${project.name}.bz2.phar" />
        </exec>
        <exec dir="${commons:builddir}" executable="ssh" failonerror="true">
            <arg line="${remote.shell.credentials}" />
            <arg line="cd '${project.web.release.dir}/..' ; rm latest ; ln -s '${project.version}' latest" />
        </exec>

        <exec executable="ant" dir="${basedir}" failonerror="true">
            <arg line="site:deploy" />
        </exec>
    </target>

    <target name="-package:phar:before~hooked" extensionOf="-package:phar:before~hook">
        <exec executable="php" failonerror="true">
            <arg line="composer.phar" />
            <arg line="update" />
            <arg line="--prefer-dist" /> 
            <arg line="--prefer-lowest" />
            <arg line="--prefer-stable" />
        </exec>
    </target>

    <target name="-package:phar:after~hooked" extensionOf="-package:phar:after~hook">
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="stash" />
        </exec>
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="stash" />
            <arg line="drop" />
        </exec>
    </target>

</project><commit_msg>Use new build environment<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="PHP Depend" basedir=".">

    <!--
        Include local project properties.
    -->
    <property file="build.properties" />

    <!--
        Import common build targets
    -->
    <import file="${basedir}/setup/src/main/xml/base.xml" />

    <!--
        Updates the internal used case version number.
    -->
    <target name="pdepend:update-version">
        <exec executable="${commons.executable.php}" failonerror="true">
            <arg value="${basedir}/scripts/update-version.php" />
        </exec>
    </target>

    <!--
        We use the phar archive after hook to validate that a newly created
        phar archive works as expected.

        Parameters:
            ${-phar:filename}  Name of the created phar file.
    -->
    <target name="-pdepend:phar:after~hooked" extensionOf="-phar:after~hook">
        <antcall target="-package-execute">
            <param name="-package.includepath" value="${commons:tmpdir}"/>
            <param name="-package.executable" value="${-phar:filename}" />
        </antcall>
    </target>

    <!--
        We use the pear archive after hook to validate that a clean PHP_Depend
        PEAR installation works as expected.
    -->
    <target name="-pdepend:package:pear:after~hooked" extensionOf="-package:pear:after~hook">
        <antcall target="-package-execute">
            <param name="-package.includepath" value="${common-pear-root-dir}"/>
            <param name="-package.executable" value="${common-pear-bin-dir}/pdepend" />
        </antcall>
    </target>

    <!--
        Will execute the code contained in one of the package files.

        Parameters
            ${-package.includepath} The used include path.
            ${-package.executable}  The projects executable
    -->
    <target name="-package-execute">
        <echo message="Executing:" level="verbose" />
        <echo message="  ${-package.executable} --summary-xml... PDepend/Source" level="verbose" />

        <exec dir="${commons.srcdir.php}" 
              executable="${commons.executable.php}" 
              failonerror="true">

            <arg value="-d" />
            <arg value="include_path=${-package.includepath}" />
            <arg value="${-package.executable}" />
            <arg value="--summary-xml=${commons:tmpdir}/summary.xml" />
            <arg value="--jdepend-xml=${commons:tmpdir}/jdepend.xml" />
            <arg value="--jdepend-chart=${commons:tmpdir}/jdepend.svg" />
            <arg value="--overview-pyramid=${commons:tmpdir}/pyramid.svg" />
            <arg value="--coderank-mode=inheritance,property,method" />
            <arg value="PDepend/Source" />
        </exec>
    </target>

    <target name="do-copy-files-for-xyz-archive">
        <move todir="${output.dir}/src/main/php">
            <fileset dir="${output.dir}/" includes="PDepend/**/*.*" />
        </move>
        <copy todir="${output.dir}/src/main/resources">
            <fileset dir="${commons.srcdir.resource}" includes="**/*.*" />
        </copy>
    </target>

    <!--
        UTILIZED EXTENSION POINTS
    -->

    <!--
        This extension of the initialize phase triggers an update of the
        internally used case identifier.
    -->
    <target name="-pdepend:initialize:main~hooked"
            depends="pdepend:update-version"
            extensionOf="-initialize:main~hook" />

    <target name="-pdepend:news:initialize:main~hooked"
            extensionOf="-initialize:main~hook"
            if="release">

        <property name="release.news.dir" location="${basedir}/src/site/rst/news/" />
        <property name="release.news.xml" location="${release.news.dir}/.blog.xml" />
        <property name="release.news.rst" location="${release.news.dir}/pdepend-${project.version}-released.rst" />

        <property name="release.news.resource.dir" location="${basedir}/src/site/resources/news" />
        <property name="release.news.resource.rst" location="${release.news.resource.dir}/release.rst.in" />
        <property name="release.news.resource.xsl" location="${release.news.resource.dir}/stylesheet.xsl" />

        <tempfile property="release.news.xml.out" deleteonexit="true" />

        <fail message="Cannot overwrite existing blog post '${release.news.rst}'.">
            <condition>
                <available file="${release.news.rst}" />
            </condition>
        </fail>

        <xslt basedir="${release.news.dir}"
              destdir="${release.news.dir}"
              style="${release.news.resource.xsl}"
              in="${release.news.xml}"
              out="${release.news.xml.tmp}"
              includes="${release.news.xml}">

            <param name="project.version" expression="${project.version}" />
        </xslt>

        <copy file="${release.news.resource.rst}" tofile="${release.news.rst}">
            <filterset>
                <filter token="PROJECT_VERSION" value="${project.version}" />
            </filterset>
        </copy>

        <move file="${release.news.xml.tmp}" tofile="${release.news.xml}" />

        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="add" />
            <arg line="${release.news.rst}" />
            <arg line="${release.news.xml}" />
        </exec>

        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="commit" />
            <arg line="-m" />
            <arg line="'Blog post about release ${project.version} added.'" />
        </exec>
    </target>

    <target name="-pdepend:deploy:after~hooked" extensionOf="-deploy:after~hook" if="release">
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="pull" />
        </exec>
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="push" />
            <arg line="--all" />
        </exec>

        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="tag" />
            <arg line="${project.version}" />
        </exec>
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="push" />
            <arg line="--tags" />
        </exec>

        <property name="project.web.release.dir" value="${project.web.root}/static.${project.uri}/php/${project.version}" />

        <exec dir="${commons:builddir}" executable="ssh" failonerror="true">
            <arg line="${remote.shell.credentials}" />
            <arg line="mkdir '${project.web.release.dir}'" />
        </exec>
        <exec dir="${commons:builddir}" executable="scp" failonerror="true">
            <arg line="dist/${project.name}-${project.version}.phar" />
            <arg line="${remote.shell.credentials}:${project.web.release.dir}/${project.name}.phar" />
        </exec>
        <exec dir="${commons:builddir}" executable="scp" failonerror="true">
            <arg line="dist/${project.name}-${project.version}.bz2.phar" />
            <arg line="${remote.shell.credentials}:${project.web.release.dir}/${project.name}.bz2.phar" />
        </exec>
        <exec dir="${commons:builddir}" executable="ssh" failonerror="true">
            <arg line="${remote.shell.credentials}" />
            <arg line="cd '${project.web.release.dir}/..' ; rm latest ; ln -s '${project.version}' latest" />
        </exec>

        <exec executable="ant" dir="${basedir}" failonerror="true">
            <arg line="site:deploy" />
        </exec>
    </target>

    <target name="-phar:before~hooked" extensionOf="-phar:before~hook">
        <exec executable="php" failonerror="true">
            <arg line="composer.phar" />
            <arg line="update" />
            <arg line="--prefer-dist" /> 
            <arg line="--prefer-lowest" />
            <arg line="--prefer-stable" />
        </exec>
    </target>

    <target name="-phar:after~hooked" extensionOf="-phar:after~hook">
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="stash" />
        </exec>
        <exec executable="git" dir="${basedir}" failonerror="true">
            <arg line="stash" />
            <arg line="drop" />
        </exec>
    </target>

</project>
{'fraction_non_alphanumeric': 0.18508220502901354, 'fraction_numerical': 0.0006044487427466151, 'mean_word_length': 2.323623945359582, 'pattern_counts': {'":': 0, '<': 287, '<?xml version=': 2, '>': 287, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 34}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4453638', 'n_tokens_mistral': 4821, 'n_tokens_neox': 4676, 'n_words': 838}