-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbintray.gradle
194 lines (170 loc) · 4.84 KB
/
bintray.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/*
* Copyright 2016 code_gg_boy, 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.
*/
group = PROJ_GROUP
version = PROJ_VERSION
project.archivesBaseName = PROJ_ARTIFACTID
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += configurations.compile
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/7/docs/api"
title PROJ_ARTIFACTID
}
}
artifacts {
archives javadocJar
archives sourcesJar
}
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id DEVELOPER_ID
name DEVELOPER_NAME
email DEVELOPER_EMAIL
}
}
//这里有引号,并且有个空格,否则生成不了依赖,主要是这里的dependencies并不是build.gradle里的dependencies,而gradle会把他当成自身的dependencies处理
"dependencies " {
dependency {
groupId "com.google.code.gson"
artifactId "gson"
"version " "2.4"
}
dependency {
groupId "com.github.moduth"
artifactId "blockcanary-ui"
"version " "1.1.4"
}
dependency {
groupId "com.squareup"
artifactId "otto"
"version " "1.3.8"
}
dependency {
groupId "com.google.dagger"
artifactId "dagger"
"version " "2.5"
}
dependency {
groupId "com.squareup.leakcanary"
artifactId "leakcanary-android"
"version " "1.3.1"
}
dependency {
groupId "com.github.johnpersano"
artifactId "supertoasts"
"version " "2.0"
}
dependency {
groupId "com.squareup.retrofit"
artifactId "retrofit"
"version " "2.0.0-beta2"
}
dependency {
groupId "com.squareup.retrofit"
artifactId "converter-gson"
"version " "2.0.0-beta2"
}
dependency {
groupId "com.squareup.retrofit"
artifactId "adapter-rxjava"
"version " "2.0.0-beta2"
}
dependency {
groupId "com.squareup.okhttp"
artifactId "okhttp"
"version " "2.7.0"
}
dependency {
groupId "io.reactivex"
artifactId "rxjava"
"version " "1.0.16"
}
dependency {
groupId "io.reactivex"
artifactId "rxandroid"
"version " "1.0.1"
}
dependency {
groupId "com.jakewharton.rxbinding"
artifactId "rxbinding"
"version " "0.4.0"
}
dependency {
groupId "com.android.support"
artifactId "appcompat-v7"
"version " "24.1.1"
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId PROJ_ARTIFACTID
pom {
packaging 'aar'
}
pom.withXml {
def root = asNode()
root.appendNode('description', PROJ_DESCRIPTION)
root.children().last() + pomConfig
}
}
}
}
bintray {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
user = properties.getProperty('BINTRAY_USER');
key = properties.getProperty('BINTRAY_KEY');
configurations = ['archives']
publications = ['mavenJava']
publish = true
pkg {
repo = 'maven'
name = PROJ_NAME
desc = PROJ_DESCRIPTION
websiteUrl = PROJ_WEBSITEURL
issueTrackerUrl = PROJ_ISSUETRACKERURL
vcsUrl = PROJ_VCSURL
licenses = ['Apache-2.0']
publicDownloadNumbers = true
}
}