This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 6fa95fa  [documentation] Add instructions for contributing c++/python 
code changes (#2513)
6fa95fa is described below

commit 6fa95fa291483d28296760503c1150cf1c393d34
Author: Sijie Guo <[email protected]>
AuthorDate: Wed Sep 5 14:41:37 2018 -0700

    [documentation] Add instructions for contributing c++/python code changes 
(#2513)
---
 pulsar-client-cpp/docker-format.sh | 44 ++++++++++++++++++++++++++++++++++++++
 site2/website/contributing.md      | 24 +++++++++++++++++++++
 2 files changed, 68 insertions(+)

diff --git a/pulsar-client-cpp/docker-format.sh 
b/pulsar-client-cpp/docker-format.sh
new file mode 100755
index 0000000..f0ce191
--- /dev/null
+++ b/pulsar-client-cpp/docker-format.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# 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.
+#
+
+# Build Pulsar C++ client within a Docker container
+
+# Fail script in case of errors
+set -e
+
+ROOT_DIR=$(git rev-parse --show-toplevel)
+cd $ROOT_DIR/pulsar-client-cpp
+
+BUILD_IMAGE_NAME="${BUILD_IMAGE_NAME:-apachepulsar/pulsar-build}"
+BUILD_IMAGE_VERSION="${BUILD_IMAGE_VERSION:-ubuntu-16.04}"
+
+IMAGE="$BUILD_IMAGE_NAME:$BUILD_IMAGE_VERSION"
+
+echo "---- Build Pulsar C++ client using image $IMAGE"
+
+docker pull $IMAGE
+
+DOCKER_CMD="docker run -i -v $ROOT_DIR:/pulsar $IMAGE"
+
+# Remove any cached CMake relate file from previous builds
+find . -name CMakeCache.txt | xargs rm -f
+find . -name CMakeFiles | xargs rm -rf
+
+$DOCKER_CMD bash -c "cd /pulsar/pulsar-client-cpp && cmake . $CMAKE_ARGS && 
make format"
diff --git a/site2/website/contributing.md b/site2/website/contributing.md
index a82a287..9552244 100644
--- a/site2/website/contributing.md
+++ b/site2/website/contributing.md
@@ -181,6 +181,30 @@ Then you can push your local, committed changes to your 
(forked) repository on G
 
 All code should have appropriate unit testing coverage. New code should have 
new tests in the same contribution. Bug fixes should include a regression test 
to prevent the issue from reoccurring.
 
+### Develop C++/Python Client
+
+Currently C++ and Python client are developed under `pulsar-client-cpp` 
directory. You can use following commands to build and test your c++ or python 
code changes.
+
+#### Build C++/Python Client
+
+```
+$ ./pulsar-client-cpp/docker-build.sh
+```
+
+### Run C++/Python Client Tests
+
+```
+$ ./pulsar-client-cpp/docker-test.sh
+```
+
+### Checkstyle
+
+Before you push the C++/Python changes for review, you should format the files 
to apply the checkstyle rule Pulsar is using for C++/Python code.
+
+```
+$ ./pulsar-client-cpp/docker-format.sh
+```
+
 ## Review
 
 Once the initial code is complete and the tests pass, it’s time to start the 
code review process. We review and discuss all code, no matter who authors it. 
It’s a great way to build community, since you can learn from other developers, 
and they become familiar with your contribution. It also builds a strong 
project by encouraging a high quality bar and keeping code consistent 
throughout the project.

Reply via email to