diff options
author | 2017-06-27 13:17:38 +0200 | |
---|---|---|
committer | 2017-06-27 15:06:11 +0200 | |
commit | fb43f04ac488e5056b875912c8583eac2acf9eed (patch) | |
tree | 78c49c6d2dd3d81a9e6c627f234886cf4c3bb8c0 /src/main/java/com/google/devtools/build/lib/runtime/commands/ProjectFileSupport.java | |
parent | 4bb4b3d7553f74d68b38743dd6500ece1b1be2e7 (diff) |
BlazeCommandDispatcher: make parseArgsAndConfigs not take a CommandEnvironment
Accept an ExtendedEventHandler in ProjectFileSupport, and use an
ExtendedEventHandler in BlazeCommandDispatcher that captures the posts, and
delay posting the GotProjectFileEvent until the initialization is complete.
This is a small step towards simplifying the BlazeModule API - the plan is to
merge beforeCommand, checkEnvironment, and handleOptions into a single method,
but introduce a new method (commandInit) to participate in the early command
initialization.
PiperOrigin-RevId: 160259628
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.java | 7 |
1 files changed, 3 insertions, 4 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 69b00fddc5..9d775df925 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 @@ -13,9 +13,8 @@ // limitations under the License. package com.google.devtools.build.lib.runtime.commands; -import com.google.common.eventbus.EventBus; import com.google.devtools.build.lib.events.Event; -import com.google.devtools.build.lib.events.EventHandler; +import com.google.devtools.build.lib.events.ExtendedEventHandler; import com.google.devtools.build.lib.pkgcache.PackageCacheOptions; import com.google.devtools.build.lib.pkgcache.PathPackageLocator; import com.google.devtools.build.lib.runtime.BlazeCommand; @@ -43,7 +42,7 @@ public final class ProjectFileSupport { * are not enabled, then it throws an exception instead. */ public static void handleProjectFiles( - EventHandler eventHandler, EventBus eventBus, ProjectFile.Provider projectFileProvider, + ExtendedEventHandler eventHandler, ProjectFile.Provider projectFileProvider, Path workspaceDir, Path workingDir, OptionsParser optionsParser, String command) throws OptionsParsingException { List<String> targets = optionsParser.getResidue(); @@ -73,7 +72,7 @@ public final class ProjectFileSupport { optionsParser.parse( OptionPriority.RC_FILE, projectFile.getName(), projectFile.getCommandLineFor(command)); - eventBus.post(new GotProjectFileEvent(projectFile.getName())); + eventHandler.post(new GotProjectFileEvent(projectFile.getName())); } } |