mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Doc.
This commit is contained in:
parent
b9ba951c3c
commit
07da07bb6d
1 changed files with 11 additions and 1 deletions
|
@ -1,5 +1,15 @@
|
||||||
package com.beust.kobalt.maven
|
package com.beust.kobalt.maven
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encapsulate a Maven id captured in one string, as used by Gradle or Ivy, e.g. "org.testng:testng:6.9.9".
|
||||||
|
* These id's are somewhat painful to manipulate because on top of containing groupId, artifactId
|
||||||
|
* and version, they also accept an optional packaging (e.g. "aar") and qualifier (e.g. "no_aop").
|
||||||
|
* Determining which is which in an untyped string separated by colons is not clearly defined so
|
||||||
|
* this class does a best attempt at deconstructing an id but there's surely room for improvement.
|
||||||
|
*
|
||||||
|
* This class accepts a versionless id, which needs to end with a :, e.g. "com.beust:jcommander:" (which
|
||||||
|
* usually means "latest version") but it doesn't handle version ranges yet.
|
||||||
|
*/
|
||||||
public class MavenId(val id: String) {
|
public class MavenId(val id: String) {
|
||||||
lateinit var groupId: String
|
lateinit var groupId: String
|
||||||
lateinit var artifactId: String
|
lateinit var artifactId: String
|
||||||
|
@ -33,7 +43,7 @@ public class MavenId(val id: String) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isVersion(s: String) : Boolean = Character.isDigit(s.get(0))
|
private fun isVersion(s: String) : Boolean = Character.isDigit(s[0])
|
||||||
|
|
||||||
val hasVersion = version != null
|
val hasVersion = version != null
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue