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
7a487b2c
Unverified
Commit
7a487b2c
authored
Sep 28, 2019
by
Jonah Williams
Committed by
GitHub
Sep 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure we find dart.exe on local engines (#41514)
parent
5f9c262e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
14 deletions
+29
-14
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+15
-14
artifacts_test.dart
...ages/flutter_tools/test/general.shard/artifacts_test.dart
+14
-0
No files found.
packages/flutter_tools/lib/src/artifacts.dart
View file @
7a487b2c
...
...
@@ -158,6 +158,19 @@ abstract class Artifacts {
String
getEngineType
(
TargetPlatform
platform
,
[
BuildMode
mode
]);
}
TargetPlatform
get
_currentHostPlatform
{
if
(
platform
.
isMacOS
)
{
return
TargetPlatform
.
darwin_x64
;
}
if
(
platform
.
isLinux
)
{
return
TargetPlatform
.
linux_x64
;
}
if
(
platform
.
isWindows
)
{
return
TargetPlatform
.
windows_x64
;
}
throw
UnimplementedError
(
'Host OS not supported.'
);
}
/// Manages the engine artifacts downloaded to the local cache.
class
CachedArtifacts
extends
Artifacts
{
...
...
@@ -337,19 +350,6 @@ class CachedArtifacts extends Artifacts {
assert
(
false
,
'Invalid platform
$platform
.'
);
return
null
;
}
TargetPlatform
get
_currentHostPlatform
{
if
(
platform
.
isMacOS
)
{
return
TargetPlatform
.
darwin_x64
;
}
if
(
platform
.
isLinux
)
{
return
TargetPlatform
.
linux_x64
;
}
if
(
platform
.
isWindows
)
{
return
TargetPlatform
.
windows_x64
;
}
throw
UnimplementedError
(
'Host OS not supported.'
);
}
}
/// Manages the artifacts of a locally built engine.
...
...
@@ -362,7 +362,8 @@ class LocalEngineArtifacts extends Artifacts {
@override
String
getArtifactPath
(
Artifact
artifact
,
{
TargetPlatform
platform
,
BuildMode
mode
})
{
final
String
artifactFileName
=
_artifactToFileName
(
artifact
);
platform
??=
_currentHostPlatform
;
final
String
artifactFileName
=
_artifactToFileName
(
artifact
,
platform
);
switch
(
artifact
)
{
case
Artifact
.
snapshotDart
:
return
fs
.
path
.
join
(
_engineSrcPath
,
'flutter'
,
'lib'
,
'snapshot'
,
artifactFileName
);
...
...
packages/flutter_tools/test/general.shard/artifacts_test.dart
View file @
7a487b2c
...
...
@@ -113,6 +113,20 @@ void main() {
FileSystem:
()
=>
memoryFileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
});
testUsingContext
(
'Looks up dart.exe on windows platforms'
,
()
async
{
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
contains
(
'.exe'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
memoryFileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'windows'
),
});
testUsingContext
(
'Looks up dart on linux platforms'
,
()
async
{
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
isNot
(
contains
(
'.exe'
)));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
memoryFileSystem
,
Platform:
()
=>
FakePlatform
(
operatingSystem:
'linux'
),
});
});
});
}
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