You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/12/24 16:26:45 UTC

[arrow] branch master updated: ARROW-3938: [Packaging] Stop to refer java/pom.xml to get version information

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 385c438  ARROW-3938: [Packaging] Stop to refer java/pom.xml to get version information
385c438 is described below

commit 385c4384eb0dcc384b443f24765c64e9d6d88d28
Author: Kouhei Sutou <ko...@clear-code.com>
AuthorDate: Mon Dec 24 10:26:37 2018 -0600

    ARROW-3938: [Packaging] Stop to refer java/pom.xml to get version information
    
    Author: Kouhei Sutou <ko...@clear-code.com>
    
    Closes #3259 from kou/stop-to-refer-pom-xml-for-version and squashes the following commits:
    
    3dce0a035 <Kouhei Sutou>  Stop to refer java/pom.xml to get version information
---
 c_glib/Makefile.am                                 |  3 +-
 c_glib/configure.ac                                |  8 +-
 c_glib/doc/parquet-glib/parquet-glib-docs.xml      |  4 +
 c_glib/meson.build                                 |  3 +-
 c_glib/test/test-cuda.rb                           |  2 +-
 c_glib/tool/Makefile.am                            | 19 -----
 c_glib/tool/get-version.py                         | 29 -------
 cpp/CMakeLists.txt                                 |  8 +-
 cpp/src/gandiva/CMakeLists.txt                     |  2 +
 cpp/src/plasma/CMakeLists.txt                      |  1 +
 dev/release/00-prepare.sh                          | 92 +++++++++++++++++++---
 matlab/CMakeLists.txt                              |  6 +-
 python/setup.py                                    | 30 +------
 r/DESCRIPTION                                      |  2 +-
 ruby/red-arrow-cuda/.gitignore                     |  2 -
 .../{test/helper.rb => lib/arrow-cuda/version.rb}  | 13 +--
 ruby/red-arrow-cuda/red-arrow-cuda.gemspec         |  6 +-
 ruby/red-arrow-cuda/test/helper.rb                 |  3 -
 ruby/red-arrow-cuda/version.rb                     | 71 -----------------
 ruby/red-arrow/.gitignore                          |  2 -
 .../helper.rb => red-arrow/lib/arrow/version.rb}   | 13 +--
 ruby/red-arrow/red-arrow.gemspec                   |  6 +-
 ruby/red-arrow/test/helper.rb                      |  2 -
 ruby/red-arrow/version.rb                          | 71 -----------------
 ruby/red-gandiva/.gitignore                        |  2 -
 .../lib/gandiva/version.rb}                        | 13 +--
 ruby/red-gandiva/red-gandiva.gemspec               |  6 +-
 ruby/red-gandiva/test/helper.rb                    |  3 -
 ruby/red-gandiva/version.rb                        | 71 -----------------
 ruby/red-parquet/.gitignore                        |  2 -
 .../lib/parquet/version.rb}                        | 13 +--
 ruby/red-parquet/red-parquet.gemspec               |  6 +-
 ruby/red-parquet/test/helper.rb                    |  3 -
 ruby/red-parquet/version.rb                        | 71 -----------------
 ruby/red-plasma/.gitignore                         |  2 -
 .../helper.rb => red-plasma/lib/plasma/version.rb} | 13 +--
 ruby/red-plasma/red-plasma.gemspec                 |  6 +-
 ruby/red-plasma/test/helper.rb                     |  3 -
 ruby/red-plasma/version.rb                         | 71 -----------------
 39 files changed, 157 insertions(+), 526 deletions(-)

diff --git a/c_glib/Makefile.am b/c_glib/Makefile.am
index 149894c..53bb57e 100644
--- a/c_glib/Makefile.am
+++ b/c_glib/Makefile.am
@@ -24,8 +24,7 @@ SUBDIRS =					\
 	parquet-glib				\
 	plasma-glib				\
 	doc					\
-	example					\
-	tool
+	example
 
 EXTRA_DIST =					\
 	Gemfile					\
diff --git a/c_glib/configure.ac b/c_glib/configure.ac
index a6d8ed8..c63bfff 100644
--- a/c_glib/configure.ac
+++ b/c_glib/configure.ac
@@ -17,12 +17,7 @@
 
 AC_PREREQ(2.65)
 
