Improve compatibility with the Gradle API, and follow best practices
See original GitHub issueIs your feature request related to a problem? Please describe
Hi, this is related to the Dokka Gradle plugin, which I would like to help improve.
Improving usage of Gradle would help with the following issues:
- https://github.com/Kotlin/dokka/issues/2231
- https://github.com/Kotlin/dokka/issues/2515
- https://github.com/Kotlin/dokka/issues/1833
- https://github.com/Kotlin/dokka/issues/1864
- https://github.com/Kotlin/dokka/issues/1752
- https://github.com/Kotlin/dokka/issues/2612
- https://github.com/Kotlin/dokka/issues/1217
- https://github.com/Kotlin/dokka/issues/1382
- https://github.com/Kotlin/dokka/issues/2286
- https://github.com/Kotlin/dokka/pull/830
This PR is related:
Describe the solution you’d like
- use Kotlin DSL helpers to make the code more Kotlin-esque, for example https://github.com/Kotlin/dokka/blob/83174361becb2af227159834cdf6e14db9300c53/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/gradleConfigurations.kt#L10
- Tasks that require downloading files should cache and re-use files https://github.com/Kotlin/dokka/issues/2695
- Use configurations for sharing outputs between projects https://docs.gradle.org/7.3/samples/sample_jvm_multi_project_with_code_coverage.html
- Remove non-idiomatic helper functions https://github.com/Kotlin/dokka/blob/master/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaProperty.kt
- Rename files to match the contents, e.g. https://github.com/Kotlin/dokka/blob/master/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt
- Remove usages of internal Gradle API classes https://github.com/Kotlin/dokka/blob/83174361becb2af227159834cdf6e14db9300c53/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaLeafTask.kt#L16
- avoid using
allprojects {}
orsubprojects {}
https://github.com/Kotlin/dokka/blob/83174361becb2af227159834cdf6e14db9300c53/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTaskTest.kt#L21-L23 https://github.com/Kotlin/dokka/blob/83174361becb2af227159834cdf6e14db9300c53/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/AbstractDokkaParentTask.kt#L54-L60
Describe alternatives you’ve considered A clear and concise description of any alternative solutions or features you’ve considered
Additional context
Perhaps the dokka team could create a ‘gradle-plugin’ tag for all relevant GitHub issues? https://github.com/Kotlin/dokka/issues?q=is%3Aissue+is%3Aopen++gradle
Are you willing to provide a PR?
Yes. I will try and split this up into smaller PRs.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Improve compatibility with the Gradle API #1114 - GitHub
Currently the plugin does not fully utilise the Gradle plugin API, or follow best practices. Kotlin DSL helpers are available that would make...
Read more >Best practices for authoring maintainable builds
Avoid using imperative logic in scripts · Avoid using internal Gradle APIs · Follow conventions when declaring tasks · Improve task discoverability ·...
Read more >Improve the Performance of Gradle Builds
Build performance is critical to productivity. The longer builds take to complete, the more likely they'll disrupt your development flow.
Read more >Compatibility Matrix - Gradle User Manual
Gradle is tested with Groovy 1.5.8 through 4.0.0. Gradle plugins written in Groovy must use Groovy 3.x for compatibility with Gradle and Groovy...
Read more >Upgrading your build from Gradle 7.x to the latest
This will help make this incubating API more discoverable and easier to use in an IDE. In some cases, this requires syntax changes....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi! Sorry it’s taking so long, I’ve only now finally got time after re-writing documentation for stable release.
I’ll go over all Gradle PRs in the upcoming weeks 👍
Wow… thanks! Our Gradle plugin and everything around it definitely needs work. I’ll take us some time to go through PRs, so please bear with us 😅