Skip to content

Commit

Permalink
Merge pull request #19 from martinbonnin/fixes
Browse files Browse the repository at this point in the history
Kotlin plugins: add side panel + cosmetic fixes
  • Loading branch information
oleg-nenashev authored Oct 31, 2024
2 parents f9de6bf + f4c0c3b commit 60bf29f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mkdocs-render-swagger-plugin==0.1.1
mkdocs-pdf==0.1.1
mkdocs-with-pdf==0.9.3
livereload==2.6.3
lxml==4.9.3
lxml==5.3.0
click==8.1.7
dacite==1.8.1
ghp-import==2.1.0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ temp_dir

.DS_Store

pyvenv.cfg
.venv/
9 changes: 5 additions & 4 deletions docs/plugin-development/kotlin-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,19 @@ If you are used to writing `build.gradle.kts` files, you may use the `kotlin-dsl
`kotlin-dsl` configures the Kotlin compiler so that you can use precompiled scripts plugins and/or write similar syntax in your regular `.kt` files.

The `kotlin-dls` plugin:

* applies `"java-gradle-plugin"`.
* applies `kotlin-embedded` to use the same Kotlin embeeded version as your Gradle distribution.
* applies the ``kotlin-dsl-precompiled-script-plugins`` allowing to use `build.gradle.kts` files.
* adds `gradleKotlinDsl()` to the `compileOnly` configuration.
* configures the `sam-with-receiver` Kotlin compiler plugin to transform `it.` usages into `this.`.
* configures the `kotlin-assignment` Kotlin compiler plugin to allow setting `Property` with the `=` operator.
* sets Kotlin `apiVersion` and `languageVersion` according to Gradle [compatibility [atrix](https://docs.gradle.org/current/userguide/compatibility.html#kotlin).
* sets Kotlin `apiVersion` and `languageVersion` according to Gradle [compatibility Matrix](https://docs.gradle.org/current/userguide/compatibility.html#kotlin).
* adds the `-Xsam-conversions=class` compiler option.
* adds others compiler options for compatibility:
** `-java-parameters` to support https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Parameter.html[Java 8 Parameter] class and getting method parameters through reflection
** `-Xjvm-default=all` to add link:https://kotlinlang.org/docs/java-to-kotlin-interop.html#default-methods-in-interfaces[Default methods in interfaces]
** `-Xjsr305=strict` for https://kotlinlang.org/docs/java-interop.html#compiler-configuration[increased null safety]
* `-java-parameters` to support [Java 8 Parameter](https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Parameter.html) class and getting method parameters through reflection
* `-Xjvm-default=all` to add [Default methods in interfaces](https://kotlinlang.org/docs/java-to-kotlin-interop.html#default-methods-in-interfaces)
* `-Xjsr305=strict` for [increased null safety](https://kotlinlang.org/docs/java-interop.html#compiler-configuration)

This is a significant departure from the baseline Kotlin configuration so be aware of the tradeoffs when using `kotlin-dsl`.

Expand Down
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ nav:
- Gradle for Kotlin: kotlin/README.md
- Gradle for Android: android/README.md
- Troubleshooting Gradle: troubleshooting/README.md
- Plugin Development: plugin-development/README.md
- Plugin Development:
- Summary: plugin-development/README.md
- Kotlin plugin development: plugin-development/kotlin-plugins.md

# Theme
theme:
Expand Down

0 comments on commit 60bf29f

Please sign in to comment.