Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSS Licenses Dependencies Always Absent #252

Open
kkovach opened this issue Nov 29, 2022 · 6 comments
Open

OSS Licenses Dependencies Always Absent #252

kkovach opened this issue Nov 29, 2022 · 6 comments
Labels
oss-licenses Issues related to com.google.android.gms:oss-licenses-plugin

Comments

@kkovach
Copy link

kkovach commented Nov 29, 2022

The generated dependencies.json file is always the default "absent" and as a result the dependency list is always the default "Debug License Info". I created a sample app and was able to get it working, but have not been able to get it working in my actual project, so there's clearly something different with my build file or something. My project has multiple flavor dimensions. I did add some some flavors to my sample as well. I did take time to make sure that the versions in the sample were the same as my project. They are listed below.

  • Gradle version: 7.4
  • Android Studio version [e.g. 3.1 (stable)]: Android Studio Dolphin | 2021.3.1 Patch 1
  • Android Gradle Plugin version: 7.3.1
  • Plugin name and version [e.g. OSS Licenses 16.0.0]: OSS Licenses 17.0.0

I did notice one difference between the behavior of the sample and my actual project. In the sample that works when I run the fooReleaseOssDependencyTask task there is a dependent task that runs called collectFooReleaseDependencies.

This "collect" task is not available in my project where I am getting empty dependencies. When I run my flavorReleaseOssDependencyTask in my project that has the issue I do not see a similar collectFlavorReleaseDependencies run. I also checked to see if it is available with ./gradlew :app:tasks --all and it is not in the list. I am assuming that this collect task comes from the oss-license-plugin?

I wonder if this is some clue as to why my build might be different? Any thoughts or advice would be appreciated. I can also work on adding my build file but need to clean it up first. Thanks.

build.gradle.kts.txt

@Alexander13Oster
Copy link

Hi @kkovach,
i had the same problem. The plugin looks for the debuggable flag and not whether it is a "release" or "debug" build. In your config release is configured with isDebuggable = true which is why it is always absent.

@caller9
Copy link
Collaborator

caller9 commented Jan 3, 2023

Alexander is correct. The Android Gradle Plugin only generates the dependency list that the plugin consumes for releasable builds.

@javadude
Copy link

We should have a manually-run task to generate the list regardless of build type

@tejaswini-rav
Copy link

@javadude is there any command to get the list regardless build type?

@javadude
Copy link

@tejaswini-rav Not that I know of offhand. I haven't had a chance to look into it - right now it depends on what the Android Gradle Plugin provides, and I don't know that there is an option there (other than marking isDebuggable = false)

FYI there are other plugins out there that do similar things. I used to use https://github.com/jaredsburrows/gradle-license-plugin, generating JSON from it and creating my own pages to display in my work apps.

@tejaswini-rav
Copy link

@javadude thankyou for the getback and reference link, i tried with release build version and it worked, not sure the default google provided OssLicenseActivity is looking pretty though :) but will try the other reference !

@davidmotson davidmotson added the oss-licenses Issues related to com.google.android.gms:oss-licenses-plugin label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oss-licenses Issues related to com.google.android.gms:oss-licenses-plugin
Projects
None yet
Development

No branches or pull requests

6 participants