Repository: orc
Updated Branches:
  refs/heads/master 32787e852 -> f949799c9


ORC-56. Update the cmake build system to build, test, and package the java
artifacts also. (omalley reviewed by swalkaus)

Fixes #26

Signed-off-by: Owen O'Malley <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/orc/repo
Commit: http://git-wip-us.apache.org/repos/asf/orc/commit/f949799c
Tree: http://git-wip-us.apache.org/repos/asf/orc/tree/f949799c
Diff: http://git-wip-us.apache.org/repos/asf/orc/diff/f949799c

Branch: refs/heads/master
Commit: f949799c9a57ab6d712b45536c44ab417d6ed829
Parents: 32787e8
Author: Owen O'Malley <[email protected]>
Authored: Mon May 23 10:49:26 2016 -0700
Committer: Owen O'Malley <[email protected]>
Committed: Wed May 25 16:21:50 2016 -0700

----------------------------------------------------------------------
 CMakeLists.txt             | 20 ++++++++++++------
 c++/src/CMakeLists.txt     |  4 +---
 c++/test/CMakeLists.txt    |  6 +++---
 docker/centos5/Dockerfile  | 46 -----------------------------------------
 docker/centos6/Dockerfile  |  9 +++++++-
 docker/centos7/Dockerfile  |  4 ++++
 docker/debian6/Dockerfile  | 38 ----------------------------------
 docker/debian7/Dockerfile  |  5 +++--
 docker/debian8/Dockerfile  | 39 ++++++++++++++++++++++++++++++++++
 docker/run-all.sh          |  2 +-
 docker/ubuntu12/Dockerfile |  5 +++--
 docker/ubuntu14/Dockerfile |  5 +++--
 docker/ubuntu16/Dockerfile | 39 ++++++++++++++++++++++++++++++++++
 java/CMakeLists.txt        | 39 ++++++++++++++++++++++++++++++++++
 java/core/pom.xml          | 13 ++++++++++--
 java/mapreduce/pom.xml     | 13 ++++++++++--
 java/pom.xml               | 11 +++++++++-
 java/storage-api/pom.xml   |  9 ++++++++
 18 files changed, 198 insertions(+), 109 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b10d416..be4bed2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -89,20 +89,28 @@ elseif (MSVC)
 
   set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} 
/NODEFAULTLIB:msvcrtd.lib")
 endif ()
-  
+
 enable_testing()
 
 set (EXAMPLE_DIRECTORY ${CMAKE_SOURCE_DIR}/examples)
 
 add_subdirectory(c++)
 add_subdirectory(tools)
+add_subdirectory(java)
 
 # Add another target called test-out that prints the results on failure
 if (CMAKE_CONFIGURATION_TYPES)
-  add_custom_target (test-out COMMAND ${CMAKE_CTEST_COMMAND}
-    --force-new-ctest-process --output-on-failure
-    --build-config "$<CONFIGURATION>")
+  add_custom_target (test-out
+    COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process
+      --output-on-failure --build-config "$<CONFIGURATION>"
+  )
 else (CMAKE_CONFIGURATION_TYPES)
-  add_custom_target (test-out COMMAND ${CMAKE_CTEST_COMMAND}
-    --force-new-ctest-process --output-on-failure)
+  add_custom_target (test-out
+    COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process
+      --output-on-failure
+  )
 endif (CMAKE_CONFIGURATION_TYPES)
+
+install(
+  FILES LICENSE NOTICE
+  DESTINATION .)

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/c++/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index faea222..75782f2 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -116,11 +116,9 @@ include_directories (
   )
 
 add_custom_command(OUTPUT orc_proto.pb.h orc_proto.pb.cc
-   COMMAND mkdir -p "${CMAKE_BINARY_DIR}/orc-java" &&
-     ${PROTOBUF_EXECUTABLE}
+   COMMAND ${PROTOBUF_EXECUTABLE}
         -I ${CMAKE_SOURCE_DIR}/proto
         --cpp_out="${CMAKE_CURRENT_BINARY_DIR}"
-        --java_out="${CMAKE_BINARY_DIR}/orc-java"
         "${CMAKE_SOURCE_DIR}/proto/orc_proto.proto"
 )
 

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/c++/test/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index 69a0f6b..f2f3845 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -22,7 +22,7 @@ include_directories(
 
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS} ${WARN_FLAGS}")
 
