-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.gradle
117 lines (106 loc) · 2.97 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
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
apply plugin: 'maven'
apply plugin: 'com.jfrog.bintray'
/**
* 上传maven私服
*/
uploadArchives {
configuration = configurations.archives
repositories {
mavenDeployer {
snapshotRepository(url: MAVEN_SNAPSHOT_URL) {
authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
}
repository(url: MAVEN_URL) {
authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
}
pom.project {
version VERSION_NAME
artifactId ARTIFACT_ID
groupId GROUP_ID
packaging TYPE
description DESCRIPTION
}
}
}
}
/**
* 本地测试时使用
*/
task uploadMavenLocal(type: Upload, group: 'upload') {
configuration = configurations.archives
repositories {
mavenDeployer {
repository(url: uri('E:/repo/maven'))
pom.project {
version '9.9.999'
artifactId ARTIFACT_ID
groupId GROUP_ID
packaging TYPE
description DESCRIPTION
}
}
}
}
install {
repositories.mavenInstaller {
pom.groupId = GROUP_ID
pom.artifactId = ARTIFACT_ID
pom.version = VERSION_NAME
pom.project {
name BINTRAY_NAME
description BINTRAY_PROJECT_DESC
url BINTRAY_PROJECT_GIT_URL
scm {
url BINTRAY_PROJECT_GIT_URL
connection BINTRAY_PROJECT_SCM_CONNECTION
developerConnection BINTRAY_PROJECT_SCM_CONNECTION
}
developers {
developer {
id 'devil'
name 'devil'
email '[email protected]'
}
}
}
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
group BasePlugin.BUILD_GROUP
description = 'Assembles a jar archive containing the main sources of this project.'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
group BasePlugin.BUILD_GROUP
description = 'Assembles a jar archive containing the generated Javadoc API documentation of this project.'
from groovydoc
}
artifacts {
archives sourcesJar
// archives javadocJar
}
/**
* 上传 jcenter
*/
group = GROUP_ID
version = VERSION_NAME
Properties properties = new Properties()
//properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = BINTRAY_USER
key = properties.getProperty("bintray.apikey")
publish = true
configurations = ['archives']
pkg {
repo = BINTRAY_REPO
name = BINTRAY_NAME
desc = BINTRAY_PROJECT_DESC
websiteUrl = BINTRAY_PROJECT_GIT_URL
vcsUrl = BINTRAY_PROJECT_GIT_URL
issueTrackerUrl = BINTRAY_PROJECT_ISSUE_URL
licenses = ['MIT']
labels = ['gradle-plugin', 'android']
}
}