Skip to content

Commit da2296c

Browse files
elizarovrecheej
authored andcommitted
Contributing Guidelines (Kotlin#2232)
Also moving there building instructions from README.md as only contributors shall care about them.
1 parent 46c8f7c commit da2296c

File tree

2 files changed

+109
-29
lines changed

2 files changed

+109
-29
lines changed

CONTRIBUTING.md

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Contributing Guidelines
2+
3+
There are two main ways to contribute to the project — submitting issues and submitting
4+
fixes/changes/improvements via pull requests.
5+
6+
## Submitting issues
7+
8+
Both bug reports and feature requests are welcome.
9+
Submit issues [here](https://github.com/Kotlin/kotlinx.coroutines/issues).
10+
11+
* Search for existing issues to avoid reporting duplicates.
12+
* When submitting a bug report:
13+
* Test it against the most recently released version. It might have been already fixed.
14+
* By default, we assume that your problem reproduces in Kotlin/JVM. Please, mention if the problem is
15+
specific to Kotlin/JS or Kotlin/Native.
16+
* Include the code that reproduces the problem. Provide the complete reproducer code, yet minimize it as much as possible.
17+
* However, don't put off reporting any weird or rarely appearing issues just because you cannot consistently
18+
reproduce them.
19+
* If the bug is in behavior, then explain what behavior you've expected and what you've got.
20+
* When submitting a feature request:
21+
* Explain why you need the feature — what's your use-case, what's your domain.
22+
* Explaining the problem you face is more important than suggesting a solution.
23+
Report your problem even if you don't have any proposed solution.
24+
* If there is an alternative way to do what you need, then show the code of the alternative.
25+
26+
## Submitting PRs
27+
28+
We love PRs. Submit PRs [here](https://github.com/Kotlin/kotlinx.coroutines/pulls).
29+
However, please keep in mind that maintainers will have to support the resulting code of the project,
30+
so do familiarize yourself with the following guidelines.
31+
32+
* All development (both new features and bug fixes) is performed in the `develop` branch.
33+
* The `master` branch always contains sources of the most recently released version.
34+
* Base PRs against the `develop` branch.
35+
* The `develop` branch is pushed to the `master` branch during release.
36+
* Documentation in markdown files can be updated directly in the `master` branch,
37+
unless the documentation is in the source code, and the patch changes line numbers.
38+
* If you fix documentation:
39+
* After fixing/changing code examples in the [`docs`](docs) folder or updating any references in the markdown files
40+
run the [Knit tool](#running-the-knit-tool) and commit the resulting changes as well.
41+
It will not pass the tests otherwise.
42+
* If you plan extensive rewrites/additions to the docs, then please [contact the maintainers](#contacting-maintainers)
43+
to coordinate the work in advance.
44+
* If you make any code changes:
45+
* Follow the [Kotlin Coding Conventions](https://kotlinlang.org/docs/reference/coding-conventions.html).
46+
Use 4 spaces for indentation.
47+
* [Build the project](#building) to make sure it all works and passes the tests.
48+
* If you fix a bug:
49+
* Write the test the reproduces the bug.
50+
* Fixes without tests are accepted only in exceptional circumstances if it can be shown that writing the
51+
corresponding test is too hard or otherwise impractical.
52+
* Follow the style of writing tests that is used in this project:
53+
name test functions as `testXxx`. Don't use backticks in test names.
54+
* If you introduce any new public APIs:
55+
* All new APIs must come with documentation and tests.
56+
* All new APIs are initially released with `@ExperimentalCoroutineApi` annotation and are graduated later.
57+
* [Update the public API dumps](#updating-the-public-api-dump) and commit the resulting changes as well.
58+
It will not pass the tests otherwise.
59+
* If you plan large API additions, then please start by submitting an issue with the proposed API design
60+
to gather community feedback.
61+
* [Contact the maintainers](#contacting-maintainers) to coordinate any big piece of work in advance.
62+
* Comment on the existing issue if you want to work on it. Ensure that the issue not only describes a problem,
63+
but also describes a solution that had received a positive feedback. Propose a solution if there isn't any.
64+
* Steps for contributing new integration modules are explained [here](integration/README.md#Contributing).
65+
66+
## Building
67+
68+
This library is built with Gradle.
69+
70+
* Run `./gradlew build` to build. It also runs all the tests.
71+
* Run `./gradlew <module>:test` to test the module you are looking at to speed
72+
things up during development.
73+
* Run `./gradlew jvmTest` to perform only fast JVM tests of the core multiplatform module.
74+
75+
You can import this project into IDEA, but you have to delegate build actions
76+
to Gradle (in Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Runner)
77+
78+
### Environment requirements
79+
80+
* JDK >= 11 referred to by the `JAVA_HOME` environment variable.
81+
* JDK 1.6 referred to by the `JDK_16` environment variable.
82+
It is OK to have `JDK_16` pointing to `JAVA_HOME` for external contributions.
83+
* JDK 1.8 referred to by the `JDK_18` environment variable. Only used by nightly stress-tests.
84+
It is OK to have `JDK_18` pointing to `JAVA_HOME` for external contributions.
85+
86+
### Running the Knit tool
87+
88+
* Use [Knit](https://github.com/Kotlin/kotlinx-knit/blob/master/README.md) for updates to documentation:
89+
* Run `./gradlew knit` to update example files, links, tables of content.
90+
* Commit updated documents and examples together with other changes.
91+
92+
### Updating the public API dump
93+
94+
* Use [Binary Compatibility Validator](https://github.com/Kotlin/binary-compatibility-validator/blob/master/README.md) for updates to public API:
95+
* Run `./gradlew apiDump` to update API index files.
96+
* Commit updated API indexes together with other changes.
97+
98+
## Releases
99+
100+
* Full release procedure checklist is [here](RELEASE.md).
101+
102+
## Contacting maintainers
103+
104+
* If something cannot be done, not convenient, or does not work &mdash; submit an [issue](#submitting-issues).
105+
* "How to do something" questions &mdash; [StackOverflow](https://stackoverflow.com).
106+
* Discussions and general inquiries &mdash; use `#coroutines` channel in [KotlinLang Slack](https://kotl.in/slack).

README.md

+3-29
Original file line numberDiff line numberDiff line change
@@ -212,35 +212,9 @@ enableFeaturePreview('GRADLE_METADATA')
212212
Since Kotlin/Native does not generally provide binary compatibility between versions,
213213
you should use the same version of Kotlin/Native compiler as was used to build `kotlinx.coroutines`.
214214

215-
## Building
216-
217-
This library is built with Gradle. To build it, use `./gradlew build`.
218-
You can import this project into IDEA, but you have to delegate build actions
219-
to Gradle (in Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Runner)
220-
221-
### Requirements
222-
223-
* JDK >= 11 referred to by the `JAVA_HOME` environment variable.
224-
* JDK 1.6 referred to by the `JDK_16` environment variable. It is okay to have `JDK_16` pointing to `JAVA_HOME` for external contributions.
225-
* JDK 1.8 referred to by the `JDK_18` environment variable. Only used by nightly stress-tests. It is okay to have `JDK_18` pointing to `JAVA_HOME` for external contributions.
226-
227-
## Contributions and releases
228-
229-
All development (both new features and bug fixes) is performed in `develop` branch.
230-
This way `master` sources always contain sources of the most recently released version.
231-
Please send PRs with bug fixes to `develop` branch.
232-
Fixes to documentation in markdown files are an exception to this rule. They are updated directly in `master`.
233-
234-
The `develop` branch is pushed to `master` during release.
235-
236-
* Full release procedure checklist is [here](RELEASE.md).
237-
* Steps for contributing new integration modules are explained [here](integration/README.md#Contributing).
238-
* Use [Knit](https://github.com/Kotlin/kotlinx-knit/blob/master/README.md) for updates to documentation:
239-
* In project root directory run `./gradlew knit`.
240-
* Commit updated documents and examples together with other changes.
241-
* Use [Binary Compatibility Validator](https://github.com/Kotlin/binary-compatibility-validator/blob/master/README.md) for updates to public API:
242-
* In project root directory run `./gradlew apiDump`.
243-
* Commit updated API index together with other changes.
215+
## Building and Contributing
216+
217+
See [Contributing Guidelines](CONTRIBUTING.md).
244218

245219
<!--- MODULE kotlinx-coroutines-core -->
246220
<!--- INDEX kotlinx.coroutines -->

0 commit comments

Comments
 (0)