<commit_before><!--
   To build the reference docs for a particular language only, use "ant -Dlang=en", for
   example, and call either lang.all, lang.docpdf, lang.dochtml, or lang.dochtmlsingle
   for the target of your choice.

   You can also call lang.section-check to track down missing identifiers in a particular
   language, or you can call lang.revdiff to get a difference report for a particular
   language, compared with the English reference.
-->
<project name="Ceylon Language module" default="publish" basedir=".">
    <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"/>

    <!-- 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"/>

    <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.dir" value="${module.language.dir}/${module.ceylon.language.version}"/>
    <property name="ceylon.language.src" value="${ceylon.language.dir}/${module.language.name}-${module.ceylon.language.version}.src"/>
    <property name="ceylon.language.car" value="${ceylon.language.dir}/${module.language.name}-${module.ceylon.language.version}.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-compiler"/>
    <property name="ceylon.compiler.dir" value="com/redhat/ceylon/compiler/${module.com.redhat.ceylon.compiler.version}"/>
    <property name="ceylon.compiler.jar" value="${ceylon.compiler.dir}/com.redhat.ceylon.compiler-${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="tests.car" value="${build.test}/default/default.car"/>

    <!-- ################################################################## -->
    <!-- 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}${checksum.binary-prefix}${filename}"/>
    </target>

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

    <target name="dist"
            depends="build"
            description="Create Ceylon language distribution">
        <mkdir dir="${ceylon.language.dist}"/>
        <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>
        <copy file="${runtime.jar}" tofile="${build.dist}/${ceylon.language.car}"/>
        <antcall target="sha1sum">
            <param name="file" value="${build.dist}/${ceylon.language.car}" />
        </antcall>
    </target>

    <!-- Repository targets -->
    <target name="publish"
            depends="dist,clean.repo,init.repo"
            description="Publish Ceylon language module to default repo">
        <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}"/>
    </target>

    <target name="clean.repo"
            description="Clean default local Ceylon module repository">
        <delete dir="${ceylon.language.repo}"/>
    </target>

    <!-- Tasks related to building the runtime -->
    <!-- Rule to build runtime classes from their Java and Ceylon sources -->
    <target name="runtime.classes" >
<!--
    depends="compiler.jar">
    <taskdef name="ceylonc" classname="com.redhat.ceylon.compiler.ant.Ceylonc">
      <classpath>
        <pathelement location="${compiler.jar}"/>
      </classpath>
    </taskdef>
    <ceylonc
       compiler="bin/ceylonc"
       srcdir="${runtime.src}"
       destdir="${build.classes}"/>
-->
        <mkdir dir="${build.classes}"/>
        <javac debug="true"
            srcdir="${runtime.src}"
            destdir="${build.classes}"
            includeantruntime="false"/>
    </target>

    <!-- Rule to build runtime jar -->
    <target name="runtime.jar" depends="runtime.classes">
        <mkdir dir="${build.lib}"/>
        <jar destfile="${runtime.jar}">
            <fileset dir="${build.classes}">
                <include name="ceylon/**"/>
                <include name="com/redhat/ceylon/compiler/metadata/**"/>
            </fileset>
        </jar>
    </target>

    <!-- Rule to compile and test -->
    <target name="build" depends="runtime.jar"/>
	
    <target name="ceylonc" depends="build">
        <taskdef name="ceylonc" classname="com.redhat.ceylon.compiler.ant.Ceylonc" >
            <classpath>
                <pathelement location="${ceylon.ant.lib}"/>
            </classpath>
        </taskdef>
    </target>

    <target name="compile.tests" depends="ceylonc">
        <delete dir="${build.test}"/>
        <mkdir dir="${build.test}"/>
        <ceylonc
            executable="${ceylon.compiler.loc}/build/bin/ceylonc"
            src="${test.src}"
            out="${build.test}">
            <include name="**/*.ceylon"/>
        </ceylonc>
    </target>
      <commit_msg>Adjusted build file because of changes in directory structure<commit_after><!--
   To build the reference docs for a particular language only, use "ant -Dlang=en", for
   example, and call either lang.all, lang.docpdf, lang.dochtml, or lang.dochtmlsingle
   for the target of your choice.

   You can also call lang.section-check to track down missing identifiers in a particular
   language, or you can call lang.revdiff to get a difference report for a particular
   language, compared with the English reference.
