summaryrefslogtreecommitdiff
path: root/zookeeper-client
diff options
context:
space:
mode:
authorMate Szalay-Beko <mszalay@cloudera.com>2019-10-10 14:42:46 +0200
committerAndor Molnar <andor@apache.org>2019-10-10 14:42:46 +0200
commitc9eeeda3bb83ee492a29ccbdc9f9541ee676e578 (patch)
tree9f3fee54679028dd406cb838dd5e5ab858855357 /zookeeper-client
parent11c07921c15e2fb7692375327b53f26a583b77ca (diff)
downloadzookeeper-c9eeeda3bb83ee492a29ccbdc9f9541ee676e578.tar.gz
ZOOKEEPER-3436: Enhance Mavenized Make C client
Based on eolivelli 's [previous pull request](https://github.com/apache/zookeeper/pull/993) we enhanced now the maven C client build: - we can compile now the C-client without tests (using the -DskipTests option) - we can optionally enable the test coverage calculation for the C-client (-Pc-test-coverage) - we also package the C-client into the binary tarball (when -Pfull-build is used) - I also updated the README_packaging.md file to make user's life easier (happier? :) ) I tested the build on ubuntu 16.04. Author: Mate Szalay-Beko <mszalay@cloudera.com> Author: Enrico Olivelli <eolivelli@apache.org> Reviewers: nkalmar@apache.org, eolivelli@apache.org, andor@apache.org Closes #1078 from symat/ZOOKEEPER-3436 and squashes the following commits: 18250df41 [Mate Szalay-Beko] ZOOKEEPER-3436 remove the C binaries from the binary tarball; update the readme files 57b7cd61d [Mate Szalay-Beko] ZOOKEEPER-3436 fixing file permissions of usr/bin/* in binary tarball a2ac025a0 [Mate Szalay-Beko] ZOOKEEPER-3436 enhance / format README_packaging.md 30eea5e27 [Mate Szalay-Beko] ZOOKEEPER-3436 exclude README_packaging.md from license check 936550e48 [Mate Szalay-Beko] ZOOKEEPER-3436 fixing README_packaging.md f01029524 [Mate Szalay-Beko] ZOOKEEPER-3436 Enhance Mavenized Make C client 44f6ba5d2 [Enrico Olivelli] Better .gitignore 204603751 [Enrico Olivelli] Enhance Mavenized Make C client
Diffstat (limited to 'zookeeper-client')
-rwxr-xr-xzookeeper-client/zookeeper-client-c/pom.xml138
1 files changed, 77 insertions, 61 deletions
diff --git a/zookeeper-client/zookeeper-client-c/pom.xml b/zookeeper-client/zookeeper-client-c/pom.xml
index 82948105d..e3703f1f8 100755
--- a/zookeeper-client/zookeeper-client-c/pom.xml
+++ b/zookeeper-client/zookeeper-client-c/pom.xml
@@ -33,54 +33,33 @@
<name>Apache ZooKeeper - Client - C</name>
<description>ZooKeeper c client</description>
+ <profiles>
+ <profile>
+ <id>c-test-coverage</id>
+ <properties>
+ <c-test-coverage-arg>--enable-gcov</c-test-coverage-arg>
+ </properties>
+ </profile>
+ <profile>
+ <id>no-c-test-coverage</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <c-test-coverage-arg> </c-test-coverage-arg>
+ </properties>
+ </profile>
+ </profiles>
+
<build>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-sources</id>
- <phase>generate-sources</phase>
- <configuration>
- <tasks>
- <mkdir dir="target/c" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>test-cppunit</id>
- <phase>test</phase>
- <configuration>
- <!-- do not run cpp tests if tests are globally skipped -->
- <skip>${skipTests}</skip>
- <tasks>
- <exec dir="${basedir}/target/c" executable="make" failonerror="true">
- <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
- <env key="PATH" path="${env.PATH};${basedir};" />
- <env key="CALLER" value="ANT" />
- <env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
- <env key="base_dir" value="${basedir}/../.." />
- <arg line="clean check" />
- </exec>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
+ <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>autoreconf</id>
- <phase>test-compile</phase>
+ <phase>process-sources</phase>
<goals>
<goal>exec</goal>
</goals>
@@ -97,7 +76,7 @@
</execution>
<execution>
<id>configure</id>
- <phase>test-compile</phase>
+ <phase>process-sources</phase>
<goals>
<goal>exec</goal>
</goals>
@@ -110,34 +89,71 @@
</environmentVariables>
<arguments>
<argument>--prefix=${project.build.directory}/c</argument>
- <argument>--enable-gcov</argument>
+ <argument>${c-test-coverage-arg}</argument>
</arguments>
</configuration>
</execution>
- <!--execution> TODO: Why is this not working?!
- <id>test-cppunit</id>
- <phase>test</phase>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-sources</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="target/c" />
+ </tasks>
+ </configuration>
<goals>
- <goal>exec</goal>
+ <goal>run</goal>
</goals>
+ </execution>
+ <execution>
+ <id>build-c-client</id>
+ <phase>compile</phase>
<configuration>
- <workingDirectory>${project.build.directory}/c</workingDirectory>
- <executable>make</executable>
- <environmentVariables>
- <LD_LIBRARY_PATH>${env.LD_LIBRARY_PATH};/usr/lib</LD_LIBRARY_PATH>
- <PATH>${env.PATH};${project.basedir};</PATH>
- <CALLER>ANT</CALLER>
- <CLOVER_HOME></CLOVER_HOME>
- <base_dir>${project.basedir}/../..</base_dir>
- </environmentVariables>
- <arguments>
- <argument>clean check</argument>
- </arguments>
+ <tasks>
+ <exec dir="${basedir}/target/c" executable="make" failonerror="true">
+ <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
+ <env key="PATH" path="${env.PATH};${basedir};" />
+ <env key="CALLER" value="ANT" />
+ <env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
+ <env key="base_dir" value="${basedir}/../.." />
+ <arg line="clean install" />
+ </exec>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>test-cppunit</id>
+ <phase>test</phase>
+ <configuration>
+ <!-- do not run cpp tests if tests are globally skipped -->
+ <skip>${skipTests}</skip>
+ <tasks>
+ <exec dir="${basedir}/target/c" executable="make" failonerror="true">
+ <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH};/usr/lib" />
+ <env key="PATH" path="${env.PATH};${basedir};" />
+ <env key="CALLER" value="ANT" />
+ <env key="CLOVER_HOME" value="${basedir}/../../zookeeper-server/target" />
+ <env key="base_dir" value="${basedir}/../.." />
+ <arg line="check" />
+ </exec>
+ </tasks>
</configuration>
- </execution-->
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
</executions>
</plugin>
</plugins>
</build>
-</project> \ No newline at end of file
+</project>