-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepositories.gradle
66 lines (62 loc) · 1.99 KB
/
repositories.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
/*
* Copyright (c) 2014, CleverDATA, LLC. All Rights Reserved.
*
* All information contained herein is, and remains the property of
* CleverDATA, LLC. The intellectual and technical concepts contained
* herein are proprietary to CleverDATA, LLC. Dissemination of this
* information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from CleverDATA, LLC.
*
* 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.
*/
ext {
repos = [
credentials: {
username mavenUser
password mavenPassword
}
]
repos += [
publish: [
local: {
mavenLocal()
},
release: {
maven {
url repoPublishReleaseUrl
credentials repos.credentials
}
},
snapshot: {
maven {
url repoPublishSnapshotUrl
credentials repos.credentials
}
}
],
resolve: [
release: {
maven {
url repoResolveReleaseUrl
credentials repos.credentials
}
},
snapshot: {
maven {
url repoResolveSnapshotUrl
credentials repos.credentials
}
},
local: {
mavenLocal()
}
]
]
// group all the resolve repository closures together
repos.resolve.all = repos.resolve.values().inject() { acc, repo -> acc << repo }
// smart publication that detects whether it's necessary to publish into snapshot or release repo
repos.publish.smart = project.version.endsWith('-SNAPSHOT') ? repos.publish.snapshot : repos.publish.release
}