Skip to content
This repository was archived by the owner on Jan 14, 2023. It is now read-only.

Commit 84c95fb

Browse files
committed
bugfix catkin tree generator, always take latest version of a package.
1 parent 5bd664d commit 84c95fb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

gradle_plugins/src/main/groovy/org/ros/gradle_plugins/CatkinPlugin.groovy

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,18 @@ class CatkinPackages {
8686

8787
def generate() {
8888
if ( this.pkgs.size() == 0 ) {
89-
println("Catkin plugin is generating the catkin package tree...")
9089
this.workspaces.each { workspace ->
9190
def manifestTree = project.fileTree(dir: workspace, include: '**/package.xml')
9291
manifestTree.each { file ->
9392
def pkg = new CatkinPackage(file)
94-
this.pkgs.put(pkg.name, pkg)
93+
if(this.pkgs.containsKey(pkg.name)) {
94+
if(this.pkgs[pkg.name].version < pkg.version) {
95+
println("Catkin generate tree: replacing older version of " + pkg.name + "[" + this.pkgs[pkg.name].version + "->" + pkg.version + "]")
96+
this.pkgs[pkg.name] = pkg
97+
}
98+
} else {
99+
this.pkgs.put(pkg.name, pkg)
100+
}
95101
}
96102
}
97103
}

0 commit comments

Comments
 (0)