Skip to content

Commit 7d8e275

Browse files
committed
Merge branch 'master' into develop
2 parents a78dd11 + d88a8c2 commit 7d8e275

31 files changed

+1712
-54
lines changed

RELEASE.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To release a new `<version>` of `kotlinx-coroutines`:
2121
* [`gradle.properties`](gradle.properties)
2222
* Make sure to **exclude** `CHANGES.md` from replacements.
2323

24-
As an alternative approach, you can use `./bump-version.sh old_version new_version`
24+
As an alternative approach, you can use `./bump-version.sh new_version`
2525

2626
5. Write release notes in [`CHANGES.md`](CHANGES.md):
2727
* Use the old releases for style guidance.
@@ -43,7 +43,7 @@ To release a new `<version>` of `kotlinx-coroutines`:
4343
* Get approval for it.
4444

4545
0. On [TeamCity integration server](https://teamcity.jetbrains.com/project.html?projectId=KotlinTools_KotlinxCoroutines):
46-
* Wait until "Build" configuration for committed `master` branch passes tests.
46+
* Wait until "Build" configuration for committed `version-<version>` branch passes tests.
4747
* Run "Deploy (Configure, RUN THIS ONE)" configuration with the corresponding new version:
4848
- Use the `version-<version>` branch
4949
- Set the `DeployVersion` build parameter to `<version>`
@@ -76,6 +76,5 @@ To release a new `<version>` of `kotlinx-coroutines`:
7676
8. Push the updates to GitHub:<br>
7777
`git push`
7878

79-
9. Build and publish the documentation for the web-site: <br>
80-
* Set new value for [`kotlinx.coroutines.release.tag`](https://buildserver.labs.intellij.net/admin/editProject.html?projectId=Kotlin_KotlinSites_Builds_KotlinlangOrg_LibrariesAPIs&tab=projectParams)
81-
* And run deploy [configuration](https://buildserver.labs.intellij.net/buildConfiguration/Kotlin_KotlinSites_Builds_KotlinlangOrg_KotlinCoroutinesApi?branch=%3Cdefault%3E&buildTypeTab=overview&mode=builds)
79+
9. Propose the website documentation update: <br>
80+
* Set new value for [`KOTLINX_COROUTINES_RELEASE_TAG`](https://github.com/JetBrains/kotlin-web-site/blob/master/.teamcity/BuildParams.kt), creating a Pull Request in the website's repository.

build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -356,3 +356,7 @@ allprojects { subProject ->
356356
}
357357
}
358358
}
359+
360+
tasks.named("dokkaHtmlMultiModule") {
361+
pluginsMapConfiguration.set(["org.jetbrains.dokka.base.DokkaBase": """{ "templatesDir": "${projectDir.toString().replace('\\', '/')}/dokka-templates" }"""])
362+
}

bump-version.sh

+83-23
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,95 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

3-
if [ "$#" -ne 2 ]
3+
set -efu
4+
5+
# the list of files that need to have the version updated in them
6+
#
7+
# limitations:
8+
# * no newlines in names
9+
# * no ' char in names
10+
files="
11+
README.md
12+
kotlinx-coroutines-core/README.md
13+
kotlinx-coroutines-debug/README.md
14+
kotlinx-coroutines-test/README.md
15+
ui/coroutines-guide-ui.md
16+
gradle.properties
17+
integration-testing/gradle.properties
18+
"
19+
20+
# read gradle.properties to get the old version
21+
set +e
22+
old_version="$(git grep -hoP '(?<=^version=).*(?=-SNAPSHOT$)' gradle.properties)"
23+
set -e
24+
if [ "$?" -ne 0 ]
425
then
5-
echo "Use: ./bump-version old_version new_version"
6-
exit
26+
echo "Could not read the old version from gradle.properties." >&2
27+
if [ "$#" -ne 2 ]
28+
then
29+
echo "Please use this form instead: ./bump-version.sh old_version new_version"
30+
exit 1
31+
fi
732
fi
833

9-
old_version=$1
10-
new_version=$2
34+
# check the command-line arguments for mentions of the version
35+
if [ "$#" -eq 2 ]
36+
then
37+
echo "If you want to infer the version automatically, use the form: ./bump-version.sh new_version" >&2
38+
if [ -n "$old_version" -a "$1" != "$old_version" ]
39+
then
40+
echo "The provided old version ($1) is different from the one in gradle.properties ($old_version)." >&2
41+
echo "Proceeding anyway with the provided old version." >&2
42+
fi
43+
old_version=$1
44+
new_version=$2
45+
elif [ "$#" -eq 1 ]
46+
then
47+
new_version=$1
48+
else
49+
echo "Use: ./bump-version.sh new_version" >&2
50+
exit 1
51+
fi
52+
53+
54+
# Escape dots, e.g. 1.0.0 -> 1\.0\.0
55+
escaped_old_version="$(printf "%s\n" "$old_version" | sed 's/[.]/\\./g')"
1156

1257
update_version() {
13-
echo "Updating version from '$old_version' to '$new_version' in $1"
14-
sed -i.bak s/$old_version/$new_version/g $1
15-
rm $1.bak
58+
file=$1
59+
to_undo=$2
60+
echo "Updating version from '$old_version' to '$new_version' in $1" >&2
61+
if [ -n "$(git diff --name-status -- "$file")" ]
62+
then
63+
printf "There are unstaged changes in '$file'. Refusing to proceed.\n" >&2
64+
[ -z "$to_undo" ] || eval "git checkout$to_undo"
65+
exit 1
66+
fi
67+
sed -i.bak "s/$escaped_old_version/$new_version/g" "$file"
68+
rm -f "$1.bak"
1669
}
1770

18-
update_version "README.md"
19-
update_version "kotlinx-coroutines-core/README.md"
20-
update_version "kotlinx-coroutines-debug/README.md"
21-
update_version "kotlinx-coroutines-test/README.md"
22-
update_version "ui/coroutines-guide-ui.md"
23-
update_version "gradle.properties"
24-
update_version "integration-test/gradle.properties"
71+
to_undo=$(printf "%s" "$files" | while read -r file; do
72+
if [ -n "$file" ]
73+
then
74+
update_version "$file" "${to_undo:-}"
75+
to_undo="${to_undo:-} '$file'"
76+
echo -n " '$file'"
77+
fi
78+
done)
2579
26-
# Escape dots, e.g. 1.0.0 -> 1\.0\.0
27-
escaped_old_version=$(echo $old_version | sed s/[.]/\\\\./g)
28-
result=$(find ./ -type f \( -iname \*.properties -o -iname \*.md \) | grep -v "\.gradle" | grep -v "build" | xargs -I{} grep -H "$escaped_old_version" {} | grep -v CHANGES.md | grep -v COMPATIBILITY.md)
29-
if [ -z "$result" ];
80+
set +e
81+
version_mentions=$(
82+
find . -type f \( -iname '*.properties' -o -iname '*.md' \) \
83+
-not -iname CHANGES.md \
84+
-exec git grep --fixed-strings --word "$old_version" {} +
85+
)
86+
set -e
87+
if [ -z "$version_mentions" ]
3088
then
31-
echo "Done"
89+
echo "Done. To undo, run this command:" >&2
90+
printf "git checkout%s\n" "$to_undo" >&2
3291
else
33-
echo "ERROR: Previous version is present in the project: $result"
34-
exit -1
92+
echo "ERROR: Previous version is present in the project: $version_mentions"
93+
[ -z "$to_undo" ] || eval "git checkout$to_undo"
94+
exit 1
3595
fi
Loading
Loading
97.1 KB
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

docs/kc.tree

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<chunk include-id="coroutines">
1111
<toc-element id="coroutines-guide.md"/>
1212
<toc-element id="coroutines-basics.md" accepts-web-file-names="basics.html,coroutines-basic-jvm.html"/>
13-
<toc-element toc-title="Intro to coroutines and channels – hands-on tutorial" href="https://play.kotlinlang.org/hands-on/Introduction%20to%20Coroutines%20and%20Channels/"/>
13+
<toc-element id="coroutines-and-channels.md"/>
1414
<toc-element id="cancellation-and-timeouts.md"/>
1515
<toc-element id="composing-suspending-functions.md"/>
1616
<toc-element id="coroutine-context-and-dispatchers.md"/>

0 commit comments

Comments
 (0)