diff options
author | Kristina Chodorow <kchodorow@google.com> | 2015-02-27 17:14:12 +0000 |
---|---|---|
committer | Ulf Adams <ulfjack@google.com> | 2015-03-05 14:15:41 +0000 |
commit | 91876f004def4a7858bb614091a6cd2fbef681fc (patch) | |
tree | c4d4e1473f7c327f8014443998f129fb7563057d /src/main/java/com/google/devtools/build/lib/skyframe/PackageValue.java | |
parent | 79f052118e94c418247c4ea0ba6fcd3a35ca7e0d (diff) |
Make Rule know about the name of the workspace it is in.
This is needed for taking the runfiles prefix from the WORKSPACE file instead of hardcoding it.
--
MOS_MIGRATED_REVID=87347883
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PackageValue.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/PackageValue.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageValue.java index 65fd2afb7e..d3292fbd2d 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageValue.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageValue.java @@ -19,6 +19,7 @@ import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe; import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.packages.PackageIdentifier; import com.google.devtools.build.lib.vfs.PathFragment; +import com.google.devtools.build.lib.vfs.RootedPath; import com.google.devtools.build.skyframe.SkyKey; import com.google.devtools.build.skyframe.SkyValue; @@ -52,4 +53,11 @@ public class PackageValue implements SkyValue { public static SkyKey key(PackageIdentifier pkgIdentifier) { return new SkyKey(SkyFunctions.PACKAGE, pkgIdentifier); } + + /** + * Returns a SkyKey to find the WORKSPACE file at the given path. + */ + public static SkyKey workspaceKey(RootedPath workspacePath) { + return new SkyKey(SkyFunctions.WORKSPACE_FILE, workspacePath); + } } |