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

Commit a7138e7

Browse files
committed
Update README.md
1 parent eb1e182 commit a7138e7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,24 @@ genjava
22
=======
33

44
RosJava message definition and serialization artifact generators.
5+
6+
For future reference, executing the generator from the command line requires a command of the following kind:
7+
8+
```
9+
java -classpath .:./message_generation-0.1.16.jar org.ros.internal.message.GenerateInterfaces
10+
```
11+
12+
This doesn't work exactly though because it doesn't pull in the full classpath. Make sure that is set to include everything you need. You'll also need arguments of the kind we're currently using in the hydro groovy plugin:
13+
14+
```
15+
def generatedSourcesDir = "${p.buildDir}/generated-src"
16+
def generateSourcesTask = p.tasks.create("generateSources", JavaExec)
17+
generateSourcesTask.description = "Generate sources for " + pkg.name
18+
generateSourcesTask.outputs.dir(p.file(generatedSourcesDir))
19+
/* generateSourcesTask.args = new ArrayList<String>([generatedSourcesDir, pkg.name]) */
20+
generateSourcesTask.args = new ArrayList<String>([generatedSourcesDir, '--package-path=' + pkg.directory, pkg.name])
21+
generateSourcesTask.classpath = p.configurations.runtime
22+
generateSourcesTask.main = 'org.ros.internal.message.GenerateInterfaces'
23+
p.tasks.compileJava.source generateSourcesTask.outputs.files
24+
```
25+

0 commit comments

Comments
 (0)