mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Optimize splits.
This commit is contained in:
parent
9bb3b11128
commit
160cbbcfda
7 changed files with 11 additions and 11 deletions
|
@ -15,7 +15,7 @@ class KobaltContext(val args: Args) {
|
|||
val profiles = arrayListOf<String>()
|
||||
|
||||
init {
|
||||
args.profiles?.split(",")?.filterNotNull()?.forEach {
|
||||
args.profiles?.split(',')?.filterNotNull()?.forEach {
|
||||
profiles.add(it)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,9 +53,9 @@ class TaskManager @Inject constructor(val args: Args,
|
|||
constructor(project: String, task: String) : this(project + ":" + task)
|
||||
|
||||
val project: String?
|
||||
get() = if (id.contains(":")) id.split(":")[0] else null
|
||||
get() = if (id.contains(':')) id.split(':')[0] else null
|
||||
val taskName: String
|
||||
get() = if (id.contains(":")) id.split(":")[1] else id
|
||||
get() = if (id.contains(':')) id.split(':')[1] else id
|
||||
|
||||
fun matches(projectName: String) = project == null || project == projectName
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class MavenId private constructor(val groupId: String, val artifactId: String, v
|
|||
val classifier: String?, val version: String?) {
|
||||
|
||||
companion object {
|
||||
fun isMavenId(id: String) = with(id.split(":")) {
|
||||
fun isMavenId(id: String) = with(id.split(':')) {
|
||||
size >= 3 && size <= 5
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ public class Versions {
|
|||
}
|
||||
|
||||
return normalizedVersion
|
||||
.split(".")
|
||||
.split('.')
|
||||
.take(3)
|
||||
.map {
|
||||
val s = CharMatcher.inRange('0', '9').or(CharMatcher.`is`('.')).retainFrom(it)
|
||||
|
@ -107,7 +107,7 @@ class Version(val version: String, val snapshotTimestamp: String? = null): Compa
|
|||
var lowerExclusive = version.startsWith("(")
|
||||
var upperExclusive = version.endsWith(")")
|
||||
|
||||
val split = version.drop(1).dropLast(1).split(",")
|
||||
val split = version.drop(1).dropLast(1).split(',')
|
||||
|
||||
val lower = Version.of(split[0].substring(1))
|
||||
val upper = if(split.size > 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue