You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by dl...@apache.org on 2021/10/13 18:21:04 UTC

[asterixdb-clients] branch master updated: [NO ISSUE][JDBC] Improve asterix-jdbc-taco pom file

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

dlych pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb-clients.git


The following commit(s) were added to refs/heads/master by this push:
     new dd8616e  [NO ISSUE][JDBC] Improve asterix-jdbc-taco pom file
dd8616e is described below

commit dd8616e3302fc7a6e6f9fb21f6235438380398a2
Author: Dmitry Lychagin <dm...@couchbase.com>
AuthorDate: Wed Oct 13 10:34:43 2021 -0700

    [NO ISSUE][JDBC] Improve asterix-jdbc-taco pom file
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Change-Id: If7e1aefdc76db7a4d0431c04d32a59e3e0919688
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb-clients/+/13685
    Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>
    Reviewed-by: Ian Maxon <im...@uci.edu>
    Tested-by: Ian Maxon <im...@uci.edu>
---
 asterixdb-jdbc/asterix-jdbc-taco/pom.xml | 118 ++++++++++++++++++++-----------
 1 file changed, 77 insertions(+), 41 deletions(-)

diff --git a/asterixdb-jdbc/asterix-jdbc-taco/pom.xml b/asterixdb-jdbc/asterix-jdbc-taco/pom.xml
index 552e444..9223528 100644
--- a/asterixdb-jdbc/asterix-jdbc-taco/pom.xml
+++ b/asterixdb-jdbc/asterix-jdbc-taco/pom.xml
@@ -39,14 +39,6 @@
 
   <properties>
     <root.dir>${basedir}/..</root.dir>
-    <build.taco.init.stage>none</build.taco.init.stage>
-    <build.taco.validate.stage>none</build.taco.validate.stage>
-    <build.taco.directory>${project.build.directory}/taco</build.taco.directory>
-    <build.taco.gensrc.directory>${build.taco.directory}/generated-sources</build.taco.gensrc.directory>
-    <build.taco.log.directory>${build.taco.directory}</build.taco.log.directory>
-    <build.venv.directory>${project.build.directory}/venv</build.venv.directory>
-    <build.venv.pyhton.path>${build.venv.directory}/bin/python</build.venv.pyhton.path>
-    <taco.sourceDirectory>${project.basedir}/src/main/taco</taco.sourceDirectory>
 
     <taco.plugin.class>asterixdb_jdbc</taco.plugin.class>
     <taco.plugin.name>AsterixDB</taco.plugin.name>
@@ -62,6 +54,19 @@
     <taco.plugin.jdbc.scheme>jdbc:asterixdb://</taco.plugin.jdbc.scheme>
     <taco.plugin.jdbc.properties.aux> </taco.plugin.jdbc.properties.aux>
     <taco.plugin.auth.none><![CDATA[<option value="auth-none" label="No Authentication"/>]]></taco.plugin.auth.none>
+
+    <taco.sourceDirectory>${project.basedir}/src/main/taco</taco.sourceDirectory>
+
+    <build.taco.init.sdk.stage>none</build.taco.init.sdk.stage>
+    <build.taco.package.sdk.stage>none</build.taco.package.sdk.stage>
+    <build.taco.package.nosdk.stage>none</build.taco.package.nosdk.stage>
+    <build.taco.directory>${project.build.directory}/taco</build.taco.directory>
+    <build.taco.gensrc.directory>${build.taco.directory}/generated-sources</build.taco.gensrc.directory>
+    <build.taco.gensrc.plugin.class.directory>${build.taco.gensrc.directory}/plugins/${taco.plugin.class}</build.taco.gensrc.plugin.class.directory>
+    <build.taco.log.directory>${build.taco.directory}</build.taco.log.directory>
+    <build.taco.package.file>${project.build.directory}/${taco.plugin.class}.taco</build.taco.package.file>
+    <build.venv.directory>${project.build.directory}/venv</build.venv.directory>
+    <build.venv.python.path>${build.venv.directory}/bin/python</build.venv.python.path>
   </properties>
 
   <build>
@@ -123,33 +128,13 @@
           </execution>
         </executions>
       </plugin>
-      <!-- create .taco file -->
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-shade-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>shade</goal>
-            </goals>
-            <configuration>
-              <outputFile>${project.build.directory}/${taco.plugin.class}.taco</outputFile>
-              <artifactSet>
-                <includes>
-                  <include>org.apache.asterix:asterix-jdbc-taco</include>
-                </includes>
-              </artifactSet>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>exec-maven-plugin</artifactId>
         <executions>
           <execution>
             <id>venv-install</id>
-            <phase>${build.taco.init.stage}</phase>
+            <phase>${build.taco.init.sdk.stage}</phase>
             <goals>
               <goal>exec</goal>
             </goals>
@@ -166,12 +151,12 @@
           </execution>
           <execution>
             <id>taco-packager-install</id>
-            <phase>${build.taco.init.stage}</phase>
+            <phase>${build.taco.init.sdk.stage}</phase>
             <goals>
               <goal>exec</goal>
             </goals>
             <configuration>
-              <executable>${build.venv.pyhton.path}</executable>
+              <executable>${build.venv.python.path}</executable>
               <workingDirectory>${taco.sdk.path}/connector-packager</workingDirectory>
               <arguments>
                 <argument>setup.py</argument>
@@ -184,23 +169,23 @@
             </configuration>
           </execution>
           <execution>
-            <id>taco-validate</id>
-            <phase>${build.taco.validate.stage}</phase>
+            <!-- create .taco file using Taco SDK -->
+            <id>taco-package-sdk</id>
+            <phase>${build.taco.package.sdk.stage}</phase>
             <goals>
               <goal>exec</goal>
             </goals>
             <configuration>
-              <executable>${build.venv.pyhton.path}</executable>
+              <executable>${build.venv.python.path}</executable>
               <workingDirectory>${taco.sdk.path}/connector-packager</workingDirectory>
               <arguments>
                 <argument>-m</argument>
                 <argument>connector_packager.package</argument>
-                <argument>${build.taco.gensrc.directory}/plugins/asterixdb_jdbc</argument>
-                <argument>--validate-only</argument>
+                <argument>${build.taco.gensrc.plugin.class.directory}</argument>
                 <argument>--log</argument>
                 <argument>${build.taco.log.directory}</argument>
                 <argument>--dest</argument>
-                <argument>${build.taco.directory}</argument>
+                <argument>${project.build.directory}</argument>
               </arguments>
               <environmentVariables>
                 <VIRTUALENV>${build.venv.directory}</VIRTUALENV>
@@ -210,20 +195,42 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <executions>
+          <execution>
+            <!-- create .taco file if Taco SDK is not available -->
+            <id>taco-package-nosdk</id>
+            <phase>${build.taco.package.nosdk.stage}</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <outputFile>${build.taco.package.file}</outputFile>
+              <artifactSet>
+                <includes>
+                  <include>org.apache.asterix:asterix-jdbc-taco</include>
+                </includes>
+              </artifactSet>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 
   <profiles>
     <profile>
-      <id>taco-validate</id>
+      <id>taco-sdk-exists</id>
       <activation>
         <property>
           <name>taco.sdk.path</name>
         </property>
       </activation>
       <properties>
-        <build.taco.init.stage>initialize</build.taco.init.stage>
-        <build.taco.validate.stage>compile</build.taco.validate.stage>
+        <build.taco.init.sdk.stage>initialize</build.taco.init.sdk.stage>
+        <build.taco.package.sdk.stage>package</build.taco.package.sdk.stage>
       </properties>
       <build>
         <plugins>
@@ -232,7 +239,7 @@
             <artifactId>maven-enforcer-plugin</artifactId>
             <executions>
               <execution>
-                <id>enforce-taco-packager-exists</id>
+                <id>enforce-taco-sdk-packager-exists</id>
                 <goals>
                   <goal>enforce</goal>
                 </goals>
@@ -252,10 +259,39 @@
                   <fail>true</fail>
                 </configuration>
               </execution>
+              <execution>
+                <!-- ensure that .taco was created -->
+                <id>enforce-taco-package-success</id>
+                <phase>verify</phase>
+                <goals>
+                  <goal>enforce</goal>
+                </goals>
+                <configuration>
+                  <rules>
+                    <requireFilesExist>
+                      <files>
+                        <file>${build.taco.package.file}</file>
+                      </files>
+                    </requireFilesExist>
+                  </rules>
+                  <fail>true</fail>
+                </configuration>
+              </execution>
             </executions>
           </plugin>
         </plugins>
       </build>
     </profile>
+    <profile>
+    <id>taco-sdk-missing</id>
+      <activation>
+        <property>
+          <name>!taco.sdk.path</name>
+        </property>
+      </activation>
+      <properties>
+        <build.taco.package.nosdk.stage>package</build.taco.package.nosdk.stage>
+      </properties>
+    </profile>
   </profiles>
 </project>