Skip to content
Snippets Groups Projects
Commit 0a9b7f2d authored by Daniel Stonier's avatar Daniel Stonier
Browse files

message dependency listing.

parent 181d987b
No related branches found
No related tags found
No related merge requests found
...@@ -6,11 +6,10 @@ import org.gradle.api.Task; ...@@ -6,11 +6,10 @@ import org.gradle.api.Task;
import org.gradle.api.*; import org.gradle.api.*;
/* /*
* Provides catkin information to the gradle build, defining properties for * Provides catkin information to the gradle build, defining properties:
* use by the project:
* *
* - project.catkin.rosPackagePath * - project.catkin.rosPackagePath : list of Strings
* - project.catkin.packages * - project.catkin.packages : dictionary of CatkinPackage objects
* *
* The latter can be iterated over for information: * The latter can be iterated over for information:
* *
...@@ -21,6 +20,10 @@ import org.gradle.api.*; ...@@ -21,6 +20,10 @@ import org.gradle.api.*;
* pkg.dependencies.each { d -> * pkg.dependencies.each { d ->
* println d * println d
* } * }
* // filtered list of *_msg dependencies.
* pkg.messageDependencies().each { d ->
* println d
* }
* } * }
* *
* Use this only once in the root of a multi-project gradle build - it will * Use this only once in the root of a multi-project gradle build - it will
...@@ -37,7 +40,6 @@ class CatkinPlugin implements Plugin<Project> { ...@@ -37,7 +40,6 @@ class CatkinPlugin implements Plugin<Project> {
project.catkin.rosPackagePath = [] project.catkin.rosPackagePath = []
project.catkin.rosPackagePath = "$System.env.ROS_PACKAGE_PATH".split(":") project.catkin.rosPackagePath = "$System.env.ROS_PACKAGE_PATH".split(":")
project.catkin.rosPackagePath.each { rosPackageRoot -> project.catkin.rosPackagePath.each { rosPackageRoot ->
println("RosPackageRoot.........${rosPackageRoot}")
def manifestTree = project.fileTree(dir: rosPackageRoot, include: '**/package.xml') def manifestTree = project.fileTree(dir: rosPackageRoot, include: '**/package.xml')
manifestTree.each { file -> manifestTree.each { file ->
def pkg = new CatkinPackage(file) def pkg = new CatkinPackage(file)
...@@ -46,7 +48,7 @@ class CatkinPlugin implements Plugin<Project> { ...@@ -46,7 +48,7 @@ class CatkinPlugin implements Plugin<Project> {
} }
println("CatkinPlugin is happy, you should be too.") println("CatkinPlugin is happy, you should be too.")
project.task('catkinPackageInfo') << { project.task('catkinPackageInfo') << {
println "I'll teach your grandmother to suck eggs!" println("CatkinPlugin is happy, you should be too.")
println("rosPackagePath........." + project.catkin.rosPackagePath) println("rosPackagePath........." + project.catkin.rosPackagePath)
println("Catkin Packages") println("Catkin Packages")
project.catkin.packages.each { pkg -> project.catkin.packages.each { pkg ->
...@@ -95,7 +97,21 @@ class CatkinPackage { ...@@ -95,7 +97,21 @@ class CatkinPackage {
out += " " + d + "\n" out += " " + d + "\n"
} }
return out return out
}
/*
* Find and annotate a list of package package dependencies.
* Useful for message artifact generation).
*
* @return List<String> : dependencies (package name strings)
*/
def List<String> messageDependencies() {
List<String> msgDependencies = []
dependencies.each { d ->
if ( d.contains("_msgs") ) {
msgDependencies.add(d)
}
}
return msgDependencies
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment