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

updated ros-java buildscript

parent bd097c08
No related branches found
No related tags found
No related merge requests found
...@@ -15,19 +15,33 @@ ...@@ -15,19 +15,33 @@
*/ */
/* /*
* Apply this gradle script to configure maven url's and other properties in * ABOUT:
* the root build.gradle of any rosjava project. Use alongside the api provided
* by the ros-java gradle plugin.
* *
* Usage: * Configures a single gradle project (or subproject) to utilise ros-java settings.
*
* USAGE:
*
* Generally:
*
* apply from: "https://github.com/rosjava/rosjava_bootstrap/raw/indigo/ros-java.gradle"
*
* In the root build.gradle file of a multiproject build:
* *
* subprojects { * subprojects {
* apply from: "https://github.com/rosjava/rosjava_bootstrap/raw/indigo/ros-java.gradle" * apply from: "https://github.com/rosjava/rosjava_bootstrap/raw/indigo/ros-java.gradle"
* apply plugin: 'ros-java'
* ... * ...
* }
*/ */
rootProject.subprojects { /*
* Some notes: don't force the user to apply this to every subproject...let them choose
* when and where it gets applied. This usually means applying this script redundantly
* for every subproject. To be smarter (but force the user to do it this way) would
* be to separate the components in this script to put subproject specific commands in a
* rootProject.subprojects {}
* closure and general ones in no closure...then call it from the root.gradle (not inside
* any allprojects/subprojects closures.
*/
/*********************** /***********************
* Plugins * Plugins
***********************/ ***********************/
...@@ -44,27 +58,26 @@ rootProject.subprojects { ...@@ -44,27 +58,26 @@ rootProject.subprojects {
/*********************** /***********************
* Environment Settings * Environment Settings
***********************/ ***********************/
ros.mavenRepository = System.getenv("ROS_MAVEN_REPOSITORY") ext {
ros.mavenDeploymentRepository = System.getenv("ROS_MAVEN_DEPLOYMENT_REPOSITORY") rosMavenRepository = System.getenv("ROS_MAVEN_REPOSITORY")
String mavenPath = System.getenv("ROS_MAVEN_PATH") rosMavenDeploymentRepository = System.getenv("ROS_MAVEN_DEPLOYMENT_REPOSITORY")
if (mavenPath != null) { rosMavenPath = System.getenv("ROS_MAVEN_PATH")
ros.mavenPath = mavenPath.tokenize(":")
} }
/*********************** /***********************
* Maven Repos * Maven Repos
***********************/ ***********************/
repositories { repositories {
if (ros.mavenPath != null) { if (rosMavenPath != null) {
ros.mavenPath.each { path -> rosMavenPath.tokenize(":").each { path ->
maven { maven {
url uri(path) url uri(path)
} }
} }
} }
if (ros.mavenRepository != null) { if (rosMavenRepository != null) {
maven { maven {
url ros.mavenRepository url rosMavenRepository
} }
} }
mavenLocal() mavenLocal()
...@@ -80,23 +93,22 @@ rootProject.subprojects { ...@@ -80,23 +93,22 @@ rootProject.subprojects {
/*********************** /***********************
* Java * Java
***********************/ ***********************/
sourceCompatibility = 1.6 sourceCompatibility = 1.7
targetCompatibility = 1.6 targetCompatibility = 1.7
/*********************** /***********************
* Maven Deployment * Maven Deployment
***********************/ ***********************/
if ( ros.mavenDeploymentRepository != 'null' && project.ros.mavenDeploymentRepository != '' ) { if ( rosMavenDeploymentRepository != 'null' && rosMavenDeploymentRepository != '' ) {
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
from project.components.java from components.java
} }
} }
repositories { repositories {
maven { maven {
url 'file://' + project.ros.mavenDeploymentRepository url 'file://' + rosMavenDeploymentRepository
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment