Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
5e7beaf7
Unverified
Commit
5e7beaf7
authored
Sep 03, 2019
by
Jonah Williams
Committed by
GitHub
Sep 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove input files argument to target (#39701)
parent
63c3de10
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
36 additions
and
38 deletions
+36
-38
build_system.dart
...ages/flutter_tools/lib/src/build_system/build_system.dart
+2
-2
assets.dart
...es/flutter_tools/lib/src/build_system/targets/assets.dart
+2
-2
dart.dart
...ages/flutter_tools/lib/src/build_system/targets/dart.dart
+2
-2
ios.dart
packages/flutter_tools/lib/src/build_system/targets/ios.dart
+1
-1
linux.dart
...ges/flutter_tools/lib/src/build_system/targets/linux.dart
+4
-5
macos.dart
...ges/flutter_tools/lib/src/build_system/targets/macos.dart
+4
-4
windows.dart
...s/flutter_tools/lib/src/build_system/targets/windows.dart
+4
-5
build_system_test.dart
...ls/test/general.shard/build_system/build_system_test.dart
+7
-7
exceptions_test.dart
...ools/test/general.shard/build_system/exceptions_test.dart
+2
-2
assets_test.dart
.../test/general.shard/build_system/targets/assets_test.dart
+1
-1
dart_test.dart
...ls/test/general.shard/build_system/targets/dart_test.dart
+2
-2
macos_test.dart
...s/test/general.shard/build_system/targets/macos_test.dart
+5
-5
No files found.
packages/flutter_tools/lib/src/build_system/build_system.dart
View file @
5e7beaf7
...
...
@@ -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
);
...
...
packages/flutter_tools/lib/src/build_system/targets/assets.dart
View file @
5e7beaf7
...
...
@@ -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
...
...
packages/flutter_tools/lib/src/build_system/targets/dart.dart
View file @
5e7beaf7
...
...
@@ -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
)
{
...
...
packages/flutter_tools/lib/src/build_system/targets/ios.dart
View file @
5e7beaf7
...
...
@@ -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
)
{
...
...
packages/flutter_tools/lib/src/build_system/targets/linux.dart
View file @
5e7beaf7
...
...
@@ -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'
,
...
...
packages/flutter_tools/lib/src/build_system/targets/macos.dart
View file @
5e7beaf7
...
...
@@ -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'
);
}
...
...
packages/flutter_tools/lib/src/build_system/targets/windows.dart
View file @
5e7beaf7
...
...
@@ -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'
,
...
...
packages/flutter_tools/test/general.shard/build_system/build_system_test.dart
View file @
5e7beaf7
...
...
@@ -40,7 +40,7 @@ void main() {
when
(
mockPlatform
.
isWindows
).
thenReturn
(
false
);
/// Create various testing targets.
fooTarget
=
TestTarget
((
List
<
File
>
inputFiles
,
Environment
environment
)
async
{
fooTarget
=
TestTarget
((
Environment
environment
)
async
{
environment
.
buildDir
.
childFile
(
'out'
)
...
...
@@ -56,7 +56,7 @@ void main() {
Source
.
pattern
(
'{BUILD_DIR}/out'
),
]
..
dependencies
=
<
Target
>[];
barTarget
=
TestTarget
((
List
<
File
>
inputFiles
,
Environment
environment
)
async
{
barTarget
=
TestTarget
((
Environment
environment
)
async
{
environment
.
buildDir
.
childFile
(
'bar'
)
..
createSync
(
recursive:
true
)
...
...
@@ -71,7 +71,7 @@ void main() {
Source
.
pattern
(
'{BUILD_DIR}/bar'
),
]
..
dependencies
=
<
Target
>[];
fizzTarget
=
TestTarget
((
List
<
File
>
inputFiles
,
Environment
environment
)
async
{
fizzTarget
=
TestTarget
((
Environment
environment
)
async
{
throw
Exception
(
'something bad happens'
);
})
..
name
=
'fizz'
...
...
@@ -82,7 +82,7 @@ void main() {
Source
.
pattern
(
'{BUILD_DIR}/fizz'
),
]
..
dependencies
=
<
Target
>[
fooTarget
];
sharedTarget
=
TestTarget
((
List
<
File
>
inputFiles
,
Environment
environment
)
async
{
sharedTarget
=
TestTarget
((
Environment
environment
)
async
{
shared
+=
1
;
})
..
name
=
'shared'
...
...
@@ -116,7 +116,7 @@ void main() {
}));
test
(
'Throws exception if it does not produce a specified output'
,
()
=>
testbed
.
run
(()
async
{
final
Target
badTarget
=
TestTarget
((
List
<
File
>
inputFiles
,
Environment
environment
)
async
{})
final
Target
badTarget
=
TestTarget
((
Environment
environment
)
async
{})
..
inputs
=
const
<
Source
>[
Source
.
pattern
(
'{PROJECT_DIR}/foo.dart'
),
]
...
...
@@ -251,10 +251,10 @@ T nonconst<T>(T input) => input;
class
TestTarget
extends
Target
{
TestTarget
([
this
.
_build
]);
final
Future
<
void
>
Function
(
List
<
File
>
inputFiles
,
Environment
environment
)
_build
;
final
Future
<
void
>
Function
(
Environment
environment
)
_build
;
@override
Future
<
void
>
build
(
List
<
File
>
inputFiles
,
Environment
environment
)
=>
_build
(
inputFiles
,
environment
);
Future
<
void
>
build
(
Environment
environment
)
=>
_build
(
environment
);
@override
List
<
Target
>
dependencies
=
<
Target
>[];
...
...
packages/flutter_tools/test/general.shard/build_system/exceptions_test.dart
View file @
5e7beaf7
...
...
@@ -64,10 +64,10 @@ void main() {
class
TestTarget
extends
Target
{
TestTarget
([
this
.
_build
]);
final
Future
<
void
>
Function
(
List
<
File
>
inputFiles
,
Environment
environment
)
_build
;
final
Future
<
void
>
Function
(
Environment
environment
)
_build
;
@override
Future
<
void
>
build
(
List
<
File
>
inputFiles
,
Environment
environment
)
=>
_build
(
inputFiles
,
environment
);
Future
<
void
>
build
(
Environment
environment
)
=>
_build
(
environment
);
@override
List
<
Target
>
dependencies
=
<
Target
>[];
...
...
packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart
View file @
5e7beaf7
...
...
@@ -71,7 +71,7 @@ flutter:
fs
.
file
(
'pubspec.yaml'
)
..
writeAsStringSync
(
'name: foo
\n
dependencies:
\n
foo: any
\n
'
);
await
const
FlutterPlugins
().
build
(
<
File
>[],
Environment
(
await
const
FlutterPlugins
().
build
(
Environment
(
outputDir:
fs
.
currentDirectory
,
projectDir:
fs
.
currentDirectory
,
));
...
...
packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart
View file @
5e7beaf7
...
...
@@ -135,7 +135,7 @@ flutter_tools:lib/''');
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
});
await
const
KernelSnapshot
().
build
(
<
File
>[],
androidEnvironment
);
await
const
KernelSnapshot
().
build
(
androidEnvironment
);
},
overrides:
<
Type
,
Generator
>{
KernelCompilerFactory:
()
=>
MockKernelCompilerFactory
(),
}));
...
...
@@ -159,7 +159,7 @@ flutter_tools:lib/''');
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
});
await
const
KernelSnapshot
().
build
(
<
File
>[],
Environment
(
await
const
KernelSnapshot
().
build
(
Environment
(
outputDir:
fs
.
currentDirectory
,
projectDir:
fs
.
currentDirectory
,
defines:
<
String
,
String
>{
...
...
packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart
View file @
5e7beaf7
...
...
@@ -102,7 +102,7 @@ void main() {
}
return
FakeProcessResult
()..
exitCode
=
0
;
});
await
const
DebugUnpackMacOS
().
build
(
<
File
>[],
environment
);
await
const
DebugUnpackMacOS
().
build
(
environment
);
expect
(
fs
.
directory
(
'
$_kOutputPrefix
'
).
existsSync
(),
true
);
for
(
File
file
in
inputs
)
{
...
...
@@ -116,7 +116,7 @@ void main() {
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'testing'
);
expect
(()
async
=>
await
const
DebugMacOSBundleFlutterAssets
().
build
(
<
File
>[],
environment
),
expect
(()
async
=>
await
const
DebugMacOSBundleFlutterAssets
().
build
(
environment
),
throwsA
(
isInstanceOf
<
Exception
>()));
}));
...
...
@@ -137,7 +137,7 @@ void main() {
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'testing'
);
await
const
DebugMacOSBundleFlutterAssets
().
build
(
<
File
>[],
environment
);
await
const
DebugMacOSBundleFlutterAssets
().
build
(
environment
);
expect
(
fs
.
file
(
outputKernel
).
readAsStringSync
(),
'testing'
);
expect
(
fs
.
file
(
outputPlist
).
readAsStringSync
(),
contains
(
'io.flutter.flutter.app'
));
...
...
@@ -156,7 +156,7 @@ void main() {
'flutter_assets'
,
'vm_snapshot_data'
);
final
String
precompiledIsolate
=
fs
.
path
.
join
(
'App.framework'
,
'Resources'
,
'flutter_assets'
,
'isolate_snapshot_data'
);
await
const
ProfileMacOSBundleFlutterAssets
().
build
(
<
File
>[],
environment
..
defines
[
kBuildMode
]
=
'profile'
);
await
const
ProfileMacOSBundleFlutterAssets
().
build
(
environment
..
defines
[
kBuildMode
]
=
'profile'
);
expect
(
fs
.
file
(
outputKernel
).
existsSync
(),
false
);
expect
(
fs
.
file
(
precompiledVm
).
existsSync
(),
false
);
...
...
@@ -186,7 +186,7 @@ void main() {
# Generated
sky_engine:file:///bin/cache/pkg/sky_engine/lib/
flutter_tools:lib/'''
);
await
const
CompileMacOSFramework
().
build
(
<
File
>[],
environment
..
defines
[
kBuildMode
]
=
'release'
);
await
const
CompileMacOSFramework
().
build
(
environment
..
defines
[
kBuildMode
]
=
'release'
);
},
overrides:
<
Type
,
Generator
>{
GenSnapshot:
()
=>
MockGenSnapshot
(),
Xcode:
()
=>
MockXCode
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment