Skip to content

CycloneDX and Gradle convention plugins in Kotlin DSL #746

@sabroe

Description

@sabroe

Is your feature request related to a problem? Please describe.

It has come to my awareness that it is impossible to get CycloneDX 3.1.0 to work as part of a Gradle convention plugin written in Kotlin DSL. This is a result of how properties are set directly within tasks - and "extensions" having been removed.

I would very much like to see plugin-specific extensions be put back in -- so that all properties are verifyable at compile time and can be set up for each individual sub-project in a Gradle multi-module project.

As it is now, in Kotlin DSL, you either have to live with no customization or having to revert to Groovy DSL, which I find very disappointing. The current settings in Groovy DSL is read at runtime, not at all verified at any runtime.

Instead of having to back down to old Groovy DSL -- or an older CycloneDX 2.8 -- then how about making all settings type-safe and overridable?

Hence - I suggest supporting Gradle convention plugins written in Kotlin DSL!! Just declare the settings -- let users handle their private multi-module projects.

Describe the solution you'd like

Support Gradle convention plugins written in Kotlin DSL. Let the valid settings be present and accessible as a Gradle extension object (say, one for each of the current tasks, the "direct" and the "root" aimed), type-safe at compile-time.

Users can handle their own multi-module projects, set them up as they please.

Describe alternatives you've considered

Moving from Kotlin DSL to Groovy DSL to get something working (mixing Gradle convention plugins in Groovy DSL and Kotlin DSL), live with settings possibly failing at runtime instead of compile-time.

Or just go back to a CycloneDX 2.8-something, sigh!

Additional context

No response

Contribution

  • I am willing to provide an implementation
  • I will wait until somebody else implements it

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions