Skip to content

Commit

Permalink
Merge pull request #15887 from gradle/eskatos/kotlin-dsl/fix-primer-l…
Browse files Browse the repository at this point in the history
…inks
  • Loading branch information
big-guy committed Jan 20, 2021
2 parents 1fe2f91 + b98108e commit 900529f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions subprojects/docs/src/docs/userguide/api/kotlin_dsl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

:kotlin-reference: https://kotlinlang.org/docs/reference/
:kotlin-tutorials: https://kotlinlang.org/tutorials/
:kotlin-dsl-samples: https://github.com/gradle/kotlin-dsl-samples/tree/master/samples
:gradle-issues: https://github.com/gradle/gradle/issues/
:plugin-portal: https://plugins.gradle.org/

Expand Down Expand Up @@ -920,8 +919,6 @@ The `KotlinClosure0` to `KotlinClosure2` types allows adapting Kotlin functions
include::sample[dir="snippets/kotlinDsl/interoperability-kotlinClosure/kotlin",files="build.gradle.kts[tags=kotlinClosure]"]
====

Also see the link:{kotlin-dsl-samples}groovy-interop[groovy-interop] sample.

=== The Kotlin DSL Groovy Builder

If some plugin makes heavy use of link:https://groovy-lang.org/metaprogramming.html[Groovy metaprogramming], then using it from Kotlin or Java or any statically-compiled language can be very cumbersome.
Expand All @@ -939,7 +936,7 @@ include::sample[dir="snippets/kotlinDsl/interoperability-groovy-builder/kotlin",
<4> Configure the `blockName` property, maps to a `Closure` taking method invocation
<5> Invoke `another` method taking named arguments, maps to a Groovy named arguments `Map<String, ?>` taking method invocation

The link:{kotlin-dsl-samples}maven-plugin[maven-plugin] sample demonstrates the use of the `withGroovyBuilder()` utility extensions for configuring the `uploadArchives` task to <<maven_plugin#sec:deploying_to_a_maven_repository, deploy to a Maven repository>> with a custom POM using Gradle's core <<maven_plugin#, Maven Plugin>>.
The <<maven_plugin#sec:deploying_to_a_maven_repository, deploying to a Maven repository>> using Gradle's core <<maven_plugin#, Maven Plugin>> demonstrates the use of the `withGroovyBuilder()` utility extensions for configuring the `uploadArchives` task with a custom POM.
Note that the recommended <<publishing_maven#, Maven Publish Plugin>> provides a type-safe and Kotlin-friendly DSL that allows you to easily do <<publishing_maven#sec:modifying_the_generated_pom, the same and more>> without resorting to `withGroovyBuilder()`.

[[using_a_groovy_script]]
Expand Down Expand Up @@ -983,13 +980,11 @@ native { <3>
[[kotdsl:limitations]]
== Limitations

* The Kotlin DSL is link:https://github.com/gradle/kotlin-dsl/issues/902[known to be slower than the Groovy DSL] on first use, for example with clean checkouts or on ephemeral continuous integration agents.
* The Kotlin DSL is link:https://github.com/gradle/gradle/issues/15886[known to be slower than the Groovy DSL] on first use, for example with clean checkouts or on ephemeral continuous integration agents.
Changing something in the _buildSrc_ directory also has an impact as it invalidates build-script caching.
The main reason for this is the slower script compilation for Kotlin DSL.
* In IntelliJ IDEA, you must link:https://www.jetbrains.com/help/idea/gradle.html#gradle_import[import your project from the Gradle model] in order to get content assist and refactoring support for your Kotlin DSL build scripts.
* The Kotlin DSL will not support the `model {}` block, which is part of the link:https://blog.gradle.org/state-and-future-of-the-gradle-software-model[discontinued Gradle Software Model].
However, you _can_ apply model rules from scripts — see the link:{kotlin-dsl-samples}model-rules[model rules] sample for more information.
* We recommend against enabling the incubating <<multi_project_configuration_and_execution#sec:configuration_on_demand,configuration on demand>> feature as it can lead to very hard-to-diagnose problems.

If you run into trouble or discover a suspected bug, please report the issue in the link:{gradle-issues}[Gradle issue tracker].

0 comments on commit 900529f

Please sign in to comment.