| <?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.iotdb</groupId> |
| <artifactId>iotdb-client</artifactId> |
| <version>2.0.7-SNAPSHOT</version> |
| </parent> |
| <artifactId>client-cpp</artifactId> |
| <packaging>pom</packaging> |
| <name>IoTDB: Client: Client for CPP</name> |
| <description>C++ client</description> |
| <!-- |
| The C++ client build is now driven entirely by the top-level |
| CMakeLists.txt in this directory. Maven only: |
| 1. Runs cmake configure + build (cmake-maven-plugin) |
| 2. Optionally starts/stops an IoTDB server (process-exec-maven-plugin) |
| 3. Packages the produced install tree (maven-assembly-plugin) |
| |
| Everything else - thrift download, code generation, Boost/m4/flex/bison |
| bootstrap, OpenSSL discovery - lives in CMake modules under cmake/. |
| --> |
| <properties> |
| <catch2.url>https://github.com/catchorg/Catch2/releases/download/v2.13.7/catch.hpp</catch2.url> |
| <cmake.build.type>Release</cmake.build.type> |
| <cmake.root.dir>${project.build.directory}/dependency/cmake/</cmake.root.dir> |
| <cmake.source.dir>${project.basedir}</cmake.source.dir> |
| <cmake.project.dir>${project.build.directory}/build</cmake.project.dir> |
| <cmake.install.prefix>${project.build.directory}/install</cmake.install.prefix> |
| <iotdb.deps.dir>${project.basedir}/third-party</iotdb.deps.dir> |
| <iotdb.offline>OFF</iotdb.offline> |
| <with.ssl>OFF</with.ssl> |
| <iotdb.cxx11.abi/> |
| <!-- Switched to OFF by the .skipTests profile below. --> |
| <build.tests>ON</build.tests> |
| <maven.test.skip>${ctest.skip.tests}</maven.test.skip> |
| <!-- Optional convenience: when a user still passes -Dboost.include.dir=... |
| (legacy CLI from the old build), feed it to CMake as BOOST_INCLUDEDIR. --> |
| <boost.include.dir/> |
| <iotdb.extra.cxx.flags/> |
| <!-- Override via -Dclient.cpp.package.classifier=... for per-toolchain release zips. --> |
| <client.cpp.package.classifier>${os.classifier}</client.cpp.package.classifier> |
| <client.cpp.package.name>iotdb-session-cpp-${project.version}-${client.cpp.package.classifier}</client.cpp.package.name> |
| <client.cpp.ci.build.id>${env.GITHUB_RUN_ID}</client.cpp.ci.build.id> |
| </properties> |
| <dependencies> |
| <dependency> |
| <groupId>org.apache.iotdb</groupId> |
| <artifactId>iotdb-thrift-commons</artifactId> |
| <version>2.0.7-SNAPSHOT</version> |
| <scope>provided</scope> |
| </dependency> |
| </dependencies> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>com.googlecode.maven-download-plugin</groupId> |
| <artifactId>download-maven-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>get-catch2</id> |
| <goals> |
| <goal>wget</goal> |
| </goals> |
| <phase>generate-resources</phase> |
| <configuration> |
| <url>${catch2.url}</url> |
| <unpack>false</unpack> |
| <outputDirectory>${project.build.directory}/test/catch2</outputDirectory> |
| <skip>${ctest.skip.tests}</skip> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>io.github.cmake-maven-plugin</groupId> |
| <artifactId>cmake-maven-plugin</artifactId> |
| <executions> |
| <!-- Configure: top-level CMakeLists.txt of this module --> |
| <execution> |
| <id>cmake-generate</id> |
| <goals> |
| <goal>generate</goal> |
| </goals> |
| <phase>compile</phase> |
| <configuration> |
| <generator>${cmake.generator}</generator> |
| <sourcePath>${cmake.source.dir}</sourcePath> |
| <projectDirectory>${cmake.project.dir}</projectDirectory> |
| <options> |
| <option>-DCMAKE_BUILD_TYPE=${cmake.build.type}</option> |
| <option>-DCMAKE_INSTALL_PREFIX=${cmake.install.prefix}</option> |
| <option>-DBUILD_TESTING=${build.tests}</option> |
| <option>-DWITH_SSL=${with.ssl}</option> |
| <option>-DIOTDB_OFFLINE=${iotdb.offline}</option> |
| <option>-DIOTDB_DEPS_DIR=${iotdb.deps.dir}</option> |
| <option>-DIOTDB_USE_CXX11_ABI=${iotdb.cxx11.abi}</option> |
| <option>-DBOOST_INCLUDEDIR=${boost.include.dir}</option> |
| <option>-DCMAKE_POLICY_DEFAULT_CMP0091=NEW</option> |
| <option>-DIOTDB_EXTRA_CXX_FLAGS=${iotdb.extra.cxx.flags}</option> |
| <option>-DIOTDB_SESSION_VERSION=${project.version}</option> |
| <option>-DCATCH2_INCLUDE_DIR=${project.build.directory}/test/catch2</option> |
| </options> |
| </configuration> |
| </execution> |
| <!-- Build + install: drops headers/libs into target/install/{include,lib} --> |
| <execution> |
| <id>cmake-compile</id> |
| <goals> |
| <goal>compile</goal> |
| </goals> |
| <phase>compile</phase> |
| <configuration> |
| <config>${cmake.build.type}</config> |
| <projectDirectory>${cmake.project.dir}</projectDirectory> |
| <target>install</target> |
| </configuration> |
| </execution> |
| <!-- Run ctest against the test binaries built in cmake-compile --> |
| <execution> |
| <id>cmake-run-test</id> |
| <goals> |
| <goal>test</goal> |
| </goals> |
| <phase>integration-test</phase> |
| <configuration> |
| <config>${cmake.build.type}</config> |
| <projectDirectory>${cmake.project.dir}</projectDirectory> |
| <skipTests>${maven.test.skip}</skipTests> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <!-- Start a local IoTDB server before integration-test, stop it after. --> |
| <plugin> |
| <groupId>com.bazaarvoice.maven.plugins</groupId> |
| <artifactId>process-exec-maven-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>start-iotdb</id> |
| <goals> |
| <goal>start</goal> |
| </goals> |
| <phase>pre-integration-test</phase> |
| <configuration> |
| <skip>${ctest.skip.tests}</skip> |
| <name>iotdb-server</name> |
| <waitForInterrupt>false</waitForInterrupt> |
| <waitAfterLaunch>45</waitAfterLaunch> |
| <processLogFile>${cmake.project.dir}/test.log</processLogFile> |
| <arguments> |
| <argument>${project.basedir}/../../distribution/target/apache-iotdb-${project.version}-all-bin/apache-iotdb-${project.version}-all-bin/sbin/${iotdb.start.script}</argument> |
| </arguments> |
| </configuration> |
| </execution> |
| <execution> |
| <id>stop-iotdb</id> |
| <goals> |
| <goal>stop-all</goal> |
| </goals> |
| <phase>post-integration-test</phase> |
| <configuration> |
| <skip>${ctest.skip.tests}</skip> |
| <name>iotdb-server</name> |
| <waitForInterrupt>false</waitForInterrupt> |
| <waitAfterLaunch>5</waitAfterLaunch> |
| <processLogFile>${cmake.project.dir}/stop.log</processLogFile> |
| <arguments> |
| <argument>${project.basedir}/../../distribution/target/apache-iotdb-${project.version}-all-bin/apache-iotdb-${project.version}-all-bin/sbin/${iotdb.stop.script}</argument> |
| </arguments> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <artifactId>maven-resources-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>prepare-client-cpp-package-metadata</id> |
| <goals> |
| <goal>copy-resources</goal> |
| </goals> |
| <phase>prepare-package</phase> |
| <configuration> |
| <outputDirectory>${project.build.directory}/package-metadata</outputDirectory> |
| <resources> |
| <resource> |
| <directory>${project.basedir}/src/assembly/package-metadata</directory> |
| <filtering>true</filtering> |
| </resource> |
| </resources> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <!-- zip: iotdb-session-cpp-<version>-<classifier>.zip with a package root directory. --> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-assembly-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>package-client-cpp</id> |
| <goals> |
| <goal>single</goal> |
| </goals> |
| <phase>package</phase> |
| <configuration> |
| <finalName>iotdb-session-cpp-${project.version}</finalName> |
| <descriptors> |
| <descriptor>src/assembly/client-cpp.xml</descriptor> |
| </descriptors> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <!-- Create SHA512 checksum files for the release zip. --> |
| <plugin> |
| <groupId>net.nicoulaj.maven.plugins</groupId> |
| <artifactId>checksum-maven-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>checksum-client-cpp-package</id> |
| <goals> |
| <goal>files</goal> |
| </goals> |
| <phase>package</phase> |
| <configuration> |
| <algorithms> |
| <algorithm>SHA-512</algorithm> |
| </algorithms> |
| <fileSets> |
| <fileSet> |
| <directory>${project.build.directory}</directory> |
| <includes> |
| <include>${client.cpp.package.name}.zip</include> |
| </includes> |
| </fileSet> |
| </fileSets> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| <profiles> |
| <profile> |
| <id>.os-unix</id> |
| <activation> |
| <os> |
| <name>Linux</name> |
| <family>unix</family> |
| <arch>!aarch64</arch> |
| </os> |
| </activation> |
| <properties> |
| <iotdb.start.script>start-standalone.sh</iotdb.start.script> |
| <iotdb.stop.script>stop-standalone.sh</iotdb.stop.script> |
| <os.suffix>linux</os.suffix> |
| <client.cpp.package.classifier>linux-x86_64-glibc2.28</client.cpp.package.classifier> |
| </properties> |
| </profile> |
| <profile> |
| <id>.os-unix-arm</id> |
| <activation> |
| <os> |
| <name>Linux</name> |
| <family>unix</family> |
| <arch>aarch64</arch> |
| </os> |
| </activation> |
| <properties> |
| <iotdb.start.script>start-standalone.sh</iotdb.start.script> |
| <iotdb.stop.script>stop-standalone.sh</iotdb.stop.script> |
| <os.suffix>linux</os.suffix> |
| <client.cpp.package.classifier>linux-aarch64-glibc2.28</client.cpp.package.classifier> |
| </properties> |
| </profile> |
| <profile> |
| <id>.os-mac</id> |
| <activation> |
| <os> |
| <family>mac</family> |
| <arch>!aarch64</arch> |
| </os> |
| </activation> |
| <properties> |
| <iotdb.start.script>start-standalone.sh</iotdb.start.script> |
| <iotdb.stop.script>stop-standalone.sh</iotdb.stop.script> |
| <os.suffix>mac</os.suffix> |
| <client.cpp.package.classifier>macos-x86_64</client.cpp.package.classifier> |
| </properties> |
| </profile> |
| <profile> |
| <id>.os-mac-arm</id> |
| <activation> |
| <os> |
| <family>mac</family> |
| <arch>aarch64</arch> |
| </os> |
| </activation> |
| <properties> |
| <iotdb.start.script>start-standalone.sh</iotdb.start.script> |
| <iotdb.stop.script>stop-standalone.sh</iotdb.stop.script> |
| <os.suffix>mac</os.suffix> |
| <client.cpp.package.classifier>macos-aarch64</client.cpp.package.classifier> |
| </properties> |
| </profile> |
| <profile> |
| <id>.os-windows</id> |
| <activation> |
| <os> |
| <family>windows</family> |
| </os> |
| </activation> |
| <properties> |
| <iotdb.start.script>windows/start-standalone.bat</iotdb.start.script> |
| <iotdb.stop.script>windows/stop-standalone.bat</iotdb.stop.script> |
| <os.suffix>win</os.suffix> |
| <client.cpp.package.classifier>windows-x86_64-msvc14.3</client.cpp.package.classifier> |
| </properties> |
| </profile> |
| <!-- Windows: default to x64 (VS2017 and older default to Win32 without -A x64). --> |
| <profile> |
| <id>client-cpp-vs-x64</id> |
| <activation> |
| <os> |
| <family>windows</family> |
| </os> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>io.github.cmake-maven-plugin</groupId> |
| <artifactId>cmake-maven-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>cmake-generate</id> |
| <configuration> |
| <options combine.children="append"> |
| <option>-DCMAKE_GENERATOR_PLATFORM=x64</option> |
| </options> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <profile> |
| <id>.skipTests</id> |
| <activation> |
| <property> |
| <name>skipTests</name> |
| </property> |
| </activation> |
| <properties> |
| <build.tests>OFF</build.tests> |
| </properties> |
| </profile> |
| <!-- Spotless <clangFormat> needs Spotless 2.44+; only register C++ rules on the repository baseline, JDK 17+. --> |
| <profile> |
| <id>spotless-cpp</id> |
| <activation> |
| <jdk>[17,)</jdk> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>com.diffplug.spotless</groupId> |
| <artifactId>spotless-maven-plugin</artifactId> |
| <version>2.44.5</version> |
| <configuration> |
| <cpp> |
| <includes> |
| <include>src/**/*.h</include> |
| <include>src/**/*.hpp</include> |
| <include>src/**/*.c</include> |
| <include>src/**/*.cc</include> |
| <include>src/**/*.cpp</include> |
| <include>examples/**/*.c</include> |
| <include>examples/**/*.cc</include> |
| <include>examples/**/*.cpp</include> |
| </includes> |
| <excludes> |
| <exclude>test/catch2/**</exclude> |
| </excludes> |
| <clangFormat> |
| <version>${clang.format.version}</version> |
| <style>file</style> |
| </clangFormat> |
| </cpp> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| </project> |