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

Commit d0b9e25

Browse files
committed
fix single artifact message generation when there is dependencies.
1 parent 02ee557 commit d0b9e25

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,29 @@ class CatkinPackage {
160160
p.tasks.compileJava.source generateSourcesTask.outputs.files
161161
}
162162

163+
def void generateUnofficialMessageArtifact(Project p) {
164+
/* Couple of constraints here:
165+
1) maven group forced to org.ros.rosjava_messages to that all message artifact
166+
dependencies are easily found.
167+
2) Open ended dependency range (takes the latest in ROS_PACKAGE_PATH) since we
168+
don't know the artifact versions the user really wants.
169+
*/
170+
p.version = version
171+
p.group = 'org.ros.rosjava_messages'
172+
p.dependencies.add("compile", 'org.ros.rosjava_bootstrap:message_generation:[0.2,0.3)')
173+
messageDependencies().each { d ->
174+
p.dependencies.add("compile", 'org.ros.rosjava_messages:' + d + ':[0.1,)')
175+
}
176+
def generatedSourcesDir = "${p.buildDir}/generated-src"
177+
def generateSourcesTask = p.tasks.create("generateSources", JavaExec)
178+
generateSourcesTask.description = "Generate sources for " + name
179+
generateSourcesTask.outputs.dir(p.file(generatedSourcesDir))
180+
generateSourcesTask.args = new ArrayList<String>([generatedSourcesDir, name])
181+
generateSourcesTask.classpath = p.configurations.runtime
182+
generateSourcesTask.main = 'org.ros.internal.message.GenerateInterfaces'
183+
p.tasks.compileJava.source generateSourcesTask.outputs.files
184+
}
185+
163186
/*
164187
* Hack to work around for rosjava_test_msgs - look in a subfolder for the
165188
* msgs and name the artifact by the subfolder name/version.

0 commit comments

Comments
 (0)