mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 16:48:12 -07:00
MavenId fixes.
This commit is contained in:
parent
e252a5386c
commit
54f9dde73d
2 changed files with 43 additions and 2 deletions
|
@ -23,10 +23,18 @@ public class MavenId(val id: String) {
|
|||
}
|
||||
groupId = c[0]
|
||||
artifactId = c[1]
|
||||
packaging = if (c.size == 4) c[2] else null
|
||||
version = if (c.size == 4) c[3] else if (c.size == 3 && ! c[2].isBlank()) c[2] else null
|
||||
if (! c[2].isEmpty()) {
|
||||
if (isVersion(c[2])) {
|
||||
version = c[2]
|
||||
} else {
|
||||
packaging = c[2]
|
||||
version = c[3]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun isVersion(s: String) : Boolean = Character.isDigit(s.get(0))
|
||||
|
||||
val hasVersion = version != null
|
||||
|
||||
val toId = MavenId.toId(groupId, artifactId, packaging, version)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue