Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rosjava Bootstrap Gradle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CeTI
ROS
ROS Java Packages
Rosjava Bootstrap Gradle
Commits
edbae492
Commit
edbae492
authored
11 years ago
by
Daniel Stonier
Browse files
Options
Downloads
Patches
Plain Diff
msg subproject generation, the right way.
parent
75ea608e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gradle_plugins/src/main/groovy/org/ros/gradle_plugins/CatkinPlugin.groovy
+58
-0
58 additions, 0 deletions
...rc/main/groovy/org/ros/gradle_plugins/CatkinPlugin.groovy
with
58 additions
and
0 deletions
gradle_plugins/src/main/groovy/org/ros/gradle_plugins/CatkinPlugin.groovy
+
58
−
0
View file @
edbae492
...
...
@@ -102,6 +102,60 @@ class CatkinPackages {
}
}
}
def
isMessagePackage
(
String
package_name
)
{
def
pkg
def
result
=
false
try
{
pkg
=
this
.
pkgs
[
package_name
]
/* println(" Name: " + pkg.name + "-" + pkg.version) */
/* println(" Dep-dependencies: " + pkg.dependencies) */
pkg
.
dependencies
.
each
{
d
->
if
(
d
.
equalsIgnoreCase
(
"message_generation"
)
)
{
result
=
true
}
}
}
catch
(
NullPointerException
e
)
{
/* Not a catkin package dependency (e.g. boost), ignore */
result
=
false
}
return
result
}
def
void
generateMessageArtifact
(
Project
p
,
String
package_name
)
{
def
pkg
=
this
.
pkgs
[
package_name
]
p
.
version
=
pkg
.
version
/* println("Artifact: " + pkg.name + "-" + pkg.version) */
p
.
dependencies
.
add
(
"compile"
,
'org.ros.rosjava_bootstrap:message_generation:[0.1,0.2)'
)
List
<
String
>
messageDependencies
=
[]
pkg
.
dependencies
.
each
{
d
->
/* println(" Dependency: " + d) */
if
(
this
.
isMessagePackage
(
d
)
)
{
messageDependencies
.
add
(
d
)
/* println(" Msg Pkg: yes") */
}
else
{
/* println(" Msg Pkg: no") */
}
}
messageDependencies
.
each
{
d
->
if
(
p
.
getParent
().
getChildProjects
().
containsKey
(
d
)
)
{
/* println(" Internal: " + d) */
p
.
dependencies
.
add
(
"compile"
,
p
.
dependencies
.
project
(
path:
':'
+
d
))
}
else
{
/* println(" External: " + d) */
p
.
dependencies
.
add
(
"compile"
,
'org.ros.rosjava_messages:'
+
d
+
':[0.0,)'
)
}
}
def
generatedSourcesDir
=
"${p.buildDir}/generated-src"
def
generateSourcesTask
=
p
.
tasks
.
create
(
"generateSources"
,
JavaExec
)
generateSourcesTask
.
description
=
"Generate sources for "
+
pkg
.
name
generateSourcesTask
.
outputs
.
dir
(
p
.
file
(
generatedSourcesDir
))
/* generateSourcesTask.args = new ArrayList<String>([generatedSourcesDir, pkg.name]) */
generateSourcesTask
.
args
=
new
ArrayList
<
String
>([
generatedSourcesDir
,
'--package-path='
+
pkg
.
directory
,
pkg
.
name
])
generateSourcesTask
.
classpath
=
p
.
configurations
.
runtime
generateSourcesTask
.
main
=
'org.ros.internal.message.GenerateInterfaces'
p
.
tasks
.
compileJava
.
source
generateSourcesTask
.
outputs
.
files
}
}
class
CatkinPackage
{
...
...
@@ -134,6 +188,8 @@ class CatkinPackage {
* Find and annotate a list of package package dependencies.
* Useful for message artifact generation).
*
* Depracated, but kept around for legacy purposes, remove in igloo
*
* @return List<String> : dependencies (package name strings)
*/
def
List
<
String
>
messageDependencies
()
{
...
...
@@ -146,6 +202,7 @@ class CatkinPackage {
return
msgDependencies
}
/* Depracated, but kept around for legacy purposes, remove in igloo */
def
void
generateMessageArtifact
(
Project
p
)
{
p
.
version
=
version
p
.
dependencies
.
add
(
"compile"
,
'org.ros.rosjava_bootstrap:message_generation:[0.1,0.2)'
)
...
...
@@ -162,6 +219,7 @@ class CatkinPackage {
p
.
tasks
.
compileJava
.
source
generateSourcesTask
.
outputs
.
files
}
/* Depracated, but kept around for legacy purposes, remove in igloo */
def
void
generateUnofficialMessageArtifact
(
Project
p
)
{
/* Couple of constraints here:
1) maven group forced to org.ros.rosjava_messages to that all message artifact
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment