How to Contribute to Lucene
Table of Contents |
---|
Working With Code
Getting the source code
...
Unit Tests
Please make sure that precommit and all unit tests succeed before constructing your patch: ant clean ./gradlew test.
To run a single test case from the lucene/core
directory in your working copy: ant -Dtestcase=NameOfYourUnitTest test
./gradlew -p lucene/core test --tests NameOfYourUnitTest
. Run ./gradlew helpTests
to get more information about running tests.
In case your contribution fixes a bug, please create a new test case that fails before your fix, to show the presence of the bug and ensure it never re-occurs. A test case showing the presence of a bug is also a good contribution by itself.
...
gradle precommit
Please run ant precommit
./gradlew
precommit
to identify problems that should be addressed before you contribute your changes.
...
- Check to see what files you have modified with:
git status
- Add any new files with:
git add src/.../MyNewClass.java
- In order to create a patch, just type
git diff HEAD > LUCENE-NNNN.patch
If your changes are all committed to the current (feature) branch:
git diff master... > LUCENE-NNNN.patch
If some of your changes are committed to the current (feature) branch but you have working-copy changes too:
git diff {{git merge-base master head
> LUCENE-NNNN.patch}}
This will save a diff into the LUCENE-NNNN.patch
file. Read the patch file. Make sure it includes ONLY the modifications required to fix a single issue.
...
- Nobody has done any work on the issue yet.
- The issue is likely not controversial.
- The issue is likely self-contained with limited scope.
To see a list of open Lucene and Solr issues with the newdev label, look at this link http://s.apache.org/newdevlucenesolr
...