Skip to content

Commit

Permalink
refactor: use RelationshipWorkspace instead on Module field
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Nov 28, 2024
1 parent 775ae7f commit c0c4bf1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion pkg/dependency/parser/java/pom/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type artifact struct {

Exclusions map[string]struct{}

Module bool
Relationship ftypes.Relationship

Locations ftypes.Locations
Expand Down
6 changes: 2 additions & 4 deletions pkg/dependency/parser/java/pom/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ func (p *Parser) parseRoot(root artifact, uniqModules map[string]struct{}) ([]ft
// Prepare a queue for dependencies
queue := newArtifactQueue()

// Enqueue root POM
root.Module = false
// Enqueue root/module POM
queue.enqueue(root)

var (
Expand All @@ -143,7 +142,7 @@ func (p *Parser) parseRoot(root artifact, uniqModules map[string]struct{}) ([]ft

// Modules should be handled separately so that they can have independent dependencies.
// It means multi-module allows for duplicate dependencies.
if art.Module {
if art.Relationship == ftypes.RelationshipWorkspace {
if _, ok := uniqModules[art.String()]; ok {
continue
}
Expand Down Expand Up @@ -288,7 +287,6 @@ func (p *Parser) parseModule(currentPath, relativePath string) (artifact, error)
}

moduleArtifact := module.artifact()
moduleArtifact.Module = true
moduleArtifact.Relationship = ftypes.RelationshipWorkspace

p.cache.put(moduleArtifact, result)
Expand Down

0 comments on commit c0c4bf1

Please sign in to comment.