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

cdutz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-bin-resources.git


The following commit(s) were added to refs/heads/main by this push:
     new e6c92c7  chore: Added a module allowing to release the 
iotdb-tools-thrift artifact separately from the rest of iotdb
e6c92c7 is described below

commit e6c92c77af33b32a7abf5c2aeeb8ecd63089b897
Author: Christofer Dutz <[email protected]>
AuthorDate: Thu Aug 17 13:33:47 2023 +0200

    chore: Added a module allowing to release the iotdb-tools-thrift artifact 
separately from the rest of iotdb
---
 .gitignore                                      |   3 +-
 iotdb-tools-thrift/pom.xml                      | 376 ++++++++++++++++++++++++
 iotdb-tools-thrift/src/main/assembly/thrift.xml |  64 ++++
 3 files changed, 442 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 1f2fe50..355feb8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,4 +11,5 @@
 **/*.iws
 # Apple OS X related
 **/.DS_Store
-derby-tsfile-db
\ No newline at end of file
+derby-tsfile-db
+/iotdb-tools-thrift/target/
diff --git a/iotdb-tools-thrift/pom.xml b/iotdb-tools-thrift/pom.xml
new file mode 100644
index 0000000..3f3fc51
--- /dev/null
+++ b/iotdb-tools-thrift/pom.xml
@@ -0,0 +1,376 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>30</version>
+    </parent>
+
+    <groupId>org.apache.iotdb.tools</groupId>
+    <artifactId>iotdb-tools-thrift</artifactId>
+    <!--
+        Setting the base-version to exactly the same as ${thrift.version} as 
this module
+        contains nothing else as the compiled thrift binary without any 
modification.
+        The fourth segment allows us to re-deploy, if we need to change the 
config.
+    -->
+    <version>0.14.1.0</version>
+    <packaging>pom</packaging>
+
+    <name>IoTDB-Tools: Thrift</name>
+    <description>Local build of the Apache Thrift compiler.</description>
+
+    <properties>
+        <!--
+            Thrift 0.17.0 was the last version that could be used in Java 8 
applications,
+            However Thrift 0.17.0 has an invalid entry in the 
META-INF/MANIFEST.mf file.
+            All versions between 0.17.0 and 0.14.1 have know vulnerabilities, 
so for now
+            we'll stay at 0.14.1.
+        -->
+        <thrift.version>0.14.1</thrift.version>
+        <thrift.with.cpp>ON</thrift.with.cpp>
+        <thrift.with.go>ON</thrift.with.go>
+        <thrift.with.python>ON</thrift.with.python>
+        <thrift.with.rust>ON</thrift.with.rust>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.googlecode.maven-download-plugin</groupId>
+                <artifactId>download-maven-plugin</artifactId>
+                <executions>
+                    <!-- Download the sources for building the thrift compiler 
-->
+                    <execution>
+                        <id>get-thrift</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>wget</goal>
+                        </goals>
+                        <configuration>
+                            
<url>https://archive.apache.org/dist/thrift/${thrift.version}/thrift-${thrift.version}.tar.gz</url>
+                            <unpack>true</unpack>
+                            
<outputDirectory>${project.build.directory}</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>com.googlecode.cmake-maven-project</groupId>
+                <artifactId>cmake-maven-plugin</artifactId>
+                <executions>
+                    <!-- Uses a CMake generator to generate the build using 
the build tool of choice -->
+                    <execution>
+                        <id>cmake-generate</id>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <generator>${cmake.generator}</generator>
+                            
<sourcePath>${project.build.directory}/thrift-${thrift.version}</sourcePath>
+                            
<targetPath>${project.build.directory}/build</targetPath>
+                            <options>
+                                <!-- Disable testing for now -->
+                                <option>-DBUILD_TESTING=OFF</option>
+                                <!-- Enable and disable the building of code 
generators for different languages -->
+                                <option>-DTHRIFT_COMPILER_AS3=OFF</option>
+                                <option>-DTHRIFT_COMPILER_C_GLIB=OFF</option>
+                                <option>-DTHRIFT_COMPILER_CL=OFF</option>
+                                
<option>-DTHRIFT_COMPILER_CPP=${thrift.with.cpp}</option>
+                                <option>-DTHRIFT_COMPILER_D=OFF</option>
+                                <option>-DTHRIFT_COMPILER_DART=OFF</option>
+                                <option>-DTHRIFT_COMPILER_DELPHI=OFF</option>
+                                <option>-DTHRIFT_COMPILER_ERL=OFF</option>
+                                
<option>-DTHRIFT_COMPILER_GO=${thrift.with.go}</option>
+                                <option>-DTHRIFT_COMPILER_GV=OFF</option>
+                                <option>-DTHRIFT_COMPILER_HAXE=OFF</option>
+                                <option>-DTHRIFT_COMPILER_HS=OFF</option>
+                                <option>-DTHRIFT_COMPILER_HTML=OFF</option>
+                                <option>-DTHRIFT_COMPILER_JAVA=ON</option>
+                                <option>-DTHRIFT_COMPILER_JAVAME=ON</option>
+                                <option>-DTHRIFT_COMPILER_JSON=OFF</option>
+                                <option>-DTHRIFT_COMPILER_LUA=OFF</option>
+                                <option>-DTHRIFT_COMPILER_NETSTD=ON</option>
+                                <option>-DTHRIFT_COMPILER_OCAML=OFF</option>
+                                <option>-DTHRIFT_COMPILER_PERL=OFF</option>
+                                <option>-DTHRIFT_COMPILER_PHP=OFF</option>
+                                
<option>-DTHRIFT_COMPILER_PY=${thrift.with.python}</option>
+                                <option>-DTHRIFT_COMPILER_RB=OFF</option>
+                                
<option>-DTHRIFT_COMPILER_RS=${thrift.with.rust}</option>
+                                <option>-DTHRIFT_COMPILER_ST=OFF</option>
+                                <option>-DTHRIFT_COMPILER_SWIFT=OFF</option>
+                                <option>-DTHRIFT_COMPILER_XML=OFF</option>
+                                <option>-DTHRIFT_COMPILER_XSD=OFF</option>
+                                <!-- Enable and disable the building of libs 
for different languages -->
+                                <option>-DBUILD_C_GLIB=OFF</option>
+                                <option>-DBUILD_CPP=${thrift.with.cpp}</option>
+                                <!-- Don't build Java, as the libs are 
available via Maven -->
+                                <option>-DBUILD_JAVA=OFF</option>
+                                <option>-DBUILD_NODEJS=OFF</option>
+                                
<option>-DBUILD_PYTHON=${thrift.with.python}</option>
+                                <option>-DBUILD_JAVASCRIPT=OFF</option>
+                                <option>-DBUILD_HASKELL=OFF</option>
+                                <option>-DWITH_SHARED_LIB=OFF</option>
+                                <!-- Generate libthrift.a to compile IoTDB 
Session -->
+                                <option>-DWITH_STATIC_LIB=ON</option>
+                                
<option>-DCMAKE_POSITION_INDEPENDENT_CODE=ON</option>
+                            </options>
+                        </configuration>
+                    </execution>
+                    <!-- Actually executes the build -->
+                    <execution>
+                        <id>cmake-compile</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <config>${cmake.build.type}</config>
+                            <!-- The directory where the "generate" step 
generated the build configuration -->
+                            
<projectDirectory>${project.build.directory}/build</projectDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!--
+                Bundle up the needed parts into an archive for this 
architecture
+                The bundle contains the Thrift executable, the shared 
libraries and the header-files,
+                which are all needed to build the client
+            -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <appendAssemblyId>true</appendAssemblyId>
+                            <descriptors>
+                                
<descriptor>src/main/assembly/thrift.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>.os-unix</id>
+            <activation>
+                <os>
+                    <family>unix</family>
+                    <name>Linux</name>
+                    <arch>!aarch64</arch>
+                </os>
+            </activation>
+            <properties>
+                <os.classifier>linux-x86_64</os.classifier>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.googlecode.cmake-maven-project</groupId>
+                        <artifactId>cmake-maven-plugin</artifactId>
+                        <executions>
+                            <!-- Uses a CMake generator to generate the build 
using the build tool of choice -->
+                            <execution>
+                                <id>cmake-generate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>generate</goal>
+                                </goals>
+                                <configuration>
+                                    <generator>${cmake.generator}</generator>
+                                    
<sourcePath>${project.build.directory}/thrift-${thrift.version}</sourcePath>
+                                    
<targetPath>${project.build.directory}/build</targetPath>
+                                    <options combine.children="append">
+                                        <!-- Tell the linker to build 
statically linked binaries -->
+                                        
<option>-DCMAKE_EXE_LINKER_FLAGS=-static</option>
+                                        
<option>-DZLIB_USE_STATIC_LIBS=ON</option>
+                                        
<option>-DOPENSSL_USE_STATIC_LIBS=ON</option>
+                                    </options>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>.os-unix-arm</id>
+            <activation>
+                <os>
+                    <family>unix</family>
+                    <name>Linux</name>
+                    <arch>aarch64</arch>
+                </os>
+            </activation>
+            <properties>
+                <os.classifier>linux-aarch64</os.classifier>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.googlecode.cmake-maven-project</groupId>
+                        <artifactId>cmake-maven-plugin</artifactId>
+                        <executions>
+                            <!-- Uses a CMake generator to generate the build 
using the build tool of choice -->
+                            <execution>
+                                <id>cmake-generate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>generate</goal>
+                                </goals>
+                                <configuration>
+                                    <generator>${cmake.generator}</generator>
+                                    
<sourcePath>${project.build.directory}/thrift-${thrift.version}</sourcePath>
+                                    
<targetPath>${project.build.directory}/build</targetPath>
+                                    <options combine.children="append">
+                                        <!-- Tell the linker to build 
statically linked binaries -->
+                                        
<option>-DCMAKE_EXE_LINKER_FLAGS=-static</option>
+                                        
<option>-DZLIB_USE_STATIC_LIBS=ON</option>
+                                        
<option>-DOPENSSL_USE_STATIC_LIBS=ON</option>
+                                    </options>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>.os-mac</id>
+            <activation>
+                <os>
+                    <family>mac</family>
+                    <arch>!aarch64</arch>
+                </os>
+            </activation>
+            <properties>
+                <os.classifier>mac-x86_64</os.classifier>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.googlecode.cmake-maven-project</groupId>
+                        <artifactId>cmake-maven-plugin</artifactId>
+                        <executions>
+                            <!-- Uses a CMake generator to generate the build 
using the build tool of choice -->
+                            <execution>
+                                <id>cmake-generate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>generate</goal>
+                                </goals>
+                                <configuration>
+                                    <generator>${cmake.generator}</generator>
+                                    
<sourcePath>${project.build.directory}/thrift-${thrift.version}</sourcePath>
+                                    
<targetPath>${project.build.directory}/build</targetPath>
+                                    <options combine.children="append">
+                                        <!-- Specify new version Bison path 
for Mac-OS, as the default version is too old -->
+                                        
<option>-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison</option>
+                                    </options>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>.os-mac-arm</id>
+            <activation>
+                <os>
+                    <family>mac</family>
+                    <arch>aarch64</arch>
+                </os>
+            </activation>
+            <properties>
+                <os.classifier>mac-aarch64</os.classifier>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.googlecode.cmake-maven-project</groupId>
+                        <artifactId>cmake-maven-plugin</artifactId>
+                        <executions>
+                            <!-- Uses a CMake generator to generate the build 
using the build tool of choice -->
+                            <execution>
+                                <id>cmake-generate</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>generate</goal>
+                                </goals>
+                                <configuration>
+                                    <generator>${cmake.generator}</generator>
+                                    
<sourcePath>${project.build.directory}/thrift-${thrift.version}</sourcePath>
+                                    
<targetPath>${project.build.directory}/build</targetPath>
+                                    <options combine.children="append">
+                                        <!-- Specify new version Bison path 
for Mac-OS, as the default version is too old -->
+                                        
<option>-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison</option>
+                                    </options>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>.os-windows</id>
+            <activation>
+                <os>
+                    <family>windows</family>
+                    <arch>!aarch64</arch>
+                </os>
+            </activation>
+            <properties>
+                <os.classifier>windows-x86_64</os.classifier>
+            </properties>
+        </profile>
+
+        <profile>
+            <id>.os-windows-arm</id>
+            <activation>
+                <os>
+                    <family>windows</family>
+                    <arch>aarch64</arch>
+                </os>
+            </activation>
+            <properties>
+                <os.classifier>windows-aarch64</os.classifier>
+            </properties>
+        </profile>
+    </profiles>
+</project>
diff --git a/iotdb-tools-thrift/src/main/assembly/thrift.xml 
b/iotdb-tools-thrift/src/main/assembly/thrift.xml
new file mode 100644
index 0000000..9a3d9c6
--- /dev/null
+++ b/iotdb-tools-thrift/src/main/assembly/thrift.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+<assembly 
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
 http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
+    <id>${os.classifier}</id>
+    <formats>
+        <format>zip</format>
+        <format>dir</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <fileSets>
+        <!-- Include the executable -->
+        <fileSet>
+            
<directory>${project.build.directory}/build/compiler/cpp/bin</directory>
+            <!-- Make the file executable -->
+            <fileMode>0755</fileMode>
+            <includes>
+                <include>**</include>
+            </includes>
+            <outputDirectory>bin</outputDirectory>
+        </fileSet>
+        <!-- Include the shared-libraries -->
+        <fileSet>
+            <directory>${project.build.directory}/build</directory>
+            <includes>
+                <include>lib/*.a</include>
+                <include>lib/Release/*.lib</include>
+            </includes>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+        <!-- Include the header-files -->
+        <fileSet>
+            
<directory>${project.build.directory}/thrift-${thrift.version}/lib/cpp/src</directory>
+            <includes>
+                <include>**</include>
+            </includes>
+            <outputDirectory>include</outputDirectory>
+        </fileSet>
+        <!-- Include the config.h -->
+        <fileSet>
+            <directory>${project.build.directory}/build/thrift</directory>
+            <includes>
+                <include>config.h</include>
+            </includes>
+            <outputDirectory>include/thrift</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>

Reply via email to