blob: 8d11a82274c46bcc89d1449b80549c30e9b15934 [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
https://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.tsfile</groupId>
<artifactId>tsfile-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
</parent>
<artifactId>tsfile-cpp</artifactId>
<packaging>pom</packaging>
<name>TsFile: C++</name>
<properties>
<!-- Tell Sonar where to find the sources -->
<sonar.sources>common,examples,tsfile</sonar.sources>
<sonar.cfamily.build-wrapper-output>${project.build.directory}/build-wrapper-output</sonar.cfamily.build-wrapper-output>
<cmake.addition.option>-DCOV_ENABLED=OFF</cmake.addition.option>
</properties>
<build>
<sourceDirectory>${project.basedir}</sourceDirectory>
<plugins>
<!--
Do the actual build.
-->
<plugin>
<groupId>com.googlecode.cmake-maven-project</groupId>
<artifactId>cmake-maven-plugin</artifactId>
<executions>
<!-- Generate the configuration for the main compilation -->
<!--execution>
<id>cmake-generate-compile</id>
<phase>compile</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
<!- Compile the main code ->
<execution>
<id>cmake-execute-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution-->
<!-- Generate the configuration for the test compilation -->
<execution>
<id>cmake-generate-test-compile</id>
<phase>generate-test-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<options>
<option>-DBUILD_PHASE=test-compile</option>
<option>${cmake.addition.option}</option>
</options>
<sourcePath/>
<targetPath/>
</configuration>
</execution>
<!-- Compile the test code -->
<execution>
<id>cmake-execute-test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<!-- Execute the tests -->
<execution>
<id>cmake-run-tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<buildDirectory>${project.build.directory}/build/test</buildDirectory>
</configuration>
</execution>
</executions>
<configuration>
<!--
Actually the path to the CMakeList.txt file which then again
tells to tool where to find the sources.
-->
<sourcePath>${project.basedir}</sourcePath>
<!--
Path to where the build configuration is generated
(This directory is then used in the compile step to actually perform the build)
-->
<targetPath>${project.build.directory}/build</targetPath>
<!--
Name of the generator the compile step will be executing.
-->
<generator>${cmake.generator}</generator>
<!-- The directory where the "generate" step generated the build configuration -->
<projectDirectory>${project.build.directory}/build</projectDirectory>
</configuration>
</plugin>
<!-- Overwrite test config-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.1.1</version>
<executions>
<!-- rename the cmake binary and generate a script that adds the sonar build-wrapper -->
<execution>
<id>sync-project-version</id>
<phase>process-sources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>${project.basedir}/VersionUpdater.groovy</source>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>linux-install-uuid-dev</id>
<activation>
<os>
<family>unix</family>
<name>Linux</name>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>install-uuid-dev</id>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>bash</executable>
<arguments>
<argument>-c</argument>
<argument>sudo apt-get update &amp;&amp; sudo apt-get install -y uuid-dev</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>with-code-coverage</id>
<properties>
<cmake.addition.option>-DCOV_ENABLED=ON</cmake.addition.option>
</properties>
</profile>
<!-- When running on jenkins, download the sonar build-wrapper, so we can do a code analysis -->
<profile>
<id>jenkins-build</id>
<!-- This is needed by the groovy hack script -->
<properties>
<cmake.root>${project.build.directory}/dependency/cmake/bin</cmake.root>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<!-- Get the build-wrapper from our sonarcloud server -->
<execution>
<id>get-build-wrapper</id>
<phase>generate-sources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<skipCache>true</skipCache>
<url>https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip</url>
<unpack>true</unpack>
<outputDirectory>${project.build.directory}</outputDirectory>
<skipCache>true</skipCache>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>