blob: 726e54bd5cbe65aa2eea83e64d0abe6b263a0546 [file] [log] [blame]
<?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>1.3.2-SNAPSHOT</version>
</parent>
<artifactId>client-cpp</artifactId>
<packaging>pom</packaging>
<name>IoTDB: Client: Client for CPP</name>
<description>C++ client</description>
<!-- TODO: The tests don't run, if distribution has not been built locally and fails without reasoning -->
<properties>
<catch2.url>https://github.com/catchorg/Catch2/releases/download/v2.13.7/catch.hpp</catch2.url>
<cmake.build.type>Release</cmake.build.type>
<!-- Default value of cmake root -->
<cmake.root.dir>${project.build.directory}/dependency/cmake/</cmake.root.dir>
<thrift.exec.absolute.path>${project.build.directory}/thrift/bin/${thrift.executable}</thrift.exec.absolute.path>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-thrift-commons</artifactId>
<version>1.3.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Build and do session integration test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-test-resources</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>validate</phase>
<configuration>
<outputDirectory>${project.build.directory}/build/test</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/test</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>get-thrift</id>
<goals>
<goal>unpack</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.iotdb.tools</groupId>
<artifactId>iotdb-tools-thrift</artifactId>
<version>${iotdb-tools-thrift.version}</version>
<classifier>${os.classifier}</classifier>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/thrift</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<!-- Download the Catch2 header file. -->
<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}/build/test/catch2</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<!-- TODO: Do this differently using the artifact downloader -->
<execution>
<id>copy-protocol-thrift-source</id>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<sourceFile>../../iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift</sourceFile>
<destinationFile>${project.build.directory}/protocols/client.thrift</destinationFile>
</fileSet>
<fileSet>
<sourceFile>../../iotdb-protocol/thrift-commons/src/main/thrift/common.thrift</sourceFile>
<destinationFile>${project.build.directory}/protocols/common.thrift</destinationFile>
</fileSet>
</fileSets>
</configuration>
</execution>
<!-- TODO: Do this differently using the maven-resources-plugin -->
<execution>
<!-- Copy source file and CmakeLists.txt into target directory -->
<id>copy-cmakelist-file</id>
<goals>
<goal>copy</goal>
</goals>
<phase>compile</phase>
<configuration>
<fileSets>
<fileSet>
<sourceFile>${project.basedir}/src/main/CMakeLists.txt</sourceFile>
<destinationFile>${project.build.directory}/build/main/CMakeLists.txt</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.basedir}/src/main/Session.h</sourceFile>
<destinationFile>${project.build.directory}/build/main/generated-sources-cpp/Session.h</destinationFile>
</fileSet>
<fileSet>
<sourceFile>${project.basedir}/src/main/Session.cpp</sourceFile>
<destinationFile>${project.build.directory}/build/main/generated-sources-cpp/Session.cpp</destinationFile>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.thrift.tools</groupId>
<artifactId>maven-thrift-plugin</artifactId>
<executions>
<execution>
<id>generate-thrift-sources-cpp</id>
<goals>
<goal>compile</goal>
</goals>
<!-- Move from generate-sources to generate-resources to avoid double executions -->
<phase>generate-resources</phase>
<configuration>
<generator>cpp:no_skeleton</generator>
<thriftExecutable>${thrift.exec.absolute.path}</thriftExecutable>
<thriftSourceRoot>${project.build.directory}/protocols</thriftSourceRoot>
<outputDirectory>${project.build.directory}/build/main/generated-sources-cpp</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>
<goals>
<goal>generate</goal>
</goals>
<phase>compile</phase>
<configuration>
<generator>${cmake.generator}</generator>
<sourcePath>${project.build.directory}/build/main</sourcePath>
<targetPath>${project.build.directory}/build/main</targetPath>
<options>
<option>-DBOOST_INCLUDEDIR=${boost.include.dir}</option>
</options>
</configuration>
</execution>
<!-- Generate Cmake build directory to compile testing program -->
<execution>
<id>cmake-generate-test</id>
<goals>
<goal>generate</goal>
</goals>
<phase>test-compile</phase>
<configuration>
<generator>${cmake.generator}</generator>
<sourcePath>${project.build.directory}/build/test</sourcePath>
<targetPath>${project.build.directory}/build/test</targetPath>
<options>
<option>-DBOOST_INCLUDEDIR=${boost.include.dir}</option>
</options>
</configuration>
</execution>
<!-- Actually executes the build -->
<execution>
<id>cmake-compile</id>
<goals>
<goal>compile</goal>
</goals>
<phase>compile</phase>
<configuration>
<config>${cmake.build.type}</config>
<!-- The directory where the "generate" step generated the build configuration -->
<projectDirectory>${project.build.directory}/build/main</projectDirectory>
</configuration>
</execution>
<!-- Actually executes the testing compilation -->
<execution>
<id>cmake-compile-test</id>
<goals>
<goal>compile</goal>
</goals>
<phase>test-compile</phase>
<configuration>
<config>${cmake.build.type}</config>
<projectDirectory>${project.build.directory}/build/test</projectDirectory>
</configuration>
</execution>
<!-- Run the integration test cases -->
<!-- TODO: This execution doesn't seem to respect the "skipTests" config -->
<execution>
<id>cmake-run-test</id>
<goals>
<goal>test</goal>
</goals>
<phase>integration-test</phase>
<configuration>
<buildDirectory>${project.build.directory}/build/test</buildDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!--Package all C++ header files and client library-->
<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>${project.artifactId}-${project.version}</finalName>
<descriptors>
<descriptor>src/assembly/client-cpp.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.bazaarvoice.maven.plugins</groupId>
<artifactId>process-exec-maven-plugin</artifactId>
<executions>
<!-- Start a local IoTDB server to run integration test cases -->
<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>
<!-- Maximum time in seconds to wait after launching IoTDB -->
<waitAfterLaunch>15</waitAfterLaunch>
<!-- Redirect IoTDB server log to /dev/null -->
<processLogFile>${project.build.directory}/build/test/test.log</processLogFile>
<arguments>
<!-- TODO: This depends on distribution being build first and it being available in unpacked form ... unpacking the distribution locally will be the better option -->
<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>
<!-- Stop the IoTDB server when integration test finishes -->
<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>
<!-- Maximum time in seconds to wait after launching IoTDB -->
<waitAfterLaunch>5</waitAfterLaunch>
<!-- Redirect IoTDB server log to /dev/null -->
<processLogFile>${project.build.directory}/build/test/test1.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>
</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>
</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>
</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>
</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>
</properties>
</profile>
<profile>
<id>.os-windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<iotdb.start.script>start-standalone.bat</iotdb.start.script>
<iotdb.stop.script>stop-standalone.bat</iotdb.stop.script>
<os.suffix>win</os.suffix>
</properties>
</profile>
</profiles>
</project>