You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor fix for typo, indent, link, and sample code (JetBrains#3179)
* minor fix for typo, indent, link, and sample code
* chore: rollback the wrong article
* chore: new line added
* chore: fix indents
* chore: add bells and whistles
* Update kotlin-tips.md
* fix sample code, remove versions which have duplicated content, keep only 1 version
Co-authored-by: Andrey Polyakov <koshachy@gmail.com>
Copy file name to clipboardexpand all lines: docs/topics/gradle.md
+11-11
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ require the `kotlin-multiplatform` plugin. [Learn more about the plugin](multipl
61
61
62
62
```kotlin
63
63
plugins {
64
-
kotlin("multiplatform") version "%kotlinVersion%"
64
+
kotlin("multiplatform") version "%kotlinVersion%"
65
65
}
66
66
```
67
67
@@ -70,7 +70,7 @@ plugins {
70
70
71
71
```groovy
72
72
plugins {
73
-
id 'org.jetbrains.kotlin.multiplatform' version '%kotlinVersion%'
73
+
id 'org.jetbrains.kotlin.multiplatform' version '%kotlinVersion%'
74
74
}
75
75
```
76
76
@@ -82,7 +82,7 @@ plugins {
82
82
To target the JVM, apply the Kotlin JVM plugin.
83
83
84
84
<tabsgroup="build-script">
85
-
<tab title="Kotlin" group-key="kotlin">
85
+
<tabtitle="Kotlin"group-key="kotlin">
86
86
87
87
```kotlin
88
88
plugins {
@@ -116,7 +116,7 @@ Applying Kotlin plugins with `apply` in the Kotlin Gradle DSL is not recommended
116
116
117
117
Kotlin sources and Java sources can be stored in the same folder, or they can be placed in different folders. The default convention is to use different folders:
118
118
119
-
```groovy
119
+
```text
120
120
project
121
121
- src
122
122
- main (root)
@@ -479,7 +479,7 @@ plugin won't override it or add a second standard library.
479
479
480
480
If you do not need a standard library at all, you can add the opt-out option to the `gradle.properties`:
481
481
482
-
```kotlin
482
+
```properties
483
483
kotlin.stdlib.default.dependency=false
484
484
```
485
485
@@ -1088,18 +1088,18 @@ You can specify arguments for a specific task:
Copy file name to clipboardexpand all lines: docs/topics/js/js-project-setup.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -323,7 +323,7 @@ To run tests, execute the standard lifecycle `check` task:
323
323
./gradlew check
324
324
```
325
325
326
-
To specify envirnoment variables used by your Node.js test runners (for example, to pass external information to your tests, or to fine-tune package resolution), use the `environment` function with a key-value pair inside the `testTask` block in your build script:
326
+
To specify environment variables used by your Node.js test runners (for example, to pass external information to your tests, or to fine-tune package resolution), use the `environment` function with a key-value pair inside the `testTask` block in your build script:
You can dump this report into a file with the plugin option [`-Kapt-dump-processor-timings` (`org.jetbrains.kotlin.kapt3:dumpProcessorTimings`)](https://github.com/JetBrains/kotlin/pull/4280).
192
192
The following command will run kapt and dump the statistics to the `ap-perf-report.file` file:
Copy file name to clipboardexpand all lines: docs/topics/kotlin-tips.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -6,55 +6,55 @@ Kotlin Tips is a series of short videos where members of the Kotlin team show ho
6
6
7
7
## null + null in Kotlin
8
8
9
-
What happens when you add `null + null` in Kotlin, and what does it return? Sebastian addresses this mystery in our latest quick tip. Along the way, he also shows why there's no reason to be scared of nullables:
9
+
What happens when you add `null + null` in Kotlin, and what does it return? Sebastian Aigner addresses this mystery in our latest quick tip. Along the way, he also shows why there's no reason to be scared of nullables:
10
10
11
11
<videowidth="560"height="315"href="wwplVknTza4"title="Kotlin Tips: null + null in Kotlin"/>
12
12
13
13
## Deduplicating collection items
14
14
15
-
Got a Kotlin collection that contains duplicates? Need a collection with only unique items? Let Sebastian show you how to remove duplicates from your lists, or turn them into sets in this Kotlin tip:
15
+
Got a Kotlin collection that contains duplicates? Need a collection with only unique items? Let Sebastian Aigner show you how to remove duplicates from your lists, or turn them into sets in this Kotlin tip:
How come functions like [`repeat()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/repeat.html), [`map()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/map.html) and [`filter()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/filter.html) accept suspending functions in their lambdas, even though their signatures aren't coroutines-aware? In this episode of Kotlin Tips Sebastian solves the riddle: it has something to do with the inline modifier:
21
+
How come functions like [`repeat()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/repeat.html), [`map()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/map.html) and [`filter()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/filter.html) accept suspending functions in their lambdas, even though their signatures aren't coroutines-aware? In this episode of Kotlin Tips Sebastian Aigner solves the riddle: it has something to do with the inline modifier:
22
22
23
23
<videowidth="560"height="315"href="R2395u7SdcI"title="Kotlin Tips: The Suspend and Inline Mystery"/>
24
24
25
25
## Unshadowing declarations with their fully qualified name
26
26
27
-
Shadowing means having two declarations in a scope have the same name. So, how do you pick? In this episode of Kotlin Tips Sebastian shows you a simple Kotlin trick to call exactly the function that you need, using the power of fully qualified names:
27
+
Shadowing means having two declarations in a scope have the same name. So, how do you pick? In this episode of Kotlin Tips Sebastian Aigner shows you a simple Kotlin trick to call exactly the function that you need, using the power of fully qualified names:
[Elvis](null-safety.md#elvis-operator) has entered the building once more! Seb explains why the operator is named after the famous singer, and how you can use `?:` in Kotlin to return or throw. The magic behind the scenes? [The Nothing type](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-nothing.html).
33
+
[Elvis](null-safety.md#elvis-operator) has entered the building once more! Sebastian Aigner explains why the operator is named after the famous singer, and how you can use `?:` in Kotlin to return or throw. The magic behind the scenes? [The Nothing type](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-nothing.html).
34
34
35
35
<videowidth="560"height="315"href="L8aFK7QrbA8"title="Kotlin Tips: Return and Throw with the Elvis Operator"/>
36
36
37
37
## Destructuring declarations
38
38
39
-
With [destructuring declarations](destructuring-declarations.md) in Kotlin, you can create multiple variables from a single object, all at once. In this video Sebastian shows you a selection of things that can be destructured – pairs, lists, maps, and more. And what about your own objects? Kotlin's component functions provide an answer for those as well:
39
+
With [destructuring declarations](destructuring-declarations.md) in Kotlin, you can create multiple variables from a single object, all at once. In this video Sebastian Aigner shows you a selection of things that can be destructured – pairs, lists, maps, and more. And what about your own objects? Kotlin's component functions provide an answer for those as well:
In Kotlin, you can override operators like addition and subtraction for your classes and supply your own logic. But what if you want to allow null values, both on their left and right sides? In this video, Sebastian answers this question:
45
+
In Kotlin, you can override operators like addition and subtraction for your classes and supply your own logic. But what if you want to allow null values, both on their left and right sides? In this video, Sebastian Aigner answers this question:
46
46
47
47
<videowidth="560"height="315"href="x2bZJv8i0vw"title="Kotlin Tips: Operator Functions With Nullable Values"/>
48
48
49
49
## Timing code
50
50
51
-
Watch Seb give a quick overview of the [`measureTimedValue()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/measure-timed-value.html) function, and learn how you can time your code:
51
+
Watch Sebastian Aigner give a quick overview of the [`measureTimedValue()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/measure-timed-value.html) function, and learn how you can time your code:
In this video, Sebastian will demonstrate how to improve [loops](control-flow.md#for-loops) to make your code more readable, understandable, and concise:
57
+
In this video, Sebastian Aigner will demonstrate how to improve [loops](control-flow.md#for-loops) to make your code more readable, understandable, and concise:
@@ -66,7 +66,7 @@ In this episode, Kate Petrova shows three tips to help you work with [Strings](s
66
66
67
67
## Doing more with the Elvis operator
68
68
69
-
In this video, Sebastian will show how to add more logic to the [Elvis operator](null-safety.md#elvis-operator), such as logging to the right part of the operator:
69
+
In this video, Sebastian Aigner will show how to add more logic to the [Elvis operator](null-safety.md#elvis-operator), such as logging to the right part of the operator:
70
70
71
71
<videowidth="560"height="315"href="L9wqYQ-fXaM"title="Kotlin Tips: The Elvis Operator"/>
0 commit comments