diff options
author | 2018-02-15 12:42:38 -0800 | |
---|---|---|
committer | 2018-02-15 12:46:51 -0800 | |
commit | b2a396b6091a07c1e9e5036e73dd14d2ff1ec818 (patch) | |
tree | 2119f4215f1616ab194299b0f8b5697d3857147d /src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java | |
parent | c35fd4d82fefffc2888838531672bfe7855363f8 (diff) |
Add some more codecs to execution-phase SkyKeys.
PiperOrigin-RevId: 185883201
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java index 74af54a41c..89ede26f7d 100644 --- a/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java +++ b/src/test/java/com/google/devtools/build/lib/actions/util/ActionsTestUtil.java @@ -64,6 +64,8 @@ import com.google.devtools.build.lib.events.ExtendedEventHandler; import com.google.devtools.build.lib.events.Reporter; import com.google.devtools.build.lib.exec.SingleBuildFileCache; import com.google.devtools.build.lib.packages.AspectDescriptor; +import com.google.devtools.build.lib.skyframe.serialization.ObjectCodec; +import com.google.devtools.build.lib.skyframe.serialization.SingletonCodec; import com.google.devtools.build.lib.util.FileType; import com.google.devtools.build.lib.util.ResourceUsage; import com.google.devtools.build.lib.util.io.FileOutErr; @@ -265,13 +267,19 @@ public final class ActionsTestUtil { null, null); - public static final ArtifactOwner NULL_ARTIFACT_OWNER = - new ArtifactOwner() { - @Override - public Label getLabel() { - return NULL_LABEL; - } - }; + static class NullArtifactOwner implements ArtifactOwner { + private static final ActionsTestUtil.NullArtifactOwner INSTANCE = + new ActionsTestUtil.NullArtifactOwner(); + static final ObjectCodec<ActionsTestUtil.NullArtifactOwner> CODEC = + SingletonCodec.of(INSTANCE, "null_artifact_owner"); + + @Override + public Label getLabel() { + return NULL_LABEL; + } + } + + public static final ArtifactOwner NULL_ARTIFACT_OWNER = NullArtifactOwner.INSTANCE; /** An unchecked exception class for action conflicts. */ public static class UncheckedActionConflictException extends RuntimeException { |