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 {
/// The location of file generators.
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
...
...
@@ -210,7 +207,6 @@ String? _artifactToFileName(Artifact artifact, Platform hostPlatform, [ BuildMod
case
Artifact
.
constFinder
:
return
'const_finder.dart.snapshot'
;
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
canvasKitPath
:
return
''
;
}
}
...
...
@@ -535,7 +531,6 @@ class CachedArtifacts implements Artifacts {
case
Artifact
.
windowsCppClientWrapper
:
case
Artifact
.
windowsDesktopPath
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
canvasKitPath
:
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
}
}
...
...
@@ -574,7 +569,6 @@ class CachedArtifacts implements Artifacts {
case
Artifact
.
windowsCppClientWrapper
:
case
Artifact
.
windowsDesktopPath
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
canvasKitPath
:
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
}
}
...
...
@@ -625,7 +619,6 @@ class CachedArtifacts implements Artifacts {
case
Artifact
.
windowsCppClientWrapper
:
case
Artifact
.
windowsDesktopPath
:
case
Artifact
.
flutterToolsFileGenerators
:
case
Artifact
.
canvasKitPath
:
return
_getHostArtifactPath
(
artifact
,
platform
,
mode
);
}
}
...
...
@@ -703,8 +696,6 @@ class CachedArtifacts implements Artifacts {
throw
StateError
(
'Artifact
$artifact
not available for platform
$platform
.'
);
case
Artifact
.
flutterToolsFileGenerators
:
return
_getFileGeneratorsPath
();
case
Artifact
.
canvasKitPath
:
return
_fileSystem
.
path
.
join
(
_cache
.
getWebSdkDirectory
().
path
,
'canvaskit'
);
}
}
...
...
@@ -974,8 +965,6 @@ class CachedLocalEngineArtifacts implements Artifacts {
return
_fileSystem
.
path
.
join
(
_getDartSdkPath
(),
'bin'
,
'snapshots'
,
artifactFileName
);
case
Artifact
.
flutterToolsFileGenerators
:
return
_getFileGeneratorsPath
();
case
Artifact
.
canvasKitPath
:
return
_fileSystem
.
path
.
join
(
localEngineInfo
.
engineOutPath
,
'canvaskit'
);
}
}
...
...
@@ -1103,8 +1092,6 @@ class CachedLocalWebSdkArtifacts implements Artifacts {
_getDartSdkPath
(),
'bin'
,
'snapshots'
,
_artifactToFileName
(
artifact
,
_platform
,
mode
),
);
case
Artifact
.
canvasKitPath
:
return
_fileSystem
.
path
.
join
(
_webSdkPath
,
'canvaskit'
);
case
Artifact
.
genSnapshot
:
case
Artifact
.
flutterTester
:
case
Artifact
.
flutterFramework
:
...
...
packages/flutter_tools/lib/src/build_system/targets/web.dart
View file @
37d4e7d6
...
...
@@ -516,20 +516,31 @@ class WebBuiltInAssets extends Target {
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
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
Future
<
void
>
build
(
Environment
environment
)
async
{
final
Directory
canvasKitDirectory
=
globals
.
fs
.
directory
(
globals
.
artifacts
!.
getArtifactPath
(
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
);
for
(
final
File
file
in
_canvasKitFiles
)
{
final
String
relativePath
=
_filePathRelativeToCanvasKitDirectory
(
file
);
final
String
targetPath
=
fileSystem
.
path
.
join
(
environment
.
outputDir
.
path
,
'canvaskit'
,
relativePath
);
file
.
copySync
(
targetPath
);
}
...
...
packages/flutter_tools/lib/src/isolated/devfs_web.dart
View file @
37d4e7d6
...
...
@@ -420,12 +420,13 @@ class WebAssetServer implements AssetReader {
File
file
=
_resolveDartFile
(
requestPath
);
if
(!
file
.
existsSync
()
&&
requestPath
.
startsWith
(
'canvaskit/'
))
{
final
String
canvasKitPath
=
globals
.
artifacts
!.
getArtifactPath
(
Artifact
.
canvasKitPath
,
platform:
TargetPlatform
.
web_javascript
,
final
Directory
canvasKitDirectory
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
join
(
globals
.
artifacts
!.
getHostArtifact
(
HostArtifact
.
flutterWebSdk
).
path
,
'canvaskit'
,
)
);
final
Uri
potential
=
globals
.
fs
.
directory
(
canvasKitPath
)
final
Uri
potential
=
canvasKitDirectory
.
uri
.
resolve
(
requestPath
.
replaceFirst
(
'canvaskit/'
,
''
));
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 {
));
File
_canvasKitFile
(
String
relativePath
)
{
final
String
canvasKitPath
=
_
artifacts
!.
getArtifactPath
(
Artifact
.
canvasKitP
ath
,
platform:
TargetPlatform
.
web_javascript
,
final
String
canvasKitPath
=
_
fileSystem
.
path
.
join
(
_artifacts
!.
getHostArtifact
(
HostArtifact
.
flutterWebSdk
).
p
ath
,
'canvaskit'
,
);
final
File
canvasKitFile
=
_fileSystem
.
file
(
_fileSystem
.
path
.
join
(
canvasKitPath
,
...
...
packages/flutter_tools/test/general.shard/artifacts_test.dart
View file @
37d4e7d6
...
...
@@ -145,10 +145,6 @@ void main() {
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
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'
,
()
{
...
...
@@ -346,10 +342,6 @@ void main() {
artifacts
.
getHostArtifact
(
HostArtifact
.
libtessellator
).
path
,
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'
,
()
{
...
...
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