Sfoglia il codice sorgente

HUE-449. tarball build changes after mavenization [part2]

* Include java src with distribution
* Fix bdist target to correctly calculate dependency
* Remove unused build.xml and ivy.xml
bc Wong 15 anni fa
parent
commit
e7e6392261

+ 0 - 5
Makefile.tarball

@@ -31,19 +31,14 @@ PROD_INCLUDES := \
 
 # Check for things in BDIST_EXCLUDES in various apps
 PROD_EXCLUDES := \
-	apps/beeswax/java \
 	apps/beeswax/thrift \
 	apps/hello \
 	apps/jframegallery \
-	apps/jobsub/src/jobsub/java \
 	build \
 	desktop/conf \
 	desktop/desktop.db \
 	desktop/devtools.mk \
-	desktop/libs/hadoop/java \
 	desktop/libs/hadoop/regenerate-thrift.sh \
-	desktop/libs/hadoop/static-group-mapping/src \
-	desktop/libs/hadoop/sudo-shell/src \
 	ext/thirdparty/js/manifest.json \
 	ext/thirdparty/README.md \
         Makefile.tarball

+ 1 - 4
apps/beeswax/Makefile

@@ -47,10 +47,7 @@ clean::
 	rm -Rf $(BEESWAX_JAVA_LIB)
 	cd $(BEESWAX_JAVA_DIR) && mvn clean || :
 
-BEESWAX_OPTS := -Dbuild.dir=$(BLD_DIR_BEESWAX) \
-	        -Dhadoop.home=$(HADOOP_HOME) \
-	        -Dhive.lib=$(BEESWAX_HIVE_LIB)
-$(BEESWAX): $(shell find $(BEESWAX_JAVA_DIR))
+$(BEESWAX): $(shell find $(BEESWAX_JAVA_DIR) -type f)
 	@echo "--- Building Desktop beeswax"
 	cd $(BEESWAX_JAVA_DIR) && mvn clean install -DskipTests
 	@mkdir -p $(BEESWAX_JAVA_LIB)

+ 0 - 151
apps/beeswax/java/build.xml

