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

<project name="Enlighter" default="devcopy" basedir=".">

    <!-- ANT-contrib !-->
    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

    <target name="full" depends="dist"/>

    <!-- "Compile" po language support files !-->
    <target name="languages">
        <apply executable="msgfmt" dest="lang" parallel="false">
            <srcfile/>
            <arg value="-o"/>
            <targetfile/>
            <fileset dir="lang" includes="*.po"/>
            <mapper type="glob" from="*.po" to="*.mo"/>
        </apply>
    </target>

    <!-- beta releases as tar archive !-->
    <target name="beta" depends="dist">
        <tar destfile=".hidden/enlighter-beta.tar" basedir="dist/"/>
    </target>

    <!-- GitHub readme + changes => WordPress transformation !-->
    <target name="readme">
        <!-- merge readme + changes !-->
        <concat destfile="dist/readme.txt" append="false">
            <filelist files="README.md, CHANGES.md"/>
        </concat>

        <!-- replace headings !-->
        <replaceregexp file="dist/readme.txt" match="^###(.*)###" replace="=\1=" byline="true"/>
        <replaceregexp file="dist/readme.txt" match="^##(.*)##" replace="==\1==" byline="true"/>
        <replaceregexp file="dist/readme.txt" match="^#(.*)#" replace="===\1===" byline="true"/>
    </target>

    <!-- Static Code Check !-->
    <target name="lint">
        <apply executable="php">
            <arg value="-l"/>

            <fileset dir="." includes="**/*.php" excludes="util/**"/>
        </apply>
    </target>

    <!-- run plugin within wordpress wpdev container !-->
    <target name="dev" depends="dist">
        <!-- Credentials, Host Settings !-->
        <loadproperties srcFile=".credentials/wordpress.conf" prefix="WP"/>

        <!-- Build Docker Image !-->
        <exec executable="docker" failonerror="true">
            <arg line="build -t enlighter-test -f Dockerfile ."/>
        </exec>

        <!-- Run Webserver !-->
        <exec executable="docker" failonerror="true">
            <arg line="run --name enlighter-test -p 8080:8080 --rm -e WP_DSN=${WP.DSN} -i -v ${basedir}/.wpcontent/themes:/srv/app/public/wp-content/themes enlighter-test"/>
        </exec>
    </target>

    <!-- Dist clean !-->
    <target name="dist-cleanup">
        <!-- cleanup !-->
        <delete dir="dist"/>
        <mkdir dir="dist"/>
    </target>

    <!-- Create Dist copy !-->
    <target name="dist" depends="dist-cleanup, readme">

        <!-- Copy Plugin !-->
        <copy todir="dist">
            <fileset dir=".">
                <include name="cache/**" />
                <include name="modules/**" />
                <include name="lang/**" />
                <include name="resources/**" />
                <include name="views/**" />
                <include name="Enlighter.php" />
                <include name="LICENSE.txt" />
            </fileset>
        </copy>
    </target>

    <!-- WP Release Copy !-->
    <target name="wp-release" depends="dist">
        <input message="Enter release version" addproperty="release.version"/>
<commit_msg>readme.txt is generated by wp-sekelton<commit_after><?xml version="1.0" encoding="UTF-8"?>

<project name="Enlighter" default="devcopy" basedir=".">

    <!-- ANT-contrib !-->
    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>

    <target name="full" depends="dist"/>

    <!-- "Compile" po language support files !-->
    <target name="languages">
        <apply executable="msgfmt" dest="lang" parallel="false">
            <srcfile/>
            <arg value="-o"/>
            <targetfile/>
            <fileset dir="lang" includes="*.po"/>
            <mapper type="glob" from="*.po" to="*.mo"/>
        </apply>
    </target>

    <!-- beta releases as tar archive !-->
    <target name="beta" depends="dist">
        <tar destfile=".hidden/enlighter-beta.tar" basedir="dist/"/>
    </target>

    <!-- Static Code Check !-->
    <target name="lint">
        <apply executable="php">
            <arg value="-l"/>

            <fileset dir="." includes="**/*.php" excludes="util/**"/>
        </apply>
    </target>

    <!-- run plugin within wordpress wpdev container !-->
    <target name="dev" depends="dist">
        <!-- Credentials, Host Settings !-->
        <loadproperties srcFile=".credentials/wordpress.conf" prefix="WP"/>

        <!-- Build Docker Image !-->
        <exec executable="docker" failonerror="true">
            <arg line="build -t enlighter-test -f Dockerfile ."/>
        </exec>

        <!-- Run Webserver !-->
        <exec executable="docker" failonerror="true">
            <arg line="run --name enlighter-test -p 8080:8080 --rm -e WP_DSN=${WP.DSN} -i -v ${basedir}/.wpcontent/themes:/srv/app/public/wp-content/themes enlighter-test"/>
        </exec>
    </target>

    <!-- Dist clean !-->
    <target name="dist-cleanup">
        <!-- cleanup !-->
        <delete dir="dist"/>
        <mkdir dir="dist"/>
    </target>

    <!-- Create Dist copy !-->
    <target name="dist" depends="dist-cleanup">

        <!-- Copy Plugin !-->
        <copy todir="dist">
            <fileset dir=".">
                <include name="cache/**" />
                <include name="modules/**" />
                <include name="lang/**" />
                <include name="resources/**" />
                <include name="views/**" />
                <include name="Enlighter.php" />
                <include name="LICENSE.txt" />
            </fileset>
        </copy>
    </target>

    <!-- WP Release Copy !-->
    <target name="wp-release" depends="dist">
        <input message="Enter release version" addproperty="release.version"/>

{'fraction_non_alphanumeric': 0.20209059233449478, 'fraction_numerical': 0.004355400696864111, 'mean_word_length': 2.060234541577825, 'pattern_counts': {'":': 0, '<': 140, '<?xml version=': 2, '>': 141, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4952336', 'n_tokens_mistral': 1738, 'n_tokens_neox': 1633, 'n_words': 364}