<commit_before><project name="Ceylon Language module" default="publish" basedir=".">
    <property file="../ceylon-common/common-build.properties"/>
    <property file="build.properties"/>

    <!-- Set build directories for all formats. -->
    <property name="build.dir" value="${basedir}/build"/>
    <property name="build.classes" location="${build.dir}/classes"/>
    <property name="build.dist" location="${build.dir}/dist"/>
    <property name="build.lib" location="${build.dir}/lib"/>
    <property name="build.test" location="${build.dir}/test"/>
    <property name="build.test.repo" location="${build.dir}/test-repo"/>
    <property name="ide.dist" location="${basedir}/ide-dist"/>
	
    <!-- The Java and Ceylon source files for the runtime -->
    <property name="runtime.src" location="runtime"/> 

    <!-- jar generated -->
    <property name="runtime.jar" location="${build.lib}/runtime.jar"/>

    <property name="test.src" location="test"/>
    <property name="test.reports" location="${build.dir}/test-reports"/>

    <tstamp/>

    <!-- Local repository -->
    <property name="ceylon.repo.dir" location="${user.home}/.ceylon/repo"/>
    
    <!-- ceylon.language -->
    <property name="module.language.src" value="${basedir}/src"/>
    <property name="module.language.dir" value="ceylon/language"/>
    <property name="module.language.name" value="ceylon.language"/>
    <property name="module.language.runtime" value="${basedir}/runtime"/>

    <!-- module archives -->
    <property name="ceylon.language.name" value="${module.language.name}-${module.ceylon.language.version}"/>
    <property name="ceylon.language.dir" value="${module.language.dir}/${module.ceylon.language.version}"/>
    <property name="ceylon.language.src" value="${ceylon.language.dir}/${ceylon.language.name}.src"/>
    <property name="ceylon.language.car" value="${ceylon.language.dir}/${ceylon.language.name}.car"/>
    <property name="ceylon.language.repo" value="${ceylon.repo.dir}/${ceylon.language.dir}"/>
    <property name="ceylon.language.dist" value="${build.dist}/${ceylon.language.dir}"/>
    <property name="ceylon.compiler.loc" value="${basedir}/../ceylon-dist"/>
    <property name="ceylon.compiler.dir" value="com/redhat/ceylon/compiler/java/${module.com.redhat.ceylon.compiler.version}"/>
    <property name="ceylon.compiler.jar" value="${ceylon.compiler.dir}/com.redhat.ceylon.compiler.java-${module.com.redhat.ceylon.compiler.version}.jar"/>
    <property name="ceylon.compiler.lib" location="${ceylon.repo.dir}/${ceylon.compiler.jar}"/>
    <property name="ceylon.ant.dir" value="com/redhat/ceylon/ant/${module.com.redhat.ceylon.compiler.version}"/>
    <property name="ceylon.ant.jar" value="${ceylon.ant.dir}/com.redhat.ceylon.ant-${module.com.redhat.ceylon.compiler.version}.jar"/>
    <property name="ceylon.ant.lib" location="${ceylon.repo.dir}/${ceylon.ant.jar}"/>
    <property name="ceylon.common.dir" value="com/redhat/ceylon/common/${module.com.redhat.ceylon.common.version}"/>
    <property name="ceylon.common.jar" value="${ceylon.common.dir}/com.redhat.ceylon.common-${module.com.redhat.ceylon.common.version}.jar"/>
    <property name="ceylon.common.lib" location="${ceylon.repo.dir}/${ceylon.common.jar}"/>

    <property name="tests.car" value="${build.test}/default/default.car"/>

    <path id="compile.classpath">
        <pathelement path="${ceylon.common.lib}"/>
    </path>
	
    <path id="test.compile.classpath">
        <pathelement path="${build.dist}/${ceylon.language.car}"/>
        <pathelement path="${junit.lib}"/>
    </path>
	
    <path id="test.run.classpath">
        <pathelement path="${junit.lib}"/>
        <pathelement path="${build.dist}/${ceylon.language.car}"/>
        <pathelement path="${build.test}"/>
        <pathelement path="${ceylon.common.lib}"/>
    </path>
	
    <path id="ant-tasks">
        <pathelement location="${ceylon.ant.lib}"/>
    </path>

    <!-- ################################################################## -->
    <!-- constant to declare a file binary for checksumsum -->
    <property name="checksum.binary-prefix" value=" *" />
    <!-- Helper target, used to create a sha1 checksum file  -->
    <!-- Requires 'file' as a parameter. -->
    <target name="sha1sum">
        <fail unless="file"/>
        <fail if="filename"/>
        <fail if="value"/>
        <basename file="${file}" property="filename"/>
        <checksum file="${file}" property="value" algorithm="sha1"/>
        <echo file="${file}.sha1" message="${value}"/>
    </target>

	<target name="ceylonc">
        <typedef resource="com/redhat/ceylon/ant/antlib.xml" classpathref="ant-tasks"/>
    </target>

    <!-- Rule to clean everything up -->
    <target name="clean" description="Clean up everything">
        <delete dir="${build.dir}"/>
    </target>

    <target name="ide" depends="dist">
        <copy 
            overwrite="true"
            file="${build.dist}/${ceylon.language.car}"
            tofile="../ceylon-ide-eclipse/plugins/com.redhat.ceylon.eclipse.ui/lib/ceylon.language-${module.ceylon.language.version}-ide.jar"/>
        <copy 
            overwrite="true"
            todir="../ceylon-ide-eclipse/plugins/com.redhat.ceylon.eclipse.ui/defaultRepository/">
        	<fileset dir="${build.dist}">
        		<include name="**/*"/>
        	</fileset>
    	</copy>
    </target>
	
    <target name="dist"
            depends="build"
            description="Create Ceylon language distribution">
    	<delete file="${build.dist}/${ceylon.language.src}"/>
        <delete file="${build.dist}/${ceylon.language.src}.sha1"/>
        <zip destfile="${build.dist}/${ceylon.language.src}">
            <fileset dir="${module.language.src}">
                <include name="ceylon/language/**/*.ceylon"/>
            </fileset>
            <fileset dir="${module.language.runtime}">
                <include name="**/*.java"/>
            </fileset>
        </zip>
        <antcall target="sha1sum">
            <param name="file" value="${build.dist}/${ceylon.language.src}" />
        </antcall>
    </target>

    <!-- Repository targets -->
    <target name="publish"
            depends="dist,clean.repo,init.repo,publish-internal"
            description="Publish Ceylon language module to default repo">
    </target>

    <target name="publish-internal">
        <copy todir="${ceylon.language.repo}">
            <fileset dir="${ceylon.language.dist}"/>
        </copy>
    </target>

    <target name="init.repo"
            description="Create default local Ceylon module repository">
        <mkdir dir="${ceylon.language.repo}"/><commit_msg>assemble js language module, copy js langmod in publish<commit_after><project name="Ceylon Language module" default="publish" basedir=".">
    <property file="../ceylon-common/common-build.properties"/>
    <property file="build.properties"/>

    <!-- Set build directories for all formats. -->
    <property name="build.dir" value="${basedir}/build"/>
    <property name="build.classes" location="${build.dir}/classes"/>
    <property name="build.dist" location="${build.dir}/dist"/>
    <property name="build.lib" location="${build.dir}/lib"/>
    <property name="build.test" location="${build.dir}/test"/>
    <property name="build.test.repo" location="${build.dir}/test-repo"/>
    <property name="ide.dist" location="${basedir}/ide-dist"/>
	
    <!-- The Java and Ceylon source files for the runtime -->
    <property name="runtime.src" location="runtime"/> 

    <!-- jar generated -->
    <property name="runtime.jar" location="${build.lib}/runtime.jar"/>

    <property name="test.src" location="test"/>
    <property name="test.reports" location="${build.dir}/test-reports"/>

    <tstamp/>

    <!-- Local repository -->
    <property name="ceylon.repo.dir" location="${user.home}/.ceylon/repo"/>
    <property name="ceylon-js.dir" location="${basedir}/../ceylon-js"/>
    
    <!-- ceylon.language -->
    <property name="module.language.src" value="${basedir}/src"/>
    <property name="module.language.dir" value="ceylon/language"/>
    <property name="module.language.name" value="ceylon.language"/>
    <property name="module.language.runtime" value="${basedir}/runtime"/>

    <!-- module archives -->
    <property name="ceylon.language.name" value="${module.language.name}-${module.ceylon.language.version}"/>
    <property name="ceylon.language.dir" value="${module.language.dir}/${module.ceylon.language.version}"/>
    <property name="ceylon.language.src" value="${ceylon.language.dir}/${ceylon.language.name}.src"/>
    <property name="ceylon.language.car" value="${ceylon.language.dir}/${ceylon.language.name}.car"/>
    <property name="ceylon.language.repo" value="${ceylon.repo.dir}/${ceylon.language.dir}"/>
    <property name="ceylon.language.dist" value="${build.dist}/${ceylon.language.dir}"/>
    <property name="ceylon.compiler.loc" value="${basedir}/../ceylon-dist"/>
    <property name="ceylon.compiler.dir" value="com/redhat/ceylon/compiler/java/${module.com.redhat.ceylon.compiler.version}"/>
    <property name="ceylon.compiler.jar" value="${ceylon.compiler.dir}/com.redhat.ceylon.compiler.java-${module.com.redhat.ceylon.compiler.version}.jar"/>
    <property name="ceylon.compiler.lib" location="${ceylon.repo.dir}/${ceylon.compiler.jar}"/>
    <property name="ceylon.ant.dir" value="com/redhat/ceylon/ant/${module.com.redhat.ceylon.compiler.version}"/>
    <property name="ceylon.ant.jar" value="${ceylon.ant.dir}/com.redhat.ceylon.ant-${module.com.redhat.ceylon.compiler.version}.jar"/>
    <property name="ceylon.ant.lib" location="${ceylon.repo.dir}/${ceylon.ant.jar}"/>
    <property name="ceylon.common.dir" value="com/redhat/ceylon/common/${module.com.redhat.ceylon.common.version}"/>
    <property name="ceylon.common.jar" value="${ceylon.common.dir}/com.redhat.ceylon.common-${module.com.redhat.ceylon.common.version}.jar"/>
    <property name="ceylon.common.lib" location="${ceylon.repo.dir}/${ceylon.common.jar}"/>

    <property name="tests.car" value="${build.test}/default/default.car"/>

    <path id="compile.classpath">
        <pathelement path="${ceylon.common.lib}"/>
    </path>
	
    <path id="test.compile.classpath">
        <pathelement path="${build.dist}/${ceylon.language.car}"/>
        <pathelement path="${junit.lib}"/>
    </path>
	
    <path id="test.run.classpath">
        <pathelement path="${junit.lib}"/>
        <pathelement path="${build.dist}/${ceylon.language.car}"/>
        <pathelement path="${build.test}"/>
        <pathelement path="${ceylon.common.lib}"/>
    </path>
	
    <path id="ant-tasks">
        <pathelement location="${ceylon.ant.lib}"/>
    </path>

    <!-- ################################################################## -->
    <!-- constant to declare a file binary for checksumsum -->
    <property name="checksum.binary-prefix" value=" *" />
    <!-- Helper target, used to create a sha1 checksum file  -->
    <!-- Requires 'file' as a parameter. -->
    <target name="sha1sum">
        <fail unless="file"/>
        <fail if="filename"/>
        <fail if="value"/>
        <basename file="${file}" property="filename"/>
        <checksum file="${file}" property="value" algorithm="sha1"/>
        <echo file="${file}.sha1" message="${value}"/>
    </target>

	<target name="ceylonc">
        <typedef resource="com/redhat/ceylon/ant/antlib.xml" classpathref="ant-tasks"/>
    </target>

    <!-- Rule to clean everything up -->
    <target name="clean" description="Clean up everything">
        <delete dir="${build.dir}"/>
    </target>

    <target name="ide" depends="dist">
        <copy 
            overwrite="true"
            file="${build.dist}/${ceylon.language.car}"
            tofile="../ceylon-ide-eclipse/plugins/com.redhat.ceylon.eclipse.ui/lib/ceylon.language-${module.ceylon.language.version}-ide.jar"/>
        <copy 
            overwrite="true"
            todir="../ceylon-ide-eclipse/plugins/com.redhat.ceylon.eclipse.ui/defaultRepository/">
        	<fileset dir="${build.dist}">
        		<include name="**/*"/>
        	</fileset>
    	</copy>
    </target>
	
    <target name="dist"
            depends="build"
            description="Create Ceylon language distribution">
    	<delete file="${build.dist}/${ceylon.language.src}"/>
        <delete file="${build.dist}/${ceylon.language.src}.sha1"/>
        <zip destfile="${build.dist}/${ceylon.language.src}">
            <fileset dir="${module.language.src}">
                <include name="ceylon/language/**/*.ceylon"/>
            </fileset>
            <fileset dir="${module.language.runtime}">
                <include name="**/*.java"/>
            </fileset>
        </zip>
        <antcall target="sha1sum">
            <param name="file" value="${build.dist}/${ceylon.language.src}" />
        </antcall>
        <ant antfile="${ceylon-js.dir}/build.xml" target="build-js-language-module" dir="${ceylon-js.dir}" inheritall="false">
            <property name="ceylon.repo.dir" value="${ceylon.repo.dir}"/>
        </ant>
    </target>

    <!-- Repository targets -->
    <target name="publish"
            depends="dist,clean.repo,init.repo,publish-internal"
            description="Publish Ceylon language module to default repo">
    </target>

    <target name="publish-internal">
        <copy todir="${ceylon.language.repo}">
            <fileset dir="${ceylon.language.dist}"/>
            <fileset dir="${ceylon-js.dir}/build/runtime/${ceylon.language.dir}" />
        </copy>
    </target>

    <target name="init.repo"
            description="Create default local Ceylon module repository">
        <mkdir dir="${ceylon.language.repo}"/>
{'fraction_non_alphanumeric': 0.210507087534707, 'fraction_numerical': 0.0008768084173608067, 'mean_word_length': 3.2100892033220547, 'pattern_counts': {'":': 0, '<': 232, '<?xml version=': 0, '>': 232, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '278785', 'n_tokens_mistral': 4128, 'n_tokens_neox': 4050, 'n_words': 625}