@@ -1,151 +0,0 @@
-<!--
-  Licensed to Cloudera, Inc. under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  Cloudera, Inc. 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.
--->
-<!-- Ant build file for beeswax server -->
-<project name="beeswax" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
-  <property name="src.dir" location="src" />
-  <property name="lib.dir" location="${build.dir}/lib" />
-
-  <property name="javac.debug" value="on"/>
-  <property name="javac.optimize" value="on"/>
-  <property name="javac.deprecation" value="on"/>
-  <property name="javac.args.warnings" value="-Xlint:unchecked"/>
-  <property name="javac.args" value=""/>
-
-  <path id="build.classpath">
-    <fileset dir="${hadoop.home}">
-      <include name="hadoop*core*.jar" />
-    </fileset>
-    <!-- TODO(philip): This could be pruned down. -->
-    <fileset dir="${hive.lib}">
-      <include name="*.jar" />
-    </fileset>
-    <!--fileset dir="${lib.dir}/default">
-      <include name="**/*.jar" />
-    </fileset-->
-  </path>
-
-  <target name="init">
-    <mkdir dir="${build.dir}/classes" />
-    <mkdir dir="${build.dir}/test-classes" />
-  </target>
-
-  <target name="build" depends="init">
-    <echo message="HDR: ${hadoop.home}"/>
-    <javac
-      srcdir="gen-java"
-      destdir="${build.dir}/classes"
-      debug="${javac.debug}"
-      optimize="${javac.optimize}"
-      deprecation="${javac.deprecation}">
-      <classpath refid="build.classpath" />
-      <compilerarg line="${javac.args}" />
-    </javac>
-    <javac
-      srcdir="src"
-      destdir="${build.dir}/classes"
-      debug="${javac.debug}"
-      optimize="${javac.optimize}"
-      deprecation="${javac.deprecation}">
-      <classpath refid="build.classpath" />
-      <compilerarg line="${javac.args} ${javac.args.warnings}" />
-    </javac>
-  </target>
-
-  <target name="jar" depends="build">
-    <copy todir="${build.dir}/out">
-      <fileset dir="${src.dir}" includes="META-INF/*" />
-    </copy>
-    <mkdir dir="${build.dir}/jar"/>
-      <jar destfile="${build.dir}/jar/BeeswaxServer.jar" basedir="${build.dir}/classes">
-        <manifest>
-          <attribute name="Main-Class" value="com.cloudera.beeswax.Server"/>
-        </manifest>
-      </jar>
-  </target>
-
-  <target name="test-build" depends="init" description="Compile sample code used in testing.">
-    <javac
-      srcdir="test"
-      destdir="${build.dir}/test-classes"
-      debug="${javac.debug}"
-      optimize="${javac.optimize}"
-      deprecation="${javac.deprecation}">
-      <classpath refid="build.classpath" />
-      <compilerarg line="${javac.args}" />
-    </javac>
-  </target>
-
-  <target name="test-jar" depends="test-build">
-    <copy todir="${build.dir}/out">
-      <fileset dir="${src.dir}" includes="META-INF/*" />
-    </copy>
-    <mkdir dir="${build.dir}/jar"/>
-    <jar destfile="${build.dir}/jar/BeeswaxTest.jar" basedir="${build.dir}/test-classes" />
-  </target>
-
-  <target name="clean">
-    <delete dir="${build.dir}" />
-  </target>
-
-  <target name="run">
-      <java classname="com.cloudera.beeswax.Server" failonerror="true" fork="yes">
-          <env key="JAVA_HOME" value="${java.home}" />
-          <env key="HADOOP_HOME" value="${HADOOP_HOME}"/>
-          <classpath refid="build.classpath"/>
-          <classpath path="${build.dir}/classes" />
-          <classpath path="${hadoop.dir}/conf" />
-      </java>
-  </target>
-
-
-  <!-- START GENERIC IVY TARGETS -->
-  <property name="ivy.install.version" value="2.0.0-beta1" />
-  <condition property="ivy.home" value="${env.IVY_HOME}">
-    <isset property="env.IVY_HOME" />
-  </condition>
-  <property name="ivy.home" value="${user.home}/.ivy_beeswax" />
-  <property name="ivy.jar.dir" value="${ivy.home}/lib" />
-  <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
-
-  <target name="download-ivy" unless="offline">
-    <mkdir dir="${ivy.jar.dir}"/>
-    <!-- download Ivy from web site so that it can be used even without any special installation -->
-    <get src="http://www.apache.org/dist/ant/ivy/${ivy.install.version}/ivy.jar"
-	dest="${ivy.jar.file}" usetimestamp="true"/>
-  </target>
-
-  <target name="init-ivy" depends="download-ivy">
-    <!-- try to load ivy here from ivy home, in case the user has not already dropped
-            it into ant's lib dir (note that the latter copy will always take precedence).
-            We will not fail as long as local lib dir exists (it may be empty) and
-            ivy is in at least one of ant's lib dir or the local lib dir. -->
-    <path id="ivy.lib.path">
-	<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
-    </path>
-    <taskdef resource="org/apache/ivy/ant/antlib.xml"
-	     uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
-  </target>
-
-
-  <target name="resolve" description="--> retrieve dependencies with ivy" depends="init-ivy">
-    <mkdir dir="${lib.dir}"/>
-    <ivy:retrieve pattern="${lib.dir}/[conf]/[module]/[revision]/[type]/[artifact].[ext]" />
-  </target>
-  <!-- END GENERIC IVY TARGETS -->
-
-</project>

+ 0 - 23
apps/beeswax/java/ivy.xml

@@ -1,23 +0,0 @@
-<!--
-  Licensed to Cloudera, Inc. under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  Cloudera, Inc. 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.
--->
-<ivy-module version="2.0">
-<info organisation="com.cloudera" module="beeswax"/>
-<dependencies>
-  <dependency org="com.google.collections" name="google-collections" rev="1.0-rc2"/>
-</dependencies>
-</ivy-module>

+ 3 - 15
desktop/libs/hadoop/Makefile

