Use platform appropriate filepaths#44221
Conversation
| final PoolResource resource = await pool.request(); | ||
| try { | ||
| final File file = fs.file(fs.path.join(outputDirectory.path, entry.key)); | ||
| final File file = fs.file(outputDirectory.uri.resolve(entry.key)); |
There was a problem hiding this comment.
Is this fix needed anywhere else?
There was a problem hiding this comment.
Updated bundle.dart
| await buildSystem.build(const CopyAssets(), environment); | ||
|
|
||
| expect(fs.file(fs.path.join(environment.buildDir.path, 'flutter_assets', 'assets/foo/bar.png')).existsSync(), true); | ||
| expect(fs.file(fs.path.join(environment.buildDir.path, 'flutter_assets', 'assets', 'foo', 'bar.png')).existsSync(), true); |
There was a problem hiding this comment.
Is it important for the test that you get different instances for the two repetitions of:
fs.file(fs.path.join(environment.buildDir.path, 'flutter_assets', 'assets', 'foo', 'bar.png') ?
If so, please add a comment. If not, then stash either the File or the String for the path in a local.
|
Fixes #35293 |
|
This also causes #46163. I think we want ot keep all these as URI encoded because the framework sends over the file names as URI encoded. If anything we should make sure we copy only the URI encoded file, and not the unencoded file. |
|
It should be safe to revert this PR. That revert should include tests of the currently failing to load assets, lest we repeat this in 10-12 months |
Description
Works on my computer?