Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: implementation generated accessor is only available if java-li…
…brary plugin is applied
  • Loading branch information
bric3 committed May 20, 2025
commit 861e629d365770c80b7f5c761df3a03af288f172
4 changes: 4 additions & 0 deletions components/yaml/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
`java-library`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this added by applying $rootDir/gradle/java.gradle below?

Copy link
Contributor Author

@bric3 bric3 May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. It is, but in kotlin DSL scripts, the apply(from = ) style doesn't give access to generated configuration type-safe accessors like implementation used in this project. Only the plugins block triggers this.
Access to implementation in particular is available only with the java-library plugin or if another plugin depends on it like me.champeau.jmh.


In general Gradle doesn't recommend the apply(from = ) style at all anymore (for various reasons), instead they recommend using convention plugins. Those would inherit any applied plugins.

}

apply(from = "$rootDir/gradle/java.gradle")

// https://repo1.maven.org/maven2/org/yaml/snakeyaml/2.4/snakeyaml-2.4.pom
Expand Down
Loading