@@ -61,11 +61,7 @@ compile: $(PLUGIN) $(STATIC_GROUP_MAPPING) $(SUDO_SHELL)
 
 # Build the plugin jar iff the source is present
 ifneq (,$(wildcard $(PLUGIN_JAVA_DIR)))
-PLUGIN_OPTS := -Dbuild.dir=$(BLD_DIR_PLUGINS) \
-	       -Dhadoop.home=$(HADOOP_HOME) \
-	       -Dplugins.version=$(DESKTOP_VERSION)
-
-$(PLUGIN): $(shell find $(PLUGIN_JAVA_DIR) )
+$(PLUGIN): $(shell find $(PLUGIN_JAVA_DIR) -type f)
 	mkdir -p $(PLUGIN_JAVA_LIB)
 	@echo "--- Building Hadoop plugins"
 	cd $(PLUGIN_JAVA_DIR) && mvn clean install -DskipTests
@@ -81,11 +77,7 @@ endif
 
 # Build the static group mapping jar iff the source is present
 ifneq (,$(wildcard $(STATIC_GROUP_MAPPING_SRC)))
-STATIC_GROUP_MAPPING_OPTS := -Dbuild.dir=$(STATIC_GROUP_MAPPING_BUILD) \
-         -Dhadoop.home=$(HADOOP_HOME) \
-         -Dstatic-group-mapping.version=$(DESKTOP_VERSION)
-
-$(STATIC_GROUP_MAPPING): $(shell find $(STATIC_GROUP_MAPPING_SRC))
+$(STATIC_GROUP_MAPPING): $(shell find $(STATIC_GROUP_MAPPING_SRC) -type f)
 	mkdir -p $(STATIC_GROUP_MAPPING_LIB)
 	@echo "--- Building static UserGroupMappingService"
 	cd $(STATIC_GROUP_MAPPING_DIR) && mvn clean install -DskipTests
@@ -101,11 +93,7 @@ endif
 
 # Build the sudo shell jar iff the source is present
 ifneq (,$(wildcard $(SUDO_SHELL_SRC)))
-SUDO_SHELL_OPTS := -Dbuild.dir=$(SUDO_SHELL_BUILD) \
-         -Dhadoop.home=$(HADOOP_HOME) \
-         -Dsudo-shell.version=$(DESKTOP_VERSION)
-
-$(SUDO_SHELL): $(shell find $(SUDO_SHELL_SRC))
+$(SUDO_SHELL): $(shell find $(SUDO_SHELL_SRC) -type f)
 	mkdir -p $(SUDO_SHELL_LIB)
 	@echo "--- Building sudo fsshell tool"
 	cd $(SUDO_SHELL_DIR) && mvn clean install -DskipTests

+ 0 - 104
desktop/libs/hadoop/java/build.xml