-m4_define([arrow_glib_version],
-           m4_esyscmd(grep "^  <version>" "$(dirname $0)/../java/pom.xml" | \
-                        sed -E \
-                            -e 's/(^  <version>)//g' \
-                            -e 's/(<\/version>$)//g' | \
-                        tr -d '\n'))
+m4_define([arrow_glib_version], 0.12.0-SNAPSHOT)
 AC_INIT([arrow-glib],
         arrow_glib_version,
         [https://issues.apache.org/jira/browse/ARROW],
@@ -283,7 +278,6 @@ AC_CONFIG_FILES([
   doc/plasma-glib/entities.xml
   example/Makefile
   example/lua/Makefile
-  tool/Makefile
 ])
 
 AC_OUTPUT
diff --git a/c_glib/doc/parquet-glib/parquet-glib-docs.xml b/c_glib/doc/parquet-glib/parquet-glib-docs.xml
index 0f2c30b..4485a67 100644
--- a/c_glib/doc/parquet-glib/parquet-glib-docs.xml
+++ b/c_glib/doc/parquet-glib/parquet-glib-docs.xml
@@ -57,6 +57,10 @@
     <title>Index of deprecated API</title>
     <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
   </index>
+  <index id="api-index-0-12-0" role="0.12.0">
+    <title>Index of new symbols in 0.12.0</title>
+    <xi:include href="xml/api-index-0.12.0.xml"><xi:fallback /></xi:include>
+  </index>
   <index id="api-index-0-11-0" role="0.11.0">
     <title>Index of new symbols in 0.11.0</title>
     <xi:include href="xml/api-index-0.11.0.xml"><xi:fallback /></xi:include>
diff --git a/c_glib/meson.build b/c_glib/meson.build
index 194421c..c2cf36c 100644
--- a/c_glib/meson.build
+++ b/c_glib/meson.build
@@ -23,8 +23,7 @@ project('arrow-glib', 'c', 'cpp',
           'cpp_std=c++11',
         ])
 
-python = find_program('python', 'python3', 'python2')
-version = run_command(python, 'tool/get-version.py').stdout().strip()
+version = '0.12.0-SNAPSHOT'
 if version.endswith('-SNAPSHOT')
   version_numbers = version.split('-')[0].split('.')
   version_tag = version.split('-')[1]
diff --git a/c_glib/test/test-cuda.rb b/c_glib/test/test-cuda.rb
index 32d486e..ae91530 100644
--- a/c_glib/test/test-cuda.rb
+++ b/c_glib/test/test-cuda.rb
@@ -58,7 +58,7 @@ Gio = GI.load("Gio")
 Arrow = GI.load("Arrow")
 ArrowCUDA = GI.load("ArrowCUDA")
 
-manager = ArrowCUDA::ADeviceManager.new
+manager = ArrowCUDA::DeviceManager.new
 context = manager.get_context(0)
 serialized_handle = #{serialized_handle.to_s.dump}
 handle = ArrowCUDA::IPCMemoryHandle.new(serialized_handle)
diff --git a/c_glib/tool/Makefile.am b/c_glib/tool/Makefile.am
deleted file mode 100644
index 5d7498b..0000000
--- a/c_glib/tool/Makefile.am
+++ /dev/null
@@ -1,19 +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.
-
-EXTRA_DIST =					\
-	get-version.py
diff --git a/c_glib/tool/get-version.py b/c_glib/tool/get-version.py
deleted file mode 100755
index aacea6d..0000000
--- a/c_glib/tool/get-version.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python
-#
-# 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.
-
-import os
-import re
-
-root = os.environ.get("MESON_SOURCE_ROOT", ".")
-pom_xml = os.path.join(root, "..", "java", "pom.xml")
-with open(pom_xml) as pom:
-    version_tag = re.search('^  <version>(.+)</version>',
-                            pom.read(),
-                            re.MULTILINE)
-    print(version_tag.group(1))
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 1672245..006b406 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -18,12 +18,8 @@
 cmake_minimum_required(VERSION 3.2)
 message(STATUS "Building using CMake version: ${CMAKE_VERSION}")
 
-# Extract Arrow version number
-file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../java/pom.xml" POM_XML)
-string(REGEX MATCHALL
-  "\n  <version>[^<]+</version>" ARROW_VERSION_TAG "${POM_XML}")
-string(REGEX REPLACE
-  "(\n  <version>|</version>)" "" ARROW_VERSION "${ARROW_VERSION_TAG}")
+set(ARROW_VERSION "0.12.0-SNAPSHOT")
+
 string(REGEX MATCH
   "^[0-9]+\\.[0-9]+\\.[0-9]+" ARROW_BASE_VERSION "${ARROW_VERSION}")
 
diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt
index d28c372..b574c67 100644
--- a/cpp/src/gandiva/CMakeLists.txt
+++ b/cpp/src/gandiva/CMakeLists.txt
@@ -15,6 +15,8 @@
 # specific language governing permissions and limitations
 # under the License.
 
+set(GANDIVA_VERSION "${ARROW_VERSION}")
+
 # For "make gandiva" to build everything Gandiva-related
 add_custom_target(gandiva-all)
 add_custom_target(gandiva)
diff --git a/cpp/src/plasma/CMakeLists.txt b/cpp/src/plasma/CMakeLists.txt
index a71acf8..2be5740 100644
--- a/cpp/src/plasma/CMakeLists.txt
+++ b/cpp/src/plasma/CMakeLists.txt
@@ -23,6 +23,7 @@ add_dependencies(plasma-all plasma plasma-tests plasma-benchmarks)
 
 # For the moment, Plasma is versioned like Arrow
 project(plasma VERSION "${ARROW_BASE_VERSION}")
+set(PLASMA_VERSION "${ARROW_VERSION}")
 
 find_package(Threads)
 
diff --git a/dev/release/00-prepare.sh b/dev/release/00-prepare.sh
index 5ff4ddc..35d1998 100755
--- a/dev/release/00-prepare.sh
+++ b/dev/release/00-prepare.sh
@@ -21,6 +21,78 @@ set -e
 
 SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
+update_versions() {
+  local version=$1
+
+  cd "${SOURCE_DIR}/../../cpp"
+  sed -i.bak -r -e \
+    "s/^set\(ARROW_VERSION \".+\"\)/set(ARROW_VERSION \"${version}\")/" \
+    CMakeLists.txt
+  rm -f CMakeLists.txt.bak
+  git add CMakeLists.txt
+  cd -
+
+  cd "${SOURCE_DIR}/../../c_glib"
+  sed -i.bak -r -e \
+    "s/^m4_define\(\[arrow_glib_version\], .+\)/m4_define([arrow_glib_version], ${version})/" \
+    configure.ac
+  sed -i.bak -r -e \
+    "s/^version = '.+'/version = '${version}'/" \
+    meson.build
+  rm -f configure.ac.bak meson.build.bak
+  git add configure.ac meson.build
+  cd -
+
+  # We can enable this when Arrow JS uses the same version.
+  # cd "${SOURCE_DIR}/../../js"
+  # sed -i.bak -r -e \
+  #   "s/^  \"version\": \".+\"/  \"version\": \"${version}\"/" \
+  #   package.json
+  # rm -f package.json
+  # git add package.json
+  # cd -
+
+  cd "${SOURCE_DIR}/../../matlab"
+  sed -i.bak -r -e \
+    "s/^set\(MLARROW_VERSION \".+\"\)/set(MLARROW_VERSION \"${version}\")/" \
+    CMakeLists.txt
+  rm -f CMakeLists.txt.bak
+  git add CMakeLists.txt
+  cd -
+
+  cd "${SOURCE_DIR}/../../python"
+  sed -i.bak -r -e \
+    "s/^default_version: '.+'/default_version = '${version}'/" \
+    setup.py
+  rm -f setup.py.bak
+  git add setup.py
+  cd -
+
+  cd "${SOURCE_DIR}/../../r"
+  sed -i.bak -r -e \
+    "s/^Version: .+/Version: ${version}/" \
+    DESCRIPTION
+  rm -f DESCRIPTION.bak
+  git add DESCRIPTION
+  cd -
+
+  cd "${SOURCE_DIR}/../../ruby"
+  sed -i.bak -r -e \
+    "s/^  VERSION = \".+\"/  VERSION = \"${version}\"/g" \
+    */*/*/version.rb
+  rm -f */*/*/version.rb.bak
+  git add */*/*/version.rb
+  cd -
+
+  cd "${SOURCE_DIR}/../../rust"
+  sed -i.bak -r -e \
+    "s/^version = \".+\"/version = \"${version}\"/g" \
+    Cargo.toml
+  rm -f Cargo.toml.bak
+  git add Cargo.toml
+  cd -
+}
+
 if [ "$#" -eq 2 ]; then
   version=$1
   nextVersion=$2
@@ -43,14 +115,19 @@ if [ "$#" -eq 2 ]; then
 
   echo "prepare release ${version} on tag ${tag} then reset to version ${nextVersionSNAPSHOT}"
 
-  cd "${SOURCE_DIR}/../../java"
+  update_versions "${version}"
+  git commit -m "[Release] Update versions for ${version}"
 
+  cd "${SOURCE_DIR}/../../java"
   mvn release:clean
   mvn release:prepare -Dtag=${tag} -DreleaseVersion=${version} -DautoVersionSubmodules -DdevelopmentVersion=${nextVersionSNAPSHOT}
-
   cd -
 
-  echo "Updating .deb package names for $nextVersion"
+  echo "Updating versions for ${nextVersionSNAPSHOT}"
+  update_versions "${nextVersionSNAPSHOT}"
+  git commit -m "[Release] Update versions for ${nextVersionSNAPSHOT}"
+
+  echo "Updating .deb package names for ${nextVersion}"
   deb_lib_suffix=$(echo $version | sed -r -e 's/^[0-9]+\.([0-9]+)\.[0-9]+$/\1/')
   next_deb_lib_suffix=$(echo $nextVersion | sed -r -e 's/^[0-9]+\.([0-9]+)\.[0-9]+$/\1/')
   cd $SOURCE_DIR/../tasks/linux-packages/
@@ -76,15 +153,6 @@ if [ "$#" -eq 2 ]; then
   git commit -m "[Release] Update .deb package names for $nextVersion"
   cd -
 
-  echo "prepare release ${version} in Rust crate"
-
-  cd "${SOURCE_DIR}/../../rust"
-  sed -i.bak -r -e "s/version = \"$version\"/version = \"$nextVersion\"/g" Cargo.toml
-  rm -f Cargo.toml.bak
-  git add Cargo.toml
-  git commit -m "[Release] Update Rust Cargo.toml version for $nextVersion"
-  cd -
-
   echo "Finish staging binary artifacts by running: sh dev/release/01-perform.sh"
 
 else
diff --git a/matlab/CMakeLists.txt b/matlab/CMakeLists.txt
index 8970866..a6371d1 100755
--- a/matlab/CMakeLists.txt
+++ b/matlab/CMakeLists.txt
@@ -18,7 +18,11 @@
 cmake_minimum_required(VERSION 3.2)
 set(CMAKE_CXX_STANDARD 11)
 
-project(mlarrow)
+set(MLARROW_VERSION "0.12.0-SNAPSHOT")
+string(REGEX MATCH
+  "^[0-9]+\\.[0-9]+\\.[0-9]+" MLARROW_BASE_VERSION "${MLARROW_VERSION}")
+
+project(mlarrow VERSION "${MLARROW_BASE_VERSION}")
 
 # Grab CMAKE Modules from the CPP interface
 set(CPP_CMAKE_MODULES "${CMAKE_SOURCE_DIR}/../cpp/cmake_modules")
diff --git a/python/setup.py b/python/setup.py
index b8d192d..7428519 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -483,39 +483,15 @@ def _move_shared_libs_unix(build_prefix, build_lib, lib_name):
 
 # If the event of not running from a git clone (e.g. from a git archive
 # or a Python sdist), see if we can set the version number ourselves
+default_version = '0.12.0-SNAPSHOT'
 if (not os.path.exists('../.git')
         and not os.environ.get('SETUPTOOLS_SCM_PRETEND_VERSION')):
     if os.path.exists('PKG-INFO'):
         # We're probably in a Python sdist, setuptools_scm will handle fine
         pass
-    elif os.path.exists('../java/pom.xml'):
-        # We're probably in a git archive
-        import xml.etree.ElementTree as ET
-        tree = ET.parse('../java/pom.xml')
-        version_tag = list(tree.getroot().findall(
-            '{http://maven.apache.org/POM/4.0.0}version'))[0]
-        use_setuptools_scm = False
-        os.environ['SETUPTOOLS_SCM_PRETEND_VERSION'] = \
-            version_tag.text.replace("-SNAPSHOT", "a0")
     else:
-        raise RuntimeError("""\
-            No reliable source available to get Arrow version.
-
-            This is either because you copied the python/ directory yourself
-            outside of a git clone or source archive, or because you ran
-            `pip install` on the python/ directory.
-
-            * Recommended workaround: first run `python sdist`, then
-              `pip install` the resulting source distribution.
-
-            * If you're looking for an editable (in-place) install,
-              `python setup.py develop` should work fine in place of
-              `pip install -e .`.
-
-            * If you really want to `pip install` the python/ directory,
-              set the SETUPTOOLS_SCM_PRETEND_VERSION environment variable
-              to force the Arrow version to the given value.
-            """)
+        os.environ['SETUPTOOLS_SCM_PRETEND_VERSION'] = \
+            default_version.replace('-SNAPSHOT', 'a0')
 
 
 def parse_git(root, **kwargs):
diff --git a/r/DESCRIPTION b/r/DESCRIPTION
index 5f93c83..10c28c3 100644
--- a/r/DESCRIPTION
+++ b/r/DESCRIPTION
@@ -1,6 +1,6 @@
 Package: arrow
 Title: R Integration to 'Apache' 'Arrow'
-Version: 0.0.0.9000
+Version: 0.12.0-SNAPSHOT
 Authors@R: c(
     person("Romain", "François", email = "romain@rstudio.com", role = c("aut", "cre")),
     person("Javier", "Luraschi", email = "javier@rstudio.com", role = c("ctb")),
diff --git a/ruby/red-arrow-cuda/.gitignore b/ruby/red-arrow-cuda/.gitignore
index 3ec5511..779545d 100644
--- a/ruby/red-arrow-cuda/.gitignore
+++ b/ruby/red-arrow-cuda/.gitignore
@@ -15,6 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-/lib/arrow-cuda/version.rb
-
 /pkg/
diff --git a/ruby/red-arrow-cuda/test/helper.rb b/ruby/red-arrow-cuda/lib/arrow-cuda/version.rb
similarity index 80%
copy from ruby/red-arrow-cuda/test/helper.rb
copy to ruby/red-arrow-cuda/lib/arrow-cuda/version.rb
index 4d01833..6426d2d 100644
--- a/ruby/red-arrow-cuda/test/helper.rb
+++ b/ruby/red-arrow-cuda/lib/arrow-cuda/version.rb
@@ -15,9 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../../red-arrow/version"
-require_relative "../version"
+module ArrowCUDA
+  VERSION = "0.12.0-SNAPSHOT"
 
-require "arrow-cuda"
-
-require "test-unit"
+  module Version
+    numbers, TAG = VERSION.split("-")
+    MAJOR, MINOR, MICRO = numbers.split(".").collect(&:to_i)
+    STRING = VERSION
+  end
+end
diff --git a/ruby/red-arrow-cuda/red-arrow-cuda.gemspec b/ruby/red-arrow-cuda/red-arrow-cuda.gemspec
index b2ee982..0c593ff 100644
--- a/ruby/red-arrow-cuda/red-arrow-cuda.gemspec
+++ b/ruby/red-arrow-cuda/red-arrow-cuda.gemspec
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "version"
+require_relative "lib/arrow-cuda/version"
 
 Gem::Specification.new do |spec|
   spec.name = "red-arrow-cuda"
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
     ArrowCUDA::Version::MAJOR.to_s,
     ArrowCUDA::Version::MINOR.to_s,
     ArrowCUDA::Version::MICRO.to_s,
-    # "beta1",
+    ArrowCUDA::Version::TAG,
   ]
-  spec.version = version_components.join(".")
+  spec.version = version_components.compact.join(".")
   spec.homepage = "https://arrow.apache.org/"
   spec.authors = ["Apache Arrow Developers"]
   spec.email = ["dev@arrow.apache.org"]
diff --git a/ruby/red-arrow-cuda/test/helper.rb b/ruby/red-arrow-cuda/test/helper.rb
index 4d01833..045eb10 100644
--- a/ruby/red-arrow-cuda/test/helper.rb
+++ b/ruby/red-arrow-cuda/test/helper.rb
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../../red-arrow/version"
-require_relative "../version"
-
 require "arrow-cuda"
 
 require "test-unit"
diff --git a/ruby/red-arrow-cuda/version.rb b/ruby/red-arrow-cuda/version.rb
deleted file mode 100644
index c8bbbc7..0000000
--- a/ruby/red-arrow-cuda/version.rb
+++ /dev/null
@@ -1,71 +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.
-
-require "pathname"
-
-version_rb_path = Pathname.new(__FILE__)
-base_dir = version_rb_path.dirname
-pom_xml_path = base_dir.join("..", "..", "java", "pom.xml")
-lib_version_rb_path = base_dir.join("lib", "arrow-cuda", "version.rb")
-
-need_update = false
-if not lib_version_rb_path.exist?
-  need_update = true
-elsif version_rb_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-elsif pom_xml_path.exist? and pom_xml_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-end
-
-if need_update
-  version = pom_xml_path.read.scan(/^  <version>(.+?)<\/version>/)[0][0]
-  major, minor, micro, tag = version.split(/[.-]/)
-  lib_version_rb_path.open("w") do |lib_version_rb|
-    lib_version_rb.puts(<<-RUBY)
-# 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.
-
-module ArrowCUDA
-  module Version
-    MAJOR = #{major}
-    MINOR = #{minor}
-    MICRO = #{micro}
-    TAG = #{tag ? tag.dump : nil}
-    STRING = #{version.dump}
-  end
-
-  VERSION = Version::STRING
-end
-    RUBY
-  end
-end
-
-require_relative "lib/arrow-cuda/version"
diff --git a/ruby/red-arrow/.gitignore b/ruby/red-arrow/.gitignore
index 9fcc9cd..779545d 100644
--- a/ruby/red-arrow/.gitignore
+++ b/ruby/red-arrow/.gitignore
@@ -15,6 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-/lib/arrow/version.rb
-
 /pkg/
diff --git a/ruby/red-arrow-cuda/test/helper.rb b/ruby/red-arrow/lib/arrow/version.rb
similarity index 80%
copy from ruby/red-arrow-cuda/test/helper.rb
copy to ruby/red-arrow/lib/arrow/version.rb
index 4d01833..8ff0779 100644
--- a/ruby/red-arrow-cuda/test/helper.rb
+++ b/ruby/red-arrow/lib/arrow/version.rb
@@ -15,9 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../../red-arrow/version"
-require_relative "../version"
+module Arrow
+  VERSION = "0.12.0-SNAPSHOT"
 
-require "arrow-cuda"
-
-require "test-unit"
+  module Version
+    numbers, TAG = VERSION.split("-")
+    MAJOR, MINOR, MICRO = numbers.split(".").collect(&:to_i)
+    STRING = VERSION
+  end
+end
diff --git a/ruby/red-arrow/red-arrow.gemspec b/ruby/red-arrow/red-arrow.gemspec
index 3f0f68a..9db755f 100644
--- a/ruby/red-arrow/red-arrow.gemspec
+++ b/ruby/red-arrow/red-arrow.gemspec
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "version"
+require_relative "lib/arrow/version"
 
 Gem::Specification.new do |spec|
   spec.name = "red-arrow"
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
     Arrow::Version::MAJOR.to_s,
     Arrow::Version::MINOR.to_s,
     Arrow::Version::MICRO.to_s,
-    # "beta1",
+    Arrow::Version::TAG,
   ]
