Skip to content

Commit

Permalink
feat: KT-48585 synchronization for Kotlin/Groovy tabs (JetBrains#2508)
Browse files Browse the repository at this point in the history
* feat: test groovy/kotlin tab sync

* feat: test groovy/kotlin tab sync 2 pages

* feat: tab sync in gradle.md

* feat: tab sync across all docs

* fix: revert tab sync in compatibility-guide-15.md

* fix: add missing space

* chore: remove redundant spaces

* feat: test two-level tabs for OS select

* Revert "feat: test two-level tabs for OS select"

This reverts commit 7d21df3.

* chore: add missing macos Apple silicon target

* chore: remove tabs for duplicate Groovy/Kotlin code
  • Loading branch information
p7nov authored Sep 8, 2021
1 parent 29611ad commit 4d5fb9c
Show file tree
Hide file tree
Showing 39 changed files with 1,458 additions and 990 deletions.
34 changes: 22 additions & 12 deletions docs/topics/configure-build-for-eap.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,35 @@ Alternatively, you can specify the EAP version in the `pluginManagement` block i

Here is an example for the Multiplatform project.

<tabs>
<tabs group="build-script">
<tab title="Kotlin" group-key="kotlin">

```groovy
```kotlin
plugins {
id 'java'
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN-EAP-VERSION'
java
kotlin("multiplatform") version "KOTLIN-EAP-VERSION"
}

repositories {
mavenCentral()
}
```

```kotlin
</tab>
<tab title="Groovy" group-key="groovy">

```groovy
plugins {
java
kotlin("multiplatform") version "KOTLIN-EAP-VERSION"
id 'java'
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN-EAP-VERSION'
}
repositories {
mavenCentral()
}
```

</tab>
</tabs>

### Adjust versions in dependencies
Expand All @@ -74,20 +79,25 @@ Here is an example.

For the **kotlinx.coroutines** library, add the version number – `%coroutinesEapVersion%` – that is compatible with `%kotlinEapVersion%`.

<tabs>
<tabs group="build-script">
<tab title="Kotlin" group-key="kotlin">

```groovy
```kotlin
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:%coroutinesEapVersion%"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:%coroutinesEapVersion%")
}
```

```kotlin
</tab>
<tab title="Groovy" group-key="groovy">

```groovy
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:%coroutinesEapVersion%")
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:%coroutinesEapVersion%"
}
```

</tab>
</tabs>

## Configure in Maven
Expand Down
43 changes: 25 additions & 18 deletions docs/topics/curl.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,40 +68,44 @@ the missing directories will have to be created before any new files can be adde
Use the following `build.gradle(.kts)` Gradle build file:
<tabs>
<tabs group="build-script">
<tab title="Kotlin" group-key="kotlin">
```groovy
```kotlin
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '%kotlinVersion%'
kotlin("multiplatform") version "%kotlinVersion%"
}
repositories {
mavenCentral()
}
kotlin {
linuxX64("native") { // on Linux
// macosX64("native") { // on macOS
// mingwX64("native") { //on Windows
compilations.main.cinterops {
interop
}
linuxX64("native") { // on Linux
// macosX64("native") { // on x86_64 macOS
// macosArm64("native") { // on Apple Silicon macOS
// mingwX64("native") { // on Windows
val main by compilations.getting
val interop by main.cinterops.creating
binaries {
executable()
}
}
}
wrapper {
tasks.wrapper {
gradleVersion = "%gradleVersion%"
distributionType = "ALL"
distributionType = Wrapper.DistributionType.ALL
}
```
```kotlin
</tab>
<tab title="Groovy" group-key="groovy">
```groovy
plugins {
kotlin("multiplatform") version "%kotlinVersion%"
id 'org.jetbrains.kotlin.multiplatform' version '%kotlinVersion%'
}
repositories {
Expand All @@ -110,23 +114,26 @@ repositories {
kotlin {
linuxX64("native") { // on Linux
// macosX64("native") { // on macOS
// macosX64("native") { // on x86_64 macOS
// macosArm64("native") { // on Apple Silicon macOS
// mingwX64("native") { // on Windows
val main by compilations.getting
val interop by main.cinterops.creating
compilations.main.cinterops {
interop
}
binaries {
executable()
}
}
}
tasks.wrapper {
wrapper {
gradleVersion = "%gradleVersion%"
distributionType = Wrapper.DistributionType.ALL
distributionType = "ALL"
}
```
</tab>
</tabs>
The project file configures the C interop as an additional step of the build.
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ fun <T> singletonList(item: T): List<T> {
// ...
}

fun <T> T.basicToString(): String { // extension function
fun <T> T.basicToString(): String { // extension function
// ...
}
```
Expand Down
Loading

0 comments on commit 4d5fb9c

Please sign in to comment.