licensed icon indicating copy to clipboard operation
licensed copied to clipboard

checking gradle and swift project found no dependencies

Open ja2081 opened this issue 3 years ago • 2 comments

On a ubuntu env, i have run the command "licensed list" in two different projects' source directory (mobile app -- android/ios) got zero dependencies report.

configuration file used all default copied from the documentation, exect changed the source_path to current directory. source_path: '.'

I am wondering did i used the scanner correctly or missed any configuration?

ja2081 avatar Feb 17 '22 19:02 ja2081

:wave: sorry for the delayed response @ja2081, I've unfortunately been very busy the past few days. The first thing to check is that any dependencies which can be installed locally are installed, e.g. when using npm, npm install needs to be run before licensed can find and report on dependencies. I don't have much experience personally with Gradle or Swift and am not sure if either of these dependency managers have a similar command.

From my read, it sounds like your file structure has a root folder that contains a .licensed.yml file and separate folders for the android (gradle) and ios (swift) projects. The licensed configuration file has source_path: '.' configured, and you're running licensed list from each of the folders for the android and ios projects. Is that accurate?

e.g. a folder structure similar to the following (folder names and the full path to the android and ios folders are not meant to be accurate)

<root>
|_ .licensed.yml
|_ android (gradle)
  |_ <files>
|_ ios (swift)
  |_ <files>

If that's accurate, you should update your licensed configuration file to specify the paths to the android and ios projects - licensed won't know your file structure and expects to be configured with the locations of individual projects. Specifying multiple source paths is done using the apps configuration keyword

In this case I'd suggest something like the following in your .licensed.yml file

... global config including allowed licenses, ignored or reviewed dependencies

apps:
  - source_path: <relative path to ios project from repo root>
    sources:
      swift: true
  - source_path: <relative path to android project from repo root>
    sources:
      gradle: true
    # include any other gradle configuration options you need to set here
    # see https://github.com/github/licensed/blob/master/docs/sources/gradle.md

With this configured, you should run licensed list from the folder containing the .licensed.yml file (repo root?) and licensed will do the rest.

jonabc avatar Feb 22 '22 20:02 jonabc

thank you

ja2081 avatar Mar 03 '22 20:03 ja2081

I'm going to close this as it's not clear if there is anything else to do or resolve in this issue. Please reopen if there's anything else you'd like to see 🙇

jonabc avatar Feb 25 '23 20:02 jonabc