hierynomus / license-gradle-plugin

Manage your license(s)
http://www.javadude.nl
Other
409 stars 114 forks source link

Fix getting licenses on Android. #184

Open nic-bell opened 4 years ago

nic-bell commented 4 years ago

Licenses were always coming up blank on Android used some logic from oss-licenses-plugin.

Tested with following config in root build.gradle.

buildscript {
    ...
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'
        ...
        classpath "com.github.nic-bell:license-gradle-plugin:cac7e1c79a"
    }
}

allprojects {
    ...
    apply plugin: "com.github.hierynomus.license-report"
}

downloadLicenses {
    includeProjectDependencies = true
    dependencyConfiguration = 'releaseRuntimeClasspath'
}

Should fix #174 #182

michallaskowski commented 4 years ago

Hi. Any chance on replaying the job on CI, and merging? We tested the changes here, and it works on our Android project. We got 403 dependencies vs 0 with previous versions.

nic-bell commented 4 years ago

@jakubvimn I've made some changes based on your feedback. I think upgrading the Android plugin and Gradle broke AnimalSniffer and maybe some of the tests too. Tried investigating this briefly then resorted to just using the plugin straight off JitPack.

jakubvimn commented 4 years ago

@nic-bell will you look into the failed build? Do you need any support?

Jeehut commented 4 years ago

@michallaskowski How did you get this running from the fork? Can you maybe provide some instructions and gradle code how you integrated it? Couldn't do it using jitpack following these instructions as this is not a library but a plugin. Some help would be much appreciated! @nic-bell

michallaskowski commented 4 years ago

@Jeehut I didn't, @jakubvimn did (we work together). I will ensure tomorrow he saw this message, in case he didn't get the notification. Afaik, he published a build from this PR's branch to our internal artifacts repository. I think we all count on this PR being merged, though.

nic-bell commented 4 years ago

@nic-bell will you look into the failed build? Do you need any support?

I gave up after I ran into the animal sniffer issue. I am not even sure this repo is actively maintained.

nic-bell commented 4 years ago

@michallaskowski How did you get this running from the fork? Can you maybe provide some instructions and gradle code how you integrated it? Couldn't do it using jitpack following these instructions as this is not a library but a plugin. Some help would be much appreciated! @nic-bell

Hey the instructions to try it out are in the original PR description but here they are again anyway. I am using it in Android project as a library.

buildscript {
 ...
  dependencies {
    ...
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
    classpath "com.github.nic-bell:license-gradle-plugin:a1215e995d"
}

allprojects {
    ...
    apply plugin: "com.github.hierynomus.license-report"
}

downloadLicenses {
    includeProjectDependencies = true
    dependencyConfiguration = 'releaseRuntimeClasspath'
}

For the latest build look here: https://jitpack.io/#nic-bell/license-gradle-plugin

jakubvimn commented 4 years ago

@Jeehut Yes, for our internal use, I just configured maven-publish plugin for our internal nexus and pushed the library there. But I guess that after the response from @nic-bell my help is not needed anymore.

Jeehut commented 4 years ago

Thanks to @nic-bell's instructions I was able to set the fork up. But I'm still getting the output message:

No dependencies recognized!

Looks like this is not fixing https://github.com/hierynomus/license-gradle-plugin/issues/174, at least not for me ...

Jeehut commented 4 years ago

Okay guys, taking back what I just said, it actually works now after I found the issue with @nic-bell's instructions:

In my project, I don't have a release variant, so I had to replace releaseRuntimeClasspath with productionReleaseRuntimeClasspath in my case, your case may vary. But it works now, thank you! 🎉

jakubvimn commented 4 years ago

Any update on that? Do you need any help to move it forward?

Khosbayar commented 3 years ago

May I know what is the status of this PR? Seems like a lot of people are facing this issue.

Thanks and looking forward to it.

Mepfic commented 3 years ago

Do we have any chance to look this PR merged? Because I faced with this issue too.. Thanks

openkin commented 3 years ago

Do we have any chance to look this PR merged? Because I faced with this issue too.. Thanks

Use this version: https://github.com/openkin/license-gradle-plugin (add to your project: implements "com.github.openkin:license-gradle-plugin:0d9582e233")

Mepfic commented 3 years ago

0d9582e233

I tried get it this way: plugins { id "com.github.openkin:license-gradle-plugin" version "0d9582e233" }, but faced with error: Plugin id contains invalid char ':'

Could you provide more details to implement it? Thanks for your time

anikitin-intermedia commented 3 years ago

@Mepfic Try this: Root build.gradle

buildscript {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath "com.github.openkin:license-gradle-plugin:0d9582e233"
    }
}

And then in your module build.gradle:

apply plugin: 'com.github.hierynomus.license-report'
Mepfic commented 3 years ago

@Mepfic Try this: Root build.gradle

buildscript {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath "com.github.openkin:license-gradle-plugin:0d9582e233"
    }
}

And then in your module build.gradle:

apply plugin: 'com.github.hierynomus.license-report'

In this case I get a error: `> Could not find com.github.openkin:license-gradle-plugin:0d9582e233. Searched in the following locations:

Should I use some special repository?

anikitin-intermedia commented 3 years ago

@Mepfic Yes, use the jitpack. I've just updated the comment above

Mepfic commented 3 years ago

In this case I get a error: > Could not find com.github.openkin:license-gradle-plugin:0d9582e233. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/github/openkin/license-gradle-plugin/0d9582e233/license-gradle-plugin-0d9582e233.pom - https://repo.maven.apache.org/maven2/com/github/openkin/license-gradle-plugin/0d9582e233/license-gradle-plugin-0d9582e233.pom - https://plugins.gradle.org/m2/com/github/openkin/license-gradle-plugin/0d9582e233/license-gradle-plugin-0d9582e233.pom

Should I use some special repository?

@Mepfic Try this: Root build.gradle

buildscript {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath "com.github.openkin:license-gradle-plugin:0d9582e233"
    }
}

And then in your module build.gradle:

apply plugin: 'com.github.hierynomus.license-report'

@Mepfic Yes, use the jitpack. I've just updated the comment above

Cool, I got license report, btw, in my case (for android) works fine only with next parameters: downloadLicenses { includeProjectDependencies = true dependencyConfiguration = 'releaseRuntimeClasspath' } Otherwise I got an empty report. Thanks

anikitin-intermedia commented 3 years ago

@Mepfic Could you try dependencyConfiguration = 'all' ? This settings works in my case

Mepfic commented 3 years ago

@Mepfic Could you try dependencyConfiguration = 'all' ? This settings works in my case

yea, it works too (from fork version). In release version 0.16.1 'all' didn't work, only 'releaseRuntimeClasspath' and 'debugRuntimeClasspath' - by my build variants.

anthony-fresneau-kiplin commented 2 years ago

Hi, Is that fix for Android will be merged and released soon? Thanks and best regards,

anthony-fresneau-kiplin commented 1 year ago

Hello, Any updates on this pull request? Regards

conan commented 6 months ago

The forked version worked for me on a test java project (not android). Any chance of this PR being merged?