Skip to content

Commit c92cec3

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents 34c3464 + 401c05c commit c92cec3

8 files changed

+135
-45
lines changed

CONTRIBUTING.md

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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 a non 1.6 JDK (e.g. `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` to a non 1.8 JDK (e.g. `JAVA_HOME`) for external contributions.
85+
86+
For external contributions you can for example add this to your shell startup scripts (e.g. `~/.zshrc`):
87+
```shell
88+
# This assumes JAVA_HOME is set already to a JDK >= 11 version
89+
export JDK_16="$JAVA_HOME"
90+
export JDK_18="$JAVA_HOME"
91+
```
92+
93+
### Running the Knit tool
94+
95+
* Use [Knit](https://github.com/Kotlin/kotlinx-knit/blob/master/README.md) for updates to documentation:
96+
* Run `./gradlew knit` to update example files, links, tables of content.
97+
* Commit updated documents and examples together with other changes.
98+
99+
### Updating the public API dump
100+
101+
* Use [Binary Compatibility Validator](https://github.com/Kotlin/binary-compatibility-validator/blob/master/README.md) for updates to public API:
102+
* Run `./gradlew apiDump` to update API index files.
103+
* Commit updated API indexes together with other changes.
104+
105+
## Releases
106+
107+
* Full release procedure checklist is [here](RELEASE.md).
108+
109+
## Contacting maintainers
110+
111+
* If something cannot be done, not convenient, or does not work &mdash; submit an [issue](#submitting-issues).
112+
* "How to do something" questions &mdash; [StackOverflow](https://stackoverflow.com).
113+
* 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 -->

docs/coroutine-context-and-dispatchers.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,21 @@ The Coroutine Debugger of the Kotlin plugin simplifies debugging coroutines in I
165165

166166
> Debugging works for versions 1.3.8 or later of `kotlinx-coroutines-core`.
167167
168-
The **Debug Tool Window** contains a **Coroutines** tab. In this tab, you can find information about both currently
169-
running and suspended coroutines. The coroutines are grouped by the dispatcher they are running on.
168+
The **Debug** tool window contains the **Coroutines** tab. In this tab, you can find information about both currently running and suspended coroutines.
169+
The coroutines are grouped by the dispatcher they are running on.
170170

171-
![Debugging coroutines](images/coroutine-debugger.png)
171+
![Debugging coroutines](images/coroutine-idea-debugging-1.png)
172172

173-
You can:
174-
* Easily check the state of each coroutine.
173+
With the coroutine debugger, you can:
174+
* Check the state of each coroutine.
175175
* See the values of local and captured variables for both running and suspended coroutines.
176176
* See a full coroutine creation stack, as well as a call stack inside the coroutine. The stack includes all frames with
177177
variable values, even those that would be lost during standard debugging.
178+
* Get a full report that contains the state of each coroutine and its stack. To obtain it, right-click inside the **Coroutines** tab, and then click **Get Coroutines Dump**.
178179

179-
If you need a full report containing the state of each coroutine and its stack, right-click inside the **Coroutines** tab, and then
180-
click **Get Coroutines Dump**.
180+
To start coroutine debugging, you just need to set breakpoints and run the application in debug mode.
181181

182-
Learn more about debugging coroutines in [this blog post](https://blog.jetbrains.com/kotlin/2020/07/kotlin-1-4-rc-debugging-coroutines/)
183-
and [IntelliJ IDEA documentation](https://www.jetbrains.com/help/idea/debug-kotlin-coroutines.html).
182+
Learn more about coroutines debugging in the [tutorial](https://kotlinlang.org/docs/tutorials/coroutines/debug-coroutines-with-idea.html).
184183

185184
#### Debugging using logging
186185

docs/exception-handling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
## Exception Handling
2020

2121
This section covers exception handling and cancellation on exceptions.
22-
We already know that cancelled coroutine throws [CancellationException] in suspension points and that it
22+
We already know that a cancelled coroutine throws [CancellationException] in suspension points and that it
2323
is ignored by the coroutines' machinery. Here we look at what happens if an exception is thrown during cancellation or multiple children of the same
2424
coroutine throw an exception.
2525

docs/flow.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -1463,13 +1463,15 @@ fun main() = runBlocking<Unit> {
14631463
14641464
A "Caught ..." message is not printed despite there being a `catch` operator:
14651465

1466-
<!--- TEST EXCEPTION
1466+
```text
14671467
Emitting 1
14681468
1
14691469
Emitting 2
14701470
Exception in thread "main" java.lang.IllegalStateException: Collected 2
14711471
at ...
1472-
-->
1472+
```
1473+
1474+
<!--- TEST EXCEPTION -->
14731475

14741476
#### Catching declaratively
14751477

@@ -1510,12 +1512,14 @@ fun main() = runBlocking<Unit> {
15101512
Now we can see that a "Caught ..." message is printed and so we can catch all the exceptions without explicitly
15111513
using a `try/catch` block:
15121514

1513-
<!--- TEST EXCEPTION
1515+
```text
15141516
Emitting 1
15151517
1
15161518
Emitting 2
15171519
Caught java.lang.IllegalStateException: Collected 2
1518-
-->
1520+
```
1521+
1522+
<!--- TEST EXCEPTION -->
15191523

15201524
### Flow completion
15211525

docs/images/coroutine-debugger.png

-382 KB
Binary file not shown.
243 KB
Loading

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ jsdom_global_version=3.0.2
4747
kotlin.incremental.multiplatform=true
4848
kotlin.native.ignoreDisabledTargets=true
4949

50-
# Site deneration
50+
# Site generation
5151
jekyll_version=4.0
5252

53-
# JS IR baceknd sometimes crashes with out-of-memory
53+
# JS IR backend sometimes crashes with out-of-memory
5454
# TODO: Remove once KT-37187 is fixed
5555
org.gradle.jvmargs=-Xmx2g
5656

0 commit comments

Comments
 (0)