<commit_before><?xml version="1.0"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You 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 name="solr" default="usage">
  <description>Solr</description>
  
  <target name="usage" description="Prints out instructions">
    <echo message="Welcome to the Solr project!" />
    <echo message="Use 'ant example' to create a runnable example configuration." />
    <echo message="Use 'ant run-example' to create and run the example." />
    <echo message="And for developers:"/>
    <echo message="Use 'ant clean' to clean compiled files." />
    <echo message="Use 'ant compile' to compile the source code." />
    <echo message="Use 'ant dist' to build the project WAR and JAR files." />
    <echo message="Use 'ant javadocs' to build javadocs under build/docs/api" />
    <echo message="Use 'ant generate-maven-artifacts' to generate maven artifacts." />
    <echo message="Use 'ant package' to generate zip, tgz for distribution." />
    <!--<echo message="Use 'ant luke' to start luke.  see: http://luke.googlecode.com" />-->
    <echo message="Use 'ant test' to run unit tests." />
  </target>

  <import file="common-build.xml"/>
  
  <!-- ========================================================================= -->
  <!-- ============================== USER TASKS =============================== -->
  <!-- ========================================================================= -->
 
  <target name="example" description="Creates a runnable example configuration."
          depends="dist-contrib,dist-war">
    <copy file="${dist}/${fullnamever}.war"
          tofile="${example}/webapps/${ant.project.name}.war"/>
    <jar destfile="${example}/exampledocs/post.jar"
         basedir="${dest}/solr-core/classes/java"
         includes="org/apache/solr/util/SimplePostTool*.class">
      <manifest>
        <attribute name="Main-Class" value="org.apache.solr.util.SimplePostTool"/>
      </manifest>
    </jar>
    <delete includeemptydirs="true">
      <fileset dir="${example}/work" includes="**/*"/>
    </delete>
    <echo>See ${example}/README.txt for how to run the Solr example configuration.</echo>
  </target>
 
  <target name="run-example" depends="example"
          description="Run Solr interactively, via Jetty.  -Dexample.debug=true to enable JVM debugger">
    <property name="example.solr.home" location="example/solr"/>
    <property name="example.data.dir" location="example/solr/data"/>
    <property name="example.debug.suspend" value="n"/>
    <property name="example.jetty.port" value="8983"/>
    <condition property="example.jvm.line" value="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${example.debug.suspend},address=5005">
      <isset property="example.debug"/>
    </condition>
    <property name="example.jvm.line" value=""/>
    <property name="example.heap.size" value="512M"/>
    <java jar="${example}/start.jar" fork="true" dir="${example}" maxmemory="${example.heap.size}">
      <jvmarg line="${example.jvm.line}"/>
      <sysproperty key="solr.solr.home" file="${example.solr.home}"/>
      <sysproperty key="solr.data.dir" file="${example.data.dir}"/>
      <sysproperty key="jetty.port" value="${example.jetty.port}"/>
    </java>
  </target>
 
  <!-- setup proxy for download tasks -->
  <condition property="proxy.specified">
    <or>
      <isset property="proxy.host"/>
      <isset property="proxy.port"/>
      <isset property="proxy.user"/>
    </or>
  </condition>
 
  <target name="proxy.setup" if="proxy.specified">
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.user}" proxypassword="${<PASSWORD>}"/>
  </target>

  <!--LUCENE-3286: Luke is incompatible with new XML QP location and target is not flexible
  when it comes to incompatible changes.  Update when Luke has updated.
  <target name="compile-xml-query-parser">
  	<ant dir="${common.dir}/../modules/queryparser" target="compile-core" inheritAll="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>

  <property  name="luke.version" value="1.0.1"/>
  <available file="luke/luke-${luke.version}.jar" property="luke.jar.exists" />
  <target name="luke-download" unless="luke.jar.exists" depends="proxy.setup,compile-xml-query-parser">
    <mkdir dir="luke"/>
    <get src="http://luke.googlecode.com/files/luke-${luke.version}.jar"
         dest="luke/luke-${luke.version}.jar"/>
  </target>
  <path id="luke.classpath">
    <pathelement location="${common.dir}/build/classes/java" />
    <pathelement location="${common.dir}/../modules/queryparser/build/classes/java" />
  </path>
  <target name="luke" depends="luke-download">
    <java fork="true"
          classname="org.getopt.luke.Luke"
          logError="true"
          failonerror="true">
      <classpath>
        <fileset dir="luke">
          <include name="luke-${luke.version}.jar"/>
        </fileset>
        <path refid="classpath"/>
        <path refid="luke.classpath"/>
        <path refid="test.classpath"/>
      </classpath>
    </java>
  </target>-->
  
  <!-- ========================================================================= -->
  <!-- ========================== BUILD/TEST TASKS ============================= -->
  <!-- ========================================================================= -->
  
  <target name="compile" description="Compile the source code."
          depends="compile-core, compile-contrib"/>
  <target name="test" description="Validate, then run core, solrj, and contrib unit tests."
          depends="validate-solr, test-core, test-contrib"/>
  <target name="test-core" description="Runs the core and solrj unit tests."
          depends="test-solr-core, test-solrj"/>
  <target name="compile-test" description="Compile unit tests."
          depends="compile-solr-test-framework, compile-test-solr-core, compile-test-solrj, compile-test-contrib, test-jsp"/>
  <target name="javadocs" description="Calls javadocs-all, javadocs-solrj, and javadocs-test-framework"
          depends="javadocs-all,javadocs-solrj,javadocs-test-framework"/><commit_msg>fix test-jsp target to be actually called (its not a compile task, it just tries to compile as the test itsself)<commit_after><?xml version="1.0"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You 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 name="solr" default="usage">
  <description>Solr</description>
  
  <target name="usage" description="Prints out instructions">
    <echo message="Welcome to the Solr project!" />
    <echo message="Use 'ant example' to create a runnable example configuration." />
    <echo message="Use 'ant run-example' to create and run the example." />
    <echo message="And for developers:"/>
    <echo message="Use 'ant clean' to clean compiled files." />
    <echo message="Use 'ant compile' to compile the source code." />
    <echo message="Use 'ant dist' to build the project WAR and JAR files." />
    <echo message="Use 'ant javadocs' to build javadocs under build/docs/api" />
    <echo message="Use 'ant generate-maven-artifacts' to generate maven artifacts." />
    <echo message="Use 'ant package' to generate zip, tgz for distribution." />
    <!--<echo message="Use 'ant luke' to start luke.  see: http://luke.googlecode.com" />-->
    <echo message="Use 'ant test' to run unit tests." />
  </target>

  <import file="common-build.xml"/>
  
  <!-- ========================================================================= -->
  <!-- ============================== USER TASKS =============================== -->
  <!-- ========================================================================= -->
 
  <target name="example" description="Creates a runnable example configuration."
          depends="dist-contrib,dist-war">
    <copy file="${dist}/${fullnamever}.war"
          tofile="${example}/webapps/${ant.project.name}.war"/>
    <jar destfile="${example}/exampledocs/post.jar"
         basedir="${dest}/solr-core/classes/java"
         includes="org/apache/solr/util/SimplePostTool*.class">
      <manifest>
        <attribute name="Main-Class" value="org.apache.solr.util.SimplePostTool"/>
      </manifest>
    </jar>
    <delete includeemptydirs="true">
      <fileset dir="${example}/work" includes="**/*"/>
    </delete>
    <echo>See ${example}/README.txt for how to run the Solr example configuration.</echo>
  </target>
 
  <target name="run-example" depends="example"
          description="Run Solr interactively, via Jetty.  -Dexample.debug=true to enable JVM debugger">
    <property name="example.solr.home" location="example/solr"/>
    <property name="example.data.dir" location="example/solr/data"/>
    <property name="example.debug.suspend" value="n"/>
    <property name="example.jetty.port" value="8983"/>
    <condition property="example.jvm.line" value="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${example.debug.suspend},address=5005">
      <isset property="example.debug"/>
    </condition>
    <property name="example.jvm.line" value=""/>
    <property name="example.heap.size" value="512M"/>
    <java jar="${example}/start.jar" fork="true" dir="${example}" maxmemory="${example.heap.size}">
      <jvmarg line="${example.jvm.line}"/>
      <sysproperty key="solr.solr.home" file="${example.solr.home}"/>
      <sysproperty key="solr.data.dir" file="${example.data.dir}"/>
      <sysproperty key="jetty.port" value="${example.jetty.port}"/>
    </java>
  </target>
 
  <!-- setup proxy for download tasks -->
  <condition property="proxy.specified">
    <or>
      <isset property="proxy.host"/>
      <isset property="proxy.port"/>
      <isset property="proxy.user"/>
    </or>
  </condition>
 
  <target name="proxy.setup" if="proxy.specified">
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}" proxyuser="${proxy.user}" proxypassword="${proxy.password}"/>
  </target>

  <!--LUCENE-3286: Luke is incompatible with new XML QP location and target is not flexible
  when it comes to incompatible changes.  Update when Luke has updated.
  <target name="compile-xml-query-parser">
  	<ant dir="${common.dir}/../modules/queryparser" target="compile-core" inheritAll="false">
      <propertyset refid="uptodate.and.compiled.properties"/>
    </ant>
  </target>

  <property  name="luke.version" value="1.0.1"/>
  <available file="luke/luke-${luke.version}.jar" property="luke.jar.exists" />
  <target name="luke-download" unless="luke.jar.exists" depends="proxy.setup,compile-xml-query-parser">
    <mkdir dir="luke"/>
    <get src="http://luke.googlecode.com/files/luke-${luke.version}.jar"
         dest="luke/luke-${luke.version}.jar"/>
  </target>
  <path id="luke.classpath">
    <pathelement location="${common.dir}/build/classes/java" />
    <pathelement location="${common.dir}/../modules/queryparser/build/classes/java" />
  </path>
  <target name="luke" depends="luke-download">
    <java fork="true"
          classname="org.getopt.luke.Luke"
          logError="true"
          failonerror="true">
      <classpath>
        <fileset dir="luke">
          <include name="luke-${luke.version}.jar"/>
        </fileset>
        <path refid="classpath"/>
        <path refid="luke.classpath"/>
        <path refid="test.classpath"/>
      </classpath>
    </java>
  </target>-->
  
  <!-- ========================================================================= -->
  <!-- ========================== BUILD/TEST TASKS ============================= -->
  <!-- ========================================================================= -->
  
  <target name="compile" description="Compile the source code."
          depends="compile-core, compile-contrib"/>
  <target name="test" description="Validate, then run core, solrj, and contrib unit tests."
          depends="validate-solr, test-jsp, test-core, test-contrib"/>
  <target name="test-core" description="Runs the core and solrj unit tests."
          depends="test-solr-core, test-solrj"/>
  <target name="compile-test" description="Compile unit tests."
          depends="compile-solr-test-framework, compile-test-solr-core, compile-test-solrj, compile-test-contrib"/>
  <target name="javadocs" description="Calls javadocs-all, javadocs-solrj, and javadocs-test-framework"
          depends="javadocs-all,javadocs-solrj,javadocs-test-framework"/>
{'fraction_non_alphanumeric': 0.21199737283806466, 'fraction_numerical': 0.003502882580456834, 'mean_word_length': 3.8441145281018025, 'pattern_counts': {'":': 0, '<': 206, '<?xml version=': 2, '>': 206, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1493842', 'n_tokens_mistral': 3997, 'n_tokens_neox': 3866, 'n_words': 987}