You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by ab...@apache.org on 2010/07/07 22:30:39 UTC

svn commit: r961498 - in /nutch/trunk: CHANGES.txt bin/ build.xml default.properties src/bin/ src/bin/nutch

Author: ab
Date: Wed Jul  7 20:30:38 2010
New Revision: 961498

URL: http://svn.apache.org/viewvc?rev=961498&view=rev
Log:
NUTCH-843 Separate the build and runtime environments.

Added:
    nutch/trunk/src/bin/
      - copied from r961321, nutch/trunk/bin/
Removed:
    nutch/trunk/bin/
Modified:
    nutch/trunk/CHANGES.txt
    nutch/trunk/build.xml
    nutch/trunk/default.properties
    nutch/trunk/src/bin/nutch

Modified: nutch/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/nutch/trunk/CHANGES.txt?rev=961498&r1=961497&r2=961498&view=diff
==============================================================================
--- nutch/trunk/CHANGES.txt (original)
+++ nutch/trunk/CHANGES.txt Wed Jul  7 20:30:38 2010
@@ -2,6 +2,8 @@ Nutch Change Log
 
 Release 2.0 - Current Development
 
+* NUTCH-843 Separate the build and runtime environments (ab)
+
 * NUTCH-821 Use ivy in nutch builds (Enis Soztutar, jnioche)
 
 * NUTCH-838 Add timing information to all Tool classes (Jeroen van Vianen, mattmann)

