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

bugfix the broken chained workspace maven repo chain.

parent 449c2f68
No related branches found
No related tags found
No related merge requests found
...@@ -7,10 +7,14 @@ import org.gradle.api.*; ...@@ -7,10 +7,14 @@ import org.gradle.api.*;
/* /*
* Provides information about the ros workspace. * Provides information about the ros workspace.
* *
* - project.ros.maven : location of local ros maven repository * - project.ros.mavenPath : location of local ros maven repositories (in your chained workspaces)
* - project.ros.mavenDeploymentPath : location of the ros maven repository you will publish to
* *
* Use this only once in the root of a multi-project gradle build - it will * It also performs the following actions
* only generate the properties once and share them this way. *
* - checks and maeks sure the maven plugin is running
* - constructs the sequence of dependant maven repos (local ros maven repos, mavenLocal, external ros maven repo)
* - configures the uploadArchives for artifact deployment to the local ros maven repo (devel/share/maven)
*/ */
class RosPlugin implements Plugin<Project> { class RosPlugin implements Plugin<Project> {
Project project Project project
...@@ -22,17 +26,21 @@ class RosPlugin implements Plugin<Project> { ...@@ -22,17 +26,21 @@ class RosPlugin implements Plugin<Project> {
} }
/* Create project.ros.* property extensions */ /* Create project.ros.* property extensions */
project.extensions.create("ros", RosPluginExtension) project.extensions.create("ros", RosPluginExtension)
project.ros.maven = "$System.env.ROS_MAVEN_DEPLOYMENT_PATH" project.ros.mavenPath = "$System.env.ROS_MAVEN_PATH".split(':')
if ( project.ros.maven != 'null' && project.ros.maven != '' ) { project.ros.mavenDeploymentPath = "$System.env.ROS_MAVEN_DEPLOYMENT_PATH"
if ( project.ros.mavenDeploymentPath != 'null' && project.ros.mavenDeploymentPath != '' ) {
project.uploadArchives { project.uploadArchives {
repositories.mavenDeployer { repositories.mavenDeployer {
repository(url: 'file://' + project.ros.maven) repository(url: 'file://' + project.ros.mavenDeploymentPath)
} }
} }
} }
def repoURLs = project.ros.mavenPath.collect { 'file://' + it }
project.repositories { project.repositories {
repoURLs.each { p ->
maven { maven {
url 'file://' + project.ros.maven url p
}
} }
mavenLocal() mavenLocal()
maven { maven {
...@@ -43,5 +51,6 @@ class RosPlugin implements Plugin<Project> { ...@@ -43,5 +51,6 @@ class RosPlugin implements Plugin<Project> {
} }
class RosPluginExtension { class RosPluginExtension {
String maven List<String> mavenPath
String mavenDeploymentPath
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment