1- import com.android.builder.core.BuilderConstants
2-
31apply plugin : ' com.android.library'
42apply plugin : ' com.github.kt3k.coveralls'
53
6- group = ' com.parse'
7- version = ' 1.0.7-SNAPSHOT'
8-
9- ext {
10- projDescription = ' A library that gives you access to the powerful Parse cloud platform from your Android app.'
11- artifact = ' parse-livequery-android'
12- projName = ' Parse-LiveQuery-Android'
13- gitLink = ' https://github.com/parse-community/ParseLiveQuery-Android'
14- }
15-
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-
264android {
27- compileSdkVersion rootProject. ext. compileSdkVersion
28- buildToolsVersion rootProject. ext. buildToolsVersion
5+ compileSdkVersion 27
296
307 defaultConfig {
31- minSdkVersion rootProject . ext . minSdkVersion
32- targetSdkVersion rootProject . ext . targetSdkVersion
8+ minSdkVersion 15
9+ targetSdkVersion 27
3310 versionCode 1
34- versionName project . version
11+ versionName " 1.0 "
3512 consumerProguardFiles ' release-proguard.pro'
3613 }
3714
@@ -47,135 +24,15 @@ android {
4724}
4825
4926dependencies {
50- compile ' com.parse:parse-android:1.14.1'
51- compile ' com.squareup.okhttp3:okhttp:3.6.0'
52- compile ' com.parse.bolts:bolts-tasks:1.4.0'
53- testCompile ' org.robolectric:robolectric:3.3.1'
54- testCompile ' org.skyscreamer:jsonassert:1.5.0'
55- testCompile ' junit:junit:4.12'
56- testCompile ' org.mockito:mockito-core:1.10.19'
57- }
58-
59- android. libraryVariants. all { variant ->
60- def name = variant. buildType. name
61- def jar = project. tasks. create(name : " jar${ name.capitalize()} " , type : Jar ) {
62- dependsOn variant. javaCompile
63- from variant. javaCompile. destinationDir
64-
65- manifest {
66- attributes(
67- " Bundle-Name" : ' parse-livequery-android' ,
68- " Bundle-Version" : project. version
69- )
70- }
71-
72- exclude ' **/R.class'
73- exclude ' **/R\$ *.class'
74- exclude ' **/Manifest.class'
75- exclude ' **/Manifest\$ *.class'
76- exclude ' **/BuildConfig.class'
77- }
78-
79- def javadoc = task(" javadoc${ variant.name.capitalize()} " , type : Javadoc ) {
80- description " Generates Javadoc for $variant . name . "
81- source = variant. javaCompile. source
82- ext. androidJar = " ${ android.sdkDirectory} /platforms/${ android.compileSdkVersion} /android.jar"
83- classpath = files(variant. javaCompile. classpath. files) + files(ext. androidJar)
84-
85- options. docletpath = [rootProject. file(" ./gradle/ExcludeDoclet.jar" )]
86- options. doclet = " me.grantland.doclet.ExcludeDoclet"
87-
88- options. linksOffline(" http://d.android.com/reference" , " ${ android.sdkDirectory} /docs/reference" )
89- options. links(" http://boltsframework.github.io/docs/android/" )
90-
91- exclude ' **/BuildConfig.java'
92- exclude ' **/R.java'
93- exclude ' **/internal/**'
94- }
95-
96- def javadocJar = task(" javadocJar${ variant.name.capitalize()} " , type : Jar , dependsOn : " javadoc${ variant.name.capitalize()} " ) {
97- classifier = ' javadoc'
98- from javadoc. destinationDir
99- }
100-
101- if (name. equals(BuilderConstants . RELEASE )) {
102- artifacts. add(' archives' , jar);
103- artifacts. add(' archives' , javadocJar);
104- }
105- }
106-
107- // region Maven
108-
109- apply plugin : ' maven'
110- apply plugin : ' signing'
111-
112- def isSnapshot = version. endsWith(' -SNAPSHOT' )
113- def ossrhUsername = hasProperty(' NEXUS_USERNAME' ) ? NEXUS_USERNAME : System . getenv(' CI_NEXUS_USERNAME' )
114- def ossrhPassword = hasProperty(' NEXUS_PASSWORD' ) ? NEXUS_PASSWORD : System . getenv(' CI_NEXUS_PASSWORD' )
115-
116- def pomConfig = {
117- scm {
118- connection ' scm:git@github.com:parse-community/ParseLiveQuery-Android.git'
119- developerConnection ' scm:git@github.com:parse-community/ParseLiveQuery-Android.git'
120- url gitLink
121- }
122-
123- licenses {
124- license {
125- name ' BSD License'
126- url ' https://github.com/parse-community/ParseLiveQuery-Android/blob/master/LICENSE'
127- distribution ' repo'
128- }
129- }
130-
131- developers {
132- developer {
133- id ' parse'
134- name ' Parse'
135- }
136- }
137- }
138-
139- uploadArchives {
140- repositories. mavenDeployer {
141- beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
27+ api " com.github.parse-community.Parse-SDK-Android:parse:1.18.2"
28+ api ' com.squareup.okhttp3:okhttp:3.11.0'
14229
143- repository(url : " https://oss.sonatype.org/service/local/staging/deploy/maven2/" ) {
144- authentication(userName : ossrhUsername, password : ossrhPassword)
145- }
146-
147- snapshotRepository(url : " https://oss.sonatype.org/content/repositories/snapshots/" ) {
148- authentication(userName : ossrhUsername, password : ossrhPassword)
149- }
150-
151- def basePom = {
152- name projName
153- artifactId artifact
154- packaging ' aar'
155- description projDescription
156- url gitLink
157- }
158-
159- pom. project basePom << pomConfig
160- }
30+ testImplementation ' org.robolectric:robolectric:3.3.1'
31+ testImplementation ' org.skyscreamer:jsonassert:1.5.0'
32+ testImplementation ' junit:junit:4.12'
33+ testImplementation ' org.mockito:mockito-core:1.10.19'
16134}
16235
163- signing {
164- required { ! isSnapshot && gradle. taskGraph. hasTask(" uploadArchives" ) }
165- sign configurations. archives
166- }
167-
168- task androidSourcesJar (type : Jar ) {
169- classifier = ' sources'
170- from android. sourceSets. main. java. sourceFiles
171- }
172-
173- artifacts {
174- archives androidSourcesJar
175- }
176-
177- // endregion
178-
17936// region Code Coverage
18037
18138apply plugin : ' jacoco'
@@ -218,71 +75,4 @@ coveralls.jacocoReportPath = "${buildDir}/reports/jacoco/jacocoTestReport/jacoco
21875
21976// endregion
22077
221- // Requires apply plugin: 'com.jfrog.bintray'
222-
223- apply plugin : ' com.jfrog.bintray'
224-
225- bintray {
226- user = System . getenv(' BINTRAY_USER' )
227- key = System . getenv(' BINTRAY_API_KEY' )
228-
229- publications = [" MyPublication" ]
230-
231- publish = true
232- pkg {
233- repo = ' maven'
234- name = ' com.parse:parse-livequery-android'
235- userOrg = ' parse'
236- licenses = [' BSD' ]
237- vcsUrl = gitLink
238- version {
239- name = project. version
240- desc = projDescription
241- released = new Date ()
242- vcsTag = project. version
243-
244- // Sonatype username/passwrod must be set for this operation to happen
245- mavenCentralSync {
246- sync = true
247- user = ossrhUsername
248- password = ossrhPassword
249- close = ' 1' // release automatically
250- }
251- }
252- }
253- }
254-
255- // Create the publication with the pom configuration:
256- apply plugin : ' maven-publish'
257-
258- publishing {
259- publications {
260- MyPublication (MavenPublication ) {
261- groupId group
262- artifactId artifact
263- artifacts = [androidSourcesJar, bundleRelease]
264- version version
265- pom. withXml {
266- def root = asNode()
267- root. appendNode(' description' , projDescription)
268- root. appendNode(' name' , projName)
269- root. appendNode(' url' , gitLink)
270- root. children(). last() + pomConfig
271-
272- // maven-publish workaround to include dependencies
273- def dependenciesNode = asNode(). appendNode(' dependencies' )
274-
275- // Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
276- configurations. compile. allDependencies. each {
277- def dependencyNode = dependenciesNode. appendNode(' dependency' )
278- dependencyNode. appendNode(' groupId' , it. group)
279- dependencyNode. appendNode(' artifactId' , it. name)
280- dependencyNode. appendNode(' version' , it. version)
281- }
282-
283- }
284- }
285- }
286- }
287-
288- // End of Bintray plugin
78+ apply from : ' https://raw.githubusercontent.com/Commit451/gradle-android-javadocs/1.0.0/gradle-android-javadocs.gradle'
0 commit comments