remove input files argument to target (#39701)
This commit is contained in:
@@ -113,7 +113,7 @@ abstract class Target {
|
||||
List<Source> get outputs;
|
||||
|
||||
/// The action which performs this build step.
|
||||
Future<void> build(List<File> inputFiles, Environment environment);
|
||||
Future<void> build(Environment environment);
|
||||
|
||||
/// Collect hashes for all inputs to determine if any have changed.
|
||||
///
|
||||
@@ -585,7 +585,7 @@ class _BuildInstance {
|
||||
}
|
||||
} else {
|
||||
printStatus('${target.name}: Starting');
|
||||
await target.build(inputs, environment);
|
||||
await target.build(environment);
|
||||
printStatus('${target.name}: Complete');
|
||||
|
||||
final List<File> outputs = target.resolveOutputs(environment, implicit: true);
|
||||
|
||||
@@ -74,7 +74,7 @@ class CopyAssets extends Target {
|
||||
];
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
final Directory output = environment
|
||||
.buildDir
|
||||
.childDirectory('flutter_assets');
|
||||
@@ -128,7 +128,7 @@ class FlutterPlugins extends Target {
|
||||
];
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
// The pubspec may change for reasons other than plugins changing, so we compare
|
||||
// the manifest before writing. Some hosting build systems use timestamps
|
||||
// so we need to be careful to avoid tricking them into doing more work than
|
||||
|
||||
@@ -81,7 +81,7 @@ class KernelSnapshot extends Target {
|
||||
List<Target> get dependencies => <Target>[];
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
final KernelCompiler compiler = await kernelCompilerFactory.create(
|
||||
FlutterProject.fromDirectory(environment.projectDir),
|
||||
);
|
||||
@@ -118,7 +118,7 @@ abstract class AotElfBase extends Target {
|
||||
const AotElfBase();
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
final AOTSnapshotter snapshotter = AOTSnapshotter(reportTimings: false);
|
||||
final String outputPath = environment.buildDir.path;
|
||||
if (environment.defines[kBuildMode] == null) {
|
||||
|
||||
@@ -20,7 +20,7 @@ abstract class AotAssemblyBase extends Target {
|
||||
const AotAssemblyBase();
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
final AOTSnapshotter snapshotter = AOTSnapshotter(reportTimings: false);
|
||||
final String outputPath = environment.buildDir.path;
|
||||
if (environment.defines[kBuildMode] == null) {
|
||||
|
||||
@@ -36,12 +36,11 @@ class UnpackLinux extends Target {
|
||||
List<Target> get dependencies => <Target>[];
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
final String basePath = artifacts.getArtifactPath(Artifact.linuxDesktopPath);
|
||||
for (File input in inputFiles) {
|
||||
if (fs.path.basename(input.path) == 'linux.dart') {
|
||||
continue;
|
||||
}
|
||||
for (File input in fs.directory(basePath)
|
||||
.listSync(recursive: true)
|
||||
.whereType<File>()) {
|
||||
final String outputPath = fs.path.join(
|
||||
environment.projectDir.path,
|
||||
'linux',
|
||||
|
||||
@@ -113,7 +113,7 @@ abstract class UnpackMacOS extends Target {
|
||||
List<Target> get dependencies => <Target>[];
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
if (environment.defines[kBuildMode] == null) {
|
||||
throw MissingDefineException(kBuildMode, 'unpack_macos');
|
||||
}
|
||||
@@ -191,7 +191,7 @@ class DebugMacOSFramework extends Target {
|
||||
String get name => 'debug_macos_framework';
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
final File outputFile = fs.file(fs.path.join(
|
||||
environment.buildDir.path, 'App.framework', 'App'));
|
||||
outputFile.createSync(recursive: true);
|
||||
@@ -236,7 +236,7 @@ class CompileMacOSFramework extends Target {
|
||||
String get name => 'compile_macos_framework';
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
if (environment.defines[kBuildMode] == null) {
|
||||
throw MissingDefineException(kBuildMode, 'compile_macos_framework');
|
||||
}
|
||||
@@ -302,7 +302,7 @@ abstract class MacOSBundleFlutterAssets extends Target {
|
||||
];
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
if (environment.defines[kBuildMode] == null) {
|
||||
throw MissingDefineException(kBuildMode, 'compile_macos_framework');
|
||||
}
|
||||
|
||||
@@ -39,13 +39,12 @@ class UnpackWindows extends Target {
|
||||
List<Target> get dependencies => const <Target>[];
|
||||
|
||||
@override
|
||||
Future<void> build(List<File> inputFiles, Environment environment) async {
|
||||
Future<void> build(Environment environment) async {
|
||||
// This path needs to match the prefix in the rule below.
|
||||
final String basePath = artifacts.getArtifactPath(Artifact.windowsDesktopPath);
|
||||
for (File input in inputFiles) {
|
||||
if (fs.path.basename(input.path) == 'windows.dart') {
|
||||
continue;
|
||||
}
|
||||
for (File input in fs.directory(basePath)
|
||||
.listSync(recursive: true)
|
||||
.whereType<File>()) {
|
||||
final String outputPath = fs.path.join(
|
||||
environment.projectDir.path,
|
||||
'windows',
|
||||
|
||||
Reference in New Issue
Block a user