mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-29 22:27:31 +00:00
perf: 优化 Artifact 的判断条件.
根据相关文档[1], baseVersion 和 Version 不需要同时判断, 只需要单独判断 Version 即可确认版本是否符合. 另外, 如果 Version 不符, 那么 isSnapshot 就没有必要判断(不可能出现 Version 相同的情况下, 一个是快照版, 一个是发布版的情况), 故移除对 baseVersion 和 isSnapshot 的检查. 另外, Properties 属于 Aether 内部的非持久化信息交换方式, 不是必须纳入检查的项目, 故新增参数用于选择是否检查 Properties 是否相同. ------------------------------------ [1]: https://community.sonatype.com/t/what-is-the-differences-between-maven-baseversion-and-maven-version/2937
This commit is contained in:
parent
7e48f4bf0b
commit
35c77f6093
@ -10,16 +10,14 @@ import java.io.FilenameFilter
|
|||||||
|
|
||||||
internal fun ByteArray.toHexString(): String = joinToString("") { it.toString(16) }
|
internal fun ByteArray.toHexString(): String = joinToString("") { it.toString(16) }
|
||||||
|
|
||||||
internal fun Artifact.equalsArtifact(that: Artifact): Boolean =
|
internal fun Artifact.equalsArtifact(that: Artifact, checkProperties: Boolean = false): Boolean =
|
||||||
this.groupId.equals(that.groupId) &&
|
this.groupId.equals(that.groupId) &&
|
||||||
this.artifactId.equals(that.artifactId) &&
|
this.artifactId.equals(that.artifactId) &&
|
||||||
this.version.equals(that.version) &&
|
this.version.equals(that.version) &&
|
||||||
this.baseVersion.equals(that.baseVersion) &&
|
|
||||||
this.isSnapshot == that.isSnapshot &&
|
|
||||||
this.classifier.equals(that.classifier) &&
|
this.classifier.equals(that.classifier) &&
|
||||||
this.extension.equals(that.extension) &&
|
this.extension.equals(that.extension) &&
|
||||||
(if (this.file == null) that.file == null else this.file.equals(that.file)) &&
|
(if (this.file == null) that.file == null else this.file.equals(that.file)) &&
|
||||||
this.properties.equals(that.properties)
|
(!checkProperties || this.properties.equals(that.properties))
|
||||||
|
|
||||||
internal fun File.deepListFiles(
|
internal fun File.deepListFiles(
|
||||||
addSelf: Boolean = false,
|
addSelf: Boolean = false,
|
||||||
|
Loading…
Reference in New Issue
Block a user