Skip to content

Commit 2be3b30

Browse files
committed
Style comments
1 parent dca1bb6 commit 2be3b30

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

buildSrc/src/main/java/com/google/firebase/gradle/plugins/GmavenHelper.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class GmavenHelper(val groupId: String, val artifactId: String) {
3838
}
3939

4040
fun hasReleasedVersion(version: String): Boolean {
41-
val doc: Document? = getDocument()
41+
val doc: Document? = getMavenMetadata()
4242
if (doc != null) {
4343
val versions = doc.getElementsByTagName("version")
4444
for (i in 0..versions.length - 1) {
@@ -51,16 +51,16 @@ class GmavenHelper(val groupId: String, val artifactId: String) {
5151
}
5252

5353
fun getLatestReleasedVersion(): String {
54-
val doc: Document? = getDocument()
54+
val doc: Document? = getMavenMetadata()
5555
return doc?.getElementsByTagName("latest")?.item(0)?.getTextContent() ?: ""
5656
}
5757

58-
fun getDocument(): Document? {
58+
fun getMavenMetadata(): Document? {
59+
val groupIdAsPath = groupId.replace(".", "/")
60+
val mavenMetadataUrl = "${GMAVEN_ROOT}/${groupIdAsPath}/${artifactId}/maven-metadata.xml"
61+
val factory: DocumentBuilderFactory = DocumentBuilderFactory.newInstance()
62+
val builder: DocumentBuilder = factory.newDocumentBuilder()
5963
try {
60-
val groupIdAsPath = groupId.replace(".", "/")
61-
val mavenMetadataUrl = "${GMAVEN_ROOT}/${groupIdAsPath}/${artifactId}/maven-metadata.xml"
62-
val factory: DocumentBuilderFactory = DocumentBuilderFactory.newInstance()
63-
val builder: DocumentBuilder = factory.newDocumentBuilder()
6464
val doc: Document = builder.parse(URL(mavenMetadataUrl).openStream())
6565
doc.documentElement.normalize()
6666
return doc

buildSrc/src/main/java/com/google/firebase/gradle/plugins/GmavenVersionChecker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ abstract class GmavenVersionChecker : DefaultTask() {
4141
if (latestMavenVersion.isEmpty()) {
4242
return
4343
}
44-
// b/285892320
44+
// TODO(b/285892320): Remove condition when bug fixed
4545
if (artifactId.get() == "protolite-well-known-types") {
4646
return
4747
}

0 commit comments

Comments
 (0)