Skip to content

Commit 99be7de

Browse files
Mate Szalay-Bekoanmolnar
authored andcommitted
ZOOKEEPER-3530: add new artifact for compiled c-client code
During the old ZooKeeper 3.4 ant builds (ant package-native), there was an artifact (zookeeper-<version>-lib.tar.gz) created just for the C-client, with the following content: ``` usr |--- bin |--- cli_mt |--- cli_st |--- load_gen |--- include |--- zookeeper |--- proto.h |--- recordio.h |--- zookeeper.h |--- zookeeper.jute.h |--- zookeeper_log.h |--- zookeeper_version.h |--- lib |--- libzookeeper_mt.a |--- libzookeeper_mt.la |--- libzookeeper_mt.so |--- libzookeeper_mt.so.2 |--- libzookeeper_mt.so.2.0.0 |--- libzookeeper_st.a |--- libzookeeper_st.la |--- libzookeeper_st.so |--- libzookeeper_st.so.2 |--- libzookeeper_st.so.2.0.0 ``` Currently with maven, when we are generating a tarball during full-build then the C-client is not getting archived. In [PR-1078](apache#1078) we discussed that we should re-introduce the apache-zookeeper-<version>-lib.tar.gz artifact. The goals of this PR are: - re-introduce the 'lib' artifact, with the same structure we had for the older zookeeper 3.4.x ant generated tar file - we should also add the LICENSE.txt file to the archive (it was missing from the 3.4.x version tar.gz file) - the new artifact should be generated only when the full-build profile is set for maven - we should also update the README_packaging.md file Author: Mate Szalay-Beko <[email protected]> Reviewers: [email protected], [email protected] Closes apache#1113 from symat/ZOOKEEPER-3530-PR
1 parent c9eeeda commit 99be7de

3 files changed

Lines changed: 91 additions & 0 deletions

File tree

README_packaging.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ The compiled C client can be found here:
6464
- `zookeeper-client/zookeeper-client-c/target/c/lib` - Native libraries
6565
- `zookeeper-client/zookeeper-client-c/target/c/include/zookeeper` - Native library headers
6666

67+
The same folders gets archived to the `zookeeper-assembly/target/apache-zookeeper-<version>-lib.tar.gz` file, assuming you activated the `full-build` maven profile.
6768

6869
## Package build command (using ant)
6970

zookeeper-assembly/pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,20 @@
3333
<name>Apache ZooKeeper - Assembly</name>
3434
<description>ZooKeeper Assembly</description>
3535

36+
<profiles>
37+
<profile>
38+
<id>full-build</id>
39+
<properties>
40+
<skip.lib.artifact>false</skip.lib.artifact>
41+
</properties>
42+
</profile>
43+
</profiles>
44+
45+
3646
<properties>
3747
<rw.file.permission>0644</rw.file.permission>
3848
<rwx.file.permission>0755</rwx.file.permission>
49+
<skip.lib.artifact>true</skip.lib.artifact>
3950
</properties>
4051

4152
<dependencies>
@@ -143,6 +154,22 @@
143154
<tarLongFileMode>posix</tarLongFileMode>
144155
</configuration>
145156
</execution>
157+
<execution>
158+
<id>lib-assembly</id>
159+
<phase>package</phase>
160+
<goals>
161+
<goal>single</goal>
162+
</goals>
163+
<configuration>
164+
<descriptors>
165+
<descriptor>${project.basedir}/src/main/assembly/lib-package.xml</descriptor>
166+
</descriptors>
167+
<finalName>apache-zookeeper-${project.version}-lib</finalName>
168+
<appendAssemblyId>false</appendAssemblyId>
169+
<tarLongFileMode>posix</tarLongFileMode>
170+
<skipAssembly>${skip.lib.artifact}</skipAssembly>
171+
</configuration>
172+
</execution>
146173
</executions>
147174
</plugin>
148175

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
4+
<!--
5+
/**
6+
* Licensed to the Apache Software Foundation (ASF) under one
7+
* or more contributor license agreements. See the NOTICE file
8+
* distributed with this work for additional information
9+
* regarding copyright ownership. The ASF licenses this file
10+
* to you under the Apache License, Version 2.0 (the
11+
* "License"); you may not use this file except in compliance
12+
* with the License. You may obtain a copy of the License at
13+
*
14+
* http://www.apache.org/licenses/LICENSE-2.0
15+
*
16+
* Unless required by applicable law or agreed to in writing, software
17+
* distributed under the License is distributed on an "AS IS" BASIS,
18+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19+
* See the License for the specific language governing permissions and
20+
* limitations under the License.
21+
*/
22+
-->
23+
<id>lib-package</id>
24+
<formats>
25+
<format>tar.gz</format>
26+
</formats>
27+
<includeBaseDirectory>true</includeBaseDirectory>
28+
29+
<fileSets>
30+
<fileSet>
31+
<!-- ZooKeeper C client lib and include files -->
32+
<directory>${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c</directory>
33+
<outputDirectory>usr</outputDirectory>
34+
<includes>
35+
<include>include/**/*</include>
36+
<include>lib/*</include>
37+
</includes>
38+
<fileMode>${rw.file.permission}</fileMode>
39+
<directoryMode>${rwx.file.permission}</directoryMode>
40+
</fileSet>
41+
<fileSet>
42+
<!-- ZooKeeper C client binaries-->
43+
<directory>${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c</directory>
44+
<outputDirectory>usr</outputDirectory>
45+
<includes>
46+
<include>bin/*</include>
47+
</includes>
48+
<fileMode>${rwx.file.permission}</fileMode>
49+
<directoryMode>${rwx.file.permission}</directoryMode>
50+
</fileSet>
51+
<fileSet>
52+
<!-- ZooKeeper license -->
53+
<directory>${project.basedir}/..</directory>
54+
<includes>
55+
<include>LICENSE.txt</include>
56+
</includes>
57+
<fileMode>${rw.file.permission}</fileMode>
58+
<directoryMode>${rwx.file.permission}</directoryMode>
59+
</fileSet>
60+
61+
</fileSets>
62+
63+
</assembly>

0 commit comments

Comments
 (0)