<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!-- 
Copyright (c) 2009, <NAME>
Copyright (c) 2008, <NAME>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.

    * Neither the name of the Technische Universität Berlin nor the
      names of its contributors may be used to endorse or promote
      products derived from this software without specific prior
      written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="java-blas" basedir="." default="jar">
    <description>
		This is the build script to compile and deploy the java-blas project.
		It also generates JavaDoc from source in ../doc.
    </description>

    <import file="configure.xml" />

    <!-- Define directories -->

    <property name="src" value="${basedir}/src" />
    <property name="test" value="${basedir}/test" />
    <property name="bin" value="${basedir}/bin" />
    <property name="native-libs" value="${basedir}/native-libs" />
    <property name="doc" value="${basedir}/javadoc" />
    <property name="jar" value="${basedir}/jblas.jar" />
    <property name="include" value="${basedir}/include" />
    <property name="native" value="${basedir}/native" />
    <property name="external" value="${basedir}/external" />
    <property name="scripts" value="${basedir}/scripts" />
    <property name="pkgbase" value="org.jblas" />
    <property name="version" value="0.3" />

    <!-- Macros -->

    <macrodef name="class-to-float" description="generate a float version of a class">
        <attribute name="class"/>
        <attribute name="path" default="src"/>
        <sequential>
            <echo message="Generating float version of @{class}"/>
            <exec executable="ruby">
                <arg line="scripts/class_to_float.rb @{path} @{class}"/>
            </exec>
        </sequential>
    </macrodef>
    <macrodef name="static-class-to-float" description="Add float versions to a class">
        <attribute name="class"/>
        <sequential>
            <echo message="Add float versions to class @{class}"/>
            <exec executable="ruby">
                <arg line="scripts/static_class_to_float.rb src @{class}"/>
            </exec>
        </sequential>
    </macrodef>
    <macrodef name="rjpp" description="Run the ruby-java preprocessor.">
        <attribute name="file"/>
        <sequential>
            <exec executable="ruby">
                <arg line="scripts/rjpp.rb @{file}"/>
            </exec>
        </sequential>
    </macrodef>
    <macrodef name="create-jar" description="create jar file">
        <attribute name="filename" />
        <sequential>
        <jar destfile="@{filename}">
            <fileset dir="${bin}">
                <include name="org/**" />
                <include name="lib/**/lib*.so"/>
                <include name="lib/**/*.dll"/>
            </fileset>
            <manifest>
                <attribute name="Built-By" value="IDA Group, TU Berlin" />
            </manifest>
        </jar>
        </sequential>
    </macrodef>

    <!-- Organizational targets -->

    <target name="clean" description="clean generated files">
        <delete dir="${doc}" />
        <delete dir="${bin}" />
        <delete dir="${include}" />
        <exec executable="${make}">
            <arg line="clean" />
        </exec>
    </target>
    <target name="clean-jars" description="delete all jar files">
        <delete>
            <fileset dir="." includes="*.jar" />
        </delete>
    </target>
    <target name="realclean" depends="clean" description="delete also dumped information on fortran functions">
        <exec executable="${make}">
            <arg line="realclean" />
        </exec>
    </target>
    <target name="prepare" description="create directories needed for compilation">
        <mkdir dir="${bin}" />
        <mkdir dir="${native}" />
        <mkdir dir="${include}" />
    </target>
    <target name="compile" depends="prepare,wrapper,generate-float" description="compile java code">
        <javac destdir="${bin}" encoding="utf-8" source="1.6" debug="on" compiler="javac1.6" fork="yes" nowarn="yes">
            <src path="${src}" />
        </javac>
    </target>
    <target name="compile-test" depends="compile" description="compile java test code">
        <javac destdir="${bin}" encoding="utf-8" source="1.6" debug="on" compiler="javac1.6" fork="yes" nowarn="yes">
            <src path="${test}" />
            <classpath>
                <pathelement location="${external}/junit.jar" />
            </classpath>
        </javac>
    </target>
    <target name="javah" depends="prepare,wrapper,compile" description="run javah">
        <javah destdir="${include}" force="yes">
            <class name="${pkgbase}.NativeBlas" />
            <classpath>
                <pathelement path="${bin}" />
            </classpath>
        </javah>
    </target>
    <target name="compile-native" depends="prepare,javah" description="compile native JNI stubs">
        <exec executable="${make}">
            <arg line="compile-native" />
        </exec>
    </target>
    <target name="wrapper" depends="prepare" description="generate the JNI stub code">
        <exec executable="${make}">
            <arg line="generate-wrapper" />
        </exec>
    </target>
    <target name="generate-float" depends="preprocess" description="generate float versions of classes">
        <class-to-float class="${pkgbase}.DoubleMatrix"/>
        <class-to-float class="${pkgbase}.DoubleFunction"/>
        <class-to-float class="${pkgbase}.ComplexDouble"/>
        <class-to-float path="test" class="${pkgbase}.TestDoubleMatrix"/>
        <class-to-float path="test" class="${pkgbase}.TestBlasDouble"/>
        <class-to-float class="${pkgbase}.ComplexDoubleMatrix"/>
        <static-class-to-float class="${pkgbase}.SimpleBlas"/>
        <static-class-to-float class="${pkgbase}.Solve"/>
        <static-class-to-float class="${pkgbase}.Eigen"/>
        <static-class-to-float class="${pkgbase}.Geometry"/>
        <static-class-to-float class="${pkgbase}.MatrixFunctions"/>
        <static-class-to-float class="${pkgbase}.JavaBlas"/>
    </target>
    <target name="preprocess" description="run the ruby preprocessor on necessary files">
        <rjpp file="src/org/jblas/DoubleMatrix.java"/>
        <rjpp file="test/org/jblas/TestDoubleMatrix.java"/>
        <rjpp file="src/org/jblas/MatrixFunctions.java"/>
        <rjpp file="src/org/jblas/ComplexDoubleMatrix.java"/>
    </target>

    <!-- jar files -->

    <target name="jar" depends="compile,compile-native" description="create jblas.jar (local system, as configured)">
        <delete dir="${bin}/lib" />
        <copy todir="${bin}/lib">
            <fileset dir="${native-libs}">
                <include name="${linkage}/${os_name}/${os_arch}/*" />
            </fileset>
        </copy>
        <create-jar filename="jblas-0.2.jar" />
    </target>

    <target name="dynamic-jar" depends="compile,compile-native" description="create jblas.jar (local system, dynamic)">
        <delete dir="${bin}/lib" />
        <copy todir="${bin}/lib">
            <fileset dir="${native-libs}">
                <include name="dynamic/${os_name}/${os_arch}/*" />
            </fileset>
        </copy>
        <create-jar filename="jblas-${version}-${os_name}-${os_arch}.jar" />
    </target>
    <target name="static-jar" description="create jblas-static.jar (local system, static)">
        <delete dir="${bin}/lib" />
        <copy todir="${bin}/lib">
            <fileset dir="${native-libs}">
                <include name="static/${os_name}/${os_arch}/*" /><commit_msg>Fixed bug in the name of the jar file.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!-- 
