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

empty report when used with Android-Plugin

Open ligi opened this issue 10 years ago • 14 comments

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

ligi avatar Dec 16 '14 13:12 ligi

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

johnjohndoe avatar Jan 15 '15 15:01 johnjohndoe

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

ligi avatar Jan 15 '15 15:01 ligi

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 avatar Apr 10 '15 20:04 RobertFischer

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.

RobertFischer avatar Apr 10 '15 20:04 RobertFischer

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 avatar Sep 07 '15 15:09 sschuberth

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.

sschuberth avatar Sep 10 '15 11:09 sschuberth

@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.

jaredsburrows avatar Jan 06 '17 16:01 jaredsburrows

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

sschuberth avatar Jan 06 '17 16:01 sschuberth

@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.

jaredsburrows avatar Jan 06 '17 17:01 jaredsburrows

That plugin is for creating headers on source files.

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

sschuberth avatar Jan 06 '17 17:01 sschuberth

Awesome. Ill have to try it out!

On Jan 6, 2017 9:17 AM, "Sebastian Schuberth" [email protected] 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 avatar Jan 06 '17 17:01 jaredsburrows

@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.

jaredsburrows avatar Jan 06 '17 18:01 jaredsburrows

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.

sschuberth avatar Jan 06 '17 18:01 sschuberth

@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!

jaredsburrows avatar Jan 06 '17 18:01 jaredsburrows