You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by yo...@apache.org on 2006/01/29 16:16:57 UTC

svn commit: r373315 - /incubator/solr/trunk/build.xml

Author: yoavs
Date: Sun Jan 29 07:16:56 2006
New Revision: 373315

URL: http://svn.apache.org/viewcvs?rev=373315&view=rev
Log:
Initial version of build.xml -- not working yet, but I need to commit here since there's no JDK 1.5 on minotaur, and I'll continue on my laptop to make it work.

Added:
    incubator/solr/trunk/build.xml

Added: incubator/solr/trunk/build.xml
URL: http://svn.apache.org/viewcvs/incubator/solr/trunk/build.xml?rev=373315&view=auto
==============================================================================
--- incubator/solr/trunk/build.xml (added)
+++ incubator/solr/trunk/build.xml Sun Jan 29 07:16:56 2006
@@ -0,0 +1,146 @@
+<!-- Solr build file -->
+<project name="solr" default="usage" basedir=".">
+  <!-- Initialize property values: allow easy customization via build.properties -->
+  <property file="build.properties" />
+
+  <!-- Solr version -->
+  <property name="version" value="1.0" />
+
+  <!-- 3rd party libraries for compilation -->
+  <property name="lib" value="lib" />
+
+  <!-- solr source files -->
+  <property name="src" value="src" />
+
+  <!-- Destination for compiled classes and binaries -->
+  <property name="dest" value="build" />
+
+  <!-- Destination for distribution files (demo WAR, src distro, etc.) -->
+  <property name="dist" value="dist" />
+
+  <!-- Default target: usage.  Prints out instructions. -->
+  <target name="usage"
+          description="Prints out instructions">
+    <echo message="Welcome to the Solr project!" />
+    <echo message="Use 'ant build' to compile the source code." />
+    <echo message="Use 'ant dist' to build the project distribution files." />
+    <echo message="Use 'ant clean' to clean compiled files." />
+    <echo message="Use 'ant test' to run unit tests." />
+  </target>
+
+  <!-- Clean: cleans compiled files and other temporary artifacts. -->
+  <target name="clean"
+          description="Cleans compiled files and other temporary artifacts.">
+    <delete dir="${dest}" />
+  </target>
+
+
+  <!-- ------------------------------------------------------------------------- -->
+  <!-- ===================== COMPILATION-RELATED TASKS ========================= -->
+  <!-- ------------------------------------------------------------------------- -->
+
+
+  <!-- The compilation classpath -->
+  <path id="compile.classpath">
+    <fileset dir="${lib}">
+      <include name="lucene-core-nightly.jar" />
+      <include name="lucene-snowball-nightly.jar" />
+      <include name="servlet-api-2.4.jar" />
+      <include name="xpp3-1.1.3.4.0.jar" />
+    </fileset>
+  </path>
+
+  <!-- Compile the project. -->
+  <target name="compile"
+          description="Compile the source code.">
+    <mkdir dir="${dest}" />
+    <javac destdir="${dest}"
+           classpathref="compile.classpath">
+      <src dir="${srcdir}/java" />
+      <src dir="${srcdir}/webapp" />
+
+      <!-- Should we include this here?  A better name for this directory is needed anyways. -->
+      <src dir="${srcdir}/lucene_extras" />
+    </javac>
+  </target>
+
+
+  <!-- ------------------------------------------------------------------------- -->
+  <!-- ===================== TESTING-RELATED TASKS ============================= -->
+  <!-- ------------------------------------------------------------------------- -->
+
+
+  <!-- Classpath for unit test compilation. -->
+  <!-- For now, it's the same as main classpath.  Later it will have JUnit, Clover, etc. -->
+  <path id="test.compile.classpath">
+    <path refid="compile.classpath" />
+  </path>
+
+  <!-- Compile unit tests. -->
+  <target name="compileTests"
+          description="Compile unit tests."
+          depends="compile">
+    <mkdir dir="${dest}/tests" />
+    <javac destdir="${dest}/tests"
+           classpathref="test.compile.classpath">
+      <src dir="${src}/test" />
+      <src dir="${src}/apps/SolarTest/src" />
+    </javac>
+  </target>
+
+  <!-- Run unit tests. -->
+  <target name="test"
+          description="Runs the unit tests."
+          depends="compileTests">
+    <echo message="TO-DO later or after we convert tests to JUnit." />
+  </target>
+
+
+
+  <!-- ------------------------------------------------------------------------- -->
+  <!-- ===================== DISTRIBUTION-RELATED TASKS ======================== -->
+  <!-- ------------------------------------------------------------------------- -->
+
+
+  <!-- Creates the Solr distribution files. -->
+  <target name="dist"
+          description="Creates the Solr distribution files."
+          depends="dist-src, dist-war, dist-bin" />
+
+  <!-- Creates the demo WAR file. -->
+  <target name="dist-war"
+          description="Creates the demo WAR file."
+          depends="compile">
+    <mkdir dir="${dist}" />
+    <war destfile="${dist}/${ant.project.name}-${version}.war"
+         webxml="${src}/webapp/WEB-INF/web.xml">
+      <classes dir="${dest}" />
+      <lib dir="${lib}">
+        <exclude name="servlet-api-2.4.jar" />
+      </lib>
+    </war>
+  </target>
+
+  <!-- Creates the source distribution. -->
+  <target name="dist-src"
+          description="Creates the source distribution."
+          depends="clean">
+    <mkdir dir="${dist}" />
+    <zip destfile="${dist}/${ant.project.name}-${version}-src.zip"
+         basedir="${src}" />
+  </target>
+
+  <!-- Creates the binary distribution. -->
+  <target name="dist-bin"
+          description="Creates the binary distribution."
+          depends="clean, compile, dist-war">
+    <mkdir dir="${dist}" />
+    
+    <jar destfile="${dist}/${ant.project.name}-${version}.jar"
+         basedir="${dest}" />  
+
+    <zip destfile="${dist}/${ant.project.name}-${version}.zip"
+         basedir="${dist}" />
+  </target>
+
+</project>
\ No newline at end of file