-  spec.version = version_components.join(".")
+  spec.version = version_components.compact.join(".")
   spec.homepage = "https://arrow.apache.org/"
   spec.authors = ["Apache Arrow Developers"]
   spec.email = ["dev@arrow.apache.org"]
diff --git a/ruby/red-arrow/test/helper.rb b/ruby/red-arrow/test/helper.rb
index 2aa868b..12f12d3 100644
--- a/ruby/red-arrow/test/helper.rb
+++ b/ruby/red-arrow/test/helper.rb
@@ -15,8 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../version"
-
 require "arrow"
 
 require "pathname"
diff --git a/ruby/red-arrow/version.rb b/ruby/red-arrow/version.rb
deleted file mode 100644
index e8f043f..0000000
--- a/ruby/red-arrow/version.rb
+++ /dev/null
@@ -1,71 +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.
-
-require "pathname"
-
-version_rb_path = Pathname.new(__FILE__)
-base_dir = version_rb_path.dirname
-pom_xml_path = base_dir.join("..", "..", "java", "pom.xml")
-lib_version_rb_path = base_dir.join("lib", "arrow", "version.rb")
-
-need_update = false
-if not lib_version_rb_path.exist?
-  need_update = true
-elsif version_rb_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-elsif pom_xml_path.exist? and pom_xml_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-end
-
-if need_update
-  version = pom_xml_path.read.scan(/^  <version>(.+?)<\/version>/)[0][0]
-  major, minor, micro, tag = version.split(/[.-]/)
-  lib_version_rb_path.open("w") do |lib_version_rb|
-    lib_version_rb.puts(<<-RUBY)
-# 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.
-
-module Arrow
-  module Version
-    MAJOR = #{major}
-    MINOR = #{minor}
-    MICRO = #{micro}
-    TAG = #{tag ? tag.dump : nil}
-    STRING = #{version.dump}
-  end
-
-  VERSION = Version::STRING
-end
-    RUBY
-  end
-end
-
-require_relative "lib/arrow/version"
diff --git a/ruby/red-gandiva/.gitignore b/ruby/red-gandiva/.gitignore
index 99c64a5..779545d 100644
--- a/ruby/red-gandiva/.gitignore
+++ b/ruby/red-gandiva/.gitignore
@@ -15,6 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-/lib/gandiva/version.rb
-
 /pkg/
diff --git a/ruby/red-arrow-cuda/test/helper.rb b/ruby/red-gandiva/lib/gandiva/version.rb
similarity index 80%
copy from ruby/red-arrow-cuda/test/helper.rb
copy to ruby/red-gandiva/lib/gandiva/version.rb
index 4d01833..dbdaf36 100644
--- a/ruby/red-arrow-cuda/test/helper.rb
+++ b/ruby/red-gandiva/lib/gandiva/version.rb
@@ -15,9 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../../red-arrow/version"
-require_relative "../version"
+module Gandiva
+  VERSION = "0.12.0-SNAPSHOT"
 
-require "arrow-cuda"
-
-require "test-unit"
+  module Version
+    numbers, TAG = VERSION.split("-")
+    MAJOR, MINOR, MICRO = numbers.split(".").collect(&:to_i)
+    STRING = VERSION
+  end
+end
diff --git a/ruby/red-gandiva/red-gandiva.gemspec b/ruby/red-gandiva/red-gandiva.gemspec
index 7f84faf..857559e 100644
--- a/ruby/red-gandiva/red-gandiva.gemspec
+++ b/ruby/red-gandiva/red-gandiva.gemspec
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "version"
+require_relative "lib/gandiva/version"
 
 Gem::Specification.new do |spec|
   spec.name = "red-gandiva"
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
     Gandiva::Version::MAJOR.to_s,
     Gandiva::Version::MINOR.to_s,
     Gandiva::Version::MICRO.to_s,