-add_executable (test-orc
+add_executable (orc-test
   TestByteRle.cc
   TestColumnPrinter.cc
   TestColumnReader.cc
@@ -34,7 +34,7 @@ add_executable (test-orc
   TestType.cc
 )
 
-target_link_libraries (test-orc
+target_link_libraries (orc-test
   orc
   ${PROTOBUF_LIBRARIES}
   ${GMOCK_LIBRARIES}
@@ -51,5 +51,5 @@ target_link_libraries (create-test-files
   ${PROTOBUF_LIBRARIES}
 )
 
-add_test (test-orc test-orc)
+add_test (NAME orc-test COMMAND orc-test)
 

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/centos5/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/centos5/Dockerfile b/docker/centos5/Dockerfile
deleted file mode 100644
index 8b4667f..0000000
--- a/docker/centos5/Dockerfile
+++ /dev/null
@@ -1,46 +0,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.
-
-# ORC compile for CentOS 5
-#
-
-FROM centos:5
-MAINTAINER Owen O'Malley <[email protected]>
-
-RUN yum check-update || true
-RUN yum install -y \
-  cmake \
-  curl-devel \
-  expat-devel \
-  gcc \
-  gcc-c++ \
-  gettext-devel \
-  make \
-  openssl-devel \
-  wget \
-  zlib-devel
-
-ENV TZ=America/Los_Angeles
-WORKDIR /root
-RUN wget https://github.com/git/git/archive/v2.7.0.tar.gz -O git.tgz
-RUN tar xzf git.tgz
-RUN cd git-2.7.0 && make prefix=/usr all install
-
-CMD git clone https://github.com/apache/orc.git -b master && \
-  mkdir orc/build && \
-  cd orc/build && \
-  cmake .. && \ 
-  make package test-out

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/centos6/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/centos6/Dockerfile b/docker/centos6/Dockerfile
index 043b7e8..86bcf64 100644
--- a/docker/centos6/Dockerfile
+++ b/docker/centos6/Dockerfile
@@ -29,12 +29,19 @@ RUN yum install -y \
   gcc-c++ \
   gettext-devel \
   git \
+  java-1.7.0-openjdk \
+  java-1.7.0-openjdk-devel \
   make \
   openssl-devel \
+  tar \
+  wget \
+  which \
   zlib-devel
 
-ENV TZ=America/Los_Angeles
 WORKDIR /root
+RUN wget 
http://apache.mesi.com.ar/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
 -O maven.tgz
+RUN tar xzf maven.tgz
+RUN ln -s /root/apache-maven-3.3.9/bin/mvn /usr/bin/mvn
 
 CMD git clone https://github.com/apache/orc.git -b master && \
   mkdir orc/build && \

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/centos7/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/centos7/Dockerfile b/docker/centos7/Dockerfile
index f5ede0e..22b3dd0 100644
--- a/docker/centos7/Dockerfile
+++ b/docker/centos7/Dockerfile
@@ -29,8 +29,12 @@ RUN yum install -y \
   gcc-c++ \
   gettext-devel \
   git \
+  java-1.7.0-openjdk \
+  java-1.7.0-openjdk-devel \
   make \
+  maven \
   openssl-devel \
+  which \
   zlib-devel
 
 ENV TZ=America/Los_Angeles

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/debian6/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/debian6/Dockerfile b/docker/debian6/Dockerfile
deleted file mode 100644
index ded7bd0..0000000
--- a/docker/debian6/Dockerfile
+++ /dev/null
@@ -1,38 +0,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.
-
-# ORC compile for Debian 6
-#
-
-FROM debian:6
-MAINTAINER Owen O'Malley <[email protected]>
-
-RUN apt-get update
-RUN apt-get install -y \
-  cmake \
-  gcc \
-  g++ \
-  git \
-  make
-
-ENV TZ=America/Los_Angeles
-WORKDIR /root
-
-CMD git clone https://github.com/apache/orc.git -b master && \
-  mkdir orc/build && \
-  cd orc/build && \
-  cmake .. && \ 
-  make package test-out

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/debian7/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/debian7/Dockerfile b/docker/debian7/Dockerfile
index ef0e146..45f32ba 100644
--- a/docker/debian7/Dockerfile
+++ b/docker/debian7/Dockerfile
@@ -26,9 +26,10 @@ RUN apt-get install -y \
   gcc \
   g++ \
   git \
-  make
+  make \
+  maven \
+  openjdk-7-jdk
 
-ENV TZ=America/Los_Angeles
 WORKDIR /root
 
 CMD git clone https://github.com/apache/orc.git -b master && \

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/debian8/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/debian8/Dockerfile b/docker/debian8/Dockerfile
new file mode 100644
index 0000000..81fe8e8
--- /dev/null
+++ b/docker/debian8/Dockerfile
@@ -0,0 +1,39 @@
+# 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.
+
+# ORC compile for Debian 8
+#
+
+FROM debian:8
+MAINTAINER Owen O'Malley <[email protected]>
+
+RUN apt-get update
+RUN apt-get install -y \
+  cmake \
+  gcc \
+  g++ \
+  git \
+  make \
+  maven \
+  openjdk-7-jdk
+
+WORKDIR /root
+
+CMD git clone https://github.com/apache/orc.git -b master && \
+  mkdir orc/build && \
+  cd orc/build && \
+  cmake .. && \
+  make package test-out

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/run-all.sh
----------------------------------------------------------------------
diff --git a/docker/run-all.sh b/docker/run-all.sh
index 79cb87b..2341130 100755
--- a/docker/run-all.sh
+++ b/docker/run-all.sh
@@ -20,7 +20,7 @@ URL=https://github.com/$GITHUB_USER/orc.git
 BRANCH=$2
 
 start=`date`
-for os in centos5 centos6 centos7 debian6 debian7 ubuntu12 ubuntu14; do
+for os in centos6 centos7 debian7 debian8 ubuntu12 ubuntu14 ubuntu16; do
   echo "Testing $os"
   ( cd $os && docker build -t "orc-$os" . )
   docker run "orc-$os" /bin/bash -c "git clone $URL -b $BRANCH && mkdir 
orc/build && cd orc/build && cmake .. && make package test-out" || exit 1

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/ubuntu12/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/ubuntu12/Dockerfile b/docker/ubuntu12/Dockerfile
index ca3c430..e424018 100644
--- a/docker/ubuntu12/Dockerfile
+++ b/docker/ubuntu12/Dockerfile
@@ -26,9 +26,10 @@ RUN apt-get install -y \
   gcc \
   g++ \
   git \
-  make
+  make \
+  maven \
+  openjdk-7-jdk
 
-ENV TZ=America/Los_Angeles
 WORKDIR /root
 
 CMD git clone https://github.com/apache/orc.git -b master && \

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/ubuntu14/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/ubuntu14/Dockerfile b/docker/ubuntu14/Dockerfile
index d789a71..67dc289 100644
--- a/docker/ubuntu14/Dockerfile
+++ b/docker/ubuntu14/Dockerfile
@@ -26,9 +26,10 @@ RUN apt-get install -y \
   gcc \
   g++ \
   git \
-  make
+  make \
+  maven \
+  openjdk-7-jdk
 
-ENV TZ=America/Los_Angeles
 WORKDIR /root
 
 CMD git clone https://github.com/apache/orc.git -b master && \

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/docker/ubuntu16/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/ubuntu16/Dockerfile b/docker/ubuntu16/Dockerfile
new file mode 100644
index 0000000..5ee0491
--- /dev/null
+++ b/docker/ubuntu16/Dockerfile
@@ -0,0 +1,39 @@
+# 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.
+
+# ORC compile for Ubuntu 16
+#
+
+FROM ubuntu:16.04
+MAINTAINER Owen O'Malley <[email protected]>
+
+RUN apt-get update
+RUN apt-get install -y \
+  cmake \
+  default-jdk \
+  gcc \
+  g++ \
+  git \
+  make \
+  maven
+
+WORKDIR /root
+
+CMD git clone https://github.com/apache/orc.git -b master && \
+  mkdir orc/build && \
+  cd orc/build && \
+  cmake .. && \
+  make package test-out

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/java/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
new file mode 100644
index 0000000..f0b6eb3
--- /dev/null
+++ b/java/CMakeLists.txt
@@ -0,0 +1,39 @@
+# Licensed 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.
+
+# set the version in the POM file to match the CMake version string
+execute_process(COMMAND mvn versions:set -DnewVersion=${ORC_VERSION}
+                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+set(ORC_JARS
+  ${CMAKE_CURRENT_BINARY_DIR}/storage-api/hive-storage-api-2.0.2-pre-orc.jar
+  ${CMAKE_CURRENT_BINARY_DIR}/core/orc-core-${ORC_VERSION}.jar
+  ${CMAKE_CURRENT_BINARY_DIR}/mapreduce/orc-mapreduce-${ORC_VERSION}.jar
+)
+
+add_custom_command(
+   OUTPUT ${ORC_JARS}
+   COMMAND mvn -Pcmake -Dbuild.dir=${CMAKE_CURRENT_BINARY_DIR} -DskipTests 
package
+   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+   COMMENT "Build the java directory"
+   VERBATIM)
+
+add_custom_target(java_build ALL DEPENDS ${ORC_JARS})
+
+add_test(
+  NAME java-test
+  COMMAND mvn -Pcmake -Dbuild.dir=${CMAKE_CURRENT_BINARY_DIR} test
+  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+install(
+  FILES ${ORC_JARS}
+  DESTINATION share)

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/java/core/pom.xml
----------------------------------------------------------------------
diff --git a/java/core/pom.xml b/java/core/pom.xml
index c3efa0b..fcff5bf 100644
--- a/java/core/pom.xml
+++ b/java/core/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.apache.orc</groupId>
     <artifactId>orc</artifactId>
-    <version>1.1.0-SNAPSHOT</version>
+    <version>1.1.0</version>
     <relativePath>../pom.xml</relativePath>
   </parent>
 
@@ -136,7 +136,7 @@
             </goals>
             <configuration>
               <sources>
-                <source>target/generated-sources</source>
+                <source>${project.build.directory}/generated-sources</source>
               </sources>
             </configuration>
           </execution>
@@ -176,4 +176,13 @@
       </plugin>
     </plugins>
   </build>
+
+  <profiles>
+    <profile>
+      <id>cmake</id>
+      <build>
+        <directory>${build.dir}/core</directory>
+      </build>
+    </profile>
+  </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/java/mapreduce/pom.xml
----------------------------------------------------------------------
diff --git a/java/mapreduce/pom.xml b/java/mapreduce/pom.xml
index cbb625f..c7ac02d 100644
--- a/java/mapreduce/pom.xml
+++ b/java/mapreduce/pom.xml
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.apache.orc</groupId>
     <artifactId>orc</artifactId>
-    <version>1.1.0-SNAPSHOT</version>
+    <version>1.1.0</version>
     <relativePath>../pom.xml</relativePath>
   </parent>
 
@@ -31,7 +31,7 @@
     <dependency>
       <groupId>org.apache.orc</groupId>
       <artifactId>orc-core</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
+      <version>1.1.0</version>
     </dependency>
 
     <!-- inter-project -->
@@ -140,4 +140,13 @@
       </plugin>
     </plugins>
   </build>
+
+  <profiles>
+    <profile>
+      <id>cmake</id>
+      <build>
+        <directory>${build.dir}/mapreduce</directory>
+      </build>
+    </profile>
+  </profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/java/pom.xml
----------------------------------------------------------------------
diff --git a/java/pom.xml b/java/pom.xml
index 7ce1161..a78a0ec 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -21,7 +21,7 @@
   </parent>
   <groupId>org.apache.orc</groupId>
   <artifactId>orc</artifactId>
-  <version>1.1.0-SNAPSHOT</version>
+  <version>1.1.0</version>
   <packaging>pom</packaging>
 
   <name>ORC</name>
@@ -99,6 +99,15 @@
     </plugins>
   </build>
 
+  <profiles>
+    <profile>
+      <id>cmake</id>
+      <build>
+        <directory>${build.dir}</directory>
+      </build>
+    </profile>
+  </profiles>
+
   <dependencies>
     <!-- global dependencies -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/orc/blob/f949799c/java/storage-api/pom.xml
----------------------------------------------------------------------
diff --git a/java/storage-api/pom.xml b/java/storage-api/pom.xml
index 7636446..cb4bf1d 100644
--- a/java/storage-api/pom.xml
+++ b/java/storage-api/pom.xml
@@ -75,4 +75,13 @@
       </plugin>
     </plugins>
   </build>
+
+  <profiles>
+    <profile>
+      <id>cmake</id>
+      <build>
+        <directory>${build.dir}/storage-api</directory>
+      </build>
+    </profile>
+  </profiles>
 </project>

Reply via email to