RobertFischer / Gradle-License-Report

A plugin for generating reports about the licenses of third party software using Gradle
The Unlicense
41 stars 8 forks source link

empty report when used with Android-Plugin #2

Open ligi opened 9 years ago

ligi commented 9 years ago

it seem to find no configuration -> hence an empty report I see 2 solutions: either throw an exception that it is used in combination with the android plugin or ( preferred ) also be able to resolve dependencies/configurations in combination with the android plugin

johnjohndoe commented 9 years ago

Same here: empty report for a Gradle application project with many dependencies. I feel the license crawler is built to find Maven libraries only.

ligi commented 9 years ago

as a workaround: copy the dependency block to a java project to generate the report - not that pretty but gets the task done ;-)

RobertFischer commented 9 years ago

How does the Android plugin resolve dependencies/configurations?

Right now, it uses the runtime configuration to generate reports. You can modify that by assigning the reportedConfiguration or reportedConfigurations property: https://github.com/RobertFischer/Gradle-License-Report/blob/master/src/main/groovy/com/smokejumperit/gradle/report/DependencyLicenseReport.java#L49-L65

RobertFischer commented 9 years ago

If we could detect that the Android plugin was added, we could change our reportedConfigurations property default to support whatever the Android plugin's configuration is. I'd happily accept a pull request to do that.

sschuberth commented 9 years ago

Right now, it uses the runtime configuration to generate reports.

Hmm, judging from https://github.com/RobertFischer/Gradle-License-Report/tree/master/build/reports/dependency-license I would have thought by default all configurations are used. If only the runtime configuration can used, how did you create these reports?

sschuberth commented 9 years ago

In any case, I believe there are at least two pieces to the puzzle: One is to use the compile configuration for Android projects (BTW, this fork makes it easy to customize the configurations to take into account via Groovy DSL), the other is that Android projects usually are multi-projects. This means you need to wrap applying the plugin into allprojects in the root build.gradle file in order to make the dependencyLicenseReport task available in those (sub-)projects that actually have the dependencies.

jaredsburrows commented 7 years ago

@ligi @johnjohndoe I am not sure how active this project is but I created a gradle-license-plugin for Android users in order to display the "Open Source Dialog" in the Settings menu.

sschuberth commented 7 years ago

@jaredsburrows Interesting. Are you also aware of https://github.com/hierynomus/license-gradle-plugin?

jaredsburrows commented 7 years ago

@sschuberth No I was not. That plugin is for creating headers on source files. Mine is for the "Open Source Dialog" menu like you see in most apps.

sschuberth commented 7 years ago

That plugin is for creating headers on source files.

Not only. I'm using the downloadLicenses task to generate reports.

jaredsburrows commented 7 years ago

Awesome. Ill have to try it out!

On Jan 6, 2017 9:17 AM, "Sebastian Schuberth" notifications@github.com wrote:

That plugin is for creating headers on source files.

Not only. I'm using the downloadLicenses task to generate reports.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RobertFischer/Gradle-License-Report/issues/2#issuecomment-270953854, or mute the thread https://github.com/notifications/unsubscribe-auth/ABqMSCMqGjoA3Y2RRnPx-cYK2KqZvY9pks5rPndBgaJpZM4DI-GU .

jaredsburrows commented 7 years ago

@sschuberth I just tried this out on an app I work on. The license report is empty. It seems you have to add in the "license" dsl with explicit params to get it to work. Also, it seems that the webpage is not meant for mobile:

screen shot 2017-01-06 at 10 15 46 am

I'll continue to take feedback and work on my light weight plugin.

sschuberth commented 7 years ago

Just FYI, I wasn't meaning to discourage you to continue working on your plugin. I just wanted to point out a similar project for the sake of possible sharing code / learning from each other.

jaredsburrows commented 7 years ago

@sschuberth Oh yeah! I know, thanks for informing me of these other helpful plugins. They all have unique reports that have been helpful to me. I just want something lightweight for Android specifically. Thanks for your information!