@@ -1,104 +0,0 @@
-<?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="hue" default="jar">
-
-  <!-- Additional -->
-  <property name="name" value="${ant.project.name}"/>
-  <property name="build.encoding" value="ISO-8859-1"/>
-  <property name="build.classes" location="${build.dir}/classes"/>
-  <property name="src.dir"  location="${basedir}/src/java"/>
-
-  <property name="lib.dir" location="${build.dir}/lib" />
-
-  <!-- this version number is provided by the invoker -->
-  <property name="plugins.version" value="DEV" />
-  <property name="test.available" value="true" />
-
-  <property name="javac.debug" value="on"/>
-  <property name="javac.optimize" value="on"/>
-  <property name="javac.deprecation" value="on"/>
-  <property name="javac.args.warnings" value="-Xlint:unchecked"/>
-  <property name="javac.args" value=""/>
-
-  <!-- create the list of files to add to the classpath -->
-  <path id="build.classpath">
-    <fileset dir="${hadoop.home}">
-      <include name="hadoop*core*.jar" />
-      <include name="lib/commons-log*.jar" />
-      <include name="lib/*slf4j*.jar" />
-    </fileset>
-    <fileset dir="${basedir}/lib">
-      <include name="*.jar" />
-    </fileset>
-  </path>
-
-  <!--fileset dir="${hadoop.home}/lib" id="class.path">
-    <include name="**/*.jar" />
-    <exclude name="**/excluded/" />
-  </fileset-->
-
-  <target name="init">
-    <mkdir dir="${build.classes}"/>
-  </target>
-
-  <target name="compile-gen" depends="init">
-    <echo message="contrib: ${name}"/>
-    <javac encoding="${build.encoding}"
-      srcdir="gen-java"
-      includes="**/*.java"
-      destdir="${build.classes}"
-      debug="${javac.debug}"
-      optimize="${javac.optimize}"
-      deprecation="${javac.deprecation}">
-     <classpath refid="build.classpath" />
-     <compilerarg line="${javac.args}" />
-    </javac>
-  </target>
-
-  <target name="compile" depends="compile-gen">
-    <echo message="contrib: ${name}"/>
-    <echo message="src dir: ${src.dir}"/>
-    <javac
-     encoding="${build.encoding}"
-     srcdir="${src.dir}"
-     includes="**/*.java"
-     destdir="${build.classes}"
-     debug="${javac.debug}"
-     optimize="${javac.optimize}"
-     deprecation="${javac.deprecation}">
-     <classpath refid="build.classpath"/>
-     <compilerarg line="${javac.args} ${javac.args.warnings}" />
-    </javac>
-  </target>
-
-  <!-- Override jar target to specify main class, and to include default
-       configuration file -->
-  <target name="jar" depends="compile">
-    <jar jarfile="${build.dir}/hue-plugins-${plugins.version}.jar"
-         basedir="${build.classes}">
-      <fileset dir="${src.dir}">
-        <include name="hue-default.xml" />
-      </fileset>
-      <!-- the version of thrift packaged with hadoop is ancient - bundle ours -->
-      <zipfileset src="lib/libthrift.jar" />
-    </jar>
-  </target>
-
-</project>

+ 0 - 69
desktop/libs/hadoop/java/ivy.xml

@@ -1,69 +0,0 @@
-<?xml version="1.0" ?>
-<!--
-  Licensed to Cloudera, Inc. under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  Cloudera, Inc. 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.
--->
-<ivy-module version="1.0">
-  <info organisation="org.apache.hadoop" module="${ant.project.name}">
-    <license name="Apache 2.0"/>
-    <ivyauthor name="Apache Hadoop Team" url="http://hadoop.apache.org"/>
-    <description>
-        Apache Hadoop
-    </description>
-  </info>
-  <configurations defaultconfmapping="default">
-    <!--these match the Maven configurations-->
-    <conf name="default" extends="master,runtime"/>
-    <conf name="master" description="contains the artifact but no dependencies"/>
-    <conf name="runtime" description="runtime but not the artifact" />
-
-    <conf name="common" visibility="private" 
-      extends="runtime"
-      description="artifacts needed to compile/test the application"/>
-    <conf name="test" visibility="private" extends="runtime"/>
-  </configurations>
-
-  <publications>
-    <!--get the artifact from our module name-->
-    <artifact conf="master"/>
-  </publications>
-  <dependencies>
-    <dependency org="commons-logging"
-      name="commons-logging"
-      rev="${commons-logging.version}"
-      conf="common->default"/>
-    <dependency org="log4j"
-      name="log4j"
-      rev="${log4j.version}"
-      conf="common->master"/>
-    <dependency org="org.mortbay.jetty"
-      name="jetty-util"
-      rev="${jetty-util.version}"
-      conf="common->master"/>
-    <dependency org="org.mortbay.jetty"
-      name="jetty"
-      rev="${jetty.version}"
-      conf="common->master"/>
-    <dependency org="junit"
-      name="junit"
-      rev="${junit.version}"
-      conf="common->default" />
-     <dependency org="tomcat"
-      name="servlet"
-      rev="${servlet.version}"
-      conf="common->default"/>     
-    </dependencies>
-</ivy-module>

+ 0 - 75
desktop/libs/hadoop/static-group-mapping/build.xml

