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

use maven-publish plugin for publishing rosjava packages.

parent b65de6b0
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ project(rosjava_bootstrap) ...@@ -11,7 +11,7 @@ project(rosjava_bootstrap)
find_package(catkin REQUIRED rosjava_build_tools) find_package(catkin REQUIRED rosjava_build_tools)
catkin_rosjava_setup(uploadArchives) catkin_rosjava_setup(publishMavenJavaPublicationToMavenRepository)
catkin_package() catkin_package()
......
...@@ -26,13 +26,14 @@ project.ext { ...@@ -26,13 +26,14 @@ project.ext {
allprojects { allprojects {
group='org.ros.rosjava_bootstrap' group='org.ros.rosjava_bootstrap'
version = '0.1.5' version = '0.1.6'
} }
subprojects { subprojects {
/* Have to manually do this below since our gradle plugin is our sub project */ /* Have to manually do this below since our gradle plugin is our sub project */
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'maven' apply plugin: 'maven'
apply plugin: 'maven-publish'
sourceCompatibility = 1.6 sourceCompatibility = 1.6
targetCompatibility = 1.6 targetCompatibility = 1.6
...@@ -50,9 +51,16 @@ subprojects { ...@@ -50,9 +51,16 @@ subprojects {
} }
} }
if ( project.rosMavenDeploymentRepository != 'null' && project.rosMavenDeploymentRepository != '' ) { if ( project.rosMavenDeploymentRepository != 'null' && project.rosMavenDeploymentRepository != '' ) {
uploadArchives { publishing {
repositories.mavenDeployer { publications {
repository(url: 'file://' + project.rosMavenDeploymentRepository) mavenJava(MavenPublication) {
from components.java
}
}
repositories {
maven {
url 'file://' + project.rosMavenDeploymentRepository
}
} }
} }
} }
......
...@@ -2,6 +2,7 @@ package org.ros.gradle_plugins; ...@@ -2,6 +2,7 @@ package org.ros.gradle_plugins;
import org.gradle.api.Project; import org.gradle.api.Project;
import org.gradle.api.Plugin; import org.gradle.api.Plugin;
import org.gradle.api.publish.maven.MavenPublication;
import org.gradle.api.*; import org.gradle.api.*;
/* /*
...@@ -13,17 +14,36 @@ class RosJavaPlugin implements Plugin<Project> { ...@@ -13,17 +14,36 @@ class RosJavaPlugin implements Plugin<Project> {
def void apply(Project project) { def void apply(Project project) {
this.project = project this.project = project
if (!project.plugins.findPlugin('ros')) {
project.apply(plugin: 'ros')
}
if (!project.plugins.findPlugin('java')) { if (!project.plugins.findPlugin('java')) {
project.apply(plugin: 'java') project.apply(plugin: 'java')
} }
/* Disabling for now - may be source of build farm problems if (!project.plugins.findPlugin('maven-publish')) {
project.apply(plugin: 'maven-publish')
}
if (!project.plugins.findPlugin('osgi')) { if (!project.plugins.findPlugin('osgi')) {
project.apply(plugin: 'osgi') project.apply(plugin: 'osgi')
} }
*/
project.sourceCompatibility = 1.6 project.sourceCompatibility = 1.6
project.targetCompatibility = 1.6 project.targetCompatibility = 1.6
if ( project.ros.mavenDeploymentRepository != 'null' && project.ros.mavenDeploymentRepository != '' ) {
project.publishing {
publications {
mavenJava(MavenPublication) {
from project.components.java
}
}
repositories {
maven {
url 'file://' + project.ros.mavenDeploymentRepository
}
}
}
}
} }
} }
......
...@@ -22,19 +22,12 @@ class RosPlugin implements Plugin<Project> { ...@@ -22,19 +22,12 @@ class RosPlugin implements Plugin<Project> {
def void apply(Project project) { def void apply(Project project) {
this.project = project this.project = project
if (!project.plugins.findPlugin('maven')) { if (!project.plugins.findPlugin('maven')) {
project.apply(plugin: org.gradle.api.plugins.MavenPlugin) project.apply(plugin: 'maven')
} }
/* Create project.ros.* property extensions */ /* Create project.ros.* property extensions */
project.extensions.create("ros", RosPluginExtension) project.extensions.create("ros", RosPluginExtension)
project.ros.mavenPath = "$System.env.ROS_MAVEN_PATH".split(':') project.ros.mavenPath = "$System.env.ROS_MAVEN_PATH".split(':')
project.ros.mavenDeploymentRepository = "$System.env.ROS_MAVEN_DEPLOYMENT_REPOSITORY" project.ros.mavenDeploymentRepository = "$System.env.ROS_MAVEN_DEPLOYMENT_REPOSITORY"
if ( project.ros.mavenDeploymentRepository != 'null' && project.ros.mavenDeploymentRepository != '' ) {
project.uploadArchives {
repositories.mavenDeployer {
repository(url: 'file://' + project.ros.mavenDeploymentRepository)
}
}
}
/* /*
* Could use some better handling for when this is not defined as it sets * 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 * file://null, but it doesn't seem to hurt the process any
......
...@@ -21,13 +21,6 @@ dependencies { ...@@ -21,13 +21,6 @@ dependencies {
compile 'org.apache.commons:com.springsource.org.apache.commons.io:1.4.0' compile 'org.apache.commons:com.springsource.org.apache.commons.io:1.4.0'
compile 'commons-pool:commons-pool:1.6' compile 'commons-pool:commons-pool:1.6'
compile 'org.apache.commons:com.springsource.org.apache.commons.lang:2.4.0' compile 'org.apache.commons:com.springsource.org.apache.commons.lang:2.4.0'
compile project(':gradle_plugins') compile project(':gradle_plugins')
} }
jar {
manifest {
symbolicName = 'org.ros.rosjava_messages.message_generation'
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment