Matan Lurey 0e59f0f64c
flutter build aar regenerates tooling between each build-mode step (#162705)
Closes https://github.com/flutter/flutter/issues/162703.

I still need to do a similar change for `ios|macos`-`framework` in
https://github.com/flutter/flutter/issues/162704.

I added two unit tests, as well as opted in an integration test to the
flag (it will become the default in
https://github.com/flutter/flutter/pull/160289).

/cc @reidbaker @gmackall.
2025-02-06 17:03:02 +00:00

53 lines
1.6 KiB
Dart

// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../base/context.dart';
import '../build_info.dart';
import '../project.dart';
/// The builder in the current context.
AndroidBuilder? get androidBuilder {
return context.get<AndroidBuilder>();
}
abstract class AndroidBuilder {
const AndroidBuilder();
/// Builds an AAR artifact.
Future<void> buildAar({
required FlutterProject project,
required Set<AndroidBuildInfo> androidBuildInfo,
required String target,
required Future<void> Function(FlutterProject, {required bool releaseMode}) generateTooling,
String? outputDirectoryPath,
required String buildNumber,
});
/// Builds an APK artifact.
Future<void> buildApk({
required FlutterProject project,
required AndroidBuildInfo androidBuildInfo,
required String target,
bool configOnly = false,
});
/// Builds an App Bundle artifact.
Future<void> buildAab({
required FlutterProject project,
required AndroidBuildInfo androidBuildInfo,
required String target,
bool validateDeferredComponents = true,
bool deferredComponentsEnabled = false,
bool configOnly = false,
});
/// Returns a list of available build variant from the Android project.
Future<List<String>> getBuildVariants({required FlutterProject project});
/// Outputs app link related project settings into a json file.
///
/// The return future resolves to the path of the json file.
Future<String> outputsAppLinkSettings(String buildVariant, {required FlutterProject project});
}