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
37d4e7d6
Unverified
Commit
37d4e7d6
authored
Apr 04, 2023
by
Jackson Gardner
Committed by
GitHub
Apr 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always use the canvaskit path from the web sdk. (#123915)
Always use the canvaskit path from the web sdk.
parent
842873c2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
39 deletions
+30
-39
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+0
-13
web.dart
packages/flutter_tools/lib/src/build_system/targets/web.dart
+21
-10
devfs_web.dart
packages/flutter_tools/lib/src/isolated/devfs_web.dart
+6
-5
flutter_web_platform.dart
...ages/flutter_tools/lib/src/test/flutter_web_platform.dart
+3
-3
artifacts_test.dart
...ages/flutter_tools/test/general.shard/artifacts_test.dart
+0
-8
No files found.
packages/flutter_tools/lib/src/artifacts.dart
View file @
37d4e7d6
...
@@ -66,9 +66,6 @@ enum Artifact {
...
@@ -66,9 +66,6 @@ enum Artifact {
/// The location of file generators.
/// The location of file generators.
flutterToolsFileGenerators
,
flutterToolsFileGenerators
,
/// The path to the CanvasKit files built by the flutter engine.
canvasKitPath
,
}
}
/// A subset of [Artifact]s that are platform and build mode independent
/// A subset of [Artifact]s that are platform and build mode independent
...
@@ -210,7 +207,6 @@ String? _artifactToFileName(Artifact artifact, Platform hostPlatform, [ BuildMod
...
@@ -210,7 +207,6 @@ String? _artifactToFileName(Artifact artifact, Platform hostPlatform, [ BuildMod
case
Artifact
.
constFinder
:
case
Artifact
.
constFinder
:
return
'const_finder.dart.snapshot'
;
return
'const_finder.dart.snapshot'
;
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
canvasKitPath
:
return
''
;
return
''
;
}
}
}
}
...
@@ -535,7 +531,6 @@ class CachedArtifacts implements Artifacts {
...
@@ -535,7 +531,6 @@ class CachedArtifacts implements Artifacts {
case
Artifact
.
windowsCppClientWrapper
:
case
Artifact
.
windowsCppClientWrapper
:
case
Artifact
.
windowsDesktopPath
:
case
Artifact
.
windowsDesktopPath
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
canvasKitPath
:
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
}
}
}
}
...
@@ -574,7 +569,6 @@ class CachedArtifacts implements Artifacts {
...
@@ -574,7 +569,6 @@ class CachedArtifacts implements Artifacts {
case
Artifact
.
windowsCppClientWrapper
:
case
Artifact
.
windowsCppClientWrapper
:
case
Artifact
.
windowsDesktopPath
:
case
Artifact
.
windowsDesktopPath
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
canvasKitPath
:
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
}
}
}
}
...
@@ -625,7 +619,6 @@ class CachedArtifacts implements Artifacts {
...
@@ -625,7 +619,6 @@ class CachedArtifacts implements Artifacts {
case
Artifact
.
windowsCppClientWrapper
:
case
Artifact
.
windowsCppClientWrapper
:
case
Artifact
.
windowsDesktopPath
:
case
Artifact
.
windowsDesktopPath
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
canvasKitPath
:
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
}
}
}
}
...
@@ -703,8 +696,6 @@ class CachedArtifacts implements Artifacts {
...
@@ -703,8 +696,6 @@ class CachedArtifacts implements Artifacts {
throw
StateError
(
'Artifact
$artifact
not available for platform
$platform
.'
);
throw
StateError
(
'Artifact
$artifact
not available for platform
$platform
.'
);
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
flutterToolsFileGenerators
:
return
_getFileGeneratorsPath
();
return
_getFileGeneratorsPath
();
case
Artifact
.
canvasKitPath
:
return
_fileSystem
.
path
.
join
(
_cache
.
getWebSdkDirectory
().
path
,
'canvaskit'
);
}
}
}
}
...
@@ -974,8 +965,6 @@ class CachedLocalEngineArtifacts implements Artifacts {
...
@@ -974,8 +965,6 @@ class CachedLocalEngineArtifacts implements Artifacts {
return
_fileSystem
.
path
.
join
(
_getDartSdkPath
(),
'bin'
,
'snapshots'
,
artifactFileName
);
return
_fileSystem
.
path
.
join
(
_getDartSdkPath
(),
'bin'
,
'snapshots'
,
artifactFileName
);
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
flutterToolsFileGenerators
:
return
_getFileGeneratorsPath
();
return
_getFileGeneratorsPath
();
case
Artifact
.
canvasKitPath
:
return
_fileSystem
.
path
.
join
(
localEngineInfo
.
engineOutPath
,
'canvaskit'
);
}
}
}
}
...
@@ -1103,8 +1092,6 @@ class CachedLocalWebSdkArtifacts implements Artifacts {
...
@@ -1103,8 +1092,6 @@ class CachedLocalWebSdkArtifacts implements Artifacts {
_getDartSdkPath
(),
'bin'
,
'snapshots'
,
_getDartSdkPath
(),
'bin'
,
'snapshots'
,
_artifactToFileName
(
artifact
,
_platform
,
mode
),
_artifactToFileName
(
artifact
,
_platform
,
mode
),
);
);
case
Artifact
.
canvasKitPath
:
return
_fileSystem
.
path
.
join
(
_webSdkPath
,
'canvaskit'
);
case
Artifact
.
genSnapshot
:
case
Artifact
.
genSnapshot
:
case
Artifact
.
flutterTester
:
case
Artifact
.
flutterTester
:
case
Artifact
.
flutterFramework
:
case
Artifact
.
flutterFramework
:
...
...
packages/flutter_tools/lib/src/build_system/targets/web.dart
View file @
37d4e7d6
...
@@ -516,20 +516,31 @@ class WebBuiltInAssets extends Target {
...
@@ -516,20 +516,31 @@ class WebBuiltInAssets extends Target {
Source
.
hostArtifact
(
HostArtifact
.
flutterWebSdk
),
Source
.
hostArtifact
(
HostArtifact
.
flutterWebSdk
),
];
];
Directory
get
_canvasKitDirectory
=>
globals
.
fs
.
directory
(
fileSystem
.
path
.
join
(
globals
.
artifacts
!.
getHostArtifact
(
HostArtifact
.
flutterWebSdk
).
path
,
'canvaskit'
,
)
);
List
<
File
>
get
_canvasKitFiles
=>
_canvasKitDirectory
.
listSync
(
recursive:
true
).
whereType
<
File
>().
toList
();
String
_filePathRelativeToCanvasKitDirectory
(
File
file
)
=>
fileSystem
.
path
.
relative
(
file
.
path
,
from:
_canvasKitDirectory
.
path
);
@override
@override
List
<
Source
>
get
outputs
=>
const
<
Source
>[];
List
<
Source
>
get
outputs
=>
<
Source
>[
if
(
isWasm
)
const
Source
.
pattern
(
'{BUILD_DIR}/main.dart.js'
),
const
Source
.
pattern
(
'{BUILD_DIR}/flutter.js'
),
for
(
final
File
file
in
_canvasKitFiles
)
Source
.
pattern
(
'{BUILD_DIR}/canvaskit/
${_filePathRelativeToCanvasKitDirectory(file)}
'
),
];
@override
@override
Future
<
void
>
build
(
Environment
environment
)
async
{
Future
<
void
>
build
(
Environment
environment
)
async
{
final
Directory
canvasKitDirectory
=
globals
.
fs
.
directory
(
for
(
final
File
file
in
_canvasKitFiles
)
{
globals
.
artifacts
!.
getArtifactPath
(
final
String
relativePath
=
_filePathRelativeToCanvasKitDirectory
(
file
);
Artifact
.
canvasKitPath
,
platform:
TargetPlatform
.
web_javascript
,
),
);
for
(
final
File
file
in
canvasKitDirectory
.
listSync
(
recursive:
true
).
whereType
<
File
>())
{
final
String
relativePath
=
fileSystem
.
path
.
relative
(
file
.
path
,
from:
canvasKitDirectory
.
path
);
final
String
targetPath
=
fileSystem
.
path
.
join
(
environment
.
outputDir
.
path
,
'canvaskit'
,
relativePath
);
final
String
targetPath
=
fileSystem
.
path
.
join
(
environment
.
outputDir
.
path
,
'canvaskit'
,
relativePath
);
file
.
copySync
(
targetPath
);
file
.
copySync
(
targetPath
);
}
}
...
...
packages/flutter_tools/lib/src/isolated/devfs_web.dart
View file @
37d4e7d6
...
@@ -420,12 +420,13 @@ class WebAssetServer implements AssetReader {
...
@@ -420,12 +420,13 @@ class WebAssetServer implements AssetReader {
File
file
=
_resolveDartFile
(
requestPath
);
File
file
=
_resolveDartFile
(
requestPath
);
if
(!
file
.
existsSync
()
&&
requestPath
.
startsWith
(
'canvaskit/'
))
{
if
(!
file
.
existsSync
()
&&
requestPath
.
startsWith
(
'canvaskit/'
))
{
final
String
canvasKitPath
=
globals
.
artifacts
!.
getArtifactPath
(
final
Directory
canvasKitDirectory
=
globals
.
fs
.
directory
(
Artifact
.
canvasKitPath
,
globals
.
fs
.
path
.
join
(
platform:
TargetPlatform
.
web_javascript
,
globals
.
artifacts
!.
getHostArtifact
(
HostArtifact
.
flutterWebSdk
).
path
,
'canvaskit'
,
)
);
);
final
Uri
potential
=
globals
.
fs
final
Uri
potential
=
canvasKitDirectory
.
directory
(
canvasKitPath
)
.
uri
.
uri
.
resolve
(
requestPath
.
replaceFirst
(
'canvaskit/'
,
''
));
.
resolve
(
requestPath
.
replaceFirst
(
'canvaskit/'
,
''
));
file
=
globals
.
fs
.
file
(
potential
);
file
=
globals
.
fs
.
file
(
potential
);
...
...
packages/flutter_tools/lib/src/test/flutter_web_platform.dart
View file @
37d4e7d6
...
@@ -221,9 +221,9 @@ class FlutterWebPlatform extends PlatformPlugin {
...
@@ -221,9 +221,9 @@ class FlutterWebPlatform extends PlatformPlugin {
));
));
File
_canvasKitFile
(
String
relativePath
)
{
File
_canvasKitFile
(
String
relativePath
)
{
final
String
canvasKitPath
=
_
artifacts
!.
getArtifactPath
(
final
String
canvasKitPath
=
_
fileSystem
.
path
.
join
(
Artifact
.
canvasKitP
ath
,
_artifacts
!.
getHostArtifact
(
HostArtifact
.
flutterWebSdk
).
p
ath
,
platform:
TargetPlatform
.
web_javascript
,
'canvaskit'
,
);
);
final
File
canvasKitFile
=
_fileSystem
.
file
(
_fileSystem
.
path
.
join
(
final
File
canvasKitFile
=
_fileSystem
.
file
(
_fileSystem
.
path
.
join
(
canvasKitPath
,
canvasKitPath
,
...
...
packages/flutter_tools/test/general.shard/artifacts_test.dart
View file @
37d4e7d6
...
@@ -145,10 +145,6 @@ void main() {
...
@@ -145,10 +145,6 @@ void main() {
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
fileSystem
.
path
.
join
(
'root'
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
'snapshots'
,
'frontend_server.dart.snapshot'
)
fileSystem
.
path
.
join
(
'root'
,
'bin'
,
'cache'
,
'dart-sdk'
,
'bin'
,
'snapshots'
,
'frontend_server.dart.snapshot'
)
);
);
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
canvasKitPath
),
fileSystem
.
path
.
join
(
'root'
,
'bin'
,
'cache'
,
'flutter_web_sdk'
,
'canvaskit'
),
);
});
});
testWithoutContext
(
'precompiled web artifact paths are correct'
,
()
{
testWithoutContext
(
'precompiled web artifact paths are correct'
,
()
{
...
@@ -346,10 +342,6 @@ void main() {
...
@@ -346,10 +342,6 @@ void main() {
artifacts
.
getHostArtifact
(
HostArtifact
.
libtessellator
).
path
,
artifacts
.
getHostArtifact
(
HostArtifact
.
libtessellator
).
path
,
fileSystem
.
path
.
join
(
'/out'
,
'host_debug_unopt'
,
'libtessellator.so'
),
fileSystem
.
path
.
join
(
'/out'
,
'host_debug_unopt'
,
'libtessellator.so'
),
);
);
expect
(
artifacts
.
getArtifactPath
(
Artifact
.
canvasKitPath
,
platform:
TargetPlatform
.
web_javascript
),
fileSystem
.
path
.
join
(
'/out'
,
'wasm_release'
,
'canvaskit'
),
);
});
});
testWithoutContext
(
'falls back to bundled impeller artifacts if the files do not exist in the local engine'
,
()
{
testWithoutContext
(
'falls back to bundled impeller artifacts if the files do not exist in the local engine'
,
()
{
...
...
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