Skip to content

Commit e794799

Browse files
sarahhaggartydanil-pavlov
authored andcommitted
update: update withJava() function content
1 parent 6739234 commit e794799

File tree

7 files changed

+38
-75
lines changed

7 files changed

+38
-75
lines changed

docs/topics/gradle/gradle-configure-project.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,24 @@ plugins {
4848
When configuring your project, check the Kotlin Gradle plugin (KGP) compatibility with available Gradle versions.
4949
In the following table, there are the minimum and maximum **fully supported** versions of Gradle and Android Gradle plugin (AGP):
5050

51-
| KGP version | Gradle min and max versions | AGP min and max versions |
52-
|---------------|----------------------------------------|-----------------------------------------------------|
53-
| 2.1.0 | %minGradleVersion%–%maxGradleVersion%* | %minAndroidGradleVersion%–%maxAndroidGradleVersion% |
54-
| 2.0.20–2.0.21 | 6.8.3–8.8* | 7.1.3–8.5 |
55-
| 2.0.0 | 6.8.3–8.5 | 7.1.3–8.3.1 |
56-
| 1.9.20–1.9.25 | 6.8.3–8.1.1 | 4.2.2–8.1.0 |
57-
| 1.9.0–1.9.10 | 6.8.3–7.6.0 | 4.2.2–7.4.0 |
58-
| 1.8.20–1.8.22 | 6.8.3–7.6.0 | 4.1.3–7.4.0 |
59-
| 1.8.0–1.8.11 | 6.8.3–7.3.3 | 4.1.3–7.2.1 |
60-
| 1.7.20–1.7.22 | 6.7.1–7.1.1 | 3.6.4–7.0.4 |
61-
| 1.7.0–1.7.10 | 6.7.1–7.0.2 | 3.4.3–7.0.2 |
62-
| 1.6.20–1.6.21 | 6.1.1–7.0.2 | 3.4.3–7.0.2 |
63-
64-
> *Kotlin 2.0.20–2.0.21 and Kotlin 2.1.0 are fully compatible with Gradle up to 8.6.
51+
| KGP version | Gradle min and max versions | AGP min and max versions |
52+
|---------------|---------------------------------------|-----------------------------------------------------|
53+
| 2.1.20 | %minGradleVersion%–%maxGradleVersion% | %minAndroidGradleVersion%–%maxAndroidGradleVersion% |
54+
| 2.1.0–2.1.10 | 7.6.3–8.10* | 7.3.1–8.7.2 |
55+
| 2.0.20–2.0.21 | 6.8.3–8.8* | 7.1.3–8.5 |
56+
| 2.0.0 | 6.8.3–8.5 | 7.1.3–8.3.1 |
57+
| 1.9.20–1.9.25 | 6.8.3–8.1.1 | 4.2.2–8.1.0 |
58+
| 1.9.0–1.9.10 | 6.8.3–7.6.0 | 4.2.2–7.4.0 |
59+
| 1.8.20–1.8.22 | 6.8.3–7.6.0 | 4.1.3–7.4.0 |
60+
| 1.8.0–1.8.11 | 6.8.3–7.3.3 | 4.1.3–7.2.1 |
61+
| 1.7.20–1.7.22 | 6.7.1–7.1.1 | 3.6.4–7.0.4 |
62+
| 1.7.0–1.7.10 | 6.7.1–7.0.2 | 3.4.3–7.0.2 |
63+
| 1.6.20–1.6.21 | 6.1.1–7.0.2 | 3.4.3–7.0.2 |
64+
65+
> *Kotlin 2.0.20–2.0.21 and Kotlin 2.1.0–2.1.10 are fully compatible with Gradle up to 8.6.
6566
> Gradle versions 8.7–8.10 are also supported, with only one exception: If you use the Kotlin Multiplatform Gradle plugin,
66-
> you may see deprecation warnings in your multiplatform projects calling the [`withJava()` function in the JVM target](multiplatform-dsl-reference.md#jvm-targets).
67-
> For more information, see the issue in [YouTrack](https://youtrack.jetbrains.com/issue/KT-66542/Gradle-JVM-target-with-withJava-produces-a-deprecation-warning).
67+
> you may see deprecation warnings in your multiplatform projects calling the `withJava()` function in the JVM target.
68+
> For more information, see [Java source sets created by default](multiplatform-compatibility-guide.md#java-source-sets-created-by-default).
6869
>
6970
{style="warning"}
7071

docs/topics/ksp/ksp-multiplatform.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,20 @@ plugins {
1414
}
1515

1616
kotlin {
17-
jvm {
18-
withJava()
19-
}
20-
linuxX64() {
17+
jvm()
18+
linuxX64 {
2119
binaries {
2220
executable()
2321
}
2422
}
25-
sourceSets {
26-
val commonMain by getting
27-
val linuxX64Main by getting
28-
val linuxX64Test by getting
29-
}
3023
}
3124

3225
dependencies {
3326
add("kspCommonMainMetadata", project(":test-processor"))
3427
add("kspJvm", project(":test-processor"))
3528
add("kspJvmTest", project(":test-processor")) // Not doing anything because there's no test source set for JVM
3629
// There is no processing for the Linux x64 main source set, because kspLinuxX64 isn't specified
37-
add("kspLinuxX64Test", project(":test-processor"))
30+
// add("kspLinuxX64Test", project(":test-processor"))
3831
}
3932
```
4033

docs/topics/multiplatform/multiplatform-compatibility-guide.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@ the Kotlin version you have in your projects, for example:
1818
When configuring your project, check the compatibility of a particular version of the Kotlin Multiplatform Gradle plugin
1919
(same as the Kotlin version in your project) with Gradle, Xcode, and Android Gradle plugin versions:
2020

21-
| Kotlin Multiplatform plugin version | Gradle | Android Gradle plugin | Xcode |
22-
|-------------------------------------|----------------------------------------|---------------------------------|---------|
23-
| 2.1.0 | %minGradleVersion%–%maxGradleVersion%* | 7.4.2–%maxAndroidGradleVersion% | %xcode% |
24-
| 2.0.21 | 7.5-8.8* | 7.4.2–8.5 | 16.0 |
25-
| 2.0.20 | 7.5-8.8* | 7.4.2–8.5 | 15.3 |
26-
| 2.0.0 | 7.5-8.5 | 7.4.2–8.3 | 15.3 |
27-
| 1.9.20 | 7.5-8.1.1 | 7.4.2–8.2 | 15.0 |
28-
29-
> *Kotlin 2.0.20–2.0.21 and Kotlin 2.1.0 are fully compatible with Gradle up to 8.6.
30-
> Gradle 8.7 and 8.8 are also supported, but you may see deprecation warnings in your multiplatform projects
31-
> calling the [`withJava()` function in the JVM target](multiplatform-dsl-reference.md#jvm-targets).
32-
> For more information, see the issue in [YouTrack](https://youtrack.jetbrains.com/issue/KT-66542/Gradle-JVM-target-with-withJava-produces-a-deprecation-warning).
33-
>
21+
| Kotlin Multiplatform plugin version | Gradle | Android Gradle plugin | Xcode |
22+
|-------------------------------------|---------------------------------------|---------------------------------|---------|
23+
| 2.1.20 | %minGradleVersion%–%maxGradleVersion% | 7.4.2–%maxAndroidGradleVersion% | %xcode% |
24+
| 2.1.0–2.1.10 | 7.6.3-8.10* | 7.4.2–8.7.2 | 16.0 |
25+
| 2.0.21 | 7.5-8.8* | 7.4.2–8.5 | 16.0 |
26+
| 2.0.20 | 7.5-8.8* | 7.4.2–8.5 | 15.3 |
27+
| 2.0.0 | 7.5-8.5 | 7.4.2–8.3 | 15.3 |
28+
| 1.9.20 | 7.5-8.1.1 | 7.4.2–8.2 | 15.0 |
29+
30+
> *Kotlin 2.0.20–2.0.21 and Kotlin 2.1.0–2.1.10 are fully compatible with Gradle up to 8.6.
31+
> Gradle versions 8.7–8.10 are also supported, with only one exception: If you use the Kotlin Multiplatform Gradle plugin,
32+
> you may see deprecation warnings in your multiplatform projects calling the `withJava()` function in the JVM target.
33+
> For more information, see [Java source sets created by default](#java-source-sets-created-by-default).
34+
>
3435
{style="warning"}
3536

3637
## Kotlin 2.0.0 and later

docs/topics/multiplatform/multiplatform-configure-compilations.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,24 +207,14 @@ JVM versions in your final artifact, or you have already set up source sets in G
207207

208208
## Use Java sources in JVM compilations
209209

210-
When creating a project with the [project wizard](https://kmp.jetbrains.com/), Java sources are included in the compilations of
210+
When creating a project with the [project wizard](https://kmp.jetbrains.com/), Java sources are created by default and included in the compilations of
211211
the JVM target.
212212

213-
In the build script, the following section applies the Gradle `java` plugin and configures the target to cooperate with it:
214-
215-
```kotlin
216-
kotlin {
217-
jvm {
218-
withJava()
219-
}
220-
}
221-
```
222-
223213
The Java source files are placed in the child directories of the Kotlin source roots. For example, the paths are:
224214

225215
![Java source files](java-source-paths.png){width=200}
226216

227-
The common source sets cannot include Java sources.
217+
The common source sets can't include Java sources.
228218

229219
Due to current limitations, the Kotlin plugin replaces some tasks configured by the Java plugin:
230220

docs/topics/multiplatform/multiplatform-dsl-reference.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -135,27 +135,6 @@ In any target block, you can use the following declarations:
135135
| `components` | Components used to set up Gradle publications. |
136136
| `compilerOptions` | [Compiler options](#compiler-options) used for the target. This declaration overrides any `compilerOptions {}` configured at [top level](multiplatform-dsl-reference.md#top-level-blocks). |
137137

138-
### JVM targets
139-
140-
In addition to [common target configuration](#common-target-configuration), `jvm` targets have a specific function:
141-
142-
| **Name** | **Description** |
143-
|--------------|-----------------------------------------------------------|
144-
| `withJava()` | Includes Java sources into the JVM target's compilations. |
145-
146-
Use this function for projects that contain both Java and Kotlin source files. Note that the default source directories for Java sources
147-
don't follow the Java plugin's defaults. Instead, they are derived from the Kotlin source sets. For example, if the JVM target
148-
has the default name `jvm`, the paths are `src/jvmMain/java` (for production Java sources) and `src/jvmTest/java` for test Java sources.
149-
Learn more about [Java sources in JVM compilations](multiplatform-configure-compilations.md#use-java-sources-in-jvm-compilations).
150-
151-
```kotlin
152-
kotlin {
153-
jvm {
154-
withJava()
155-
}
156-
}
157-
```
158-
159138
### Web targets
160139

161140
The `js {}` block describes the configuration of Kotlin/JS targets, and the `wasmJs {}` block describes the configuration of

docs/topics/whatsnew2020.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,7 @@ This feature is available for the `Set`, `Map`, and `List` Kotlin collection typ
518518

519519
Kotlin 2.0.20 is fully compatible with Gradle 6.8.3 through 8.6. Gradle 8.7 and 8.8 are also supported, with only one
520520
exception: If you use the Kotlin Multiplatform Gradle plugin, you may see deprecation warnings in your multiplatform projects
521-
calling the [`withJava()` function in the JVM target](multiplatform-dsl-reference.md#jvm-targets). We plan to fix
522-
this issue as soon as possible.
521+
calling the `withJava()` function in the JVM target. We plan to fix this issue as soon as possible.
523522

524523
For more information, see the issue in [YouTrack](https://youtrack.jetbrains.com/issue/KT-66542/Gradle-JVM-target-with-withJava-produces-a-deprecation-warning).
525524

docs/topics/whatsnew21.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ Learn more about [ES2015 (ECMAScript 2015, ES6) in the official documentation](h
11811181
Kotlin 2.1.0 is fully compatible with Gradle 7.6.3 through 8.6.
11821182
Gradle versions 8.7 to 8.10 are also supported, with only one exception.
11831183
If you use the Kotlin Multiplatform Gradle plugin,
1184-
you may see deprecation warnings in your multiplatform projects calling the [`withJava()` function in the JVM target](multiplatform-dsl-reference.md#jvm-targets).
1184+
you may see deprecation warnings in your multiplatform projects calling the `withJava()` function in the JVM target.
11851185
We plan to fix this issue as soon as possible.
11861186

11871187
For more information,

0 commit comments

Comments
 (0)