diff --git a/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosPlugin.groovy b/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosPlugin.groovy index cd5366e657cc0ee505e24d3755f6ee59bc60c091..2024cb52d424478e964f4c052982acdd85af75e7 100644 --- a/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosPlugin.groovy +++ b/gradle_plugins/src/main/groovy/org/ros/gradle_plugins/RosPlugin.groovy @@ -25,10 +25,13 @@ class RosPlugin implements Plugin<Project> { project.apply(plugin: 'maven') } /* Create project.ros.* property extensions */ - project.extensions.create("ros", RosPluginExtension) + project.extensions.create("ros", RosExtension) project.ros.mavenPath = "$System.env.ROS_MAVEN_PATH".split(':') project.ros.mavenDeploymentRepository = "$System.env.ROS_MAVEN_DEPLOYMENT_REPOSITORY" - project.ros.mavenRepository = "$System.env.ROS_MAVEN_REPOSITORY" + def mavenRepository = "$System.env.ROS_MAVEN_REPOSITORY" + if ( mavenRepository != 'null' ) { + project.ros.mavenRepository = mavenRepository + } /* * Could use some better handling for when this is not defined as it sets * file://null, but it doesn't seem to hurt the process any @@ -49,7 +52,17 @@ class RosPlugin implements Plugin<Project> { } } -class RosPluginExtension { +/* http://www.gradle.org/docs/nightly/dsl/org.gradle.api.plugins.ExtensionAware.html */ +class RosExtension { List<String> mavenPath String mavenDeploymentRepository + String mavenRepository + String mavenRepositoryD + + RosExtension() { + /* Initialising the strings here gets rid of the dynamic property deprecated warnings. */ + this.mavenDeploymentRepository = "" + this.mavenRepository = "https://github.com/rosjava/rosjava_mvn_repo/raw/master" + this.mavenRepositoryD = "https://github.com/rosjava/rosjava_mvn_repo/raw/master" + } }