leonardocustodio / polkadart

Polkadart provides developers the ability to query a node and interact with the Polkadot or Substrate chains using Dart.
Apache License 2.0
25 stars 14 forks source link

[Windows only] polkadart_cli: file paths in src imports in generated files should be normalized (use POSIX) #323

Closed clangenb closed 12 months ago

clangenb commented 1 year ago

The import statements look like this when the files are generated on a Windows OS:

import '..\primitive_types\h256.dart' as _i2;

whereas slashes instead of backslashes should be used:

import '../primitive_types/h256.dart' as _i2;
leonardocustodio commented 12 months ago

This seems to be an issue with code_builder library. This would need to be fixed over there. https://github.com/dart-lang/code_builder/issues/383

clangenb commented 12 months ago

Yeah, I almost suspected that. In case we have other exotic people like me here, this script can be run as a post-processing step to fix it:

https://github.com/encointer/encointer-wallet-flutter/blob/5197562a9f0c2103e40f69ee4b09b52a4197f9ca/scripts/replace_backslash_in_dart_files.sh