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
270878fc
Unverified
Commit
270878fc
authored
Sep 12, 2019
by
Jonah Williams
Committed by
GitHub
Sep 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix copy command and remove resolve sync for macOS assemble (#40294)
parent
b9399216
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
9 deletions
+67
-9
build_system.dart
...ages/flutter_tools/lib/src/build_system/build_system.dart
+29
-4
macos.dart
...ges/flutter_tools/lib/src/build_system/targets/macos.dart
+4
-1
assemble.dart
packages/flutter_tools/lib/src/commands/assemble.dart
+1
-1
macos_test.dart
...s/test/general.shard/build_system/targets/macos_test.dart
+33
-3
No files found.
packages/flutter_tools/lib/src/build_system/build_system.dart
View file @
270878fc
...
...
@@ -146,11 +146,11 @@ abstract class Target {
final
File
stamp
=
_findStampFile
(
environment
);
final
List
<
String
>
inputPaths
=
<
String
>[];
for
(
File
input
in
inputs
)
{
inputPaths
.
add
(
input
.
resolveSymbolicLinksSync
()
);
inputPaths
.
add
(
input
.
path
);
}
final
List
<
String
>
outputPaths
=
<
String
>[];
for
(
File
output
in
outputs
)
{
outputPaths
.
add
(
output
.
resolveSymbolicLinksSync
()
);
outputPaths
.
add
(
output
.
path
);
}
final
Map
<
String
,
Object
>
result
=
<
String
,
Object
>{
'inputs'
:
inputPaths
,
...
...
@@ -502,7 +502,7 @@ class _BuildInstance {
outputFiles
[
output
.
path
]
=
output
;
}
}
else
{
printStatus
(
'
${node.target.name}
: Starting'
);
printStatus
(
'
${node.target.name}
: Starting
due to
${node.invalidatedReasons}
'
);
await
node
.
target
.
build
(
environment
);
printStatus
(
'
${node.target.name}
: Complete'
);
...
...
@@ -653,9 +653,14 @@ class Node {
/// Output file paths from the previous invocation of this build node.
final
Set
<
String
>
previousOutputs
=
<
String
>{};
/// In
o
ut file paths from the previous invocation of this build node.
/// In
p
ut file paths from the previous invocation of this build node.
final
Set
<
String
>
previousInputs
=
<
String
>{};
/// One or more reasons why a task was invalidated.
///
/// May be empty if the task was skipped.
final
Set
<
InvalidedReason
>
invalidatedReasons
=
<
InvalidedReason
>{};
/// Whether this node needs an action performed.
bool
get
dirty
=>
_dirty
;
bool
_dirty
=
false
;
...
...
@@ -685,6 +690,7 @@ class Node {
if
(
fileHashStore
.
currentHashes
.
containsKey
(
absolutePath
))
{
final
String
currentHash
=
fileHashStore
.
currentHashes
[
absolutePath
];
if
(
currentHash
!=
previousHash
)
{
invalidatedReasons
.
add
(
InvalidedReason
.
inputChanged
);
_dirty
=
true
;
}
}
else
{
...
...
@@ -698,11 +704,13 @@ class Node {
// output paths changed.
if
(!
currentOutputPaths
.
contains
(
previousOutput
))
{
_dirty
=
true
;
invalidatedReasons
.
add
(
InvalidedReason
.
outputSetChanged
);
// if this isn't a current output file there is no reason to compute the hash.
continue
;
}
final
File
file
=
fs
.
file
(
previousOutput
);
if
(!
file
.
existsSync
())
{
invalidatedReasons
.
add
(
InvalidedReason
.
outputMissing
);
_dirty
=
true
;
continue
;
}
...
...
@@ -711,6 +719,7 @@ class Node {
if
(
fileHashStore
.
currentHashes
.
containsKey
(
absolutePath
))
{
final
String
currentHash
=
fileHashStore
.
currentHashes
[
absolutePath
];
if
(
currentHash
!=
previousHash
)
{
invalidatedReasons
.
add
(
InvalidedReason
.
outputChanged
);
_dirty
=
true
;
}
}
else
{
...
...
@@ -728,9 +737,25 @@ class Node {
if
(
sourcesToHash
.
isNotEmpty
)
{
final
List
<
File
>
dirty
=
await
fileHashStore
.
hashFiles
(
sourcesToHash
);
if
(
dirty
.
isNotEmpty
)
{
invalidatedReasons
.
add
(
InvalidedReason
.
inputChanged
);
_dirty
=
true
;
}
}
return
!
_dirty
;
}
}
/// A description of why a task was rerun.
enum
InvalidedReason
{
/// An input file has an updated hash.
inputChanged
,
/// An output file has an updated hash.
outputChanged
,
/// An output file that is expected is missing.
outputMissing
,
/// The set of expected output files changed.
outputSetChanged
,
}
packages/flutter_tools/lib/src/build_system/targets/macos.dart
View file @
270878fc
...
...
@@ -122,7 +122,9 @@ abstract class UnpackMacOS extends Target {
final
Directory
targetDirectory
=
environment
.
outputDir
.
childDirectory
(
'FlutterMacOS.framework'
);
if
(
targetDirectory
.
existsSync
())
{
targetDirectory
.
deleteSync
(
recursive:
true
);
}
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
'cp'
,
'-R'
,
basePath
,
targetDirectory
.
path
]);
if
(
result
.
exitCode
!=
0
)
{
...
...
@@ -285,6 +287,7 @@ abstract class MacOSBundleFlutterAssets extends Target {
@override
List
<
Source
>
get
inputs
=>
const
<
Source
>[
Source
.
pattern
(
'{PROJECT_DIR}/pubspec.yaml'
),
Source
.
pattern
(
'{BUILD_DIR}/App.framework/App'
),
Source
.
behavior
(
MacOSAssetBehavior
())
];
...
...
packages/flutter_tools/lib/src/commands/assemble.dart
View file @
270878fc
...
...
@@ -149,7 +149,7 @@ void writeListIfChanged(List<File> files, String path) {
final
StringBuffer
buffer
=
StringBuffer
();
// These files are already sorted.
for
(
File
file
in
files
)
{
buffer
.
writeln
(
file
.
resolveSymbolicLinksSync
()
);
buffer
.
writeln
(
file
.
path
);
}
final
String
newContents
=
buffer
.
toString
();
if
(!
file
.
existsSync
())
{
...
...
packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart
View file @
270878fc
...
...
@@ -85,11 +85,21 @@ void main() {
for
(
File
input
in
inputs
)
{
input
.
createSync
(
recursive:
true
);
}
// Create output directory so we can test that it is deleted.
environment
.
outputDir
.
childDirectory
(
_kOutputPrefix
)
.
createSync
(
recursive:
true
);
when
(
processManager
.
run
(
any
)).
thenAnswer
((
Invocation
invocation
)
async
{
final
List
<
String
>
arguments
=
invocation
.
positionalArguments
.
first
;
final
Directory
source
=
fs
.
directory
(
arguments
[
arguments
.
length
-
2
]);
final
Directory
target
=
fs
.
directory
(
arguments
.
last
)
..
createSync
(
recursive:
true
);
final
String
sourcePath
=
arguments
[
arguments
.
length
-
2
];
final
String
targetPath
=
arguments
.
last
;
final
Directory
source
=
fs
.
directory
(
sourcePath
);
final
Directory
target
=
fs
.
directory
(
targetPath
);
// verify directory was deleted by command.
expect
(
target
.
existsSync
(),
false
);
target
.
createSync
(
recursive:
true
);
for
(
FileSystemEntity
entity
in
source
.
listSync
(
recursive:
true
))
{
if
(
entity
is
File
)
{
final
String
relative
=
fs
.
path
.
relative
(
entity
.
path
,
from:
source
.
path
);
...
...
@@ -163,6 +173,26 @@ void main() {
expect
(
fs
.
file
(
precompiledIsolate
).
existsSync
(),
false
);
}));
test
(
'release/profile macOS application updates when App.framework updates'
,
()
=>
testbed
.
run
(()
async
{
fs
.
file
(
fs
.
path
.
join
(
'bin'
,
'cache'
,
'artifacts'
,
'engine'
,
'darwin-x64'
,
'vm_isolate_snapshot.bin'
)).
createSync
(
recursive:
true
);
fs
.
file
(
fs
.
path
.
join
(
'bin'
,
'cache'
,
'artifacts'
,
'engine'
,
'darwin-x64'
,
'isolate_snapshot.bin'
)).
createSync
(
recursive:
true
);
final
File
inputFramework
=
fs
.
file
(
fs
.
path
.
join
(
environment
.
buildDir
.
path
,
'App.framework'
,
'App'
))
..
createSync
(
recursive:
true
)
..
writeAsStringSync
(
'ABC'
);
await
const
ProfileMacOSBundleFlutterAssets
().
build
(
environment
..
defines
[
kBuildMode
]
=
'profile'
);
final
File
outputFramework
=
fs
.
file
(
fs
.
path
.
join
(
environment
.
outputDir
.
path
,
'App.framework'
,
'App'
));
expect
(
outputFramework
.
readAsStringSync
(),
'ABC'
);
inputFramework
.
writeAsStringSync
(
'DEF'
);
await
const
ProfileMacOSBundleFlutterAssets
().
build
(
environment
..
defines
[
kBuildMode
]
=
'profile'
);
expect
(
outputFramework
.
readAsStringSync
(),
'DEF'
);
}));
test
(
'release/profile macOS compilation uses correct gen_snapshot'
,
()
=>
testbed
.
run
(()
async
{
when
(
genSnapshot
.
run
(
snapshotType:
anyNamed
(
'snapshotType'
),
...
...
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