aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java
diff options
context:
space:
mode:
authorGravatar John Cater <jcater@google.com>2017-11-28 20:47:41 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-11-28 20:49:17 -0800
commite0d1d0ef7e1d53f232a457ac66496a5d8d9b82e3 (patch)
treed3637b0bf3f2020638665335841bf0ba752c7a1e /src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java
parent55a4b9ae3f4ac5c453e7d944c5113f7fe9baf24b (diff)
Update PathPackageLocator to take a list of potential build file names,
instead of assuming BUILD. - Default the list to the same value as PackageLookupFunction: BUILD.bazel, BUILD. - Move BuildFileNames to the packages package, so it is more generally available. Part of #4056. Change-Id: Ie12512b492cd7d47a9e56ec3bc209f829feaf4b5 PiperOrigin-RevId: 177261295
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java
index 98c76bdaaf..ffb81648f6 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java
@@ -20,6 +20,7 @@ import com.google.devtools.build.lib.pkgcache.PathPackageLocator;
import com.google.devtools.build.lib.runtime.BlazeCommand;
import com.google.devtools.build.lib.runtime.CommonCommandOptions;
import com.google.devtools.build.lib.runtime.ProjectFile;
+import com.google.devtools.build.lib.skyframe.BazelSkyframeExecutorConstants;
import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.common.options.OptionPriority.PriorityCategory;
@@ -59,14 +60,18 @@ public final class ProjectFileSupport {
// cwd is a subdirectory of the workspace, that will be surprising, and we should interpret it
// relative to the cwd instead.
PathFragment projectFilePath = PathFragment.create(targets.get(0).substring(1));
- List<Path> packagePath = PathPackageLocator.create(
- // We only need a non-null outputBase for the PathPackageLocator if we support external
- // repositories, which we don't for project files.
- null,
- optionsParser.getOptions(PackageCacheOptions.class).packagePath,
- eventHandler,
- workspaceDir,
- workingDir).getPathEntries();
+ List<Path> packagePath =
+ PathPackageLocator.create(
+ // We only need a non-null outputBase for the PathPackageLocator if we support
+ // external
+ // repositories, which we don't for project files.
+ null,
+ optionsParser.getOptions(PackageCacheOptions.class).packagePath,
+ eventHandler,
+ workspaceDir,
+ workingDir,
+ BazelSkyframeExecutorConstants.BUILD_FILES_BY_PRIORITY)
+ .getPathEntries();
ProjectFile projectFile = projectFileProvider.getProjectFile(
workingDir, packagePath, projectFilePath);
eventHandler.handle(Event.info("Using " + projectFile.getName()));