anchor.diff:      return fs.path.dirname(fs.path.fromUri(packageMap.map[package]));
     }
   
  -  Future<bool> _isBuildRequired(SnapshotType type, String outputSnapshotPath, String depfilePath, String mainPath, String fingerprintPath) async {
  +  Future<bool> _isBuildRequired(SnapshotType type, Set<String> outputPaths, String depfilePath, String mainPath, String fingerprintPath) async {
       final File fingerprintFile = fs.file(fingerprintPath);
  -    final File outputSnapshotFile = fs.file(outputSnapshotPath);
  -    final File depfile = fs.file(depfilePath);
  -    if (!outputSnapshotFile.existsSync() || !depfile.existsSync() || !fingerprintFile.existsSync())
  +    final List<String> requiredFiles = <String>[fingerprintPath, depfilePath]..addAll(outputPaths);
  +    if (!requiredFiles.every(fs.isFileSync))
         return true;
   
       try {
         if (fingerprintFile.existsSync()) {
           final Fingerprint oldFingerprint = new Fingerprint.fromJson(await fingerprintFile.readAsString());
  -        final Set<String> inputFilePaths = await readDepfile(depfilePath)..addAll(<String>[outputSnapshotPath, mainPath]);
  +        final Set<String> inputFilePaths = await readDepfile(depfilePath)..add(mainPath)..addAll(outputPaths);
           final Fingerprint newFingerprint = createFingerprint(type, mainPath, inputFilePaths);
           return oldFingerprint != newFingerprint;
         }
  
positive.code:       ]);
      }
  
      final String entryPoint = mainPath;
      final SnapshotType snapshotType = new SnapshotType(platform, buildMode);
      Future<Fingerprint> makeFingerprint() async {
        final Set<String> snapshotInputPaths = await readDepfile(dependencies)
          ..add(entryPoint)
          ..addAll(outputPaths);
        return Snapshotter.createFingerprint(snapshotType, entryPoint, snapshotInputPaths);
      }
  
      final File fingerprintFile = fs.file('$dependencies.fingerprint');
      final List<File> fingerprintFiles = <File>[fingerprintFile, fs.file(dependencies)]
        ..addAll(inputPaths.map(fs.file))
        ..addAll(outputPaths.map(fs.file));
      if (fingerprintFiles.every((File file) => file.existsSync())) {
        try {
          final String json = await fingerprintFile.readAsString();
          final Fingerprint oldFingerprint = new Fingerprint.fromJson(json);
          if (oldFingerprint == await makeFingerprint()) {
            printStatus('Skipping AOT snapshot build. Fingerprint match.');
            return 0;
          }
        } catch (e) {
          // Log exception and continue, this step is a performance improvement only.
          printTrace('Rebuilding snapshot due to fingerprint check error: $e');
        }
      }
  
      if (previewDart2) {
        final CompilerOutput compilerOutput = await kernelCompiler.compile(
          sdkRoot: artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
  
negative.code:       ]);
      }
  
      genSnapshotArgs.add(entrypointPath);
  
      final int genSnapshotExitCode = await genSnapshot.run(
        snapshotType: new SnapshotType(platform, buildMode),
  