forked from rosjava/rosjava_bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathros-java.gradle
118 lines (112 loc) · 3.18 KB
/
ros-java.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* Copyright (C) 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/*
* *************************** ABORTED ***************************
*
* See discussion in https://github.com/rosjava/rosjava_bootstrap/issues/41
*
* I've left this lying around as a useful reference.
* ***************************************************************
/*
* ABOUT:
*
* Configures a single gradle project (or subproject) to utilise ros-java settings.
*
* USAGE:
*
* Generally:
*
* apply from: "https://github.com/rosjava/rosjava_bootstrap/raw/kinetic/ros-java.gradle"
*
* In the root build.gradle file of a multiproject build:
*
* subprojects {
* apply from: "https://github.com/rosjava/rosjava_bootstrap/raw/kinetic/ros-java.gradle"
* ...
* }
*/
/*
* 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
***********************/
if (!plugins.findPlugin('maven-publish')) {
apply(plugin: 'maven-publish')
}
/***********************
* Environment Settings
***********************/
ext {
rosMavenRepository = System.getenv("ROS_MAVEN_REPOSITORY")
rosMavenDeploymentRepository = System.getenv("ROS_MAVEN_DEPLOYMENT_REPOSITORY")
rosMavenPath = System.getenv("ROS_MAVEN_PATH")
}
/***********************
* Maven Repos
***********************/
repositories {
if (rosMavenPath != null) {
rosMavenPath.tokenize(":").each { path ->
maven {
url uri(path)
}
}
}
if (rosMavenRepository != null) {
maven {
url rosMavenRepository
}
}
mavenLocal()
maven {
url "http://repository.springsource.com/maven/bundles/release"
allowInsecureProtocol = true
}
maven {
url "http://repository.springsource.com/maven/bundles/external"
allowInsecureProtocol = true
}
jcenter()
}
/***********************
* Java
***********************/
sourceCompatibility = 1.7
targetCompatibility = 1.7
/***********************
* Maven Deployment
***********************/
if ( rosMavenDeploymentRepository != 'null' && rosMavenDeploymentRepository != '' ) {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
maven {
url 'file://' + rosMavenDeploymentRepository
}
}
}
}