Skip to content

Commit

Permalink
增加版本判断
Browse files Browse the repository at this point in the history
  • Loading branch information
645775992 committed May 16, 2023
1 parent 68db7eb commit 25ce08f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 3 additions & 1 deletion fix/file_fix_maven.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ func (p *mavenParams) getFixModelList(params FixParams, pomPathList []string) {
for _, comp := range params.CompList {
for _, pomPath := range pomPathList {
list := GetFixModelList(filepath.Join(params.Dir, pomPath), pomPath, comp.CompName, comp.CompVersion, comp.MinFixVersion, p.propertyMap)
p.fixModelList = append(p.fixModelList, list...)
if len(list) > 0 {
p.fixModelList = append(p.fixModelList, list...)
}

}
}
Expand Down
19 changes: 11 additions & 8 deletions fix/xml_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,18 @@ func (l *ChildXMLListener) EnterElement(ctx *parser.ElementContext) {

if propertyModel, ok := l.modelMap[model.OldVersion]; ok {
for _, m := range propertyModel {
newModel := FixModel{
Line: m.Line,
OldVersion: model.OldVersion,
NewVersion: l.newVersion,
CompName: l.compName,
PomPath: l.pomPath,
relativePomPath: l.relativePomPath,
if m.OldVersion == l.compVersion {
newModel := FixModel{
Line: m.Line,
OldVersion: model.OldVersion,
NewVersion: l.newVersion,
CompName: l.compName,
PomPath: l.pomPath,
relativePomPath: l.relativePomPath,
}
l.fixModelList = append(l.fixModelList, newModel)
}
l.fixModelList = append(l.fixModelList, newModel)

}
}
} else {
Expand Down

0 comments on commit 25ce08f

Please sign in to comment.