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

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-cookbook.git


The following commit(s) were added to refs/heads/main by this push:
     new c02e0cd  [Java] Add Java build against Arrow Nightlies version (#253)
c02e0cd is described below

commit c02e0cdeb76471e371bedf8021720937e1f20f8f
Author: Raúl Cumplido <[email protected]>
AuthorDate: Tue Oct 4 15:27:36 2022 +0200

    [Java] Add Java build against Arrow Nightlies version (#253)
    
    * [Java] Add initial Java build against Arrow Nightlies version
    
    * Update Java version to use 10.0.0-SNAPSHOT if ARROW_NIGHTLY is defined 
and not empty
    
    * Fix typo on GitHub Worflow
    
    * Test define env var to 0
    
    * Add excludes to not run all combinations
    
    * Add documentation and try numeric values instead of string for the 
environment variable
    
    * Specifically check whether ARROW_NIGHTLY is 0 or not
    
    * Add OSX combination
---
 .github/workflows/test_java_linux_cookbook.yml | 8 ++++++++
 .github/workflows/test_java_osx_cookbook.yml   | 8 ++++++++
 java/CONTRIBUTING.rst                          | 4 ++++
 java/ext/javadoctest.py                        | 1 +
 java/source/conf.py                            | 7 ++++++-
 java/source/demo/pom.xml                       | 6 ++++++
 java/source/index.rst                          | 2 +-
 7 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/test_java_linux_cookbook.yml 
b/.github/workflows/test_java_linux_cookbook.yml
index 1e3393f..fee1862 100644
--- a/.github/workflows/test_java_linux_cookbook.yml
+++ b/.github/workflows/test_java_linux_cookbook.yml
@@ -37,6 +37,14 @@ jobs:
       matrix:
         python-version: [ '3.9' ]
         java-version: [ '11', '17', '18' ]
+        arrow_nightly: ['0', '1']
+        exclude:
+          - java-version: '11'
+            arrow_nightly: '1'
+          - java-version: '17'
+            arrow_nightly: '1'
+    env:
+      ARROW_NIGHTLY: ${{ matrix.arrow_nightly }}
     steps:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v3
diff --git a/.github/workflows/test_java_osx_cookbook.yml 
b/.github/workflows/test_java_osx_cookbook.yml
index b68d9a5..dfa30a3 100644
--- a/.github/workflows/test_java_osx_cookbook.yml
+++ b/.github/workflows/test_java_osx_cookbook.yml
@@ -37,6 +37,14 @@ jobs:
       matrix:
         python-version: [ '3.9' ]
         java-version: [ '11', '17', '18' ]
+        arrow_nightly: ['0', '1']
+        exclude:
+          - java-version: '11'
+            arrow_nightly: '1'
+          - java-version: '17'
+            arrow_nightly: '1'
+    env:
+      ARROW_NIGHTLY: ${{ matrix.arrow_nightly }}
     steps:
       - uses: actions/checkout@v3
       - uses: actions/setup-python@v3
diff --git a/java/CONTRIBUTING.rst b/java/CONTRIBUTING.rst
index 9e3dd9a..55f5345 100644
--- a/java/CONTRIBUTING.rst
+++ b/java/CONTRIBUTING.rst
@@ -55,6 +55,10 @@ and compile the cookbook to HTML.
 
 You will see the compiled result inside the ``build/java`` directory.
 
+If the environment variable ``ARROW_NIGHTLY`` is defined and not 0
+the cookbooks will be run against the latest development version of
+Arrow published by the `Nightly jobs. 
<https://arrow.apache.org/docs/java/install.html#installing-nightly-packages>`_
+
 Testing Java Recipes
 ====================
 
diff --git a/java/ext/javadoctest.py b/java/ext/javadoctest.py
index 712b724..3896dfe 100644
--- a/java/ext/javadoctest.py
+++ b/java/ext/javadoctest.py
@@ -54,6 +54,7 @@ class JavaDocTestBuilder(DocTestBuilder):
                 "dependency:build-classpath",
                 "-DincludeTypes=jar",
                 "-Dmdep.outputFile=.cp.tmp",
+                f"-Darrow.version={self.env.config.version}",
             ],
             cwd=path_arrow_project,
             text=True,
diff --git a/java/source/conf.py b/java/source/conf.py
index 9b26630..fe3abb2 100644
--- a/java/source/conf.py
+++ b/java/source/conf.py
@@ -36,7 +36,12 @@ sys.path.append(os.path.abspath("../ext"))
 project = 'Apache Arrow Java Cookbook'
 copyright = '2022, Apache Software Foundation'
 author = 'The Apache Software Foundation'
-
+arrow_nightly=os.getenv("ARROW_NIGHTLY")
+if arrow_nightly and arrow_nightly != '0':
+    version = "10.0.0-SNAPSHOT"
+else:
+    version = "9.0.0"
+print(f"Running with Arrow version: {version}")
 
 # -- General configuration ---------------------------------------------------
 
diff --git a/java/source/demo/pom.xml b/java/source/demo/pom.xml
index d412574..60c119a 100644
--- a/java/source/demo/pom.xml
+++ b/java/source/demo/pom.xml
@@ -25,6 +25,12 @@
       </extension>
     </extensions>
     </build>
+    <repositories>
+        <repository>
+            <id>arrow-apache-nightlies</id>
+            <url>https://nightlies.apache.org/arrow/java</url>
+        </repository>
+    </repositories>
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
diff --git a/java/source/index.rst b/java/source/index.rst
index 5ece41c..1ae98bb 100644
--- a/java/source/index.rst
+++ b/java/source/index.rst
@@ -28,7 +28,7 @@ The Apache Arrow Cookbook is a collection of recipes which 
demonstrate how to so
 To get started with Apache Arrow in Java, see the
 `Installation Instructions <https://arrow.apache.org/docs/java/install.html>`_.
 
-This cookbook is tested with **Apache Arrow 9.0.0**.
+This cookbook is tested with Apache Arrow |version|.
 
 .. toctree::
    :maxdepth: 2

Reply via email to