|
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 | 5 | version = rootProject.ext.commonLibVersion
|
|
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.2' |
23 |
| - } |
24 |
| -} |
25 | 13 |
|
26 | 14 | android {
|
27 | 15 | compileSdkVersion rootProject.ext.compileSdkVersion
|
@@ -64,111 +52,6 @@ dependencies {
|
64 | 52 | testImplementation "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
|
65 | 53 | }
|
66 | 54 |
|
67 |
| -android.libraryVariants.all { variant -> |
68 |
| - def name = variant.buildType.name |
69 |
| - |
70 |
| - def javadoc = task("javadoc${variant.name.capitalize()}", type: Javadoc) { |
71 |
| - description "Generates Javadoc for $variant.name." |
72 |
| - destinationDir = rootProject.file("docs/api") |
73 |
| - source = variant.javaCompiler.source |
74 |
| - ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar" |
75 |
| - doFirst { |
76 |
| - classpath = files(variant.javaCompiler.classpath.files) + files(ext.androidJar) |
77 |
| - } |
78 |
| - options.docletpath = [rootProject.file("./gradle/ExcludeDoclet.jar")] |
79 |
| - options.doclet = "me.grantland.doclet.ExcludeDoclet" |
80 |
| - |
81 |
| - options.linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference") |
82 |
| - options.links("http://boltsframework.github.io/docs/android/") |
83 |
| - |
84 |
| - exclude '**/BuildConfig.java' |
85 |
| - exclude '**/R.java' |
86 |
| - exclude '**/internal/**' |
87 |
| - } |
88 |
| - |
89 |
| - def javadocJar = task("javadocJar${variant.name.capitalize()}", type: Jar, dependsOn: "javadoc${variant.name.capitalize()}") { |
90 |
| - classifier = 'javadoc' |
91 |
| - from javadoc.destinationDir |
92 |
| - } |
93 |
| - |
94 |
| - if (name.equals(BuilderConstants.RELEASE)) { |
95 |
| - artifacts.add('archives', javadocJar); |
96 |
| - } |
97 |
| -} |
98 |
| - |
99 |
| -//region Maven |
100 |
| - |
101 |
| -apply plugin: 'maven' |
102 |
| -apply plugin: 'signing' |
103 |
| - |
104 |
| -def isSnapshot = version.endsWith('-SNAPSHOT') |
105 |
| -def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : System.getenv('CI_NEXUS_USERNAME') |
106 |
| -def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : System.getenv('CI_NEXUS_PASSWORD') |
107 |
| - |
108 |
| -def pomConfig = { |
109 |
| - licenses { |
110 |
| - license { |
111 |
| - name 'BSD License' |
112 |
| - url 'https://github.com/parse-community/Parse-SDK-Android/blob/master/LICENSE' |
113 |
| - distribution 'repo' |
114 |
| - } |
115 |
| - } |
116 |
| - |
117 |
| - scm { |
118 |
| - connection 'scm:[email protected]:parse-community/Parse-SDK-Android.git' |
119 |
| - developerConnection 'scm:[email protected]:parse-community/Parse-SDK-Android.git' |
120 |
| - url gitLink |
121 |
| - } |
122 |
| - |
123 |
| - developers { |
124 |
| - developer { |
125 |
| - id 'parse' |
126 |
| - name 'Parse' |
127 |
| - } |
128 |
| - } |
129 |
| -} |
130 |
| - |
131 |
| - |
132 |
| -uploadArchives { |
133 |
| - repositories.mavenDeployer { |
134 |
| - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
135 |
| - |
136 |
| - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
137 |
| - authentication(userName: ossrhUsername, password: ossrhPassword) |
138 |
| - } |
139 |
| - |
140 |
| - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
141 |
| - authentication(userName: ossrhUsername, password: ossrhPassword) |
142 |
| - } |
143 |
| - |
144 |
| - def basePom = { |
145 |
| - name projName |
146 |
| - artifactId = artifact |
147 |
| - packaging 'aar' |
148 |
| - description projDescription |
149 |
| - url gitLink |
150 |
| - } |
151 |
| - |
152 |
| - pom.project basePom << pomConfig |
153 |
| - } |
154 |
| -} |
155 |
| - |
156 |
| -signing { |
157 |
| - required { !isSnapshot && gradle.taskGraph.hasTask("uploadArchives") } |
158 |
| - sign configurations.archives |
159 |
| -} |
160 |
| - |
161 |
| -task androidSourcesJar(type: Jar) { |
162 |
| - classifier = 'sources' |
163 |
| - from android.sourceSets.main.java.sourceFiles |
164 |
| -} |
165 |
| - |
166 |
| -artifacts { |
167 |
| - archives androidSourcesJar |
168 |
| -} |
169 |
| - |
170 |
| -//endregion |
171 |
| - |
172 | 55 | //region Code Coverage
|
173 | 56 |
|
174 | 57 | apply plugin: 'jacoco'
|
@@ -211,73 +94,4 @@ coveralls.jacocoReportPath = "${buildDir}/reports/jacoco/jacocoTestReport/jacoco
|
211 | 94 |
|
212 | 95 | //endregion
|
213 | 96 |
|
214 |
| -// Requires apply plugin: 'com.jfrog.bintray' |
215 |
| - |
216 |
| -bintray { |
217 |
| - user = System.getenv('BINTRAY_USER') |
218 |
| - key = System.getenv('BINTRAY_API_KEY') |
219 |
| - |
220 |
| - publications = ["mavenAar"] |
221 |
| - |
222 |
| - publish = true |
223 |
| - pkg { |
224 |
| - repo = 'maven' |
225 |
| - name = 'com.parse:parse-android' |
226 |
| - userOrg = 'parse' |
227 |
| - licenses = ['BSD License'] |
228 |
| - vcsUrl = 'https://github.com/parse-community/Parse-SDK-Android' |
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: 'digital.wup.android-maven-publish' |
248 |
| - |
249 |
| -publishing { |
250 |
| - publications { |
251 |
| - mavenAar(MavenPublication) { |
252 |
| - from components.android |
253 |
| - groupId group |
254 |
| - // We have to specify it here because otherwise Bintray's plugin will assume the artifact's name is Parse |
255 |
| - artifactId artifact |
256 |
| - artifacts = [androidSourcesJar, javadocJarRelease, bundleRelease] |
257 |
| - version version |
258 |
| - |
259 |
| - } |
260 |
| - |
261 |
| - } |
262 |
| -} |
263 |
| - |
264 |
| -// End of Bintray plugin |
265 |
| - |
266 |
| -apply plugin: "com.jfrog.artifactory" |
267 |
| - |
268 |
| -artifactory { |
269 |
| - contextUrl = 'https://oss.jfrog.org' |
270 |
| - publish { |
271 |
| - repository { |
272 |
| - repoKey = 'oss-snapshot-local' // The Artifactory repository key to publish to |
273 |
| - |
274 |
| - username = System.getenv('BINTRAY_USER') |
275 |
| - password = System.getenv('BINTRAY_API_KEY') |
276 |
| - maven = true |
277 |
| - } |
278 |
| - defaults { |
279 |
| - publishArtifacts = true |
280 |
| - publications('mavenAar') |
281 |
| - } |
282 |
| - } |
283 |
| -} |
| 97 | +apply from: rootProject.file('gradle/gradle-mvn-push.gradle') |
0 commit comments