-    # "beta1",
+    Gandiva::Version::TAG,
   ]
-  spec.version = version_components.join(".")
+  spec.version = version_components.compact.join(".")
   spec.homepage = "https://arrow.apache.org/"
   spec.authors = ["Apache Arrow Developers"]
   spec.email = ["dev@arrow.apache.org"]
diff --git a/ruby/red-gandiva/test/helper.rb b/ruby/red-gandiva/test/helper.rb
index 2f4e7dc..9c291f7 100644
--- a/ruby/red-gandiva/test/helper.rb
+++ b/ruby/red-gandiva/test/helper.rb
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../../red-arrow/version"
-require_relative "../version"
-
 require "gandiva"
 
 require "test-unit"
diff --git a/ruby/red-gandiva/version.rb b/ruby/red-gandiva/version.rb
deleted file mode 100644
index ba76979..0000000
--- a/ruby/red-gandiva/version.rb
+++ /dev/null
@@ -1,71 +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.
-
-require "pathname"
-
-version_rb_path = Pathname.new(__FILE__)
-base_dir = version_rb_path.dirname
-pom_xml_path = base_dir.join("..", "..", "java", "pom.xml")
-lib_version_rb_path = base_dir.join("lib", "gandiva", "version.rb")
-
-need_update = false
-if not lib_version_rb_path.exist?
-  need_update = true
-elsif version_rb_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-elsif pom_xml_path.exist? and pom_xml_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-end
-
-if need_update
-  version = pom_xml_path.read.scan(/^  <version>(.+?)<\/version>/)[0][0]
-  major, minor, micro, tag = version.split(/[.-]/)
-  lib_version_rb_path.open("w") do |lib_version_rb|
-    lib_version_rb.puts(<<-RUBY)
-# 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.
-
-module Gandiva
-  module Version
-    MAJOR = #{major}
-    MINOR = #{minor}
-    MICRO = #{micro}
-    TAG = #{tag ? tag.dump : nil}
-    STRING = #{version.dump}
-  end
-
-  VERSION = Version::STRING
-end
-    RUBY
-  end
-end
-
-require_relative "lib/gandiva/version"
diff --git a/ruby/red-parquet/.gitignore b/ruby/red-parquet/.gitignore
index 542f54c..779545d 100644
--- a/ruby/red-parquet/.gitignore
+++ b/ruby/red-parquet/.gitignore
@@ -15,6 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-/lib/parquet/version.rb
-
 /pkg/