Copyright (c) 2009, <NAME>
Copyright (c) 2008, <NAME>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.

    * Neither the name of the Technische Universität Berlin nor the
      names of its contributors may be used to endorse or promote
      products derived from this software without specific prior
      written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<project name="java-blas" basedir="." default="jar">
    <description>
		This is the build script to compile and deploy the java-blas project.
		It also generates JavaDoc from source in ../doc.
    </description>

    <import file="configure.xml" />

    <!-- Define directories -->

    <property name="src" value="${basedir}/src" />
    <property name="test" value="${basedir}/test" />
    <property name="bin" value="${basedir}/bin" />
    <property name="native-libs" value="${basedir}/native-libs" />
    <property name="doc" value="${basedir}/javadoc" />
    <property name="jar" value="${basedir}/jblas.jar" />
    <property name="include" value="${basedir}/include" />
    <property name="native" value="${basedir}/native" />
    <property name="external" value="${basedir}/external" />
    <property name="scripts" value="${basedir}/scripts" />
    <property name="pkgbase" value="org.jblas" />
    <property name="version" value="0.3" />

    <!-- Macros -->

    <macrodef name="class-to-float" description="generate a float version of a class">
        <attribute name="class"/>
        <attribute name="path" default="src"/>
        <sequential>
            <echo message="Generating float version of @{class}"/>
            <exec executable="ruby">
                <arg line="scripts/class_to_float.rb @{path} @{class}"/>
            </exec>
        </sequential>
    </macrodef>
    <macrodef name="static-class-to-float" description="Add float versions to a class">
        <attribute name="class"/>
        <sequential>
            <echo message="Add float versions to class @{class}"/>
            <exec executable="ruby">
                <arg line="scripts/static_class_to_float.rb src @{class}"/>
            </exec>
        </sequential>
    </macrodef>
    <macrodef name="rjpp" description="Run the ruby-java preprocessor.">
        <attribute name="file"/>
        <sequential>
            <exec executable="ruby">
                <arg line="scripts/rjpp.rb @{file}"/>
            </exec>
        </sequential>
    </macrodef>
    <macrodef name="create-jar" description="create jar file">
        <attribute name="filename" />
        <sequential>
        <jar destfile="@{filename}">
            <fileset dir="${bin}">
                <include name="org/**" />
                <include name="lib/**/lib*.so"/>
                <include name="lib/**/*.dll"/>
            </fileset>
            <manifest>
                <attribute name="Built-By" value="IDA Group, TU Berlin" />
            </manifest>
        </jar>
        </sequential>
    </macrodef>

    <!-- Organizational targets -->

    <target name="clean" description="clean generated files">
        <delete dir="${doc}" />
        <delete dir="${bin}" />
        <delete dir="${include}" />
        <exec executable="${make}">
            <arg line="clean" />
        </exec>
    </target>
    <target name="clean-jars" description="delete all jar files">
        <delete>
            <fileset dir="." includes="*.jar" />
        </delete>
    </target>
    <target name="realclean" depends="clean" description="delete also dumped information on fortran functions">
        <exec executable="${make}">
            <arg line="realclean" />
        </exec>
    </target>
    <target name="prepare" description="create directories needed for compilation">
        <mkdir dir="${bin}" />
        <mkdir dir="${native}" />
        <mkdir dir="${include}" />
    </target>
    <target name="compile" depends="prepare,wrapper,generate-float" description="compile java code">
        <javac destdir="${bin}" encoding="utf-8" source="1.6" debug="on" compiler="javac1.6" fork="yes" nowarn="yes">
            <src path="${src}" />
        </javac>
    </target>
    <target name="compile-test" depends="compile" description="compile java test code">
        <javac destdir="${bin}" encoding="utf-8" source="1.6" debug="on" compiler="javac1.6" fork="yes" nowarn="yes">
            <src path="${test}" />
            <classpath>
                <pathelement location="${external}/junit.jar" />
            </classpath>
        </javac>
    </target>
    <target name="javah" depends="prepare,wrapper,compile" description="run javah">
        <javah destdir="${include}" force="yes">
            <class name="${pkgbase}.NativeBlas" />
            <classpath>
                <pathelement path="${bin}" />
            </classpath>
        </javah>
    </target>
    <target name="compile-native" depends="prepare,javah" description="compile native JNI stubs">
        <exec executable="${make}">
            <arg line="compile-native" />
        </exec>
    </target>
    <target name="wrapper" depends="prepare" description="generate the JNI stub code">
        <exec executable="${make}">
            <arg line="generate-wrapper" />
        </exec>
    </target>
    <target name="generate-float" depends="preprocess" description="generate float versions of classes">
        <class-to-float class="${pkgbase}.DoubleMatrix"/>
        <class-to-float class="${pkgbase}.DoubleFunction"/>
        <class-to-float class="${pkgbase}.ComplexDouble"/>
        <class-to-float path="test" class="${pkgbase}.TestDoubleMatrix"/>
        <class-to-float path="test" class="${pkgbase}.TestBlasDouble"/>
        <class-to-float class="${pkgbase}.ComplexDoubleMatrix"/>
        <static-class-to-float class="${pkgbase}.SimpleBlas"/>
        <static-class-to-float class="${pkgbase}.Solve"/>
        <static-class-to-float class="${pkgbase}.Eigen"/>
        <static-class-to-float class="${pkgbase}.Geometry"/>
        <static-class-to-float class="${pkgbase}.MatrixFunctions"/>
        <static-class-to-float class="${pkgbase}.JavaBlas"/>
    </target>
    <target name="preprocess" description="run the ruby preprocessor on necessary files">
        <rjpp file="src/org/jblas/DoubleMatrix.java"/>
        <rjpp file="test/org/jblas/TestDoubleMatrix.java"/>
        <rjpp file="src/org/jblas/MatrixFunctions.java"/>
        <rjpp file="src/org/jblas/ComplexDoubleMatrix.java"/>
    </target>

    <!-- jar files -->

    <target name="jar" depends="compile,compile-native" description="create jblas.jar (local system, as configured)">
        <delete dir="${bin}/lib" />
        <copy todir="${bin}/lib">
            <fileset dir="${native-libs}">
                <include name="${linkage}/${os_name}/${os_arch}/*" />
            </fileset>
        </copy>
        <create-jar filename="jblas-${version}.jar" />
    </target>

    <target name="dynamic-jar" depends="compile,compile-native" description="create jblas.jar (local system, dynamic)">
        <delete dir="${bin}/lib" />
        <copy todir="${bin}/lib">
            <fileset dir="${native-libs}">
                <include name="dynamic/${os_name}/${os_arch}/*" />
            </fileset>
        </copy>
        <create-jar filename="jblas-${version}-${os_name}-${os_arch}.jar" />
    </target>
    <target name="static-jar" description="create jblas-static.jar (local system, static)">
        <delete dir="${bin}/lib" />
        <copy todir="${bin}/lib">
            <fileset dir="${native-libs}">
                <include name="static/${os_name}/${os_arch}/*" />
{'fraction_non_alphanumeric': 0.1578084360511139, 'fraction_numerical': 0.0027140110822119192, 'mean_word_length': 2.7752401280683032, 'pattern_counts': {'":': 0, '<': 329, '<?xml version=': 2, '>': 329, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '37974', 'n_tokens_mistral': 5038, 'n_tokens_neox': 4798, 'n_words': 1322}