Skip to content
Snippets Groups Projects
Commit d4de89be authored by Daniel Stonier's avatar Daniel Stonier
Browse files

set default maven repo if variable is empty and bugfix dynamic property warnings.

parent 0d13c155
Branches
Tags
No related merge requests found
......@@ -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"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment