| 1 | Contributing |
| 2 | ============ |
| 3 | |
| 4 | Want to contribute? Great! First, read this page (including the small print at the end). |
| 5 | |
| 6 | # Before you contribute |
| 7 | Before we can use your code, you must sign the |
| 8 | [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1) |
| 9 | (CLA), which you can do online. The CLA is necessary mainly because you own the |
| 10 | copyright to your changes, even after your contribution becomes part of our |
| 11 | codebase, so we need your permission to use and distribute your code. We also |
| 12 | need to be sure of various other things—for instance that you'll tell us if you |
| 13 | know that your code infringes on other people's patents. You don't have to sign |
| 14 | the CLA until after you've submitted your code for review and a member has |
| 15 | approved it, but you must do it before we can put your code into our codebase. |
| 16 | Before you start working on a larger contribution, you should get in touch with |
| 17 | us first through the issue tracker with your idea so that we can help out and |
| 18 | possibly guide you. Coordinating up front makes it much easier to avoid |
| 19 | frustration later on. |
| 20 | |
| 21 | # Code reviews |
| 22 | All submissions, including submissions by project members, require review. We |
| 23 | use Github pull requests for this purpose. |
| 24 | |
| 25 | # The small print |
| 26 | Contributions made by corporations are covered by a different agreement than |
| 27 | the one above, the Software Grant and Corporate Contributor License Agreement. |
| 28 | |
| 29 | # Building |
| 30 | |
| 31 | The following commands will clone the GitHub repository and run all the RE2/J |
| 32 | tests: |
| 33 | |
| 34 | ``` |
| 35 | $ git clone https://github.com/google/re2j.git |
| 36 | $ cd re2j |
| 37 | $ ./gradlew check |
| 38 | ``` |
| 39 | |
| 40 | # Running the benchmarks |
| 41 | |
| 42 | You can run the benchmarks by checking out the GitHub repository and then |
| 43 | running the following command: |
| 44 | |
| 45 | ``` |
| 46 | $ ./gradlew :benchmarks:run |
| 47 | ``` |
| 48 | |
| 49 | Benchmarks are implemented in [JMH][1], which has a rich command-line |
| 50 | interface. For help, see |
| 51 | |
| 52 | ``` |
| 53 | $ ./gradlew :benchmarks:run -- --args='-h' |
| 54 | ``` |
| 55 | |
| 56 | [1]: https://openjdk.java.net/projects/code-tools/jmh/ |