anchor.diff:      }
   
       metrics.addAll(<String, dynamic>{
  -      'release_full_compile_millis': watch.elapsedMilliseconds,
  +      'release_${deleteGradleCache ? 'initial' : 'full'}_compile_millis': watch.elapsedMilliseconds,
         'release_size_bytes': releaseSizeInBytes,
       });
   
       return metrics;
     }
   
  -  static Future<Map<String, dynamic>> _compileDebug({
  +  Future<Map<String, dynamic>> _compileDebug({
  +    required bool deleteGradleCache,
       required bool clean,
       required String metricKey,
     }) async {
       if (clean) {
         await flutter('clean');
  +    }
  +    if (deleteGradleCache) {
  +      final Directory gradleCacheDir = Directory('$testDirectory/android/.gradle');
  +      gradleCacheDir.deleteSync(recursive: true);
       }
       final Stopwatch watch = Stopwatch();
       final List<String> options = <String>['--debug'];
  
positive.code:     return inDirectory<TaskResult>(testDirectory, () async {
        await flutter('packages', options: <String>['get']);
  
        final Map<String, dynamic> compileRelease = await _compileApp(reportPackageContentSizes: reportPackageContentSizes);
        final Map<String, dynamic> compileDebug = await _compileDebug(
          clean: true,
          metricKey: 'debug_full_compile_millis',
        );
        // Build again without cleaning, should be faster.
        final Map<String, dynamic> compileSecondDebug = await _compileDebug(
          clean: false,
          metricKey: 'debug_second_compile_millis',
        );
  
        final Map<String, dynamic> metrics = <String, dynamic>{
          ...compileRelease,
          ...compileDebug,
          ...compileSecondDebug,
        };
  
  
negative.code:     });
    }
  
    Future<Map<String, dynamic>> _compileApp({required bool deleteGradleCache}) async {
      await flutter('clean');
      if (deleteGradleCache) {
        final Directory gradleCacheDir = Directory('$testDirectory/android/.gradle');
        gradleCacheDir.deleteSync(recursive: true);
      }
      final Stopwatch watch = Stopwatch();
      int releaseSizeInBytes;
      final List<String> options = <String>['--release'];
  