-
Notifications
You must be signed in to change notification settings - Fork 151
/
Copy pathpublish.gradle
45 lines (41 loc) · 1.46 KB
/
publish.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
apply plugin: 'maven'
apply plugin: 'signing'
def DEBUG = true
def VERSION = '1.4.0'
def GROUP = 'com.smallsoho.mobcase'
def ARTIFACT = 'McImage'
Properties properties = new Properties()
if (project.rootProject.file('local.properties').exists()) {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
}
static def isSnapshot(def version) {
return version.endsWith("SNAPSHOT")
}
uploadArchives {
repositories {
mavenDeployer {
if (DEBUG) {
repository(url: uri("${buildDir}/libs"))
} else {
if (isSnapshot(VERSION)) {
repository(url: uri(properties.getProperty('MAVEN_SNAPSHOT_REPO'))) {
authentication(
userName: properties.getProperty('MAVEN_USER_NAME'),
password: properties.getProperty('MAVEN_PASSWORD')
)
}
} else {
repository(url: uri(properties.getProperty('MAVEN_RELEASE_REPO'))) {
authentication(
userName: properties.getProperty('MAVEN_USER_NAME'),
password: properties.getProperty('MAVEN_PASSWORD')
)
}
}
}
pom.groupId = GROUP
pom.artifactId = ARTIFACT
pom.version = VERSION
}
}
}