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
1fb7c5f7
Commit
1fb7c5f7
authored
11 years ago
by
Daniel Stonier
Browse files
Options
Downloads
Patches
Plain Diff
extra handles for debian maven repo integration.
parent
cbd02f4b
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
cmake/rosjava.cmake.em
+21
-4
21 additions, 4 deletions
cmake/rosjava.cmake.em
env-hooks/15.rosjava.bash.em
+1
-0
1 addition, 0 deletions
env-hooks/15.rosjava.bash.em
generate_ros_maven_path.py
+15
-3
15 additions, 3 deletions
generate_ros_maven_path.py
with
37 additions
and
7 deletions
cmake/rosjava.cmake.em
+
21
−
4
View file @
1fb7c5f7
...
...
@@ -2,6 +2,8 @@
# Utilities
##############################################################################
set(CATKIN_GLOBAL_MAVEN_DESTINATION ${CATKIN_GLOBAL_SHARE_DESTINATION}/maven CACHE PATH "path to which maven artifacts are deployed in your workspace")
# Scans down directories till it finds the gradle wrapper.
# It sets the following variables
# - ${PROJECT_NAME}_gradle_BINARY
...
...
@@ -35,22 +37,35 @@ macro(find_gradle_repo_root)
get_filename_component(${PROJECT_NAME}_gradle_ROOT ${${PROJECT_NAME}_gradle_SETTINGS} PATH)
endmacro()
# Sets environment variables that are used by gradle to customise a build.
# This is better than modifying a gradle script - gradle should be able
# to be called alone without cmake intervention.
macro(_rosjava_env)
set(ROSJAVA_ENV $ENV{ROS_MAVEN_DEPLOYMENT_PATH})
if(NOT ROSJAVA_ENV)
set(ROSJAVA_ENV "ROS_MAVEN_DEPLOYMENT_PATH=${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}")
endif()
endmacro()
##############################################################################
# RosJava Package
##############################################################################
# Calls the gradle wrapper to compile just the package
# that it is called in with install and installApp targets.
macro(catkin_rosjava_setup)
_rosjava_env()
find_gradle()
if( ${ARGC} EQUAL 0 )
set(gradle_tasks "install;installApp")
# Note : COMMAND is a list of variables, so these need to be a list, not a single string
set(gradle_tasks "install;installApp;uploadArchives")
else()
s
tring(REPLACE ";" " "
gradle_tasks
"
${ARGV}
"
)
s
et(
gradle_tasks ${ARGV})
endif()
add_custom_target(gradle-${PROJECT_NAME}
ALL
COMMAND ${CATKIN_ENV} ${${PROJECT_NAME}_gradle_BINARY} ${gradle_tasks}
COMMAND
${ROSJAVA_ENV}
${CATKIN_ENV} ${${PROJECT_NAME}_gradle_BINARY} ${gradle_tasks}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
)
catkin_package_xml()
foreach(depends in ${${PROJECT_NAME}_BUILD_DEPENDS})
...
...
@@ -76,6 +91,7 @@ endmacro()
# It checks the build type and determines whether it should run
# assembleDebug or assembleRelease
macro(catkin_android_setup)
_rosjava_env()
find_gradle()
if( ${ARGC} EQUAL 0 )
if(CMAKE_BUILD_TYPE STREQUAL "Release")
...
...
@@ -88,8 +104,9 @@ macro(catkin_android_setup)
endif()
add_custom_target(gradle-${PROJECT_NAME}
ALL
COMMAND ${CATKIN_ENV} ${${PROJECT_NAME}_gradle_BINARY} ${gradle_tasks}
COMMAND
${ROSJAVA_ENV}
${CATKIN_ENV} ${${PROJECT_NAME}_gradle_BINARY} ${gradle_tasks}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
)
catkin_package_xml()
foreach(depends in ${${PROJECT_NAME}_BUILD_DEPENDS})
...
...
This diff is collapsed.
Click to expand it.
env-hooks/15.rosjava.bash.em
+
1
−
0
View file @
1fb7c5f7
...
...
@@ -2,6 +2,7 @@
@[if DEVELSPACE]@
export
ROS_MAVEN_PATH
=
`
python @
(
CMAKE_CURRENT_SOURCE_DIR
)
/generate_ros_maven_path.py
`
export
ROS_MAVEN_DEPLOYMENT_PATH
=
`
python @
(
CMAKE_CURRENT_SOURCE_DIR
)
/generate_ros_maven_path.py
--deployment-repository
`
@[else]@
export
ROS_MAVEN_PATH
=
`
python @
(
CMAKE_INSTALL_PREFIX
)
/share/rosjava_tools/generate_ros_maven_path.py
`
@[end
if
]
@
...
...
This diff is collapsed.
Click to expand it.
generate_ros_maven_path.py
+
15
−
3
View file @
1fb7c5f7
#!/usr/bin/env python
import
os
import
argparse
CATKIN_MARKER_FILE
=
'
.catkin
'
def
parse_arguments
():
parser
=
argparse
.
ArgumentParser
(
description
=
'
Generate environment variables for the rosjava maven environment.
'
)
parser
.
add_argument
(
'
-d
'
,
'
--deployment-repository
'
,
action
=
'
store_true
'
,
help
=
'
Return the current devel workspace maven directory.
'
)
args
=
parser
.
parse_args
()
return
args
def
get_workspaces
(
environ
):
'''
Based on CMAKE_PREFIX_PATH return all catkin workspaces.
...
...
@@ -13,10 +20,15 @@ def get_workspaces(environ):
value
=
environ
[
env_name
]
if
env_name
in
environ
else
''
paths
=
[
path
for
path
in
value
.
split
(
os
.
pathsep
)
if
path
]
# remove non-workspace paths
workspaces
=
[
path
for
path
in
paths
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
CATKIN_MARKER_FILE
))
or
(
include_fuerte
and
path
.
startswith
(
'
/opt/ros/fuerte
'
))
]
workspaces
=
[
path
for
path
in
paths
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
CATKIN_MARKER_FILE
))]
return
workspaces
if
__name__
==
'
__main__
'
:
args
=
parse_arguments
()
workspaces
=
get_workspaces
(
dict
(
os
.
environ
))
maven_repository_paths
=
[
os
.
path
.
join
(
path
,
'
maven
'
)
for
path
in
workspaces
]
if
args
.
deployment_repository
:
# assuming one value exists here
print
os
.
path
.
join
(
workspaces
[
0
],
'
share
'
,
'
maven
'
)
else
:
maven_repository_paths
=
[
os
.
path
.
join
(
path
,
'
share
'
,
'
maven
'
)
for
path
in
workspaces
]
print
os
.
pathsep
.
join
(
maven_repository_paths
)
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