Skip to content

Commit 3e1ad5f

Browse files
committed
Merge branch 'master' into version-4.1.0-dev
Change-Id: I7e776a6614770fb89a2b87794ac3027284624a12
2 parents fc9e46a + 9aceabb commit 3e1ad5f

File tree

5 files changed

+117
-70
lines changed

5 files changed

+117
-70
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ libraries.
4747
```groovy
4848
dependencies {
4949
// FirebaseUI for Firebase Realtime Database
50-
implementation 'com.firebaseui:firebase-ui-database:4.0.0'
50+
implementation 'com.firebaseui:firebase-ui-database:4.0.1'
5151
5252
// FirebaseUI for Cloud Firestore
53-
implementation 'com.firebaseui:firebase-ui-firestore:4.0.0'
53+
implementation 'com.firebaseui:firebase-ui-firestore:4.0.1'
5454
5555
// FirebaseUI for Firebase Auth
56-
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
56+
implementation 'com.firebaseui:firebase-ui-auth:4.0.1'
5757
5858
// FirebaseUI for Cloud Storage
59-
implementation 'com.firebaseui:firebase-ui-storage:4.0.0'
59+
implementation 'com.firebaseui:firebase-ui-storage:4.0.1'
6060
}
6161
```
6262

@@ -206,7 +206,7 @@ repositories {
206206
Then you can depend on snapshot versions:
207207

208208
```groovy
209-
implementation 'com.firebaseui:firebase-ui-auth:4.0.0-SNAPSHOT'
209+
implementation 'com.firebaseui:firebase-ui-auth:x.y.z-SNAPSHOT'
210210
```
211211

212212
You can see which `SNAPSHOT` builds are avaiable here:

auth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Gradle, add the dependency:
6363
```groovy
6464
dependencies {
6565
// ...
66-
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
66+
implementation 'com.firebaseui:firebase-ui-auth:4.0.1'
6767
6868
// Required only if Facebook login support is required
6969
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94

build.gradle.kts

Lines changed: 108 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,30 @@ allprojects {
4646
configureAndroid()
4747
configureQuality()
4848

49-
val isLibrary = name == "library"
5049
if (Config.submodules.contains(name) || isLibrary) {
51-
setupPublishing(isLibrary)
50+
setupPublishing()
5251
}
5352
}
5453
}
5554

5655
val Project.configDir get() = "$rootDir/library/quality"
5756
val Project.reportsDir get() = "$buildDir/reports"
5857

58+
/**
59+
* Determines if a Project is the 'library' module
60+
*/
61+
val Project.isLibrary get() = name == "library"
62+
63+
/**
64+
* Returns the maven artifact name for a Project.
65+
*/
66+
val Project.artifactName get() = if (isLibrary) "firebase-ui" else "firebase-ui-$name"
67+
68+
/**
69+
* Returns the name for a Project's maven publication.
70+
*/
71+
val Project.publicationName get() = if (isLibrary) "monolithLibrary" else "${name}Library"
72+
5973
fun Project.configureAndroid() {
6074
if (name == "app" || name == "proguard-tests") {
6175
apply(plugin = "com.android.application")
@@ -113,10 +127,7 @@ fun Project.configureQuality() {
113127
}
114128
}
115129

116-
fun Project.setupPublishing(isLibrary: Boolean) {
117-
val publicationName = if (isLibrary) "monolithLibrary" else "${name}Library"
118-
val artifactName = if (isLibrary) "firebase-ui" else "firebase-ui-${project.name}"
119-
130+
fun Project.setupPublishing() {
120131
val sourcesJar = task<Jar>("sourcesJar") {
121132
classifier = "sources"
122133
from(project.the<BaseExtension>().sourceSets["main"].java.srcDirs)
@@ -185,6 +196,8 @@ fun Project.setupPublishing(isLibrary: Boolean) {
185196
dependsOn(javadocJar, sourcesJar, "assembleRelease", pomTask)
186197
}
187198
}
199+
200+
tasks["bintrayUpload"].dependsOn("prepareArtifacts")
188201
}
189202

190203
apply(plugin = "maven-publish")
@@ -219,55 +232,21 @@ fun Project.setupPublishing(isLibrary: Boolean) {
219232
artifactId = artifactName
220233
version = Config.version
221234

222-
artifact("$buildDir/outputs/aar/${project.name}-release.aar")
235+
val releaseAar = "$buildDir/outputs/aar/${project.name}-release.aar"
236+
237+
logger.info("""
238+
|Creating maven publication '$publicationName'
239+
| Group: $groupName
240+
| Artifact: $artifactName
241+
| Version: $version
242+
| Aar: $releaseAar
243+
""".trimMargin())
244+
245+
artifact(releaseAar)
223246
artifact(javadocJar)
224247
artifact(sourcesJar)
225248

226249
pom {
227-
name.set("FirebaseUI ${project.name.capitalize()}")
228-
description.set("Firebase UI for Android")
229-
url.set("https://github.com/firebase/FirebaseUI-Android")
230-
231-
organization {
232-
name.set("Firebase")
233-
url.set("https://github.com/firebase")
234-
}
235-
236-
scm {
237-
val scmUrl = "scm:git:[email protected]/firebase/firebaseui-android.git"
238-
connection.set(scmUrl)
239-
developerConnection.set(scmUrl)
240-
url.set(this@pom.url)
241-
tag.set("HEAD")
242-
}
243-
244-
developers {
245-
developer {
246-
id.set("samtstern")
247-
name.set("Sam Stern")
248-
email.set("[email protected]")
249-
organization.set("Firebase")
250-
organizationUrl.set("https://firebase.google.com")
251-
roles.set(listOf("Project-Administrator", "Developer"))
252-
timezone.set("-8")
253-
}
254-
255-
developer {
256-
id.set("SUPERCILEX")
257-
name.set("Alex Saveau")
258-
email.set("[email protected]")
259-
roles.set(listOf("Developer"))
260-
timezone.set("-8")
261-
}
262-
}
263-
264-
licenses {
265-
license {
266-
name.set("The Apache License, Version 2.0")
267-
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
268-
}
269-
}
270-
271250
withXml {
272251
asNode().appendNode("dependencies").apply {
273252
fun Dependency.write(scope: String) = appendNode("dependency").apply {
@@ -288,14 +267,64 @@ fun Project.setupPublishing(isLibrary: Boolean) {
288267
dependency.write("runtime")
289268
}
290269
}
270+
271+
// Common values
272+
val repoUrl = "https://github.com/firebase/FirebaseUI-Android"
273+
val scmUrl = "scm:git:[email protected]/firebase/firebaseui-android.git"
274+
275+
// Name
276+
asNode().appendNode("name", artifactId)
277+
278+
// Description
279+
asNode().appendNode("description", "Firebase UI for Android")
280+
281+
// Organization
282+
asNode().appendNode("organization").apply {
283+
appendNode("name", "FirebaseUI")
284+
appendNode("url", repoUrl)
285+
}
286+
287+
// URL
288+
asNode().appendNode("url", repoUrl)
289+
290+
// SCM
291+
asNode().appendNode("scm").apply {
292+
appendNode("connection", scmUrl)
293+
appendNode("developerConnection", scmUrl)
294+
appendNode("url", repoUrl)
295+
appendNode("tag", "HEAD")
296+
}
297+
298+
// Developers
299+
asNode().appendNode("developers").appendNode("developer").apply {
300+
appendNode("id", "samtstern")
301+
appendNode("email", "[email protected]")
302+
appendNode("organization", "Firebase")
303+
appendNode("organizationUrl", "https://firebase.google.com")
304+
305+
appendNode("roles").apply {
306+
appendNode("role", "Project-Administrator")
307+
appendNode("role", "Developer")
308+
}
309+
310+
appendNode("timezone", "-8")
311+
}
312+
313+
// Licenses
314+
asNode().appendNode("licenses").appendNode("license").apply {
315+
appendNode("name", "The Apache License, Version 2.0")
316+
appendNode("url", "http://www.apache.org/licenses/LICENSE-2.0.txt")
317+
}
291318
}
292319
}
293320
}
294321
}
295322
}
296323

297-
val bintrayUsername = System.getProperty("BINTRAY_USER") ?: System.getenv("BINTRAY_USER")
298-
val bintrayKey = System.getProperty("BINTRAY_KEY") ?: System.getenv("BINTRAY_KEY")
324+
val bintrayUsername = properties["bintrayUser"] as String?
325+
?: System.getProperty("BINTRAY_USER") ?: System.getenv("BINTRAY_USER")
326+
val bintrayKey = properties["bintrayKey"] as String?
327+
?: System.getProperty("BINTRAY_KEY") ?: System.getenv("BINTRAY_KEY")
299328

300329
configure<ArtifactoryPluginConvention> {
301330
setContextUrl("https://oss.jfrog.org")
@@ -314,16 +343,34 @@ fun Project.setupPublishing(isLibrary: Boolean) {
314343
user = bintrayUsername
315344
key = bintrayKey
316345
setPublications(publicationName)
317-
setConfigurations("archives")
346+
347+
// When uploading, move and rename the generated POM
348+
val pomSrc = "$buildDir/publications/$publicationName/pom-default.xml"
349+
val pomDest = "com/firebaseui/$artifactName/${Config.version}/"
350+
val pomName = "$artifactName-${Config.version}.pom"
351+
352+
val pubLog: (String) -> String = { name ->
353+
val publishing = project.extensions
354+
.getByType(PublishingExtension::class.java)
355+
.publications[name] as MavenPublication
356+
"'$name': ${publishing.artifacts}"
357+
}
358+
logger.info("""
359+
|Bintray configuration for '$publicationName'
360+
| Artifact name: $artifactName
361+
| Artifacts: ${publications.joinToString(transform = pubLog)}
362+
""".trimMargin())
363+
logger.info("""
364+
|POM transformation
365+
| Src: $pomSrc
366+
| Dest: $pomDest
367+
| Name: $pomName
368+
""".trimMargin())
318369

319370
filesSpec(closureOf<RecordingCopyTask> {
320-
from(if (isLibrary) {
321-
"$buildDir/publications/monolithLibrary/pom-default.xml"
322-
} else {
323-
"$buildDir/publications/${project.name}Library/pom-default.xml"
324-
})
325-
into("com/firebaseui/$artifactName/${Config.version}/")
326-
rename(KotlinClosure1<String, String>({ "$artifactName-${Config.version}.pom" }))
371+
from(pomSrc)
372+
into(pomDest)
373+
rename(KotlinClosure1<String, String>({ pomName }))
327374
})
328375

329376
pkg(closureOf<BintrayExtension.PackageConfig> {

buildSrc/src/main/kotlin/Config.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
object Config {
2-
const val version = "4.0.1-SNAPSHOT"
2+
const val version = "4.0.1"
33
val submodules = listOf("auth", "common", "firestore", "database", "storage")
44

55
private const val kotlinVersion = "1.2.41"
@@ -15,7 +15,7 @@ object Config {
1515
const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
1616
const val google = "com.google.gms:google-services:4.0.1"
1717

18-
const val bintray = "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
18+
const val bintray = "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0"
1919
const val buildInfo = "org.jfrog.buildinfo:build-info-extractor-gradle:4.7.3"
2020
}
2121

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-rc-1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)