Modified: nutch/trunk/build.xml
URL: http://svn.apache.org/viewvc/nutch/trunk/build.xml?rev=961498&r1=961497&r2=961498&view=diff
==============================================================================
--- nutch/trunk/build.xml (original)
+++ nutch/trunk/build.xml Wed Jul  7 20:30:38 2010
@@ -15,7 +15,7 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<project name="Nutch" default="job" xmlns:ivy="antlib:org.apache.ivy.ant">
+<project name="Nutch" default="runtime" xmlns:ivy="antlib:org.apache.ivy.ant">
 
   <!-- Load all the default properties, and any the user wants    -->
   <!-- to contribute (without having to type -D or edit this file -->
@@ -143,6 +143,39 @@
     </jar>
   </target>
 
+  <target name="runtime" depends="jar, job">
+    <mkdir dir="${runtime.dir}"/>
+    <mkdir dir="${runtime.local}"/>
+    <mkdir dir="${runtime.deploy}"/>
+    <!-- deploy area -->
+    <copy file="${build.dir}/${final.name}.job"
+          todir="${runtime.deploy}"/>
+    <copy todir="${runtime.deploy}/bin">
+      <fileset dir="src/bin"/>
+    </copy>
+    <chmod perm="ugo+x" type="file">
+        <fileset dir="${runtime.deploy}/bin"/>
+    </chmod>
+    <!-- local area -->
+    <copy file="${build.dir}/${final.name}.jar"
+          todir="${runtime.local}/lib"/>
+    <copy todir="${runtime.local}/conf">
+      <fileset dir="conf"/>
+    </copy>
+    <copy todir="${runtime.local}/bin">
+      <fileset dir="src/bin"/>
+    </copy>
+    <chmod perm="ugo+x" type="file">
+        <fileset dir="${runtime.deploy}/bin"/>
+    </chmod>
+    <copy todir="${runtime.local}/lib">
+      <fileset dir="${build.dir}/lib"/>
+    </copy>
+    <copy todir="${runtime.local}/plugins">
+      <fileset dir="${build.dir}/plugins"/>
+    </copy>
+  </target>
+
   <!-- ================================================================== -->
   <!-- Compile test code                                                  --> 
   <!-- ================================================================== -->
@@ -495,7 +528,7 @@
   <!-- ================================================================== -->
 
   <!-- target: clean  =================================================== -->
-  <target name="clean" depends="clean-build, clean-lib, clean-dist" description="--> clean the project" />
+  <target name="clean" depends="clean-build, clean-lib, clean-dist, clean-runtime" description="--> clean the project" />
 
   <!-- target: clean-local  ============================================= -->
   <target name="clean-local" depends="" 
@@ -524,6 +557,10 @@
     <ivy:cleancache />
   </target>
 
+  <target name="clean-runtime" description="--> clean the project runtime area">
+    <delete includeemptydirs="true" dir="${runtime.dir}"/>
+  </target>
+
   <!-- ================================================================== -->
   <!-- RAT targets                                                        -->
   <!-- ================================================================== -->

Modified: nutch/trunk/default.properties
URL: http://svn.apache.org/viewvc/nutch/trunk/default.properties?rev=961498&r1=961497&r2=961498&view=diff
==============================================================================
--- nutch/trunk/default.properties (original)
+++ nutch/trunk/default.properties Wed Jul  7 20:30:38 2010
@@ -24,8 +24,6 @@ test.build.data =  ${test.build.dir}/dat
 test.build.classes = ${test.build.dir}/classes
 test.build.javadoc = ${test.build.dir}/docs/api
 
-javacc.home=/usr/java/javacc
-
 # Proxy Host and Port to use for building JavaDoc
 javadoc.proxy.host=-J-DproxyHost=
 javadoc.proxy.port=-J-DproxyPort=
@@ -42,6 +40,10 @@ javac.optimize=on
 javac.deprecation=off
 javac.version= 1.6
 
+runtime.dir=./runtime
+runtime.deploy=${runtime.dir}/deploy
+runtime.local=${runtime.dir}/local
+
 ivy.version=2.1.0
 ivy.dir=${basedir}/ivy
 ivy.file=${ivy.dir}/ivy.xml

Modified: nutch/trunk/src/bin/nutch
URL: http://svn.apache.org/viewvc/nutch/trunk/src/bin/nutch?rev=961498&r1=961321&r2=961498&view=diff
==============================================================================
--- nutch/trunk/src/bin/nutch (original)
+++ nutch/trunk/src/bin/nutch Wed Jul  7 20:30:38 2010
@@ -64,13 +64,6 @@ if [ $# = 0 ]; then
   exit 1
 fi
 
-IS_CORE=0
-#check for -core option
-if [ "$1" == "-core" ] ; then
-  IS_CORE=1
-  shift
-fi
-
 # get arguments
 COMMAND=$1
 shift
@@ -107,42 +100,26 @@ CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/to
 # so that filenames w/ spaces are handled correctly in loops below
 IFS=
 
-# for developers, add plugins, job & test code to CLASSPATH
-if [ -d "$NUTCH_HOME/build/plugins" ]; then
-  CLASSPATH=${CLASSPATH}:$NUTCH_HOME/build
-fi
-if [ -d "$NUTCH_HOME/build/test/classes" ]; then
-  CLASSPATH=${CLASSPATH}:$NUTCH_HOME/build/test/classes
-fi
-
-if [ $IS_CORE == 0 ] 
-then
-  for f in $NUTCH_HOME/build/nutch-*.job; do
+# add libs to CLASSPATH
+for f in $NUTCH_HOME/lib/*.jar; do
+  CLASSPATH=${CLASSPATH}:$f;
+done
+if [ -f ${NUTCH_HOME}/nutch-*.job ]; then
+  # distributed runtime
+  for f in $NUTCH_HOME/nutch-*.job; do
     CLASSPATH=${CLASSPATH}:$f;
   done
-
-  # for releases, add Nutch job to CLASSPATH
-  for f in $NUTCH_HOME/nutch-*.job; do
+  for f in $NUTCH_HOME/hadoop-*.jar; do
     CLASSPATH=${CLASSPATH}:$f;
   done
 else
-  CLASSPATH=${CLASSPATH}:$NUTCH_HOME/build/classes
-fi
-
-# add plugins to classpath
-if [ -d "$NUTCH_HOME/plugins" ]; then
-  CLASSPATH=${NUTCH_HOME}:${CLASSPATH}
+  # local runtime
+  # add plugins to classpath
+  if [ -d "$NUTCH_HOME/plugins" ]; then
+    CLASSPATH=${NUTCH_HOME}:${CLASSPATH}
+  fi
 fi
 
-# add libs to CLASSPATH
-for f in $NUTCH_HOME/lib/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-
-for f in $NUTCH_HOME/lib/jsp-2.1/*.jar; do
-  CLASSPATH=${CLASSPATH}:$f;
-done
-
 # cygwin path translation
 if $cygwin; then
   CLASSPATH=`cygpath -p -w "$CLASSPATH"`
@@ -150,13 +127,9 @@ fi
 
 # setup 'java.library.path' for native-hadoop code if necessary
 JAVA_LIBRARY_PATH=''
-if [ -d "${NUTCH_HOME}/build/native" -o -d "${NUTCH_HOME}/lib/native" ]; then
+if [ -d "${NUTCH_HOME}/lib/native" ]; then
   JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} org.apache.hadoop.util.PlatformName | sed -e 's/ /_/g'`
   
-  if [ -d "$NUTCH_HOME/build/native" ]; then
-    JAVA_LIBRARY_PATH=${HADOOP_HOME}/build/native/${JAVA_PLATFORM}/lib
-  fi
-  
   if [ -d "${NUTCH_HOME}/lib/native" ]; then
     if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
       JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:${NUTCH_HOME}/lib/native/${JAVA_PLATFORM}