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

fix (Gradle analyzer) Fix gradle discovery for root projects and add a flag to scan all submodules #399

Merged
merged 5 commits into from Jan 21, 2019

Conversation

zlav
Copy link
Member

@zlav zlav commented Jan 18, 2019

This PR fixes an issue with how a module is constructed when a build.gradle file is discovered but no subprojects are present.

This PR also adds support for scanning all of a projects submodules using the flag --option allsubmodules:true. This is particularly useful when running fossa analyze with the argument gradle:: to signify a gradle root project.

Steps for merging multiple projects dependency maps:

  • Create one common map[string]graph.Deps object to hold all projects configuration mappings.
  • Retrieve a projects dependency graph and start by looping through all configurations specified.
  • Retrieve the associated graph.Deps from the specified configuration in the returnable map.
  • First, merge Transitive dependencies into this configuration map.
  • Second, merge Direct dependencies by looping through the exisiting list and appending only those that are not present.

@codecov
Copy link

codecov bot commented Jan 18, 2019

Codecov Report

Merging #399 into master will decrease coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #399      +/-   ##
==========================================
- Coverage   45.05%   44.97%   -0.09%     
==========================================
  Files          76       76              
  Lines        3804     3811       +7     
==========================================
  Hits         1714     1714              
- Misses       1915     1922       +7     
  Partials      175      175
Impacted Files Coverage Δ
analyzers/gradle/gradle.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cef13fe...dff2d1b. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 18, 2019

Codecov Report

Merging #399 into master will increase coverage by 0.23%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #399      +/-   ##
==========================================
+ Coverage   45.05%   45.28%   +0.23%     
==========================================
  Files          76       76              
  Lines        3804     3811       +7     
==========================================
+ Hits         1714     1726      +12     
+ Misses       1915     1909       -6     
- Partials      175      176       +1
Impacted Files Coverage Δ
analyzers/gradle/gradle.go 0% <0%> (ø) ⬆️
config/keys.go 50.98% <0%> (+11.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cef13fe...6d04269. Read the comment docs.

flagSet := flag.NewFlagSet("test", 0)
flags.ConfigF.Apply(flagSet)
flags.OptionF.Apply(flagSet)
flagSet.Parse([]string{"gradle:argumentmodule"})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error return value of flagSet.Parse is not checked (from errcheck)

@zlav zlav merged commit 34babdf into master Jan 21, 2019
@zlav zlav deleted the fix/gradle-analyzer branch January 21, 2019 17:32
meghfossa added a commit that referenced this pull request Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants