Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
ROS Java Build Tools
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
ROS Java Build Tools
Commits
2f4d85e0
Commit
2f4d85e0
authored
Feb 18, 2015
by
Daniel Stonier
Browse files
Options
Downloads
Patches
Plain Diff
support for a message artifact command line generator.
parent
65d5c224
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/rosjava_build_tools/__init__.py
+1
-0
1 addition, 0 deletions
src/rosjava_build_tools/__init__.py
src/rosjava_build_tools/catkin.py
+63
-0
63 additions, 0 deletions
src/rosjava_build_tools/catkin.py
src/rosjava_build_tools/release.py
+2
-15
2 additions, 15 deletions
src/rosjava_build_tools/release.py
with
66 additions
and
15 deletions
src/rosjava_build_tools/__init__.py
+
1
−
0
View file @
2f4d85e0
...
...
@@ -10,3 +10,4 @@ from create_android_project import create_android_project
from
create_rosjava_project
import
create_rosjava_project
,
create_rosjava_msg_project
,
create_rosjava_library_project
from
utils
import
which
from
release
import
scrape_for_release_message_packages
import
catkin
This diff is collapsed.
Click to expand it.
src/rosjava_build_tools/catkin.py
0 → 100644
+
63
−
0
View file @
2f4d85e0
#!/usr/bin/env python
##############################################################################
# Imports
##############################################################################
import
os
import
catkin_pkg.packages
import
catkin_pkg.topological_order
##############################################################################
# Methods
##############################################################################
def
has_build_depend_on_message_generation
(
package
):
'''
Checks for a build dependency on message generation to determine if
that package contains msgs/srvs.
@param package : typical catkin package object
@type catkin_pkg.Package
@return True if it is a package that contains msgs/srvs
@rtype Bool
'''
return
'
message_generation
'
in
[
d
.
name
for
d
in
package
.
build_depends
]
def
index_message_package_dependencies_from_local_environment
(
package_name
=
None
,
package_paths
=
None
):
'''
Returns a topologically sorted list of message packages that can
be used for sequencing builds of packages.
@param package_name : sort dependencies for this package only (defaults to all packages if None is given)
@param package_paths : a python list of ros workspaces (defaults to ROS_PACKAGE_PATH if None is given)
@return dict mapping relative path to a catkin_pkg.Package
'''
if
package_paths
is
None
:
package_paths
=
os
.
getenv
(
'
ROS_PACKAGE_PATH
'
,
''
)
package_paths
=
[
x
for
x
in
package_paths
.
split
(
'
:
'
)
if
x
]
all_packages
=
{}
# mapping package name to (path, catkin_pkg.Package) tuple
message_packages
=
{}
# use reversed to write over any packages lower down in the overlay heirarchy
# i.e. no duplicates!
for
path
in
reversed
(
package_paths
):
for
package_path
,
package
in
catkin_pkg
.
packages
.
find_packages
(
path
).
items
():
all_packages
[
package
.
name
]
=
(
package_path
,
package
)
if
has_build_depend_on_message_generation
(
package
):
if
package_name
is
not
None
:
if
package_name
==
package
.
name
:
message_packages
[
package
.
name
]
=
(
package_path
,
package
)
else
:
message_packages
[
package
.
name
]
=
(
package_path
,
package
)
# put into the correct form for sorting
# The following returns: A list of tuples containing the relative path and a ``Package`` object,
sorted_package_tuples
=
catkin_pkg
.
topological_order
.
topological_order_packages
(
packages
=
dict
(
message_packages
.
values
()),
whitelisted
=
None
,
blacklisted
=
None
,
underlay_packages
=
dict
(
all_packages
.
values
()))
# print("%s" % [p.name for (unused_relative_path, p) in sorted_package_tuples])
return
sorted_package_tuples
This diff is collapsed.
Click to expand it.
src/rosjava_build_tools/release.py
+
2
−
15
View file @
2f4d85e0
...
...
@@ -6,26 +6,13 @@
import
rosdistro
import
catkin_pkg
from
.
import
catkin
##############################################################################
# Imports
##############################################################################
def
has_build_depend_on_message_generation
(
package
):
'''
Checks for a build dependency on message generation to determine if
that package contains msgs/srvs.
@param package : typical catkin package object
@type catkin_pkg.Package
@return True if it is a package that contains msgs/srvs
@rtype Bool
'''
return
'
message_generation
'
in
[
d
.
name
for
d
in
package
.
build_depends
]
def
scrape_for_release_message_packages
(
track
):
url
=
rosdistro
.
get_index_url
()
index
=
rosdistro
.
get_index
(
url
)
...
...
@@ -35,6 +22,6 @@ def scrape_for_release_message_packages(track):
package
=
catkin_pkg
.
package
.
parse_package_string
(
package_string
)
#print(" Name: %s" % package_name)
#print(" Buildtool Depends %s" % package.build)
if
has_build_depend_on_message_generation
(
package
):
if
catkin
.
has_build_depend_on_message_generation
(
package
):
packages
.
append
({
'
name
'
:
package_name
,
'
version
'
:
package
.
version
})
return
packages
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