{"action":"created","issue":{"url":"https://api.github.com/repos/jk1/Gradle-License-Report/issues/86","repository_url":"https://api.github.com/repos/jk1/Gradle-License-Report","labels_url":"https://api.github.com/repos/jk1/Gradle-License-Report/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/jk1/Gradle-License-Report/issues/86/comments","events_url":"https://api.github.com/repos/jk1/Gradle-License-Report/issues/86/events","html_url":"https://github.com/jk1/Gradle-License-Report/issues/86","id":338999432,"node_id":"MDU6SXNzdWUzMzg5OTk0MzI=","number":86,"title":"Can the renderers property under licenseReport extension accept keyword instead of new object","user":{"login":"amimas","id":16211767,"node_id":"MDQ6VXNlcjE2MjExNzY3","avatar_url":"https://avatars3.githubusercontent.com/u/16211767?v=4","gravatar_id":"","url":"https://api.github.com/users/amimas","html_url":"https://github.com/amimas","followers_url":"https://api.github.com/users/amimas/followers","following_url":"https://api.github.com/users/amimas/following{/other_user}","gists_url":"https://api.github.com/users/amimas/gists{/gist_id}","starred_url":"https://api.github.com/users/amimas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amimas/subscriptions","organizations_url":"https://api.github.com/users/amimas/orgs","repos_url":"https://api.github.com/users/amimas/repos","events_url":"https://api.github.com/users/amimas/events{/privacy}","received_events_url":"https://api.github.com/users/amimas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-06T16:28:22Z","updated_at":"2018-07-06T20:08:14Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI'm just getting started with this plugin and it's looking very interesting. One problem I ran into is that I cannot use my modularized approach for managing gradle scripts.\r\n\r\nCurrently, if we want an HTML report, after applying the plugin, this is how we should be doing configuring it.\r\n\r\n```gradle\r\nimport com.github.jk1.license.render.*\r\n\r\nlicenseReport {\r\n    renderers = [new InventoryHtmlReportRenderer()]\r\n}\r\n```\r\nI have my build organized in multiple gradle files. For example, I have a `build.gradle` under the root project. Inside this `build.gradle`, I have very generic configurations, such as `buildScript`, `plugins`, some variables, group name, project version, etc. After that I use `apply from` to include different build configurations like this:\r\n\r\n```gradle\r\napply from: 'gradle/coverage.gradle'\r\napply from: 'gradle/publishing.gradle'\r\napply from: 'gradle/code-quality.gradle'\r\napply from: 'gradle/dependency-report.gradle'\r\n``` \r\n\r\nThe problem with this approach comes up when I need to **import** any classes. For example, this plugin requires importing the render package if I want to generate different types of report as per my example above. Gradle doesn't seem to like it. I get error like this:\r\n\r\n```\r\n* What went wrong:\r\nCould not compile script '/Users/amimas/myproject/master/gradle/dependency-license.gradle'.\r\n> startup failed:\r\n  script '/Users/amimas/myproject/master/gradle/dependency-license.gradle': 12: unable to resolve class InventoryHtmlReportRenderer \r\n   @ line 12, column 15.\r\n        renderers = [new InventoryHtmlReportRenderer()]\r\n                   ^\r\n  \r\n  1 error\r\n```\r\n\r\nThe only way I can use a different renderer to generate an HTML report is if I put the configurations in the main `build.gradle` file where the plugin is being applied from. I haven't found any fix or workaround for this.\r\n\r\nThat's why I was thinking if it is possible for the `render` property to accept keywords. For example:\r\n\r\n```gradle\r\nlicenseReport {\r\n    renderers = [inventoryHtml, xml, csv]\r\n}\r\n```\r\nthis will generate 3 reports that corresponds to those keywords. Problem with this approach is when you need to pass additional parameters/options for each of those reports.\r\n\r\nNot sure if there are any other options.\r\n"},"comment":{"url":"https://api.github.com/repos/jk1/Gradle-License-Report/issues/comments/403134007","html_url":"https://github.com/jk1/Gradle-License-Report/issues/86#issuecomment-403134007","issue_url":"https://api.github.com/repos/jk1/Gradle-License-Report/issues/86","id":403134007,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzEzNDAwNw==","user":{"login":"amimas","id":16211767,"node_id":"MDQ6VXNlcjE2MjExNzY3","avatar_url":"https://avatars3.githubusercontent.com/u/16211767?v=4","gravatar_id":"","url":"https://api.github.com/users/amimas","html_url":"https://github.com/amimas","followers_url":"https://api.github.com/users/amimas/followers","following_url":"https://api.github.com/users/amimas/following{/other_user}","gists_url":"https://api.github.com/users/amimas/gists{/gist_id}","starred_url":"https://api.github.com/users/amimas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amimas/subscriptions","organizations_url":"https://api.github.com/users/amimas/orgs","repos_url":"https://api.github.com/users/amimas/repos","events_url":"https://api.github.com/users/amimas/events{/privacy}","received_events_url":"https://api.github.com/users/amimas/received_events","type":"User","site_admin":false},"created_at":"2018-07-06T20:08:14Z","updated_at":"2018-07-06T20:08:14Z","author_association":"NONE","body":"Sure, here's what I have.\r\n\r\n`build.gradle`:\r\n```gradle\r\nplugins {\r\n\tid 'com.github.jk1.dependency-license-report' version '1.0'\r\n}\r\n\r\next.javaVersion = 1.8\r\next.product = 'My Project'\r\ngroup = 'com.amimas.project1'\r\nversion = '1.0-SNAPSHOT'\r\n\r\napply from: 'gradle/base.gradle'\r\napply from: 'gradle/dependency-license.gradle'\r\n```\r\n\r\n`gradle/dependency-license.gradle`:\r\n```gradle\r\n// import com.github.jk1.license.render.*\r\nlicenseReport {\r\n\texcludeGroups = ['com.amimas.project1'] //exclude project's own group\r\n\trenderers = [new com.github.jk1.license.render.InventoryHtmlReportRenderer()]\r\n}\r\n```"}}
{"actor":{"display_login":"amimas"}}