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
f877c97b
Unverified
Commit
f877c97b
authored
Sep 10, 2019
by
Jonah Williams
Committed by
GitHub
Sep 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use persisted build information to automatically clean old outputs in assemble (#39654)
parent
03e81003
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
235 additions
and
135 deletions
+235
-135
build_system.dart
...ages/flutter_tools/lib/src/build_system/build_system.dart
+188
-124
linux.dart
...ges/flutter_tools/lib/src/build_system/targets/linux.dart
+0
-1
macos.dart
...ges/flutter_tools/lib/src/build_system/targets/macos.dart
+0
-8
windows.dart
...s/flutter_tools/lib/src/build_system/targets/windows.dart
+0
-1
build_system_test.dart
...ls/test/general.shard/build_system/build_system_test.dart
+47
-1
No files found.
packages/flutter_tools/lib/src/build_system/build_system.dart
View file @
f877c97b
This diff is collapsed.
Click to expand it.
packages/flutter_tools/lib/src/build_system/targets/linux.dart
View file @
f877c97b
...
@@ -29,7 +29,6 @@ class UnpackLinux extends Target {
...
@@ -29,7 +29,6 @@ class UnpackLinux extends Target {
Source
.
pattern
(
'{PROJECT_DIR}/linux/flutter/flutter_plugin_registrar.h'
),
Source
.
pattern
(
'{PROJECT_DIR}/linux/flutter/flutter_plugin_registrar.h'
),
Source
.
pattern
(
'{PROJECT_DIR}/linux/flutter/flutter_glfw.h'
),
Source
.
pattern
(
'{PROJECT_DIR}/linux/flutter/flutter_glfw.h'
),
Source
.
pattern
(
'{PROJECT_DIR}/linux/flutter/icudtl.dat'
),
Source
.
pattern
(
'{PROJECT_DIR}/linux/flutter/icudtl.dat'
),
Source
.
pattern
(
'{PROJECT_DIR}/linux/flutter/cpp_client_wrapper_glfw/*'
),
];
];
@override
@override
...
...
packages/flutter_tools/lib/src/build_system/targets/macos.dart
View file @
f877c97b
...
@@ -122,9 +122,6 @@ abstract class UnpackMacOS extends Target {
...
@@ -122,9 +122,6 @@ abstract class UnpackMacOS extends Target {
final
Directory
targetDirectory
=
environment
final
Directory
targetDirectory
=
environment
.
outputDir
.
outputDir
.
childDirectory
(
'FlutterMacOS.framework'
);
.
childDirectory
(
'FlutterMacOS.framework'
);
if
(
targetDirectory
.
existsSync
())
{
targetDirectory
.
deleteSync
(
recursive:
true
);
}
final
ProcessResult
result
=
await
processManager
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
'cp'
,
'-R'
,
basePath
,
targetDirectory
.
path
]);
.
run
(<
String
>[
'cp'
,
'-R'
,
basePath
,
targetDirectory
.
path
]);
...
@@ -325,11 +322,6 @@ abstract class MacOSBundleFlutterAssets extends Target {
...
@@ -325,11 +322,6 @@ abstract class MacOSBundleFlutterAssets extends Target {
final
Directory
assetDirectory
=
outputDirectory
final
Directory
assetDirectory
=
outputDirectory
.
childDirectory
(
'Resources'
)
.
childDirectory
(
'Resources'
)
.
childDirectory
(
'flutter_assets'
);
.
childDirectory
(
'flutter_assets'
);
// We're not smart enough to only remove assets that are removed. If
// anything changes blow away the whole directory.
if
(
assetDirectory
.
existsSync
())
{
assetDirectory
.
deleteSync
(
recursive:
true
);
}
assetDirectory
.
createSync
(
recursive:
true
);
assetDirectory
.
createSync
(
recursive:
true
);
final
AssetBundle
assetBundle
=
AssetBundleFactory
.
instance
.
createBundle
();
final
AssetBundle
assetBundle
=
AssetBundleFactory
.
instance
.
createBundle
();
final
int
result
=
await
assetBundle
.
build
(
final
int
result
=
await
assetBundle
.
build
(
...
...
packages/flutter_tools/lib/src/build_system/targets/windows.dart
View file @
f877c97b
...
@@ -32,7 +32,6 @@ class UnpackWindows extends Target {
...
@@ -32,7 +32,6 @@ class UnpackWindows extends Target {
Source
.
pattern
(
'{PROJECT_DIR}/windows/flutter/flutter_plugin_registrar.h'
),
Source
.
pattern
(
'{PROJECT_DIR}/windows/flutter/flutter_plugin_registrar.h'
),
Source
.
pattern
(
'{PROJECT_DIR}/windows/flutter/flutter_windows.h'
),
Source
.
pattern
(
'{PROJECT_DIR}/windows/flutter/flutter_windows.h'
),
Source
.
pattern
(
'{PROJECT_DIR}/windows/flutter/icudtl.dat'
),
Source
.
pattern
(
'{PROJECT_DIR}/windows/flutter/icudtl.dat'
),
Source
.
pattern
(
'{PROJECT_DIR}/windows/flutter/cpp_client_wrapper/*'
),
];
];
@override
@override
...
...
packages/flutter_tools/test/general.shard/build_system/build_system_test.dart
View file @
f877c97b
...
@@ -126,7 +126,7 @@ void main() {
...
@@ -126,7 +126,7 @@ void main() {
final
BuildResult
result
=
await
buildSystem
.
build
(
badTarget
,
environment
);
final
BuildResult
result
=
await
buildSystem
.
build
(
badTarget
,
environment
);
expect
(
result
.
hasException
,
true
);
expect
(
result
.
hasException
,
true
);
expect
(
result
.
exceptions
.
values
.
single
.
exception
,
isInstanceOf
<
MissingOutput
Exception
>());
expect
(
result
.
exceptions
.
values
.
single
.
exception
,
isInstanceOf
<
FileSystem
Exception
>());
}));
}));
test
(
'Saves a stamp file with inputs and outputs'
,
()
=>
testbed
.
run
(()
async
{
test
(
'Saves a stamp file with inputs and outputs'
,
()
=>
testbed
.
run
(()
async
{
...
@@ -211,6 +211,52 @@ void main() {
...
@@ -211,6 +211,52 @@ void main() {
expect
(
shared
,
1
);
expect
(
shared
,
1
);
}));
}));
test
(
'Automatically cleans old outputs when dag changes'
,
()
=>
testbed
.
run
(()
async
{
final
TestTarget
testTarget
=
TestTarget
((
Environment
envionment
)
async
{
environment
.
buildDir
.
childFile
(
'foo.out'
).
createSync
();
})
..
inputs
=
const
<
Source
>[
Source
.
pattern
(
'{PROJECT_DIR}/foo.dart'
)]
..
outputs
=
const
<
Source
>[
Source
.
pattern
(
'{BUILD_DIR}/foo.out'
)];
fs
.
file
(
'foo.dart'
).
createSync
();
await
buildSystem
.
build
(
testTarget
,
environment
);
expect
(
environment
.
buildDir
.
childFile
(
'foo.out'
).
existsSync
(),
true
);
final
TestTarget
testTarget2
=
TestTarget
((
Environment
envionment
)
async
{
environment
.
buildDir
.
childFile
(
'bar.out'
).
createSync
();
})
..
inputs
=
const
<
Source
>[
Source
.
pattern
(
'{PROJECT_DIR}/foo.dart'
)]
..
outputs
=
const
<
Source
>[
Source
.
pattern
(
'{BUILD_DIR}/bar.out'
)];
await
buildSystem
.
build
(
testTarget2
,
environment
);
expect
(
environment
.
buildDir
.
childFile
(
'bar.out'
).
existsSync
(),
true
);
expect
(
environment
.
buildDir
.
childFile
(
'foo.out'
).
existsSync
(),
false
);
}));
test
(
'reruns build if stamp is corrupted'
,
()
=>
testbed
.
run
(()
async
{
final
TestTarget
testTarget
=
TestTarget
((
Environment
envionment
)
async
{
environment
.
buildDir
.
childFile
(
'foo.out'
).
createSync
();
})
..
inputs
=
const
<
Source
>[
Source
.
pattern
(
'{PROJECT_DIR}/foo.dart'
)]
..
outputs
=
const
<
Source
>[
Source
.
pattern
(
'{BUILD_DIR}/foo.out'
)];
fs
.
file
(
'foo.dart'
).
createSync
();
await
buildSystem
.
build
(
testTarget
,
environment
);
// invalid JSON
environment
.
buildDir
.
childFile
(
'test.stamp'
).
writeAsStringSync
(
'{X'
);
await
buildSystem
.
build
(
testTarget
,
environment
);
// empty file
environment
.
buildDir
.
childFile
(
'test.stamp'
).
writeAsStringSync
(
''
);
await
buildSystem
.
build
(
testTarget
,
environment
);
// invalid format
environment
.
buildDir
.
childFile
(
'test.stamp'
).
writeAsStringSync
(
'{"inputs": 2, "outputs": 3}'
);
await
buildSystem
.
build
(
testTarget
,
environment
);
}));
test
(
'handles a throwing build action'
,
()
=>
testbed
.
run
(()
async
{
test
(
'handles a throwing build action'
,
()
=>
testbed
.
run
(()
async
{
final
BuildResult
result
=
await
buildSystem
.
build
(
fizzTarget
,
environment
);
final
BuildResult
result
=
await
buildSystem
.
build
(
fizzTarget
,
environment
);
...
...
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