merlimat closed pull request #2513: [documentation] Add instructions for 
contributing c++/python code changes
URL: https://github.com/apache/incubator-pulsar/pull/2513
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-client-cpp/docker-format.sh 
b/pulsar-client-cpp/docker-format.sh
new file mode 100755
index 0000000000..f0ce191d99
--- /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 a82a28723d..9552244daa 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.


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to