Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem committed Feb 17, 2025
1 parent 470533e commit b75fe93
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
30 changes: 18 additions & 12 deletions pkgs/intl4x/hook/build.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,32 @@ void main(List<String> args) async {
if (buildOptions == null) {
throw ArgumentError('''
Unknown build mode for icu4x. Set the build mode with either `fetch`, `local`, or `checkout` by writing a config file at ~/intl4x.json:
Unknown build mode for icu4x. Set the build mode with either `fetch`, `local`, or `checkout` by writing into your pubspec:
* fetch: Fetch the precompiled binary from a CDN.
```
{
"buildMode": "fetch"
}
...
hook:
intl4x:
buildMode: fetch
...
```
* local: Use a locally existing binary at the environment variable `LOCAL_ICU4X_BINARY`.
```
{
"buildMode": "local",
"localDylibPath": "path/to/dylib.so"
}
...
hook:
intl4x:
buildMode: local
localDylibPath: path/to/dylib.so
...
```
* checkout: Build a fresh library from a local git checkout of the icu4x repository.
```
{
"buildMode": "checkout",
"checkoutPath": "path/to/checkout"
}
...
hook:
intl4x:
buildMode: checkout
checkoutPath: path/to/checkout
...
```
''');
Expand Down
4 changes: 2 additions & 2 deletions pkgs/intl4x/lib/src/hook_helpers/build_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class BuildOptions {
Map<String, dynamic> toMap() {
return {
'buildMode': buildMode.name,
'localDylibPath': localDylibPath,
'checkoutPath': checkoutPath,
if (localDylibPath != null) 'localDylibPath': localDylibPath,
if (checkoutPath != null) 'checkoutPath': checkoutPath,
};
}

Expand Down
2 changes: 0 additions & 2 deletions pkgs/intl4x/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,3 @@ dev_dependencies:
hook:
intl4x:
buildMode: fetch
localDylibPath: null
checkoutPath: null

0 comments on commit b75fe93

Please sign in to comment.