Skip to content
This repository was archived by the owner on Jan 14, 2023. It is now read-only.

Commit 78056d1

Browse files
committed
bugfix dynamic property warnings and set a default maven repo.
1 parent d5aa481 commit 78056d1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosPlugin.groovy

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ class RosPlugin implements Plugin<Project> {
2525
project.apply(plugin: 'maven')
2626
}
2727
/* Create project.ros.* property extensions */
28-
project.extensions.create("ros", RosPluginExtension)
28+
project.extensions.create("ros", RosExtension)
2929
project.ros.mavenPath = "$System.env.ROS_MAVEN_PATH".split(':')
30-
project.ros.mavenRepository = "$System.env.ROS_MAVEN_REPOSITORY"
3130
project.ros.mavenDeploymentRepository = "$System.env.ROS_MAVEN_DEPLOYMENT_REPOSITORY"
31+
def mavenRepository = "$System.env.ROS_MAVEN_REPOSITORY"
32+
if ( mavenRepository != 'null' ) {
33+
project.ros.mavenRepository = mavenRepository
34+
}
3235
/*
3336
* Could use some better handling for when this is not defined as it sets
3437
* file://null, but it doesn't seem to hurt the process any
@@ -49,7 +52,15 @@ class RosPlugin implements Plugin<Project> {
4952
}
5053
}
5154

52-
class RosPluginExtension {
55+
/* http://www.gradle.org/docs/nightly/dsl/org.gradle.api.plugins.ExtensionAware.html */
56+
class RosExtension {
5357
List<String> mavenPath
5458
String mavenDeploymentRepository
59+
String mavenRepository
60+
61+
RosExtension() {
62+
/* Initialising the strings here gets rid of the dynamic property deprecated warnings. */
63+
this.mavenDeploymentRepository = ""
64+
this.mavenRepository = "https://github.com/rosjava/rosjava_mvn_repo/raw/master"
65+
}
5566
}

0 commit comments

Comments
 (0)