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

Commit 94ab2fa

Browse files
committed
use maven-publish plugin for publishing rosjava packages.
1 parent b65de6b commit 94ab2fa

File tree

5 files changed

+36
-22
lines changed

5 files changed

+36
-22
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ project(rosjava_bootstrap)
1111

1212
find_package(catkin REQUIRED rosjava_build_tools)
1313

14-
catkin_rosjava_setup(uploadArchives)
14+
catkin_rosjava_setup(publishMavenJavaPublicationToMavenRepository)
1515

1616
catkin_package()
1717

build.gradle

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ project.ext {
2626

2727
allprojects {
2828
group='org.ros.rosjava_bootstrap'
29-
version = '0.1.5'
29+
version = '0.1.6'
3030
}
3131

3232
subprojects {
3333
/* Have to manually do this below since our gradle plugin is our sub project */
3434
apply plugin: 'java'
3535
apply plugin: 'maven'
36+
apply plugin: 'maven-publish'
3637

3738
sourceCompatibility = 1.6
3839
targetCompatibility = 1.6
@@ -50,9 +51,16 @@ subprojects {
5051
}
5152
}
5253
if ( project.rosMavenDeploymentRepository != 'null' && project.rosMavenDeploymentRepository != '' ) {
53-
uploadArchives {
54-
repositories.mavenDeployer {
55-
repository(url: 'file://' + project.rosMavenDeploymentRepository)
54+
publishing {
55+
publications {
56+
mavenJava(MavenPublication) {
57+
from components.java
58+
}
59+
}
60+
repositories {
61+
maven {
62+
url 'file://' + project.rosMavenDeploymentRepository
63+
}
5664
}
5765
}
5866
}

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.ros.gradle_plugins;
22

33
import org.gradle.api.Project;
44
import org.gradle.api.Plugin;
5+
import org.gradle.api.publish.maven.MavenPublication;
56
import org.gradle.api.*;
67

78
/*
@@ -13,17 +14,36 @@ class RosJavaPlugin implements Plugin<Project> {
1314

1415
def void apply(Project project) {
1516
this.project = project
17+
if (!project.plugins.findPlugin('ros')) {
18+
project.apply(plugin: 'ros')
19+
}
1620
if (!project.plugins.findPlugin('java')) {
1721
project.apply(plugin: 'java')
1822
}
19-
/* Disabling for now - may be source of build farm problems
23+
if (!project.plugins.findPlugin('maven-publish')) {
24+
project.apply(plugin: 'maven-publish')
25+
}
2026
if (!project.plugins.findPlugin('osgi')) {
2127
project.apply(plugin: 'osgi')
2228
}
23-
*/
2429

2530
project.sourceCompatibility = 1.6
2631
project.targetCompatibility = 1.6
32+
33+
if ( project.ros.mavenDeploymentRepository != 'null' && project.ros.mavenDeploymentRepository != '' ) {
34+
project.publishing {
35+
publications {
36+
mavenJava(MavenPublication) {
37+
from project.components.java
38+
}
39+
}
40+
repositories {
41+
maven {
42+
url 'file://' + project.ros.mavenDeploymentRepository
43+
}
44+
}
45+
}
46+
}
2747
}
2848
}
2949

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,12 @@ class RosPlugin implements Plugin<Project> {
2222
def void apply(Project project) {
2323
this.project = project
2424
if (!project.plugins.findPlugin('maven')) {
25-
project.apply(plugin: org.gradle.api.plugins.MavenPlugin)
25+
project.apply(plugin: 'maven')
2626
}
2727
/* Create project.ros.* property extensions */
2828
project.extensions.create("ros", RosPluginExtension)
2929
project.ros.mavenPath = "$System.env.ROS_MAVEN_PATH".split(':')
3030
project.ros.mavenDeploymentRepository = "$System.env.ROS_MAVEN_DEPLOYMENT_REPOSITORY"
31-
if ( project.ros.mavenDeploymentRepository != 'null' && project.ros.mavenDeploymentRepository != '' ) {
32-
project.uploadArchives {
33-
repositories.mavenDeployer {
34-
repository(url: 'file://' + project.ros.mavenDeploymentRepository)
35-
}
36-
}
37-
}
3831
/*
3932
* Could use some better handling for when this is not defined as it sets
4033
* file://null, but it doesn't seem to hurt the process any

message_generation/build.gradle

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ dependencies {
2121
compile 'org.apache.commons:com.springsource.org.apache.commons.io:1.4.0'
2222
compile 'commons-pool:commons-pool:1.6'
2323
compile 'org.apache.commons:com.springsource.org.apache.commons.lang:2.4.0'
24-
2524
compile project(':gradle_plugins')
2625
}
2726

28-
jar {
29-
manifest {
30-
symbolicName = 'org.ros.rosjava_messages.message_generation'
31-
}
32-
}
33-

0 commit comments

Comments
 (0)