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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CeTI
ROS
ROS Java Packages
Rosjava Bootstrap Gradle
Commits
f7e4eeae
Commit
f7e4eeae
authored
11 years ago
by
Daniel Stonier
Browse files
Options
Downloads
Patches
Plain Diff
catkin plugin updates, avoid autogeneration and provide single package info.
parent
bb2a37be
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
gradle.properties
+1
-0
1 addition, 0 deletions
gradle.properties
gradle_plugins/src/main/groovy/org/ros/gradle_plugins/CatkinPlugin.groovy
+39
-17
39 additions, 17 deletions
...rc/main/groovy/org/ros/gradle_plugins/CatkinPlugin.groovy
with
40 additions
and
17 deletions
gradle.properties
0 → 100644
+
1
−
0
View file @
f7e4eeae
org.gradle.daemon
=
true
This diff is collapsed.
Click to expand it.
gradle_plugins/src/main/groovy/org/ros/gradle_plugins/CatkinPlugin.groovy
+
39
−
17
View file @
f7e4eeae
...
@@ -10,12 +10,14 @@ import org.gradle.api.*;
...
@@ -10,12 +10,14 @@ import org.gradle.api.*;
/*
/*
* Provides catkin information to the gradle build, defining properties:
* Provides catkin information to the gradle build, defining properties:
*
*
* - project.catkin.pkg : information about this package
* - project.catkin.workspaces : list of Strings
* - project.catkin.workspaces : list of Strings
* - project.catkin.packages : dictionary of CatkinPackage objects
* - project.catkin.tree.generate() : create the pkgs dictionary
* - project.catkin.tree.pkgs : dictionary of CatkinPackage objects
*
*
* The latter can be iterated over for information:
* The latter can be iterated over for information:
*
*
* project.catkin.
package
s.each { pair ->
* project.catkin.
tree.pkg
s.each { pair ->
* pkg = pair.value
* pkg = pair.value
* println pkg.name
* println pkg.name
* println pkg.version
* println pkg.version
...
@@ -42,23 +44,18 @@ class CatkinPlugin implements Plugin<Project> {
...
@@ -42,23 +44,18 @@ class CatkinPlugin implements Plugin<Project> {
this
.
project
=
project
this
.
project
=
project
/* Create project.catkin.* property extensions */
/* Create project.catkin.* property extensions */
project
.
extensions
.
create
(
"catkin"
,
CatkinPluginExtension
)
project
.
extensions
.
create
(
"catkin"
,
CatkinPluginExtension
)
project
.
catkin
.
packages
=
[:]
project
.
catkin
.
workspaces
=
[]
project
.
catkin
.
workspaces
=
[]
project
.
catkin
.
workspaces
=
"$System.env.ROS_PACKAGE_PATH"
.
split
(
":"
)
project
.
catkin
.
workspaces
=
"$System.env.ROS_PACKAGE_PATH"
.
split
(
":"
)
/*
project
.
catkin
.
tree
=
new
CatkinPackages
(
project
,
project
.
catkin
.
workspaces
)
* Would be more ideal shifting this expensive fileTree operation so
def
packageXml
=
project
.
file
(
'package.xml'
)
* that its' lazily generated (generated only if used), but that's a bit
if
(
!
packageXml
.
exists
()
)
{
* tricky - maybe by overriding CatkinPluginExtensions.getPackages()?
def
parentDirectoryName
=
file
.
getParentFile
().
getParent
();
*/
packageXml
=
project
.
file
(
'package.xml'
)
project
.
catkin
.
workspaces
.
each
{
workspace
->
def
manifestTree
=
project
.
fileTree
(
dir:
workspace
,
include:
'**/package.xml'
)
manifestTree
.
each
{
file
->
def
pkg
=
new
CatkinPackage
(
file
)
project
.
catkin
.
packages
.
put
(
pkg
.
name
,
pkg
)
}
}
if
(
packageXml
!=
null
)
{
project
.
catkin
.
pkg
=
new
CatkinPackage
(
packageXml
)
}
}
setTasks
()
setTasks
()
println
(
"CatkinPlugin is happy, you should be too."
)
}
}
def
void
setTasks
()
{
def
void
setTasks
()
{
project
.
task
(
'catkinPackageInfo'
)
<<
{
project
.
task
(
'catkinPackageInfo'
)
<<
{
...
@@ -72,8 +69,33 @@ class CatkinPlugin implements Plugin<Project> {
...
@@ -72,8 +69,33 @@ class CatkinPlugin implements Plugin<Project> {
}
}
}
}
class
CatkinPluginExtension
{
class
CatkinPluginExtension
{
CatkinPackage
pkg
List
<
String
>
workspaces
List
<
String
>
workspaces
Map
<
String
,
CatkinPackage
>
packages
CatkinPackages
tree
}
class
CatkinPackages
{
def
Map
<
String
,
CatkinPackage
>
pkgs
def
List
<
String
>
workspaces
def
Project
project
def
CatkinPackages
(
Project
project
,
List
<
String
>
workspaces
)
{
this
.
project
=
project
this
.
workspaces
=
workspaces
this
.
pkgs
=
[:]
}
def
generate
()
{
if
(
this
.
pkgs
.
size
()
==
0
)
{
println
(
"Catkin plugin is generating the catkin package tree..."
)
this
.
workspaces
.
each
{
workspace
->
def
manifestTree
=
project
.
fileTree
(
dir:
workspace
,
include:
'**/package.xml'
)
manifestTree
.
each
{
file
->
def
pkg
=
new
CatkinPackage
(
file
)
this
.
pkgs
.
put
(
pkg
.
name
,
pkg
)
}
}
}
}
}
}
class
CatkinPackage
{
class
CatkinPackage
{
...
...
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