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
62e74561
Unverified
Commit
62e74561
authored
Jan 24, 2022
by
Zachary Anderson
Committed by
GitHub
Jan 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use frontend_server from the Dart SDK (#97078)
parent
761b109b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+16
-12
artifacts_test.dart
...ages/flutter_tools/test/general.shard/artifacts_test.dart
+9
-0
No files found.
packages/flutter_tools/lib/src/artifacts.dart
View file @
62e74561
...
...
@@ -346,10 +346,10 @@ class CachedArtifacts implements Artifacts {
)
{
switch
(
artifact
)
{
case
HostArtifact
.
engineDartSdkPath
:
final
String
path
=
_dartSdkPath
(
_
fileSystem
);
final
String
path
=
_dartSdkPath
(
_
cache
);
return
_fileSystem
.
directory
(
path
);
case
HostArtifact
.
engineDartBinary
:
final
String
path
=
_fileSystem
.
path
.
join
(
_dartSdkPath
(
_
fileSystem
),
'bin'
,
_hostArtifactToFileName
(
artifact
,
_platform
.
isWindows
));
final
String
path
=
_fileSystem
.
path
.
join
(
_dartSdkPath
(
_
cache
),
'bin'
,
_hostArtifactToFileName
(
artifact
,
_platform
.
isWindows
));
return
_fileSystem
.
file
(
path
);
case
HostArtifact
.
flutterWebSdk
:
final
String
path
=
_getFlutterWebSdkPath
();
...
...
@@ -398,7 +398,7 @@ class CachedArtifacts implements Artifacts {
case
HostArtifact
.
dart2jsSnapshot
:
case
HostArtifact
.
dartdevcSnapshot
:
case
HostArtifact
.
kernelWorkerSnapshot
:
final
String
path
=
_fileSystem
.
path
.
join
(
_dartSdkPath
(
_
fileSystem
),
'bin'
,
'snapshots'
,
_hostArtifactToFileName
(
artifact
,
_platform
.
isWindows
));
final
String
path
=
_fileSystem
.
path
.
join
(
_dartSdkPath
(
_
cache
),
'bin'
,
'snapshots'
,
_hostArtifactToFileName
(
artifact
,
_platform
.
isWindows
));
return
_fileSystem
.
file
(
path
);
case
HostArtifact
.
iosDeploy
:
final
String
artifactFileName
=
_hostArtifactToFileName
(
artifact
,
_platform
.
isWindows
);
...
...
@@ -461,13 +461,11 @@ class CachedArtifacts implements Artifacts {
String
_getAndroidArtifactPath
(
Artifact
artifact
,
TargetPlatform
platform
,
BuildMode
mode
)
{
final
String
engineDir
=
_getEngineArtifactsPath
(
platform
,
mode
)!;
switch
(
artifact
)
{
case
Artifact
.
frontendServerSnapshotForEngineDartSdk
:
assert
(
mode
!=
BuildMode
.
debug
,
'Artifact
$artifact
only available in non-debug mode.'
);
return
_fileSystem
.
path
.
join
(
engineDir
,
_artifactToFileName
(
artifact
));
case
Artifact
.
genSnapshot
:
assert
(
mode
!=
BuildMode
.
debug
,
'Artifact
$artifact
only available in non-debug mode.'
);
final
String
hostPlatform
=
getNameForHostPlatform
(
getCurrentHostPlatform
());
return
_fileSystem
.
path
.
join
(
engineDir
,
hostPlatform
,
_artifactToFileName
(
artifact
));
case
Artifact
.
frontendServerSnapshotForEngineDartSdk
:
case
Artifact
.
constFinder
:
case
Artifact
.
flutterFramework
:
case
Artifact
.
flutterMacOSFramework
:
...
...
@@ -499,13 +497,13 @@ class CachedArtifacts implements Artifacts {
switch
(
artifact
)
{
case
Artifact
.
genSnapshot
:
case
Artifact
.
flutterXcframework
:
case
Artifact
.
frontendServerSnapshotForEngineDartSdk
:
final
String
artifactFileName
=
_artifactToFileName
(
artifact
)!;
final
String
engineDir
=
_getEngineArtifactsPath
(
platform
,
mode
)!;
return
_fileSystem
.
path
.
join
(
engineDir
,
artifactFileName
);
case
Artifact
.
flutterFramework
:
final
String
engineDir
=
_getEngineArtifactsPath
(
platform
,
mode
)!;
return
_getIosEngineArtifactPath
(
engineDir
,
environmentType
,
_fileSystem
);
case
Artifact
.
frontendServerSnapshotForEngineDartSdk
:
case
Artifact
.
constFinder
:
case
Artifact
.
flutterMacOSFramework
:
case
Artifact
.
flutterMacOSPodspec
:
...
...
@@ -596,10 +594,14 @@ class CachedArtifacts implements Artifacts {
// For script snapshots any gen_snapshot binary will do. Returning gen_snapshot for
// android_arm in profile mode because it is available on all supported host platforms.
return
_getAndroidArtifactPath
(
artifact
,
TargetPlatform
.
android_arm
,
BuildMode
.
profile
);
case
Artifact
.
frontendServerSnapshotForEngineDartSdk
:
return
_fileSystem
.
path
.
join
(
_dartSdkPath
(
_cache
),
'bin'
,
'snapshots'
,
_artifactToFileName
(
artifact
),
);
case
Artifact
.
flutterTester
:
case
Artifact
.
vmSnapshotData
:
case
Artifact
.
isolateSnapshotData
:
case
Artifact
.
frontendServerSnapshotForEngineDartSdk
:
case
Artifact
.
icuData
:
final
String
engineArtifactsPath
=
_cache
.
getArtifactDirectory
(
'engine'
).
path
;
final
String
platformDirName
=
_enginePlatformDirectoryName
(
platform
);
...
...
@@ -795,7 +797,7 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts {
final
String
path
=
_fileSystem
.
path
.
join
(
_hostEngineOutPath
,
'dart-sdk'
,
'bin'
,
'snapshots'
,
_hostArtifactToFileName
(
artifact
,
_platform
.
isWindows
));
return
_fileSystem
.
file
(
path
);
case
HostArtifact
.
dartdevcSnapshot
:
final
String
path
=
_fileSystem
.
path
.
join
(
_dartSdkPath
(
_
fileSystem
),
'bin'
,
'snapshots'
,
_hostArtifactToFileName
(
artifact
,
_platform
.
isWindows
));
final
String
path
=
_fileSystem
.
path
.
join
(
_dartSdkPath
(
_
cache
),
'bin'
,
'snapshots'
,
_hostArtifactToFileName
(
artifact
,
_platform
.
isWindows
));
return
_fileSystem
.
file
(
path
);
case
HostArtifact
.
kernelWorkerSnapshot
:
final
String
path
=
_fileSystem
.
path
.
join
(
_hostEngineOutPath
,
'dart-sdk'
,
'bin'
,
'snapshots'
,
_hostArtifactToFileName
(
artifact
,
_platform
.
isWindows
));
...
...
@@ -920,7 +922,9 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts {
case
Artifact
.
windowsUwpCppClientWrapper
:
return
_fileSystem
.
path
.
join
(
_hostEngineOutPath
,
artifactFileName
);
case
Artifact
.
frontendServerSnapshotForEngineDartSdk
:
return
_fileSystem
.
path
.
join
(
_hostEngineOutPath
,
'gen'
,
artifactFileName
);
return
_fileSystem
.
path
.
join
(
_hostEngineOutPath
,
'dart-sdk'
,
'bin'
,
'snapshots'
,
artifactFileName
,
);
case
Artifact
.
uwptool
:
return
_fileSystem
.
path
.
join
(
_hostEngineOutPath
,
artifactFileName
);
}
...
...
@@ -1030,8 +1034,8 @@ class OverrideArtifacts implements Artifacts {
}
/// Locate the Dart SDK.
String
_dartSdkPath
(
FileSystem
fileSystem
)
{
return
fileSystem
.
path
.
join
(
Cache
.
flutterRoot
!,
'bin'
,
'cache'
,
'dart-sdk'
)
;
String
_dartSdkPath
(
Cache
cache
)
{
return
cache
.
getRoot
().
childDirectory
(
'dart-sdk'
).
path
;
}
class
_TestArtifacts
implements
Artifacts
{
...
...
packages/flutter_tools/test/general.shard/artifacts_test.dart
View file @
62e74561
...
...
@@ -129,6 +129,10 @@ void main() {
artifacts
.
getArtifactPath
(
Artifact
.
windowsUwpDesktopPath
,
platform:
TargetPlatform
.
windows_uwp_x64
,
mode:
BuildMode
.
release
),
fileSystem
.
path
.
join
(
'root'
,
'bin'
,
'cache'
,
'artifacts'
,
'engine'
,
'windows-uwp-x64-release'
),
);
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
fileSystem
.
path
.
join
(
'root'
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
'snapshots'
,
'frontend_server.dart.snapshot'
)
);
});
testWithoutContext
(
'precompiled web artifact paths are correct'
,
()
{
...
...
@@ -294,6 +298,11 @@ void main() {
artifacts
.
getHostArtifact
(
HostArtifact
.
engineDartSdkPath
).
path
,
fileSystem
.
path
.
join
(
'/out'
,
'host_debug_unopt'
,
'dart-sdk'
),
);
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
fileSystem
.
path
.
join
(
'/out'
,
'host_debug_unopt'
,
'dart-sdk'
,
'bin'
,
'snapshots'
,
'frontend_server.dart.snapshot'
)
);
});
testWithoutContext
(
'getEngineType'
,
()
{
...
...
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