Skip to content

Commit b1ae51d

Browse files
committed
Convert value result from record to class
Gradle hates records. It needs to access the constructors of serialized types in order to deserialize the configuration cache, but record constructors must be the same access level as the class.
1 parent 9a763ef commit b1ae51d

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

gitversion-gradle/src/main/groovy/net/minecraftforge/gitversion/gradle/GitVersionValueResult.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,29 @@
44
*/
55
package net.minecraftforge.gitversion.gradle;
66

7-
record GitVersionValueResult(GitVersionExtensionInternal.Output output, String errorOutput, Throwable execFailure) { }
7+
import java.io.Serializable;
8+
9+
@SuppressWarnings("ClassCanBeRecord") // Gradle hates records -- ctor needs to be public
10+
final class GitVersionValueResult implements Serializable {
11+
private final GitVersionExtensionInternal.Output output;
12+
private final String errorOutput;
13+
private final Throwable execFailure;
14+
15+
public GitVersionValueResult(GitVersionExtensionInternal.Output output, String errorOutput, Throwable execFailure) {
16+
this.output = output;
17+
this.errorOutput = errorOutput;
18+
this.execFailure = execFailure;
19+
}
20+
21+
public GitVersionExtensionInternal.Output output() {
22+
return this.output;
23+
}
24+
25+
public String errorOutput() {
26+
return this.errorOutput;
27+
}
28+
29+
public Throwable execFailure() {
30+
return this.execFailure;
31+
}
32+
}

0 commit comments

Comments
 (0)