Skip to content

Commit 0436819

Browse files
Merge branch 'master' into kug-inclusion-kotlin-devs-brasil
2 parents e82231d + 5df0480 commit 0436819

12 files changed

+71
-41
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
* @zoobestik @nikpachoo @krutilov
22

33
# Community events
4-
/data/events.yml @MKrishtal
4+
/data/events.yml @MKrishtal @meilalina
55
/data/user-groups.yml @MKrishtal @meilalina
66
/data/universities.yml @Belosnegova
77

docs/topics/gradle/gradle-compiler-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Here is a complete list of options for Gradle tasks:
171171
| Name | Description | Possible values | Default value |
172172
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|-----------------------------|
173173
| `javaParameters` | Generate metadata for Java 1.8 reflection on method parameters | | false |
174-
| `jvmTarget` | Target version of the generated JVM bytecode | "1.8", "9", "10", ..., "20", "21". Also, see [Types for compiler options](#types-for-compiler-options) | "%defaultJvmTargetVersion%" |
174+
| `jvmTarget` | Target version of the generated JVM bytecode | "1.8", "9", "10", ..., "21", "22". Also, see [Types for compiler options](#types-for-compiler-options) | "%defaultJvmTargetVersion%" |
175175
| `noJdk` | Don't automatically include the Java runtime into the classpath | | false |
176176
| `jvmTargetValidationMode` | <list><li>Validation of the [JVM target compatibility](gradle-configure-project.md#check-for-jvm-target-compatibility-of-related-compile-tasks) between Kotlin and Java</li><li>A property for tasks of the `KotlinCompile` type.</li></list> | `WARNING`, `ERROR`, `INFO` | `ERROR` |
177177

docs/topics/k2-compiler-migration-guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ fun main(input: Rho) {
293293
var unknownObject: Rho = input
294294

295295
// Check if unknownObject inherits from the Tau interface
296+
// Note, it's possible that unknownObject inherits from both
297+
// Rho and Tau interfaces.
296298
if (unknownObject is Tau) {
297299

298300
// Use the overloaded inc() operator from interface Rho,

docs/topics/kapt.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,29 @@ kapt.incremental.apt=false
276276

277277
Note that incremental annotation processing requires [incremental compilation](gradle-compilation-and-caches.md#incremental-compilation)
278278
to be enabled as well.
279+
280+
## Inherit annotation processors from superconfigurations
281+
282+
You can define a common set of annotation processors in a separate Gradle configuration as a
283+
superconfiguration and extend it further in kapt-specific configurations for your subprojects.
284+
285+
As an example, for a subproject using [Dagger](https://dagger.dev/), in your `build.gradle(.kts)` file, use the following configuration:
286+
287+
```kotlin
288+
val commonAnnotationProcessors by configurations.creating
289+
configurations.named("kapt") { extendsFrom(commonAnnotationProcessors) }
290+
291+
dependencies {
292+
implementation("com.google.dagger:dagger:2.48.1")
293+
commonAnnotationProcessors("com.google.dagger:dagger-compiler:2.48.1")
294+
}
295+
```
296+
297+
In this example, the `commonAnnotationProcessors` Gradle configuration is your common superconfiguration for annotation processing
298+
that you want to be used for all your projects. You use the [`extendsFrom()`](https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.Configuration.html#org.gradle.api.artifacts.Configuration:extendsFrom)
299+
method to add `commonAnnotationProcessors` as a superconfiguration. kapt sees that the `commonAnnotationProcessors`
300+
Gradle configuration has a dependency on the Dagger annotation processor. Therefore, kapt includes the Dagger annotation processor
301+
in its configuration for annotation processing.
279302

280303
## Java compiler options
281304

docs/topics/kug-guidelines.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
A Kotlin User Group, or KUG, is a community that is dedicated to Kotlin and that offers you a place to share your
44
Kotlin programming experience with like-minded people.
55

6-
To become an KUG, your community should have some specific features shared by every KUG. It should:
6+
To become a KUG, your community should have some specific features shared by every KUG. It should:
77
* Provide Kotlin-related content, with regular meetups as the main form of activity.
88
* Host regular events (at least once every 3 months) with open registration and without any restriction for attendance.
99
* Be driven and organized by the community, and it should not use events to earn money or gain any other business
1010
benefits from members and attendees.
11-
* Follow and ensure a code of conduct in order to provide a welcoming environment for attendees of any background and
12-
experience (check-out our recommended [Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct)).
11+
* Follow and ensure a code of conduct to provide a welcoming environment for attendees of any background and
12+
experience (check out our recommended [Code of Conduct](https://github.com/jetbrains#code-of-conduct)).
1313

1414
There are no limits regarding the format for KUG meetups. They can take place in whatever fashion works best for the
1515
community, whether that includes presentations, hands-on labs, lectures, hackathons, or informal beer-driven get-togethers.
@@ -20,7 +20,8 @@ community, whether that includes presentations, hands-on labs, lectures, hackath
2020

2121
## How to run a KUG?
2222

23-
* In order to promote group cohesion and prevent miscommunication, we recommend keeping to a limit of one KUG per city. Check out [the list of KUGs](https://kotlinlang.org/community/user-groups) to see if there is already a KUG in your area.
23+
* To promote group cohesion and prevent miscommunication, we recommend keeping to a limit of one KUG per city.
24+
Check out [the list of KUGs](https://kotlinlang.org/community/user-groups/) to see if there is already a KUG in your area.
2425
* Use the official KUG logo and branding. Check out [the branding guidelines](kotlin-brand-assets.md#kotlin-user-group-brand-assets).
2526
* Keep your user group active. Run meetups regularly, at least once every 3 months.
2627
* Announce your KUG meetups at least 2 weeks in advance. The announcement should contain a list of talks
@@ -48,4 +49,4 @@ If you organize any other tech communities, you can apply for support as well. B
4849
* Free licenses for JetBrains products to raffle off at meetups.
4950
* Information about Kotlin official events and campaigns.
5051
* Kotlin stickers.
51-
* Help with recruiting Kotlin speakers for your events.
52+
* Help with recruiting Kotlin speakers for your events.

docs/topics/maven.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,17 +322,17 @@ The following attributes are supported:
322322

323323
### Attributes specific to JVM
324324

325-
| Name | Property name | Description | Possible values | Default value |
326-
|-------------------|---------------------------------|------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
327-
| `nowarn` | | Generate no warnings | true, false | false |
325+
| Name | Property name | Description | Possible values | Default value |
326+
|-------------------|---------------------------------|------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|-----------------------------|
327+
| `nowarn` | | Generate no warnings | true, false | false |
328328
| `languageVersion` | kotlin.compiler.languageVersion | Provide source compatibility with the specified version of Kotlin | "1.3" (DEPRECATED), "1.4" (DEPRECATED), "1.5", "1.6", "1.7", "1.8", "1.9", "2.0" (EXPERIMENTAL), "2.1" (EXPERIMENTAL) | |
329329
| `apiVersion` | kotlin.compiler.apiVersion | Allow using declarations only from the specified version of bundled libraries | "1.3" (DEPRECATED), "1.4" (DEPRECATED), "1.5", "1.6", "1.7", "1.8", "1.9", "2.0" (EXPERIMENTAL), "2.1" (EXPERIMENTAL) | |
330-
| `sourceDirs` | | The directories containing the source files to compile | | The project source roots |
331-
| `compilerPlugins` | | Enabled compiler plugins | | [] |
332-
| `pluginOptions` | | Options for compiler plugins | | [] |
333-
| `args` | | Additional compiler arguments | | [] |
334-
| `jvmTarget` | `kotlin.compiler.jvmTarget` | Target version of the generated JVM bytecode | "1.8", "9", "10", ..., "21" | "%defaultJvmTargetVersion%" |
335-
| `jdkHome` | `kotlin.compiler.jdkHome` | Include a custom JDK from the specified location into the classpath instead of the default JAVA_HOME | | |
330+
| `sourceDirs` | | The directories containing the source files to compile | | The project source roots |
331+
| `compilerPlugins` | | Enabled compiler plugins | | [] |
332+
| `pluginOptions` | | Options for compiler plugins | | [] |
333+
| `args` | | Additional compiler arguments | | [] |
334+
| `jvmTarget` | `kotlin.compiler.jvmTarget` | Target version of the generated JVM bytecode | "1.8", "9", "10", ..., "22" | "%defaultJvmTargetVersion%" |
335+
| `jdkHome` | `kotlin.compiler.jdkHome` | Include a custom JDK from the specified location into the classpath instead of the default JAVA_HOME | | |
336336

337337
## Use BOM
338338

docs/topics/multiplatform/multiplatform-plugin-releases.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ Compatible Kotlin version
4141

4242
**0.8.2**
4343

44-
Released: 25 January, 2024
44+
Released: 16 May, 2024
4545

4646
</td>
4747
<td>
4848

49-
* Support for the new Canary Android Studio Jellyfish.
49+
* Support for Android Studio Jellyfish and for the new Canary version, Koala.
5050
* Added declarations of `sourceCompatibility` and `targetCompatibility` in the shared module.
5151

5252
</td>

docs/topics/tour/kotlin-tour-control-flow.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ fun main() {
4646
```
4747
{kotlin-runnable="true" kotlin-min-compiler-version="1.3" id="kotlin-tour-if"}
4848

49-
There is no ternary operator `condition ? then : else` in Kotlin. Instead, `if` can be used as an expression. When using
50-
`if` as an expression, there are no curly braces `{}`:
49+
There is no ternary operator `condition ? then : else` in Kotlin. Instead, `if` can be used as an expression. If there is
50+
only one line of code per action, the curly braces `{}` are optional:
5151

5252
```kotlin
5353
fun main() {
@@ -405,7 +405,7 @@ fun main() {
405405
number % 15 == 0 -> "fizzbuzz"
406406
number % 3 == 0 -> "fizz"
407407
number % 5 == 0 -> "buzz"
408-
else -> number.toString()
408+
else -> "$number"
409409
}
410410
)
411411
}
@@ -447,4 +447,4 @@ fun main() {
447447

448448
## Next step
449449

450-
[Functions](kotlin-tour-functions.md)
450+
[Functions](kotlin-tour-functions.md)

docs/topics/tour/kotlin-tour-functions.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ Kotlin allows you to write even more concise code for functions by using lambda
276276
For example, the following `uppercaseString()` function:
277277

278278
```kotlin
279-
fun uppercaseString(string: String): String {
280-
return string.uppercase()
279+
fun uppercaseString(text: String): String {
280+
return text.uppercase()
281281
}
282282
fun main() {
283283
println(uppercaseString("hello"))
@@ -290,7 +290,7 @@ Can also be written as a lambda expression:
290290

291291
```kotlin
292292
fun main() {
293-
println({ string: String -> string.uppercase() }("hello"))
293+
println({ text: String -> text.uppercase() }("hello"))
294294
// HELLO
295295
}
296296
```
@@ -304,10 +304,10 @@ Within the lambda expression, you write:
304304
* the function body after the `->`.
305305

306306
In the previous example:
307-
* `string` is a function parameter.
308-
* `string` has type `String`.
307+
* `text` is a function parameter.
308+
* `text` has type `String`.
309309
* the function returns the result of the [`.uppercase()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/uppercase.html)
310-
function called on `string`.
310+
function called on `text`.
311311

312312
> If you declare a lambda without parameters, then there is no need to use `->`. For example:
313313
> ```kotlin
@@ -328,7 +328,7 @@ To assign a lambda expression to a variable, use the assignment operator `=`:
328328
329329
```kotlin
330330
fun main() {
331-
val upperCaseString = { string: String -> string.uppercase() }
331+
val upperCaseString = { text: String -> text.uppercase() }
332332
println(upperCaseString("hello"))
333333
// HELLO
334334
}
@@ -406,7 +406,7 @@ For example: `(String) -> String` or `(Int, Int) -> Int`.
406406
This is what a lambda expression looks like if a function type for `upperCaseString()` is defined:
407407

408408
```kotlin
409-
val upperCaseString: (String) -> String = { string -> string.uppercase() }
409+
val upperCaseString: (String) -> String = { text -> text.uppercase() }
410410

411411
fun main() {
412412
println(upperCaseString("hello"))
@@ -462,7 +462,7 @@ any parameters within the parentheses:
462462
```kotlin
463463
fun main() {
464464
//sampleStart
465-
println({ string: String -> string.uppercase() }("hello"))
465+
println({ text: String -> text.uppercase() }("hello"))
466466
// HELLO
467467
//sampleEnd
468468
}

docs/topics/tour/kotlin-tour-null-safety.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fun describeString(maybeString: String?): String {
7777
}
7878

7979
fun main() {
80-
var nullString: String? = null
80+
val nullString: String? = null
8181
println(describeString(nullString))
8282
// Empty or null string
8383
}
@@ -96,7 +96,7 @@ In the following example, the `lengthString()` function uses a safe call to retu
9696
fun lengthString(maybeString: String?): Int? = maybeString?.length
9797

9898
fun main() {
99-
var nullString: String? = null
99+
val nullString: String? = null
100100
println(lengthString(nullString))
101101
// null
102102
}
@@ -119,7 +119,7 @@ is skipped and `null` is returned:
119119
120120
```kotlin
121121
fun main() {
122-
var nullString: String? = null
122+
val nullString: String? = null
123123
println(nullString?.uppercase())
124124
// null
125125
}
@@ -138,7 +138,7 @@ As a result, the Elvis operator returns `0`:
138138
139139
```kotlin
140140
fun main() {
141-
var nullString: String? = null
141+
val nullString: String? = null
142142
println(nullString?.length ?: 0)
143143
// 0
144144
}

0 commit comments

Comments
 (0)