Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #
  2. # Licensed to Cloudera, Inc. under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. Cloudera, Inc. licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. ifeq ($(ROOT),)
  19. $(error "Error: Expect the environment variable $$ROOT to point to the Desktop installation")
  20. endif
  21. APP_NAME = spark
  22. include $(ROOT)/Makefile.sdk
  23. SPARK_ROOT := $(realpath .)
  24. JAVA_LIB = $(SPARK_ROOT)/java-lib
  25. LIVY_VERSION = 0.2.0-SNAPSHOT
  26. LIVY_DIR = $(SPARK_ROOT)/java
  27. LIVY_TARGET_DIR = $(LIVY_DIR)/livy-assembly/target/scala-2.10
  28. LIVY_ASSEMBLY_JAR = livy-assembly-$(LIVY_VERSION).jar
  29. LIVY_JAR = $(JAVA_LIB)/livy-assembly.jar
  30. HAVE_JAVA_SRC = $(wildcard $(LIVY_DIR))
  31. compile: $(LIVY_JAR)
  32. ifneq (,$(wildcard $(LIVY_DIR)))
  33. $(LIVY_JAR): $(shell find $(LIVY_DIR) -type f)
  34. mkdir -p $(JAVA_LIB)
  35. @echo "--- Building Desktop spark"
  36. cd $(LIVY_DIR) && mvn clean install -DskipTests $(MAVEN_OPTIONS)
  37. cp $(LIVY_TARGET_DIR)/$(LIVY_ASSEMBLY_JAR) $(LIVY_JAR)
  38. clean::
  39. rm -Rf $(JAVA_LIB)
  40. cd $(LIVY_DIR) && mvn clean $(MAVEN_OPTIONS) || :
  41. else
  42. $(LIVY_JAR):
  43. $(error Cannot build spark jars without source)
  44. endif
  45. BDIST_EXCLUDES += \
  46. --exclude=java
  47. SDIST_EXCLUDES += \
  48. --exclude=java-lib