From 3815b4cb1e8af84ddfef411a621f47ba6dcaa161 Mon Sep 17 00:00:00 2001 From: Ulf Adams Date: Fri, 18 Sep 2015 07:34:13 +0000 Subject: Move the commandId and getCommandStartTime() to CommandEnvironment. They are usually on the same line, so doing this in separate changes can cause merge conflicts. -- MOS_MIGRATED_REVID=103362797 --- .../com/google/devtools/build/lib/runtime/commands/BuildCommand.java | 2 +- .../com/google/devtools/build/lib/runtime/commands/InfoCommand.java | 2 +- .../devtools/build/lib/runtime/commands/MobileInstallCommand.java | 2 +- .../com/google/devtools/build/lib/runtime/commands/QueryCommand.java | 4 ++-- .../com/google/devtools/build/lib/runtime/commands/RunCommand.java | 2 +- .../com/google/devtools/build/lib/runtime/commands/TestCommand.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands') diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java index 0082d7149d..2a89754a9a 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/BuildCommand.java @@ -67,7 +67,7 @@ public final class BuildCommand implements BlazeCommand { getClass().getAnnotation(Command.class).name(), options, runtime.getStartupOptionsProvider(), targets, - env.getReporter().getOutErr(), runtime.getCommandId(), runtime.getCommandStartTime()); + env.getReporter().getOutErr(), env.getCommandId(), env.getCommandStartTime()); return new BuildTool(env).processRequest(request, null).getExitCondition(); } } diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java index 8347328e81..d90d27ed9f 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/InfoCommand.java @@ -199,7 +199,7 @@ public class InfoCommand implements BlazeCommand { // In order to be able to answer configuration-specific queries, we need to setup the // package path. Since info inherits all the build options, all the necessary information // is available here. - runtime.setupPackageCache( + env.setupPackageCache( optionsProvider.getOptions(PackageCacheOptions.class), runtime.getDefaultsPackageContent(optionsProvider)); // TODO(bazel-team): What if there are multiple configurations? [multi-config] diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/MobileInstallCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/MobileInstallCommand.java index 9701289c57..0c8519379f 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/MobileInstallCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/MobileInstallCommand.java @@ -80,7 +80,7 @@ public class MobileInstallCommand implements BlazeCommand { BuildRequest request = BuildRequest.create( this.getClass().getAnnotation(Command.class).name(), options, runtime.getStartupOptionsProvider(), targets, - env.getReporter().getOutErr(), runtime.getCommandId(), runtime.getCommandStartTime()); + env.getReporter().getOutErr(), env.getCommandId(), env.getCommandStartTime()); return new BuildTool(env).processRequest(request, null).getExitCondition(); } diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java index dd6ac2549e..84ba83c512 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java @@ -76,7 +76,7 @@ public final class QueryCommand implements BlazeCommand { QueryOptions queryOptions = options.getOptions(QueryOptions.class); try { - runtime.setupPackageCache( + env.setupPackageCache( options.getOptions(PackageCacheOptions.class), runtime.getDefaultsPackageContent()); } catch (InterruptedException e) { @@ -143,7 +143,7 @@ public final class QueryCommand implements BlazeCommand { try { QueryOutputUtils.output(queryOptions, result, formatter, output, queryOptions.aspectDeps.createResolver( - runtime.getPackageManager(), env.getReporter())); + env.getPackageManager(), env.getReporter())); } catch (ClosedByInterruptException | InterruptedException e) { env.getReporter().handle(Event.error("query interrupted")); return ExitCode.INTERRUPTED; diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java index 65a63ec1d8..2a7276d60b 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java @@ -147,7 +147,7 @@ public class RunCommand implements BlazeCommand { BuildRequest request = BuildRequest.create( this.getClass().getAnnotation(Command.class).name(), options, runtime.getStartupOptionsProvider(), targets, outErr, - runtime.getCommandId(), runtime.getCommandStartTime()); + env.getCommandId(), env.getCommandStartTime()); currentRunUnder = runUnder; BuildResult result; diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java index 9d9ca9de6b..33a636e763 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/TestCommand.java @@ -113,7 +113,7 @@ public class TestCommand implements BlazeCommand { BuildRequest request = BuildRequest.create( getClass().getAnnotation(Command.class).name(), options, runtime.getStartupOptionsProvider(), targets, - env.getReporter().getOutErr(), runtime.getCommandId(), runtime.getCommandStartTime()); + env.getReporter().getOutErr(), env.getCommandId(), env.getCommandStartTime()); request.setRunTests(); BuildResult buildResult = new BuildTool(env).processRequest(request, null); -- cgit v1.2.3