|
1 | | -import com.android.builder.core.BuilderConstants |
2 | | - |
3 | 1 | apply plugin: 'com.android.library' |
4 | 2 |
|
5 | | -group = 'com.parse' |
6 | | -version = '1.10.6' |
7 | | - |
8 | | -ext { |
9 | | - projName = 'ParseTwitterUtils-Android' |
10 | | - projArtifact = 'parsetwitterutils-android' |
11 | | - projDescription = 'A utility library to authenticate ParseUsers with Twitter' |
12 | | - projGitLink = 'https://github.com/parse-community/ParseTwitterUtils-Android' |
13 | | -} |
14 | | - |
15 | | -buildscript { |
16 | | - repositories { |
17 | | - jcenter() |
18 | | - } |
19 | | - |
20 | | - dependencies { |
21 | | - classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1x' |
22 | | - } |
23 | | -} |
24 | | - |
25 | 3 | android { |
26 | | - compileSdkVersion 25 |
27 | | - buildToolsVersion "25.0.2" |
28 | | - |
29 | | - useLibrary 'org.apache.http.legacy' |
| 4 | + compileSdkVersion 27 |
30 | 5 |
|
31 | 6 | defaultConfig { |
32 | | - minSdkVersion 9 |
33 | | - targetSdkVersion 25 |
| 7 | + minSdkVersion 14 |
| 8 | + targetSdkVersion 27 |
34 | 9 | versionCode 1 |
35 | 10 | versionName project.version |
36 | 11 | } |
37 | 12 | } |
38 | 13 |
|
39 | 14 | dependencies { |
40 | | - compile 'com.parse:parse-android:1.13.0' |
41 | | - |
42 | | - testCompile 'junit:junit:4.12' |
43 | | - testCompile 'org.mockito:mockito-core:1.10.19' |
44 | | -} |
45 | | - |
46 | | -android.libraryVariants.all { variant -> |
47 | | - def name = variant.buildType.name |
48 | | - |
49 | | - def jarTask = task("jar${name.capitalize()}", type: Jar) { |
50 | | - dependsOn variant.javaCompile |
51 | | - from variant.javaCompile.destinationDir |
52 | | - |
53 | | - manifest { |
54 | | - attributes( |
55 | | - "Bundle-Name": 'parsetwitterutils-android', |
56 | | - "Bundle-Version": project.version |
57 | | - ) |
58 | | - } |
59 | | - |
60 | | - exclude '**/R.class' |
61 | | - exclude '**/R\$*.class' |
62 | | - exclude '**/Manifest.class' |
63 | | - exclude '**/Manifest\$*.class' |
64 | | - exclude '**/BuildConfig.class' |
65 | | - |
66 | | - baseName 'ParseTwitterUtils' |
67 | | - } |
68 | | - |
69 | | - def javadocTask = task("javadoc${variant.name.capitalize()}", type: Javadoc) { |
70 | | - description "Generates Javadoc for $variant.name." |
71 | | - source = variant.javaCompile.source |
72 | | - ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar" |
73 | | - classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar) |
74 | | - |
75 | | - options.linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference") |
76 | | - options.links("http://boltsframework.github.io/docs/android/") |
77 | | - |
78 | | - exclude '**/BuildConfig.java' |
79 | | - exclude '**/R.java' |
80 | | - exclude '**/internal/**' |
81 | | - exclude '**/oauth/**' |
82 | | - } |
83 | | - |
84 | | - def javadocJarTask = task("javadocJar${variant.name.capitalize()}", type: Jar, dependsOn: "javadoc${variant.name.capitalize()}") { |
85 | | - classifier = 'javadoc' |
86 | | - from javadocTask.destinationDir |
87 | | - } |
88 | | - |
89 | | - if (name.equals(BuilderConstants.RELEASE)) { |
90 | | - artifacts.add('archives', jarTask); |
91 | | - artifacts.add('archives', javadocJarTask); |
92 | | - } |
93 | | -} |
94 | | - |
95 | | -//region Maven |
96 | | - |
97 | | -apply plugin: 'maven' |
98 | | -apply plugin: 'signing' |
99 | | - |
100 | | -def isSnapshot = version.endsWith('-SNAPSHOT') |
101 | | -def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : System.getenv('CI_NEXUS_USERNAME') |
102 | | -def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : System.getenv('CI_NEXUS_PASSWORD') |
103 | | - |
104 | | -def pomConfig = { |
105 | | - scm { |
106 | | - connection 'scm:git@github.com:parse-community/ParseTwitterUtils-Android.git' |
107 | | - developerConnection 'scm:git@github.com:parse-community/ParseTwitterUtils-Android.git' |
108 | | - url projGitLink |
109 | | - } |
| 15 | + api 'com.parse:parse-android:1.17.3' |
110 | 16 |
|
111 | | - licenses { |
112 | | - license { |
113 | | - name 'BSD License' |
114 | | - url 'https://github.com/parse-community/ParseTwitterUtils-Android/blob/master/LICENSE' |
115 | | - distribution 'repo' |
116 | | - } |
117 | | - } |
118 | | - |
119 | | - developers { |
120 | | - developer { |
121 | | - id 'parse' |
122 | | - name 'Parse' |
123 | | - } |
124 | | - } |
125 | | -} |
126 | | - |
127 | | -uploadArchives { |
128 | | - repositories.mavenDeployer { |
129 | | - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
130 | | - |
131 | | - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
132 | | - authentication(userName: ossrhUsername, password: ossrhPassword) |
133 | | - } |
134 | | - |
135 | | - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
136 | | - authentication(userName: ossrhUsername, password: ossrhPassword) |
137 | | - } |
138 | | - |
139 | | - def basePom = { |
140 | | - name projName |
141 | | - artifactId projArtifact |
142 | | - packaging 'aar' |
143 | | - description projDescription |
144 | | - url projGitLink |
145 | | - } |
146 | | - |
147 | | - pom.project basePom << pomConfig |
148 | | - } |
| 17 | + testImplementation 'junit:junit:4.12' |
| 18 | + testImplementation 'org.mockito:mockito-core:1.10.19' |
149 | 19 | } |
150 | 20 |
|
151 | | -signing { |
152 | | - required { !isSnapshot && gradle.taskGraph.hasTask("uploadArchives") } |
153 | | - sign configurations.archives |
154 | | -} |
155 | | - |
156 | | -task androidSourcesJar(type: Jar) { |
157 | | - classifier = 'sources' |
158 | | - from android.sourceSets.main.java.sourceFiles |
159 | | -} |
160 | | - |
161 | | -artifacts { |
162 | | - archives androidSourcesJar |
163 | | -} |
164 | | - |
165 | | -//endregion |
166 | | - |
167 | 21 | //region Code Coverage |
168 | 22 |
|
169 | 23 | apply plugin: 'jacoco' |
@@ -210,70 +64,3 @@ apply plugin: 'com.github.kt3k.coveralls' |
210 | 64 | coveralls.jacocoReportPath = "${buildDir}/reports/jacoco/jacocoTestReport/jacocoTestReport.xml" |
211 | 65 |
|
212 | 66 | //endregion |
213 | | - |
214 | | -apply plugin: 'com.jfrog.bintray' |
215 | | - |
216 | | -bintray { |
217 | | - user = System.getenv('BINTRAY_USER') |
218 | | - key = System.getenv('BINTRAY_API_KEY') |
219 | | - |
220 | | - publications = ["MyPublication"] |
221 | | - |
222 | | - publish = true |
223 | | - pkg { |
224 | | - repo = 'maven' |
225 | | - name = 'ParseTwitterUtils-Android' |
226 | | - userOrg = 'parse' |
227 | | - licenses = ['BSD'] |
228 | | - vcsUrl = projGitLink |
229 | | - version { |
230 | | - name = project.version |
231 | | - desc = projDescription |
232 | | - released = new Date() |
233 | | - vcsTag = project.version |
234 | | - |
235 | | - // Sonatype username/passwrod must be set for this operation to happen |
236 | | - mavenCentralSync { |
237 | | - sync = true |
238 | | - user = ossrhUsername |
239 | | - password = ossrhPassword |
240 | | - close = '1' // release automatically |
241 | | - } |
242 | | - } |
243 | | - } |
244 | | -} |
245 | | - |
246 | | -// Create the publication with the pom configuration: |
247 | | -apply plugin: 'maven-publish' |
248 | | - |
249 | | -publishing { |
250 | | - publications { |
251 | | - MyPublication(MavenPublication) { |
252 | | - groupId group |
253 | | - artifactId projArtifact |
254 | | - artifacts = [androidSourcesJar, bundleRelease] |
255 | | - version version |
256 | | - pom.withXml { |
257 | | - def root = asNode() |
258 | | - root.appendNode('description', projDescription) |
259 | | - root.appendNode('name', projName) |
260 | | - root.appendNode('url', projGitLink) |
261 | | - root.children().last() + pomConfig |
262 | | - |
263 | | - // maven-publish workaround to include dependencies |
264 | | - def dependenciesNode = asNode().appendNode('dependencies') |
265 | | - |
266 | | - //Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each |
267 | | - configurations.compile.allDependencies.each { |
268 | | - def dependencyNode = dependenciesNode.appendNode('dependency') |
269 | | - dependencyNode.appendNode('groupId', it.group) |
270 | | - dependencyNode.appendNode('artifactId', it.name) |
271 | | - dependencyNode.appendNode('version', it.version) |
272 | | - } |
273 | | - |
274 | | - } |
275 | | - } |
276 | | - } |
277 | | -} |
278 | | - |
279 | | -// End of Bintray plugin |
0 commit comments