Record Class LocalMavenHelper
java.lang.Object
java.lang.Record
net.fabricmc.loom.configuration.mods.dependency.LocalMavenHelper
-
Constructor Summary
ConstructorsConstructorDescriptionLocalMavenHelper(String group, String name, String version, @Nullable String baseClassifier, Path root) LocalMavenHelper(String group, String name, String version, @Nullable String baseClassifier, Path root, @Nullable String snapshotVersion) Creates an instance of aLocalMavenHelperrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the value of thebaseClassifierrecord component.copyToMaven(Path artifact, @Nullable String classifier) final booleanIndicates whether some other object is "equal to" this one.booleanReturns 该 maven 构件的 jar 与 pom 是否都存在.getOutputFile(@Nullable String classifier) getRelativeArtifactPath(@Nullable String classifier) 产出文件相对于仓库根的路径(以/分隔).group()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.booleanisReusable(@Nullable String classifier) Returns 该 maven 构件是否既存在、内容又可复用.name()Returns the value of thenamerecord component.root()Returns the value of therootrecord component.voidsavePom()@Nullable StringReturns the value of thesnapshotVersionrecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.withClassifier(String classifier)
-
Constructor Details
-
LocalMavenHelper
-
LocalMavenHelper
public LocalMavenHelper(String group, String name, String version, @Nullable String baseClassifier, Path root, @Nullable String snapshotVersion) Creates an instance of aLocalMavenHelperrecord class.- Parameters:
group- the value for thegrouprecord componentname- the value for thenamerecord componentversion- the value for theversionrecord componentbaseClassifier- the value for thebaseClassifierrecord componentroot- the value for therootrecord componentsnapshotVersion- the value for thesnapshotVersionrecord component
-
-
Method Details
-
copyToMaven
- Throws:
IOException
-
exists
Returns 该 maven 构件的 jar 与 pom 是否都存在..只做存在性判定,不校验内容,语义保持不变。若调用点需要的是「内容可用」——典型场景是把产物 当作跨 daemon/跨 loom 版本共享缓存里的就绪判据——请改用
isReusable(String)。- Returns:
- 该 maven 构件的 jar 与 pom 是否都存在
-
isReusable
Returns 该 maven 构件是否既存在、内容又可复用..在
exists(String)之上追加 jar 的内容校验(见JarReusability.isReusable(Path)): 这些仓库目录跨 daemon、跨 loom 版本共享,旧版本 loom 以最终路径为输出就地写, 被中断会留下 0 字节或截断的 jar;只判存在会让这类残骸被当成暖缓存,作为 Gradle 依赖进入编译链。该口径不会把正常产物判为不可用——按「临时文件 + 原子落位」发布的 jar 必然可打开且非空—— 因此不会引起「每次构建都重建」。
- Returns:
- 该 maven 构件是否既存在、内容又可复用
-
getNotation
-
savePom
public void savePom() -
getOutputFile
-
getRelativeArtifactPath
产出文件相对于仓库根的路径(以/分隔).供文件依赖构造使用:任务持有产出根目录,消费方据此换算出文件依赖, 从而获得携带任务依赖的引用(见架构 §5.1.1)。
-
withClassifier
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
baseClassifier
Returns the value of thebaseClassifierrecord component.- Returns:
- the value of the
baseClassifierrecord component
-
root
Returns the value of therootrecord component.- Returns:
- the value of the
rootrecord component
-
snapshotVersion
Returns the value of thesnapshotVersionrecord component.- Returns:
- the value of the
snapshotVersionrecord component
-