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
3b73e7ee
Commit
3b73e7ee
authored
Sep 21, 2013
by
Daniel Stonier
Browse files
Options
Downloads
Patches
Plain Diff
fix problems with preset ros environment variables from a chained workspace.
parent
9697ec5b
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
env-hooks/15.rosjava.bash.em
+3
-11
3 additions, 11 deletions
env-hooks/15.rosjava.bash.em
env-hooks/15.rosjava.sh.em
+3
-11
3 additions, 11 deletions
env-hooks/15.rosjava.sh.em
generate_environment_variables.py
+36
-7
36 additions, 7 deletions
generate_environment_variables.py
with
42 additions
and
29 deletions
env-hooks/15.rosjava.bash.em
+
3
−
11
View file @
3b73e7ee
...
...
@@ -6,14 +6,6 @@ SCRIPT=@(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py
SCRIPT
=
@
(
CMAKE_INSTALL_PREFIX
)
/share/rosjava_build_tools/generate_environment_variables.py
@[end
if
]
@
# Conditionally set these variables - i.e. if the user wants to override them, that is ok.
:
${
ROS_MAVEN_PATH
:
=
`
python
${
SCRIPT
}
--maven-path
`
}
:
${
ROS_MAVEN_DEPLOYMENT_REPOSITORY
:
=
`
python
${
SCRIPT
}
--maven-deployment-repository
`
}
:
${
GRADLE_USER_HOME
:
=
`
python
${
SCRIPT
}
--gradle-user-home
`
}
export
ROS_MAVEN_PATH
export
ROS_MAVEN_DEPLOYMENT_REPOSITORY
export
GRADLE_USER_HOME
#export ROS_MAVEN_PATH=`python @(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py --maven-path`
#export ROS_MAVEN_DEPLOYMENT_REPOSITORY=`python @(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py --maven-deployment-repository`
#export GRADLE_USER_HOME=`python @(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py --gradle-user-home`
export
ROS_MAVEN_PATH
=
`
python
${
SCRIPT
}
--maven-path
`
export
ROS_MAVEN_DEPLOYMENT_REPOSITORY
=
`
python
${
SCRIPT
}
--maven-deployment-repository
`
export
GRADLE_USER_HOME
=
`
python
${
SCRIPT
}
--gradle-user-home
`
This diff is collapsed.
Click to expand it.
env-hooks/15.rosjava.sh.em
+
3
−
11
View file @
3b73e7ee
...
...
@@ -6,14 +6,6 @@ SCRIPT=@(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py
SCRIPT
=
@
(
CMAKE_INSTALL_PREFIX
)
/share/rosjava_build_tools/generate_environment_variables.py
@[end
if
]
@
# Conditionally set these variables - i.e. if the user wants to override them, that is ok.
:
${
ROS_MAVEN_PATH
:
=
`
python
${
SCRIPT
}
--maven-path
`
}
:
${
ROS_MAVEN_DEPLOYMENT_REPOSITORY
:
=
`
python
${
SCRIPT
}
--maven-deployment-repository
`
}
:
${
GRADLE_USER_HOME
:
=
`
python
${
SCRIPT
}
--gradle-user-home
`
}
export
ROS_MAVEN_PATH
export
ROS_MAVEN_DEPLOYMENT_REPOSITORY
export
GRADLE_USER_HOME
#export ROS_MAVEN_PATH=`python @(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py --maven-path`
#export ROS_MAVEN_DEPLOYMENT_REPOSITORY=`python @(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py --maven-deployment-repository`
#export GRADLE_USER_HOME=`python @(CMAKE_CURRENT_SOURCE_DIR)/generate_environment_variables.py --gradle-user-home`
export
ROS_MAVEN_PATH
=
`
python
${
SCRIPT
}
--maven-path
`
export
ROS_MAVEN_DEPLOYMENT_REPOSITORY
=
`
python
${
SCRIPT
}
--maven-deployment-repository
`
export
GRADLE_USER_HOME
=
`
python
${
SCRIPT
}
--gradle-user-home
`
This diff is collapsed.
Click to expand it.
generate_environment_variables.py
+
36
−
7
View file @
3b73e7ee
...
...
@@ -26,17 +26,46 @@ def get_workspaces(environ):
workspaces
=
[
path
for
path
in
paths
if
os
.
path
.
isfile
(
os
.
path
.
join
(
path
,
CATKIN_MARKER_FILE
))]
return
workspaces
def
get_environment_variable
(
environ
,
key
):
var
=
None
try
:
var
=
environ
[
key
]
except
KeyError
:
pass
if
var
==
''
:
var
=
None
return
var
if
__name__
==
'
__main__
'
:
args
=
parse_arguments
()
workspaces
=
get_workspaces
(
dict
(
os
.
environ
))
environment_variables
=
dict
(
os
.
environ
)
workspaces
=
get_workspaces
(
environment_variables
)
if
args
.
maven_deployment_repository
:
# assuming one value exists here
print
os
.
path
.
join
(
workspaces
[
0
],
'
share
'
,
'
maven
'
)
repo
=
get_environment_variable
(
environment_variables
,
'
ROS_MAVEN_DEPLOYMENT_REPOSITORY
'
)
if
repo
is
None
:
repo
=
os
.
path
.
join
(
workspaces
[
0
],
'
share
'
,
'
maven
'
)
else
:
if
repo
in
[
os
.
path
.
join
(
w
,
'
share
'
,
'
maven
'
)
for
w
in
workspaces
]:
repo
=
os
.
path
.
join
(
workspaces
[
0
],
'
share
'
,
'
maven
'
)
print
repo
elif
args
.
maven_path
:
maven_repository_paths
=
[
os
.
path
.
join
(
path
,
'
share
'
,
'
maven
'
)
for
path
in
workspaces
]
print
os
.
pathsep
.
join
(
maven_repository_paths
)
new_maven_paths
=
[
os
.
path
.
join
(
path
,
'
share
'
,
'
maven
'
)
for
path
in
workspaces
]
maven_paths
=
get_environment_variable
(
environment_variables
,
'
ROS_MAVEN_PATH
'
)
if
maven_paths
is
None
:
maven_paths
=
new_maven_paths
else
:
maven_paths
=
maven_paths
.
split
(
os
.
pathsep
)
common_paths
=
[
p
for
p
in
maven_paths
if
p
in
new_maven_paths
]
if
common_paths
:
maven_paths
=
new_maven_paths
print
os
.
pathsep
.
join
(
maven_paths
)
elif
args
.
gradle_user_home
:
# assuming one value exists here
print
os
.
path
.
join
(
workspaces
[
0
],
'
share
'
,
'
gradle
'
)
home
=
get_environment_variable
(
environment_variables
,
'
GRADLE_USER_HOME
'
)
if
home
is
None
:
home
=
os
.
path
.
join
(
workspaces
[
0
],
'
share
'
,
'
gradle
'
)
else
:
if
home
in
[
os
.
path
.
join
(
w
,
'
share
'
,
'
gradle
'
)
for
w
in
workspaces
]:
home
=
os
.
path
.
join
(
workspaces
[
0
],
'
share
'
,
'
gradle
'
)
print
home
else
:
print
"
Nothing to see here - please provide one of the valid command switches.
"
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