run method
Runs this command.
The return value is wrapped in a Future
if necessary and returned by
CommandRunner.runCommand
.
Implementation
@override
Future<bool> run() async {
final blockLogger = logger.headerBlock("Shared");
final sharedDir = Utils.pathFromRoot(KnownPaths.shared, rootDir);
final isNoCacheSet = Platform.environment.containsKey('NO_CACHE');
final testSequence = [DartTestTask(this, blockLogger)];
final fullSequence = [
CleanDirTask(this, blockLogger),
PubGetTask(this, blockLogger),
...(isNoCacheSet
? [
BuildRunnerCleanTask(this, blockLogger),
BuildRunnerBuildTask(this, blockLogger)
]
: [BuildRunnerBuildTask(this, blockLogger)]),
...testSequence
];
useSequence(testOnly ? testSequence : fullSequence);
final result = await runSequence({
PubGetTask.taskName: {'target': sharedDir},
CleanDirTask.taskName: {'target': sharedDir},
DartTestTask.taskName: {'target': sharedDir},
BuildRunnerCleanTask.taskName: {'target': sharedDir},
BuildRunnerBuildTask.taskName: {'target': sharedDir},
});
return blockLogger.close(result);
}