diff --git a/ruby/red-arrow-cuda/test/helper.rb b/ruby/red-parquet/lib/parquet/version.rb
similarity index 80%
copy from ruby/red-arrow-cuda/test/helper.rb
copy to ruby/red-parquet/lib/parquet/version.rb
index 4d01833..997a92e 100644
--- a/ruby/red-arrow-cuda/test/helper.rb
+++ b/ruby/red-parquet/lib/parquet/version.rb
@@ -15,9 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../../red-arrow/version"
-require_relative "../version"
+module Parquet
+  VERSION = "0.12.0-SNAPSHOT"
 
-require "arrow-cuda"
-
-require "test-unit"
+  module Version
+    numbers, TAG = VERSION.split("-")
+    MAJOR, MINOR, MICRO = numbers.split(".").collect(&:to_i)
+    STRING = VERSION
+  end
+end
diff --git a/ruby/red-parquet/red-parquet.gemspec b/ruby/red-parquet/red-parquet.gemspec
index 491648b..7688dcb 100644
--- a/ruby/red-parquet/red-parquet.gemspec
+++ b/ruby/red-parquet/red-parquet.gemspec
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "version"
+require_relative "lib/parquet/version"
 
 Gem::Specification.new do |spec|
   spec.name = "red-parquet"
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
     Parquet::Version::MAJOR.to_s,
     Parquet::Version::MINOR.to_s,
     Parquet::Version::MICRO.to_s,
