Gradle-License-Report icon indicating copy to clipboard operation
Gradle-License-Report copied to clipboard

Enhancement: Provide vanilla DSL style configuration of renderers, importers etc

Open holgerstolzenberg opened this issue 4 years ago • 3 comments

It would be really great to not have to import specific classes into the build script via import statements. We see the following advantages:

  • Have a more uncluttered build script
  • Hide implementation details of the plugin from the build

We currently workaround with full qualified class names:

licenseReport {
  def name = "License Report: ${project.name}"

  //noinspection UnnecessaryQualifiedReference
  renderers = [
      new com.github.jk1.license.render.InventoryHtmlReportRenderer('license-report.html', name),
      new com.github.jk1.license.render.InventoryMarkdownReportRenderer('license-report.md', name)]

  //noinspection UnnecessaryQualifiedReference
  filters = [
      new com.github.jk1.license.filter.ExcludeTransitiveDependenciesFilter(),
      new com.github.jk1.license.filter.LicenseBundleNormalizer()
  ]
}

But having something like the following snippet (draft) would be great:

licenseReport {
  renderers {
    html {
      reportFile = 'license-report.html' // or file()
      title = 'license-report.html'
  }
  
  filters = 'exclude-transitive-dependencies', 'license-bundle-normalize'
}

holgerstolzenberg avatar Apr 22 '20 10:04 holgerstolzenberg

That would be a nice thing to implement. Thanks a lot for the suggestion.

jk1 avatar May 12 '20 09:05 jk1

I'd like to keep this one open if you don't mind, as it's still planned for implementation

jk1 avatar Jun 30 '21 04:06 jk1

I accidentally closed the issue and would be really glad to have this enhancement coming.

holgerstolzenberg avatar Feb 02 '22 07:02 holgerstolzenberg