aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime
diff options
context:
space:
mode:
authorGravatar Kristina Chodorow <kchodorow@google.com>2016-08-11 14:44:40 +0000
committerGravatar Yue Gan <yueg@google.com>2016-08-12 08:50:54 +0000
commitf8a1ae63ed616c4579db724a4d97effb8c216ceb (patch)
tree0843a158162c246f49d10058e57427f13754c6de /src/main/java/com/google/devtools/build/lib/runtime
parent153e5586a0a09237119f613ce591f892adc7efe4 (diff)
Add the repository name as a parameter to the output path functions
This doesn't do anything yet, it's in preparation for the execroot rearranging change. The execroot will have one bazel-out per repo, so it'll look like: execroot/ repo1/ bazel-out/ local-fastbuild/ bin/ repo2/ bazel-out/ local-fastbuild/ bin/ genfiles/ repo3/ bazel-out/ local-fastbuild/ testlogs/ and so on. Thus, any output path (getBinDirectory() & friends) needs to know what the repo name is. This changes so many places in the code I thought it would be good to do separately, then just flip the functionality in the execroot-rearranging commit. While I was poking around, I changed all of the refs I could from getPackageRelativeArtifact() to getBin/GenfilesArtifact(), so that 1) rule implementation don't have to know as much about roots and 2) they'll be more isolated from other output dir changes. `bazel info` and similar just return roots for the main repository. The only "change" is passing around a target label in the Java rules. Continues work on #1262. -- MOS_MIGRATED_REVID=129985336
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java
index 8237317cfb..4677b4a509 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoItem.java
@@ -22,6 +22,7 @@ import com.google.common.base.Supplier;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.analysis.BlazeVersionInfo;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration;
+import com.google.devtools.build.lib.cmdline.RepositoryName;
import com.google.devtools.build.lib.packages.Attribute;
import com.google.devtools.build.lib.packages.BuildType;
import com.google.devtools.build.lib.packages.ProtoUtils;
@@ -216,7 +217,7 @@ public abstract class InfoItem {
public byte[] get(Supplier<BuildConfiguration> configurationSupplier, CommandEnvironment env)
throws AbruptExitException {
checkNotNull(configurationSupplier);
- return print(configurationSupplier.get().getBinDirectory().getPath());
+ return print(configurationSupplier.get().getBinDirectory(RepositoryName.MAIN).getPath());
}
}
@@ -237,7 +238,8 @@ public abstract class InfoItem {
public byte[] get(Supplier<BuildConfiguration> configurationSupplier, CommandEnvironment env)
throws AbruptExitException {
checkNotNull(configurationSupplier);
- return print(configurationSupplier.get().getGenfilesDirectory().getPath());
+ return print(
+ configurationSupplier.get().getGenfilesDirectory(RepositoryName.MAIN).getPath());
}
}
@@ -258,7 +260,8 @@ public abstract class InfoItem {
public byte[] get(Supplier<BuildConfiguration> configurationSupplier, CommandEnvironment env)
throws AbruptExitException {
checkNotNull(configurationSupplier);
- return print(configurationSupplier.get().getTestLogsDirectory().getPath());
+ return print(
+ configurationSupplier.get().getTestLogsDirectory(RepositoryName.MAIN).getPath());
}
}