-    # "beta1",
+    Parquet::Version::TAG,
   ]
-  spec.version = version_components.join(".")
+  spec.version = version_components.compact.join(".")
   spec.homepage = "https://arrow.apache.org/"
   spec.authors = ["Apache Arrow Developers"]
   spec.email = ["dev@arrow.apache.org"]
diff --git a/ruby/red-parquet/test/helper.rb b/ruby/red-parquet/test/helper.rb
index 43013ab..169d1df 100644
--- a/ruby/red-parquet/test/helper.rb
+++ b/ruby/red-parquet/test/helper.rb
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../../red-arrow/version"
-require_relative "../version"
-
 require "parquet"
 
 require "tempfile"
diff --git a/ruby/red-parquet/version.rb b/ruby/red-parquet/version.rb
deleted file mode 100644
index 0604516..0000000
--- a/ruby/red-parquet/version.rb
+++ /dev/null
@@ -1,71 +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.
-
-require "pathname"
-
-version_rb_path = Pathname.new(__FILE__)
-base_dir = version_rb_path.dirname
-pom_xml_path = base_dir.join("..", "..", "java", "pom.xml")
-lib_version_rb_path = base_dir.join("lib", "parquet", "version.rb")
-
-need_update = false
-if not lib_version_rb_path.exist?
-  need_update = true
-elsif version_rb_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-elsif pom_xml_path.exist? and pom_xml_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-end
-
-if need_update
-  version = pom_xml_path.read.scan(/^  <version>(.+?)<\/version>/)[0][0]
-  major, minor, micro, tag = version.split(/[.-]/)
-  lib_version_rb_path.open("w") do |lib_version_rb|
-    lib_version_rb.puts(<<-RUBY)
-# 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.
-
-module Parquet
-  module Version
-    MAJOR = #{major}
-    MINOR = #{minor}
-    MICRO = #{micro}
-    TAG = #{tag ? tag.dump : nil}
-    STRING = #{version.dump}
-  end
-
-  VERSION = Version::STRING
-end
-    RUBY
-  end
-end
-
-require_relative "lib/parquet/version"
diff --git a/ruby/red-plasma/.gitignore b/ruby/red-plasma/.gitignore
index bd50ff8..779545d 100644
--- a/ruby/red-plasma/.gitignore
+++ b/ruby/red-plasma/.gitignore
@@ -15,6 +15,4 @@
 # specific language governing permissions and limitations
 # under the License.
 
