Skip to content

Commit 02db012

Browse files
committed
use ROS_MAVEN_REPOSITORY
1 parent 466deeb commit 02db012

File tree

7 files changed

+33
-16
lines changed

7 files changed

+33
-16
lines changed

env-hooks/15.rosjava.bash.em

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ SCRIPT=@(CMAKE_INSTALL_PREFIX)/share/rosjava_build_tools/generate_environment_va
88

99
export ROS_MAVEN_PATH=`python ${SCRIPT} --maven-path`
1010
export ROS_MAVEN_DEPLOYMENT_REPOSITORY=`python ${SCRIPT} --maven-deployment-repository`
11+
export ROS_MAVEN_REPOSITORY=`python ${SCRIPT} --maven-repository`
12+

env-hooks/15.rosjava.sh.em

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ SCRIPT=@(CMAKE_INSTALL_PREFIX)/share/rosjava_build_tools/generate_environment_va
88

99
export ROS_MAVEN_PATH=`python ${SCRIPT} --maven-path`
1010
export ROS_MAVEN_DEPLOYMENT_REPOSITORY=`python ${SCRIPT} --maven-deployment-repository`
11+
export ROS_MAVEN_REPOSITORY=`python ${SCRIPT} --maven-repository`

generate_environment_variables.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def parse_arguments():
99
parser = argparse.ArgumentParser(description='Generate environment variables for the rosjava maven environment.')
1010
cmd_group = parser.add_mutually_exclusive_group()
1111
cmd_group.add_argument('-d', '--maven-deployment-repository', action='store_true', help='Return the current devel workspace maven directory.')
12+
cmd_group.add_argument('-r', '--maven-repository', action='store_true', help='The url to the external ros maven repository.')
1213
cmd_group.add_argument('-m', '--maven-path', action='store_true', help='Generate maven path across all chained workspcaes.')
1314
cmd_group.add_argument('-g', '--gradle-user-home', action='store_true', help='Generate the local gradle user home in the current devel workspace (share/gradle).')
1415
args = parser.parse_args()
@@ -48,6 +49,11 @@ def get_environment_variable(environ, key):
4849
if repo in [os.path.join(w, 'share', 'maven') for w in workspaces]:
4950
repo = os.path.join(workspaces[0], 'share', 'maven')
5051
print repo
52+
elif args.maven_repository:
53+
repo = get_environment_variable(environment_variables, 'ROS_MAVEN_REPOSITORY')
54+
if repo is None:
55+
repo = 'https://github.com/rosjava/rosjava_mvn_repo/raw/master'
56+
print repo
5157
elif args.maven_path:
5258
new_maven_paths = [os.path.join(path, 'share', 'maven') for path in workspaces]
5359
maven_paths = get_environment_variable(environment_variables, 'ROS_MAVEN_PATH')

src/rosjava_build_tools/templates/android_package/build.gradle.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ task wrapper(type: Wrapper) {
2020

2121
buildscript {
2222
def rosMavenPath = "$System.env.ROS_MAVEN_PATH".split(':').collect { 'file://' + it }
23+
def rosMavenRepository = "$System.env.ROS_MAVEN_REPOSITORY"
2324
repositories {
2425
rosMavenPath.each { p ->
2526
maven {
@@ -28,11 +29,11 @@ buildscript {
2829
}
2930
mavenLocal()
3031
maven {
31-
url 'https://github.com/rosjava/rosjava_mvn_repo/raw/master'
32+
url rosMavenRepository
3233
}
3334
}
3435
dependencies {
35-
classpath group: 'org.ros.rosjava_bootstrap', name: 'gradle_plugins', version: '[0.1,)'
36+
classpath group: 'org.ros.rosjava_bootstrap', name: 'gradle_plugins', version: '[0.2,0.3)'
3637
}
3738
}
3839

src/rosjava_build_tools/templates/android_project/build.gradle.in

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@
1717
/*
1818
Examples of
1919
1) dependencies from another project in this gradle stack.
20-
2,3) dependency from a maven repository.
20+
2,3) open ranged dependencies from a maven repository.
2121

22-
It's a good idea to use + on the patch version dependency to
23-
save continually updating these references, but avoid applying
24-
the same principle to api breaking minor changes in the version.
22+
It's a good idea to use open ranges on to
23+
save continually updating these references, but it is recommended
24+
to restrict this to the patch version number (e.g. [0.2,0.3) will
25+
get the latest 0.2.x version) to avoid unknowingly
26+
having api breaking changes usually associated with minor and major
27+
version number changes.
2528
*/
2629
/*
2730
dependencies {
2831
compile project(':local_android_library_dependency')
29-
compile 'org.ros.android_core:android_gingerbread_mr1:[0.1,)'
30-
compile 'com.github.ros_java.android_extras:gingerbread:[0.1,)'
32+
compile 'org.ros.android_core:android_10:[0.2,0.3)'
33+
compile 'com.github.ros_java.android_extras:gingerbread:[0.2,0.3)'
3134
}
3235
*/
3336

src/rosjava_build_tools/templates/rosjava_package/build.gradle.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ task wrapper(type: Wrapper) {
2020

2121
buildscript {
2222
def rosMavenPath = "$System.env.ROS_MAVEN_PATH".split(':').collect { 'file://' + it }
23+
def rosMavenRepository = "$System.env.ROS_MAVEN_REPOSITORY"
2324
repositories {
2425
rosMavenPath.each { p ->
2526
maven {
@@ -28,11 +29,11 @@ buildscript {
2829
}
2930
mavenLocal()
3031
maven {
31-
url 'https://github.com/rosjava/rosjava_mvn_repo/raw/master'
32+
url rosMavenRepository
3233
}
3334
}
3435
dependencies {
35-
classpath group: 'org.ros.rosjava_bootstrap', name: 'gradle_plugins', version: '[0.1,)'
36+
classpath group: 'org.ros.rosjava_bootstrap', name: 'gradle_plugins', version: '[0.2,0.3)'
3637
}
3738
}
3839

src/rosjava_build_tools/templates/rosjava_project/build.gradle.in

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@
1717
/*
1818
Examples of
1919
1) dependencies from another project in this gradle stack.
20-
2,3) dependency from a maven repository.
20+
2,3) open ranged dependencies from a maven repository.
2121

22-
It's a good idea to use + on the patch version dependency to
23-
save continually updating these references, but avoid applying
24-
the same principle to api breaking minor changes in the version.
22+
It's a good idea to use open ranges on to
23+
save continually updating these references, but it is recommended
24+
to restrict this to the patch version number (e.g. [0.2,0.3) will
25+
get the latest 0.2.x version) to avoid unknowingly
26+
having api breaking changes usually associated with minor and major
27+
version number changes.
2528
*/
2629
/*
2730
dependencies {
2831
compile project(':local_android_library_dependency')
29-
compile 'org.ros.android_core:android_gingerbread_mr1:[0.1,)'
30-
compile 'com.github.ros_java.android_extras:gingerbread:[0.1,)'
32+
compile 'org.ros.rosjava_core:rosjava:[0.2,0.3)'
33+
compile 'com.github.rosjava.rosjava_extras:hokuyo:[0.2,0.3)'
3134
}
3235
*/
3336

0 commit comments

Comments
 (0)