1
- import com.android.builder.core.BuilderConstants
2
-
3
1
apply plugin : ' com.android.library'
4
2
apply plugin : ' com.github.kt3k.coveralls'
5
- apply plugin : ' com.jfrog.bintray'
6
3
7
4
group = ' com.parse'
8
- version = ' 1.16.6 '
5
+ version = rootProject . ext . commonLibVersion
9
6
10
7
ext {
11
8
projDescription = ' A library that gives you access to the powerful Parse cloud platform from your Android app.'
12
9
artifact = ' parse-android'
13
10
projName = ' Parse-Android'
14
11
gitLink = ' https://github.com/parse-community/Parse-SDK-Android'
15
12
}
16
- buildscript {
17
- repositories {
18
- jcenter()
19
- }
20
-
21
- dependencies {
22
- classpath ' org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.1'
23
- }
24
- }
25
13
26
14
android {
27
15
compileSdkVersion rootProject. ext. compileSdkVersion
28
- buildToolsVersion rootProject. ext. buildToolsVersion
29
16
30
17
defaultConfig {
31
18
minSdkVersion rootProject. ext. minSdkVersion
@@ -51,11 +38,12 @@ android {
51
38
}
52
39
53
40
ext {
54
- okhttpVersion = ' 3.9 .0'
41
+ okhttpVersion = ' 3.10 .0'
55
42
}
56
43
57
44
dependencies {
58
45
api " com.android.support:support-annotations:$supportLibVersion "
46
+ api " com.android.support:support-compat:$supportLibVersion "
59
47
api ' com.parse.bolts:bolts-tasks:1.4.0'
60
48
api " com.squareup.okhttp3:okhttp:$okhttpVersion "
61
49
@@ -65,109 +53,6 @@ dependencies {
65
53
testImplementation " com.squareup.okhttp3:mockwebserver:$okhttpVersion "
66
54
}
67
55
68
- android. libraryVariants. all { variant ->
69
- def name = variant. buildType. name
70
-
71
- def javadoc = task(" javadoc${ variant.name.capitalize()} " , type : Javadoc ) {
72
- description " Generates Javadoc for $variant . name . "
73
- source = variant. javaCompile. source
74
- ext. androidJar = " ${ android.sdkDirectory} /platforms/${ android.compileSdkVersion} /android.jar"
75
- classpath = files(variant. javaCompile. classpath. files) + files(ext. androidJar)
76
-
77
- options. docletpath = [rootProject. file(" ./gradle/ExcludeDoclet.jar" )]
78
- options. doclet = " me.grantland.doclet.ExcludeDoclet"
79
-
80
- options. linksOffline(" http://d.android.com/reference" , " ${ android.sdkDirectory} /docs/reference" )
81
- options. links(" http://boltsframework.github.io/docs/android/" )
82
-
83
- exclude ' **/BuildConfig.java'
84
- exclude ' **/R.java'
85
- exclude ' **/internal/**'
86
- }
87
-
88
- def javadocJar = task(" javadocJar${ variant.name.capitalize()} " , type : Jar , dependsOn : " javadoc${ variant.name.capitalize()} " ) {
89
- classifier = ' javadoc'
90
- from javadoc. destinationDir
91
- }
92
-
93
- if (name. equals(BuilderConstants . RELEASE )) {
94
- artifacts. add(' archives' , javadocJar);
95
- }
96
- }
97
-
98
- // region Maven
99
-
100
- apply plugin : ' maven'
101
- apply plugin : ' signing'
102
-
103
- def isSnapshot = version. endsWith(' -SNAPSHOT' )
104
- def ossrhUsername = hasProperty(' NEXUS_USERNAME' ) ? NEXUS_USERNAME : System . getenv(' CI_NEXUS_USERNAME' )
105
- def ossrhPassword = hasProperty(' NEXUS_PASSWORD' ) ? NEXUS_PASSWORD : System . getenv(' CI_NEXUS_PASSWORD' )
106
-
107
- def pomConfig = {
108
- licenses {
109
- license {
110
- name ' BSD License'
111
- url ' https://github.com/parse-community/Parse-SDK-Android/blob/master/LICENSE'
112
- distribution ' repo'
113
- }
114
- }
115
-
116
- scm {
117
- connection
' scm:[email protected] :parse-community/Parse-SDK-Android.git'
118
- developerConnection
' scm:[email protected] :parse-community/Parse-SDK-Android.git'
119
- url gitLink
120
- }
121
-
122
- developers {
123
- developer {
124
- id ' parse'
125
- name ' Parse'
126
- }
127
- }
128
- }
129
-
130
-
131
- uploadArchives {
132
- repositories. mavenDeployer {
133
- beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
134
-
135
- repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
136
- authentication(userName : ossrhUsername, password : ossrhPassword)
137
- }
138
-
139
- snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
140
- authentication(userName : ossrhUsername, password : ossrhPassword)
141
- }
142
-
143
- def basePom = {
144
- name projName
145
- artifactId = artifact
146
- packaging ' aar'
147
- description projDescription
148
- url gitLink
149
- }
150
-
151
- pom. project basePom << pomConfig
152
- }
153
- }
154
-
155
- signing {
156
- required { ! isSnapshot && gradle. taskGraph. hasTask(" uploadArchives" ) }
157
- sign configurations. archives
158
- }
159
-
160
- task androidSourcesJar (type : Jar ) {
161
- classifier = ' sources'
162
- from android. sourceSets. main. java. sourceFiles
163
- }
164
-
165
- artifacts {
166
- archives androidSourcesJar
167
- }
168
-
169
- // endregion
170
-
171
56
// region Code Coverage
172
57
173
58
apply plugin : ' jacoco'
@@ -210,88 +95,4 @@ coveralls.jacocoReportPath = "${buildDir}/reports/jacoco/jacocoTestReport/jacoco
210
95
211
96
// endregion
212
97
213
- // Requires apply plugin: 'com.jfrog.bintray'
214
-
215
- bintray {
216
- user = System . getenv(' BINTRAY_USER' )
217
- key = System . getenv(' BINTRAY_API_KEY' )
218
-
219
- publications = [" MyPublication" ]
220
-
221
- publish = true
222
- pkg {
223
- repo = ' maven'
224
- name = ' com.parse:parse-android'
225
- userOrg = ' parse'
226
- licenses = [' BSD License' ]
227
- vcsUrl = ' https://github.com/parse-community/Parse-SDK-Android'
228
- version {
229
- name = project. version
230
- desc = projDescription
231
- released = new Date ()
232
- vcsTag = project. version
233
-
234
- // Sonatype username/passwrod must be set for this operation to happen
235
- mavenCentralSync {
236
- sync = true
237
- user = ossrhUsername
238
- password = ossrhPassword
239
- close = ' 1' // release automatically
240
- }
241
- }
242
- }
243
- }
244
-
245
- // Create the publication with the pom configuration:
246
- apply plugin : ' maven-publish'
247
- publishing {
248
- publications {
249
- MyPublication (MavenPublication ) {
250
- groupId group
251
- // We have to specify it here because otherwise Bintray's plugin will assume the artifact's name is Parse
252
- artifactId artifact
253
- artifacts = [androidSourcesJar, bundleRelease]
254
- version version
255
- pom. withXml {
256
- def root = asNode()
257
- root. appendNode(' description' , projDescription)
258
- root. appendNode(' name' , projName)
259
- root. appendNode(' url' , gitLink)
260
- root. children(). last() + pomConfig
261
-
262
- // maven-publish workaround to include dependencies
263
- def dependenciesNode = asNode(). appendNode(' dependencies' )
264
-
265
- // Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
266
- configurations. implementation. allDependencies. each {
267
- def dependencyNode = dependenciesNode. appendNode(' dependency' )
268
- dependencyNode. appendNode(' groupId' , it. group)
269
- dependencyNode. appendNode(' artifactId' , it. name)
270
- dependencyNode. appendNode(' version' , it. version)
271
- }
272
-
273
- }
274
- }
275
- }
276
- }
277
-
278
- // End of Bintray plugin
279
-
280
- apply plugin : " com.jfrog.artifactory"
281
-
282
- artifactory {
283
- contextUrl = ' https://oss.jfrog.org'
284
- publish {
285
- repository {
286
- repoKey = ' oss-snapshot-local' // The Artifactory repository key to publish to
287
-
288
- username = System . getenv(' BINTRAY_USER' )
289
- password = System . getenv(' BINTRAY_API_KEY' )
290
- maven = true
291
- }
292
- defaults {
293
- publishArtifacts = true
294
- publications(' MyPublication' )
295
- }
296
- }
297
- }
98
+ apply from : rootProject. file(' gradle/gradle-mvn-push.gradle' )
0 commit comments