@@ -154,7 +154,7 @@ abstract class GMavenService : BuildService<BuildServiceParameters.None> {
154
154
* Gets the latest non-alpha version of the artifact that has been uploaded to GMaven, if any.
155
155
*
156
156
* ```
157
- * gmaven.latestVersionOrNull ("com.google.firebase", "firebase-components") // "18.0.1"
157
+ * gmaven.latestNonAlphaVersionOrNull ("com.google.firebase", "firebase-components") // "18.0.1"
158
158
* ```
159
159
*
160
160
* @param groupId The group to search under.
@@ -169,7 +169,7 @@ abstract class GMavenService : BuildService<BuildServiceParameters.None> {
169
169
* Gets the latest non-alpha version of the artifact that has been uploaded to GMaven, if any.
170
170
*
171
171
* ```
172
- * gmaven.latestVersionOrNull ("com.google.firebase", "firebase-components") // "18.0.1"
172
+ * gmaven.latestNonAlphaVersionOrNull ("com.google.firebase", "firebase-components") // "18.0.1"
173
173
* ```
174
174
*
175
175
* @param fullArtifactName The artifact to search for, represented as "groupId:artifactId".
@@ -215,24 +215,6 @@ abstract class GMavenService : BuildService<BuildServiceParameters.None> {
215
215
" Failed to get the latest version from gmaven for \' $artifactId \' . Has it been published?"
216
216
)
217
217
218
- /* *
219
- * Gets the latest non-alpha version of the artifact that has been uploaded to GMaven.
220
- *
221
- * ```
222
- * gmaven.latestVersion("com.google.firebase", "firebase-components") // "18.0.1"
223
- * ```
224
- *
225
- * @param groupId The group to search under.
226
- * @param artifactId The artifact to search for.
227
- * @return The latest released version as a string.
228
- * @see latestNonAlphaVersionOrNull
229
- */
230
- fun latestNonAlphaVersion (groupId : String , artifactId : String ) =
231
- latestVersionOrNull(groupId, artifactId)
232
- ? : throw RuntimeException (
233
- " Failed to get the latest version from gmaven for \' $artifactId \' . Has it been published?"
234
- )
235
-
236
218
/* *
237
219
* Checks if an artifact has been published to GMaven.
238
220
*
@@ -452,7 +434,7 @@ class GMavenServiceController(
452
434
return findFirebaseArtifact(groupId, artifactId)?.latestVersion
453
435
}
454
436
455
- /* * @see GMavenService.latestVersionOrNull */
437
+ /* * @see GMavenService.latestNonAlphaVersionOrNull */
456
438
fun latestNonAlphaVersionOrNull (groupId : String , artifactId : String ): String? {
457
439
return findFirebaseArtifact(groupId, artifactId)?.latestNonAlphaVersion
458
440
}
@@ -609,7 +591,7 @@ data class GroupIndexArtifact(
609
591
val artifactId : String ,
610
592
val versions : List <String >,
611
593
val latestVersion : String = versions.last(),
612
- val latestNonAlphaVersion : String = versions.last { !it.contains("alpha") }
594
+ val latestNonAlphaVersion : String? = versions.findLast { !it.contains("alpha") },
613
595
) {
614
596
615
597
/* *
0 commit comments