-->
<project name="Ceylon Language module" default="publish" basedir=".">
    <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"/>

    <!-- 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"/>

    <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.dir" value="${module.language.dir}/${module.ceylon.language.version}"/>
    <property name="ceylon.language.src" value="${ceylon.language.dir}/${module.language.name}-${module.ceylon.language.version}.src"/>
    <property name="ceylon.language.car" value="${ceylon.language.dir}/${module.language.name}-${module.ceylon.language.version}.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-compiler"/>
    <property name="ceylon.compiler.dir" value="com/redhat/ceylon/compiler/${module.com.redhat.ceylon.compiler.version}"/>
    <property name="ceylon.compiler.jar" value="${ceylon.compiler.dir}/com.redhat.ceylon.compiler-${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="tests.car" value="${build.test}/default/default.car"/>

    <!-- ################################################################## -->
    <!-- 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}${checksum.binary-prefix}${filename}"/>
    </target>

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

    <target name="dist"
            depends="build"
            description="Create Ceylon language distribution">
        <mkdir dir="${ceylon.language.dist}"/>
        <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>
        <copy file="${runtime.jar}" tofile="${build.dist}/${ceylon.language.car}"/>
        <antcall target="sha1sum">
            <param name="file" value="${build.dist}/${ceylon.language.car}" />
        </antcall>
    </target>

    <!-- Repository targets -->
    <target name="publish"
            depends="dist,clean.repo,init.repo"
            description="Publish Ceylon language module to default repo">
        <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}"/>
    </target>

    <target name="clean.repo"
            description="Clean default local Ceylon module repository">
        <delete dir="${ceylon.language.repo}"/>
    </target>

    <!-- Tasks related to building the runtime -->
    <!-- Rule to build runtime classes from their Java and Ceylon sources -->
    <target name="runtime.classes" >
<!--
    depends="compiler.jar">
    <taskdef name="ceylonc" classname="com.redhat.ceylon.compiler.ant.Ceylonc">
      <classpath>
        <pathelement location="${compiler.jar}"/>
      </classpath>
    </taskdef>
    <ceylonc
       compiler="bin/ceylonc"
       srcdir="${runtime.src}"
       destdir="${build.classes}"/>
-->
        <mkdir dir="${build.classes}"/>
        <javac debug="true"
            srcdir="${runtime.src}"
            destdir="${build.classes}"
            includeantruntime="false"/>
    </target>

    <!-- Rule to build runtime jar -->
    <target name="runtime.jar" depends="runtime.classes">
        <mkdir dir="${build.lib}"/>
        <jar destfile="${runtime.jar}">
            <fileset dir="${build.classes}">
                <include name="ceylon/**"/>
                <include name="com/redhat/ceylon/compiler/java/**"/>
            </fileset>
        </jar>
    </target>

    <!-- Rule to compile and test -->
    <target name="build" depends="runtime.jar"/>
	
    <target name="ceylonc" depends="build">
        <taskdef name="ceylonc" classname="com.redhat.ceylon.compiler.ant.Ceylonc" >
            <classpath>
                <pathelement location="${ceylon.ant.lib}"/>
            </classpath>
        </taskdef>
    </target>

    <target name="compile.tests" depends="ceylonc">
        <delete dir="${build.test}"/>
        <mkdir dir="${build.test}"/>
        <ceylonc
            executable="${ceylon.compiler.loc}/build/bin/ceylonc"
            src="${test.src}"
            out="${build.test}">
            <include name="**/*.ceylon"/>
        </ceylonc>
    </target>
      
{'fraction_non_alphanumeric': 0.19329007317409913, 'fraction_numerical': 0.0008283860278889963, 'mean_word_length': 2.887040515159646, 'pattern_counts': {'":': 0, '<': 247, '<?xml version=': 0, '>': 249, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '848373', 'n_tokens_mistral': 4186, 'n_tokens_neox': 4097, 'n_words': 814}