-/lib/plasma/version.rb
-
 /pkg/
diff --git a/ruby/red-arrow-cuda/test/helper.rb b/ruby/red-plasma/lib/plasma/version.rb
similarity index 80%
copy from ruby/red-arrow-cuda/test/helper.rb
copy to ruby/red-plasma/lib/plasma/version.rb
index 4d01833..e88f2de 100644
--- a/ruby/red-arrow-cuda/test/helper.rb
+++ b/ruby/red-plasma/lib/plasma/version.rb
@@ -15,9 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../../red-arrow/version"
-require_relative "../version"
+module Plasma
+  VERSION = "0.12.0-SNAPSHOT"
 
-require "arrow-cuda"
-
-require "test-unit"
+  module Version
+    numbers, TAG = VERSION.split("-")
+    MAJOR, MINOR, MICRO = numbers.split(".").collect(&:to_i)
+    STRING = VERSION
+  end
+end
diff --git a/ruby/red-plasma/red-plasma.gemspec b/ruby/red-plasma/red-plasma.gemspec
index 53b4d1e..09b4a55 100644
--- a/ruby/red-plasma/red-plasma.gemspec
+++ b/ruby/red-plasma/red-plasma.gemspec
@@ -17,7 +17,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "version"
+require_relative "lib/plasma/version"
 
 Gem::Specification.new do |spec|
   spec.name = "red-plasma"
@@ -25,9 +25,9 @@ Gem::Specification.new do |spec|
     Plasma::Version::MAJOR.to_s,
     Plasma::Version::MINOR.to_s,
     Plasma::Version::MICRO.to_s,
-    # "beta1",
+    Plasma::Version::TAG,
   ]
-  spec.version = version_components.join(".")
+  spec.version = version_components.compact.join(".")
   spec.homepage = "https://arrow.apache.org/"
   spec.authors = ["Apache Arrow Developers"]
   spec.email = ["dev@arrow.apache.org"]
diff --git a/ruby/red-plasma/test/helper.rb b/ruby/red-plasma/test/helper.rb
index d66d43e..255cad2 100644
--- a/ruby/red-plasma/test/helper.rb
+++ b/ruby/red-plasma/test/helper.rb
@@ -15,9 +15,6 @@
 # specific language governing permissions and limitations
 # under the License.
 
-require_relative "../../red-arrow/version"
-require_relative "../version"
-
 require "plasma"
 
 require "tempfile"
diff --git a/ruby/red-plasma/version.rb b/ruby/red-plasma/version.rb
deleted file mode 100644
index 015aac9..0000000
--- a/ruby/red-plasma/version.rb
+++ /dev/null
@@ -1,71 +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.
-
-require "pathname"
-
-version_rb_path = Pathname.new(__FILE__)
-base_dir = version_rb_path.dirname
-pom_xml_path = base_dir.join("..", "..", "java", "pom.xml")
-lib_version_rb_path = base_dir.join("lib", "plasma", "version.rb")
-
-need_update = false
-if not lib_version_rb_path.exist?
-  need_update = true
-elsif version_rb_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-elsif pom_xml_path.exist? and pom_xml_path.mtime > lib_version_rb_path.mtime
-  need_update = true
-end
-
-if need_update
-  version = pom_xml_path.read.scan(/^  <version>(.+?)<\/version>/)[0][0]
-  major, minor, micro, tag = version.split(/[.-]/)
-  lib_version_rb_path.open("w") do |lib_version_rb|
-    lib_version_rb.puts(<<-RUBY)
-# 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.
-
-module Plasma
-  module Version
-    MAJOR = #{major}
-    MINOR = #{minor}
-    MICRO = #{micro}
-    TAG = #{tag ? tag.dump : nil}
-    STRING = #{version.dump}
-  end
-
-  VERSION = Version::STRING
-end
-    RUBY
-  end
-end
-
-require_relative "lib/plasma/version"