@@ -1,75 +0,0 @@
-<?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="static-group-mapping" default="jar">
-
-  <!-- Additional -->
-  <property name="name" value="${ant.project.name}"/>
-  <property name="build.encoding" value="ISO-8859-1"/>
-  <property name="build.classes" location="${build.dir}/classes"/>
-  <property name="src.dir"  location="${basedir}/src"/>
-
-  <property name="lib.dir" location="${build.dir}/lib" />
-
-  <!-- this version number is provided by the invoker -->
-  <property name="static-group-mapping.version" value="DEV" />
-  <property name="test.available" value="true" />
-
-  <property name="javac.debug" value="on"/>
-  <property name="javac.optimize" value="on"/>
-  <property name="javac.deprecation" value="on"/>
-  <property name="javac.args.warnings" value="-Xlint:unchecked"/>
-  <property name="javac.args" value=""/>
-
-  <!-- create the list of files to add to the classpath -->
-  <path id="build.classpath">
-    <fileset dir="${hadoop.home}">
-      <include name="hadoop*core*.jar" />
-    </fileset>
-  </path>
-
-  <target name="init">
-    <mkdir dir="${build.classes}"/>
-  </target>
-
-  <target name="compile" depends="init">
-    <echo message="contrib: ${name}"/>
-    <echo message="src dir: ${src.dir}"/>
-    <javac
-     encoding="${build.encoding}"
-     srcdir="${src.dir}"
-     includes="**/*.java"
-     destdir="${build.classes}"
-     debug="${javac.debug}"
-     optimize="${javac.optimize}"
-     deprecation="${javac.deprecation}">
-     <classpath refid="build.classpath"/>
-     <compilerarg line="${javac.args} ${javac.args.warnings}" />
-    </javac>
-  </target>
-
-  <!-- Override jar target to specify main class, and to include default
-       configuration file -->
-  <target name="jar" depends="compile">
-    <jar jarfile="${build.dir}/static-group-mapping-${static-group-mapping.version}.jar"
-         basedir="${build.classes}">
-    </jar>
-  </target>
-
-</project>

+ 0 - 78
desktop/libs/hadoop/sudo-shell/build.xml

@@ -1,78 +0,0 @@
-<?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="sudo-shell" default="jar">
-
-  <!-- Additional -->
-  <property name="name" value="${ant.project.name}"/>
-  <property name="build.encoding" value="ISO-8859-1"/>
-  <property name="build.classes" location="${build.dir}/classes"/>
-  <property name="src.dir"  location="${basedir}/src"/>
-
-  <property name="lib.dir" location="${build.dir}/lib" />
-
-  <!-- this version number is provided by the invoker -->
-  <property name="sudo-shell.version" value="DEV" />
-  <property name="test.available" value="true" />
-
-  <property name="javac.debug" value="on"/>
-  <property name="javac.optimize" value="on"/>
-  <property name="javac.deprecation" value="on"/>
-  <property name="javac.args.warnings" value="-Xlint:unchecked"/>
-  <property name="javac.args" value=""/>
-
-  <!-- create the list of files to add to the classpath -->
-  <path id="build.classpath">
-    <fileset dir="${hadoop.home}">
-      <include name="hadoop*core*.jar" />
-    </fileset>
-  </path>
-
-  <target name="init">
-    <mkdir dir="${build.classes}"/>
-  </target>
-
-  <target name="compile" depends="init">
-    <echo message="contrib: ${name}"/>
-    <echo message="src dir: ${src.dir}"/>
-    <javac
-     encoding="${build.encoding}"
-     srcdir="${src.dir}"
-     includes="**/*.java"
-     destdir="${build.classes}"
-     debug="${javac.debug}"
-     optimize="${javac.optimize}"
-     deprecation="${javac.deprecation}">
-     <classpath refid="build.classpath"/>
-     <compilerarg line="${javac.args} ${javac.args.warnings}" />
-    </javac>
-  </target>
-
-  <!-- Override jar target to specify main class, and to include default
-       configuration file -->
-  <target name="jar" depends="compile">
-    <jar jarfile="${build.dir}/sudo-shell-${sudo-shell.version}.jar"
-         basedir="${build.classes}">
-      <manifest>
-        <attribute name="Main-Class" value="com.cloudera.hue.SudoFsShell"/>
-      </manifest>
-    </jar>
-  </target>
-
-</project>