<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2005-2006 The Apache Software Foundation
   
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
   
    http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<project default="default"
    xmlns:j="jelly:core"
    xmlns:u="jelly:util"
    xmlns:ant="jelly:ant"
    xmlns:util="jelly:util"
    xmlns:artifact="artifact"
    >

    <!-- ================= -->
    <!-- Global Properties -->
    <!-- ================= -->

    <!-- Determine what the top-level project root is -->
    <j:set var="project.root" value="${pom.parentBasedir().getParentFile().getCanonicalFile()}"/>

    <!-- ==================== -->
    <!-- Default Global Goals -->
    <!-- ==================== -->
    <goal name="default">
        <ant:copy todir="${basedir}/src/test/org/apache/activemq/usecases" file="${basedir}/src/release/conf/activemq.xml" overwrite="true"/>
        <attainGoal name="dist:build-bin"/>
    </goal>
    
    <goal name="prepare"
        prereqs="dist:prepare-bin-filesystem"/>

  <postGoal name="clean">
    <delete dir="${basedir}/activemq-data" />
  </postGoal>

    <preGoal name="jar:jar">

        <ant:mkdir dir="${maven.build.dir}/timestamps"/>
        <!-- Unpack all the composite ActiveMQ modules into the classes dir -->
        <j:forEach var="artifact" items="${pom.artifacts}">
            <j:set var="dependency" value="${artifact.dependency}"/>
            <j:if test="${dependency.getProperty('activemq.module') == 'true'}">
                <u:file var="file" name="${artifact.path}"/>
                <j:if test="${file.exists()}" >
                   <j:set var="uptodateFile" value="${maven.build.dir}/timestamps/${artifact.name}.ts"/>
                   <j:set var="uptodatePropName" value="tests.uptodate"/>
                   <j:remove var="${uptodatePropName}"/>
                   <ant:uptodate property="${uptodatePropName}" targetfile="${uptodateFile}" srcfile="${artifact.path}"/>
                   <j:if test="${context.getVariable(uptodatePropName) != 'true'}">
                      <unjar dest="${maven.build.dir}/classes" src="${artifact.path}"/>       
                      <touch file="${uptodateFile}"/>
                   </j:if>         
                </j:if>       
            </j:if>
        </j:forEach>

    </preGoal>

    <goal name="rebuild">
        <attainGoal name="clean"/>
        <attainGoal name="default"/>
    </goal>

 <goal
    name="dist:prepare-bin-filesystem"
    prereqs="jar:install"
    description="Builds the binary distribution file system.">
    
    <!--
    This is the directory where everything is copied to so that it can
    be archived.
    -->
    
    <ant:delete dir="${maven.dist.bin.assembly.dir}"/>
    <ant:mkdir dir="${maven.dist.bin.assembly.dir}"/>
    <ant:mkdir dir="${maven.build.dir}/unjar"/>

    <ant:echo>
      +-------------------------------------------------------+
      | C R E A T I N G  B I N A R Y  D I S T R I B U T I O N |
      +-------------------------------------------------------+
    </ant:echo>



    <!-- Copy in distribution files -->
    <ant:copy todir="${maven.dist.bin.assembly.dir}">
        <ant:fileset dir="src/release"/>
    </ant:copy>
    <ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}/bin" eol="crlf" eof="doc" includes="*.bat"/>
    <ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}/bin" eol="lf" eof="unix" includes="*" excludes="*.bat"/>
    <ant:chmod perm="ugo+rx">
      <ant:fileset dir="${maven.dist.bin.assembly.dir}/bin">
          <ant:include name="activemq"/>
      </ant:fileset>
    </ant:chmod>

    <ant:jar destfile="${maven.dist.bin.assembly.dir}/bin/run.jar" basedir="${maven.build.dir}/classes">
      <ant:include name="org/apache/activemq/console/Main*.class"/>
      <ant:manifest>
        <ant:attribute name="Main-Class" value="org.apache.activemq.console.Main"/>
      </ant:manifest>
    </ant:jar>
    <ant:copy todir="${maven.dist.bin.assembly.dir/conf}">
        <ant:fileset dir="${maven.build.dir}/classes" includes="**/activemq.dtd"/>
    </ant:copy>

    <!--
    <ant:unjar src="${maven.repo.local}/${pom.groupId}/jars/activemq-core-${pom.currentVersion}.jar"
        dest="${maven.build.dir}/unjar">
        <ant:patternset>
            <ant:include name="**/activemq.dtd"/>
        </ant:patternset>
    </ant:unjar>
    <ant:copy todir="${maven.dist.bin.assembly.dir}/conf" flatten="true">
        <ant:fileset dir="${maven.build.dir}/unjar" includes="**/activemq.dtd"/>
    </ant:copy>
    -->

    <ant:copy todir="${maven.dist.bin.assembly.dir}" file="${maven.repo.local}/${pom.groupId}/jars/${pom.artifactId}-${pom.currentVersion}.jar"/>

    <!-- Copy  the runtime dependencies into lib and create a classpath for the server.jar file -->
    <j:set var="libDir" value="${maven.dist.bin.assembly.dir}/lib"/>
    <j:set var="optionalDir" value="${maven.dist.bin.assembly.dir}/lib/optional"/>
    <ant:mkdir dir="${libDir}"/>
    <ant:mkdir dir="${optionalDir}"/>

    <j:forEach var="artifact" items="${pom.artifacts}">
        <j:set var="dependency" value="${artifact.dependency}"/>
        <j:if test="${dependency.getProperty('lib') == 'true'}">
            <ant:copy todir="${libDir}" file="${artifact.path}"/>
            <j:set var="classpath" value="${classpath} ../lib/${artifact.name}"/>
        </j:if>
    </j:forEach>

    <j:forEach var="artifact" items="${pom.artifacts}">
        <j:set var="dependency" value="${artifact.dependency}"/>
        <echo>${artifact.path} ${dependency.getProperty('optional') == 'true'}</echo>
    </j:forEach>

    <j:forEach var="artifact" items="${pom.artifacts}">
        <j:set var="dependency" value="${artifact.dependency}"/>
        <echo>${artifact.path}</echo>
        <j:if test="${dependency.getProperty('optional') == 'true'}">
            <ant:copy todir="${optionalDir}" file="${artifact.path}"/>
            <j:if test="${dependency.extension == 'jar'}">           
               <j:set var="classpath" value="${classpath} ../lib/optional/${artifact.name}"/>
            </j:if>
            <!--
            <j:if test="${dependency.extension == 'rar'}">    
               <ant:unzip src="${artifact.path}" dest="${optionalDir}">
                  <ant:patternset>
                     <include name="${dependency.artifactId}*.jar"/>
                  </ant:patternset>
               </ant:unzip>               
            </j:if>
            -->
        </j:if>
    </j:forEach>

    <ant:echo message="${project.root}"/>
    <ant:copy todir="${maven.dist.bin.assembly.dir}">
       <fileset dir="${project.root}" includes="*.txt,STATUS"/>
    </ant:copy>

    <!-- Copy documentation -->
    <u:file var="file" name="${project.root}/activemq-core/target/docs"/>
    <j:if test="${file.exists()}">
      <j:set var="docsDest" value="${project.root}/activemq-core/target/docs"/>
      <ant:copy todir="${maven.dist.bin.assembly.dir}/docs">
        <ant:fileset dir="${docsDest}">
          <ant:include name="**"/>
        </ant:fileset>
      </ant:copy>
    </j:if>       <commit_msg>Fixed build to include notice file<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2005-2006 The Apache Software Foundation
   
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
   
    http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<project default="default"
    xmlns:j="jelly:core"
    xmlns:u="jelly:util"
    xmlns:ant="jelly:ant"
    xmlns:util="jelly:util"
    xmlns:artifact="artifact"
    >

    <!-- ================= -->
    <!-- Global Properties -->
    <!-- ================= -->

    <!-- Determine what the top-level project root is -->
    <j:set var="project.root" value="${pom.parentBasedir().getParentFile().getCanonicalFile()}"/>

    <!-- ==================== -->
    <!-- Default Global Goals -->
    <!-- ==================== -->
    <goal name="default">
        <ant:copy todir="${basedir}/src/test/org/apache/activemq/usecases" file="${basedir}/src/release/conf/activemq.xml" overwrite="true"/>
        <attainGoal name="dist:build-bin"/>
    </goal>
    
    <goal name="prepare"
        prereqs="dist:prepare-bin-filesystem"/>

  <postGoal name="clean">
    <delete dir="${basedir}/activemq-data" />
  </postGoal>

    <preGoal name="jar:jar">

        <ant:mkdir dir="${maven.build.dir}/timestamps"/>
        <!-- Unpack all the composite ActiveMQ modules into the classes dir -->
        <j:forEach var="artifact" items="${pom.artifacts}">
            <j:set var="dependency" value="${artifact.dependency}"/>
            <j:if test="${dependency.getProperty('activemq.module') == 'true'}">
                <u:file var="file" name="${artifact.path}"/>
                <j:if test="${file.exists()}" >
                   <j:set var="uptodateFile" value="${maven.build.dir}/timestamps/${artifact.name}.ts"/>
                   <j:set var="uptodatePropName" value="tests.uptodate"/>
                   <j:remove var="${uptodatePropName}"/>
                   <ant:uptodate property="${uptodatePropName}" targetfile="${uptodateFile}" srcfile="${artifact.path}"/>
                   <j:if test="${context.getVariable(uptodatePropName) != 'true'}">
                      <unjar dest="${maven.build.dir}/classes" src="${artifact.path}"/>       
                      <touch file="${uptodateFile}"/>
                   </j:if>         
                </j:if>       
            </j:if>
        </j:forEach>

    </preGoal>

    <goal name="rebuild">
        <attainGoal name="clean"/>
        <attainGoal name="default"/>
    </goal>

 <goal
    name="dist:prepare-bin-filesystem"
    prereqs="jar:install"
    description="Builds the binary distribution file system.">
    
    <!--
    This is the directory where everything is copied to so that it can
    be archived.
    -->
    
    <ant:delete dir="${maven.dist.bin.assembly.dir}"/>
    <ant:mkdir dir="${maven.dist.bin.assembly.dir}"/>
    <ant:mkdir dir="${maven.build.dir}/unjar"/>

    <ant:echo>
      +-------------------------------------------------------+
      | C R E A T I N G  B I N A R Y  D I S T R I B U T I O N |
      +-------------------------------------------------------+
    </ant:echo>



    <!-- Copy in distribution files -->
    <ant:copy todir="${maven.dist.bin.assembly.dir}">
        <ant:fileset dir="src/release"/>
    </ant:copy>
    <ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}/bin" eol="crlf" eof="doc" includes="*.bat"/>
    <ant:fixcrlf srcdir="${maven.dist.bin.assembly.dir}/bin" eol="lf" eof="unix" includes="*" excludes="*.bat"/>
    <ant:chmod perm="ugo+rx">
      <ant:fileset dir="${maven.dist.bin.assembly.dir}/bin">
          <ant:include name="activemq"/>
      </ant:fileset>
    </ant:chmod>

    <ant:jar destfile="${maven.dist.bin.assembly.dir}/bin/run.jar" basedir="${maven.build.dir}/classes">
      <ant:include name="org/apache/activemq/console/Main*.class"/>
      <ant:manifest>
        <ant:attribute name="Main-Class" value="org.apache.activemq.console.Main"/>
      </ant:manifest>
    </ant:jar>
    <ant:copy todir="${maven.dist.bin.assembly.dir/conf}">
        <ant:fileset dir="${maven.build.dir}/classes" includes="**/activemq.dtd"/>
    </ant:copy>

    <!--
    <ant:unjar src="${maven.repo.local}/${pom.groupId}/jars/activemq-core-${pom.currentVersion}.jar"
        dest="${maven.build.dir}/unjar">
        <ant:patternset>
            <ant:include name="**/activemq.dtd"/>
        </ant:patternset>
    </ant:unjar>
    <ant:copy todir="${maven.dist.bin.assembly.dir}/conf" flatten="true">
        <ant:fileset dir="${maven.build.dir}/unjar" includes="**/activemq.dtd"/>
    </ant:copy>
    -->

    <ant:copy todir="${maven.dist.bin.assembly.dir}" file="${maven.repo.local}/${pom.groupId}/jars/${pom.artifactId}-${pom.currentVersion}.jar"/>

    <!-- Copy  the runtime dependencies into lib and create a classpath for the server.jar file -->
    <j:set var="libDir" value="${maven.dist.bin.assembly.dir}/lib"/>
    <j:set var="optionalDir" value="${maven.dist.bin.assembly.dir}/lib/optional"/>
    <ant:mkdir dir="${libDir}"/>
    <ant:mkdir dir="${optionalDir}"/>

    <j:forEach var="artifact" items="${pom.artifacts}">
        <j:set var="dependency" value="${artifact.dependency}"/>
        <j:if test="${dependency.getProperty('lib') == 'true'}">
            <ant:copy todir="${libDir}" file="${artifact.path}"/>
            <j:set var="classpath" value="${classpath} ../lib/${artifact.name}"/>
        </j:if>
    </j:forEach>

    <j:forEach var="artifact" items="${pom.artifacts}">
        <j:set var="dependency" value="${artifact.dependency}"/>
        <echo>${artifact.path} ${dependency.getProperty('optional') == 'true'}</echo>
    </j:forEach>

    <j:forEach var="artifact" items="${pom.artifacts}">
        <j:set var="dependency" value="${artifact.dependency}"/>
        <echo>${artifact.path}</echo>
        <j:if test="${dependency.getProperty('optional') == 'true'}">
            <ant:copy todir="${optionalDir}" file="${artifact.path}"/>
            <j:if test="${dependency.extension == 'jar'}">           
               <j:set var="classpath" value="${classpath} ../lib/optional/${artifact.name}"/>
            </j:if>
            <!--
            <j:if test="${dependency.extension == 'rar'}">    
               <ant:unzip src="${artifact.path}" dest="${optionalDir}">
                  <ant:patternset>
                     <include name="${dependency.artifactId}*.jar"/>
                  </ant:patternset>
               </ant:unzip>               
            </j:if>
            -->
        </j:if>
    </j:forEach>

    <ant:echo message="${project.root}"/>
    <ant:copy todir="${maven.dist.bin.assembly.dir}">
       <fileset dir="${project.root}" includes="*.txt,STATUS,NOTICE"/>
    </ant:copy>

    <!-- Copy documentation -->
    <u:file var="file" name="${project.root}/activemq-core/target/docs"/>
    <j:if test="${file.exists()}">
      <j:set var="docsDest" value="${project.root}/activemq-core/target/docs"/>
      <ant:copy todir="${maven.dist.bin.assembly.dir}/docs">
        <ant:fileset dir="${docsDest}">
          <ant:include name="**"/>
        </ant:fileset>
      </ant:copy>
    </j:if>       
{'fraction_non_alphanumeric': 0.21636075531493465, 'fraction_numerical': 0.0019807209824376074, 'mean_word_length': 2.5094995366079704, 'pattern_counts': {'":': 0, '<': 263, '<?xml version=': 2, '>': 263, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '762429', 'n_tokens_mistral': 4797, 'n_tokens_neox': 4552, 'n_words': 847}