Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to new native_assets #941

Merged
merged 52 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
a50df74
Update to new native_assets
mosuem Jan 30, 2025
21c0c33
Fix bindings
mosuem Jan 31, 2025
8a14be7
Add working example
mosuem Jan 31, 2025
d492715
add changelog
mosuem Jan 31, 2025
5177bd6
Add license file
mosuem Jan 31, 2025
660ba1b
Update pubspec
mosuem Feb 3, 2025
01d936c
Fix web issues
mosuem Feb 3, 2025
d375870
Format
mosuem Feb 3, 2025
699aa0c
Adapt local workflow
mosuem Feb 3, 2025
f47b431
Fix typo
mosuem Feb 11, 2025
8849714
run pub get
mosuem Feb 11, 2025
174e2ae
move pub get
mosuem Feb 11, 2025
038e108
Add print statement
mosuem Feb 11, 2025
a5f1a2b
Have default build mode
mosuem Feb 11, 2025
b824099
Fix other modes
mosuem Feb 11, 2025
0c6646c
Add print
mosuem Feb 12, 2025
4171fbe
adapt home dir
mosuem Feb 12, 2025
1b413f1
Add print
mosuem Feb 12, 2025
c586946
without percents
mosuem Feb 12, 2025
41798a2
debug print
mosuem Feb 12, 2025
65a9368
add some debug prints
mosuem Feb 12, 2025
9723b62
Use yaml edit
mosuem Feb 12, 2025
431adb8
add arg
mosuem Feb 12, 2025
38f81b6
Updating ecma stuff
mosuem Feb 12, 2025
470533e
Fix ecma
mosuem Feb 12, 2025
b75fe93
Update readme
mosuem Feb 17, 2025
25ed05f
Add options to example
mosuem Feb 17, 2025
e95605b
introduce treeshake
mosuem Feb 18, 2025
0706fb8
Remove unused RecordSymbols
mosuem Feb 18, 2025
4ac753f
Merge branch 'main' into updateIntl4x2
mosuem Feb 18, 2025
0696b85
Remove ecma changes
mosuem Feb 18, 2025
c30cf3a
Revert test ecma
mosuem Feb 18, 2025
53b53f8
Add js to pubspec
mosuem Feb 18, 2025
0f4365a
Merge branch 'main' into updateIntl4x2
mosuem Feb 18, 2025
770e1b6
Reformat
mosuem Feb 19, 2025
ff356c0
Disable workflow for now
mosuem Feb 19, 2025
ab0c521
Use new branch
mosuem Feb 19, 2025
bb89662
Update submodule
mosuem Feb 19, 2025
80c6f6b
fix wf
mosuem Feb 19, 2025
9748ea3
Fix local wf
mosuem Feb 19, 2025
f9a2e72
update to keys
mosuem Feb 19, 2025
5d05a26
Fix wf
mosuem Feb 19, 2025
2630455
update icu4x
mosuem Feb 19, 2025
0a3752a
update icu4x
mosuem Feb 19, 2025
b9c2bea
Switch to icu main branch
mosuem Feb 19, 2025
da67204
Checkout branch
mosuem Feb 20, 2025
28942b0
Small changes to icu4x
mosuem Feb 20, 2025
080f0ff
Switch to main again
mosuem Feb 20, 2025
5753449
Update to newest version
mosuem Feb 21, 2025
4810415
unformat
mosuem Feb 21, 2025
b449bd7
unformat
mosuem Feb 21, 2025
14c241a
Format all
mosuem Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ on:

jobs:
run_all:
# disable until fixed upstream
if: false
runs-on: ubuntu-latest
steps:
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
Expand Down
47 changes: 24 additions & 23 deletions .github/workflows/intl4x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
build_checkout:
runs-on: ${{ matrix.os }}

env:
ICU4X_BUILD_MODE: checkout
LOCAL_ICU4X_CHECKOUT: ${{ github.workspace }}/submodules/icu4x

defaults:
run:
working-directory: pkgs/intl4x
Expand All @@ -44,7 +40,16 @@ jobs:
with:
sdk: ${{matrix.sdk}}

- run: dart --enable-experiment=native-assets pub get
- run: dart pub get

- run: dart tool/write_option_file.dart pubspec.yaml checkout $(realpath ${{ github.workspace }}/submodules/icu4x)
if: matrix.os == 'ubuntu-latest'

- run: dart tool/write_option_file.dart pubspec.yaml checkout $(realpath ${{ github.workspace }}/submodules/icu4x)
if: matrix.os == 'macos-latest'

- run: dart tool/write_option_file.dart pubspec.yaml checkout (Get-Item ${{ github.workspace }}\submodules\icu4x).FullName -replace '/', '\'
if: matrix.os == 'windows-latest'

- run: dart --enable-experiment=native-assets analyze --fatal-infos

Expand All @@ -60,9 +65,6 @@ jobs:
build_fetch:
runs-on: ${{ matrix.os }}

env:
ICU4X_BUILD_MODE: fetch

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
Expand All @@ -80,7 +82,9 @@ jobs:
with:
sdk: dev

- run: dart --enable-experiment=native-assets pub get
- run: dart pub get

- run: dart tool/write_option_file.dart pubspec.yaml fetch

- run: dart --enable-experiment=native-assets test

Expand All @@ -91,9 +95,6 @@ jobs:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}

env:
ICU4X_BUILD_MODE: local

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
Expand All @@ -120,7 +121,7 @@ jobs:
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/linux_x64 linux_x64 dynamic icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data
dart ffi/dart/tool/build_libs.dart --file bin/linux_x64 --os linux --architecture x64 --compile_type dynamic --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data

- name: Build Mac
if: matrix.os == 'macos-latest'
Expand All @@ -132,7 +133,7 @@ jobs:
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/macos_arm64 macos_arm64 dynamic icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data
dart ffi/dart/tool/build_libs.dart --file bin/macos_arm64 --os macos --architecture arm64 --compile_type dynamic --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data

- name: Build Windows
if: matrix.os == 'windows-latest'
Expand All @@ -144,27 +145,27 @@ jobs:
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/windows_x64 windows_x64 dynamic icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data
dart ffi/dart/tool/build_libs.dart --file bin/windows_x64 --os windows --architecture x64 --compile_type dynamic --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components,compiled_data

- run: echo "LOCAL_ICU4X_BINARY=$(realpath submodules/icu4x/bin/linux_x64)" >> $GITHUB_ENV
- name: Run `dart pub get`
run: |
cd pkgs/intl4x
dart pub get

- run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local $(realpath submodules/icu4x/bin/linux_x64)
if: matrix.os == 'ubuntu-latest'

- run: echo "LOCAL_ICU4X_BINARY=$(realpath submodules/icu4x/bin/macos_arm64)" >> $GITHUB_ENV
- run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local $(realpath submodules/icu4x/bin/macos_arm64)
if: matrix.os == 'macos-latest'

- run: echo ("LOCAL_ICU4X_BINARY=" + (Get-Item submodules\icu4x\bin\windows_x64).FullName -replace '/', '\') >> $env:GITHUB_ENV
- run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local (Get-Item submodules\icu4x\bin\windows_x64).FullName -replace '/', '\'
if: matrix.os == 'windows-latest'

- run: echo $LOCAL_ICU4X_BINARY

- name: Display structure of downloaded files
run: ls -R

- name: Run `dart pub get`
run: |
cd pkgs/intl4x
dart pub get

- name: Run `dart test`
run: |
cd pkgs/intl4x
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/intl4x_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ jobs:
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/android_arm_${{ matrix.compiletype }} android_arm ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/android_arm64_${{ matrix.compiletype }} android_arm64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/android_ia32_${{ matrix.compiletype }} android_ia32 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/android_x64_${{ matrix.compiletype }} android_x64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/linux_arm_${{ matrix.compiletype }} linux_arm ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/linux_arm64_${{ matrix.compiletype }} linux_arm64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/linux_riscv64_${{ matrix.compiletype }} linux_riscv64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/linux_x64_${{ matrix.compiletype }} linux_x64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/android_arm_${{ matrix.compiletype }} --os android --architecture arm --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/android_arm64_${{ matrix.compiletype }} --os android --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/android_ia32_${{ matrix.compiletype }} --os android --architecture ia32 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/android_x64_${{ matrix.compiletype }} --os android --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/linux_arm_${{ matrix.compiletype }} --os linux --architecture arm --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/linux_arm64_${{ matrix.compiletype }} --os linux --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/linux_riscv64_${{ matrix.compiletype }} --os linux --architecture riscv64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/linux_x64_${{ matrix.compiletype }} --os linux --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}

- name: Build Linux data
if: matrix.os == 'ubuntu-latest' && matrix.compiletype == 'static'
Expand Down Expand Up @@ -105,11 +105,11 @@ jobs:
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/ios_arm_${{ matrix.compiletype }} ios_arm ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/ios_arm64_${{ matrix.compiletype }} ios_arm64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/ios_x64_${{ matrix.compiletype }} ios_x64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/macos_arm64_${{ matrix.compiletype }} macos_arm64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/macos_x64_${{ matrix.compiletype }} macos_x64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/ios_arm_${{ matrix.compiletype }} --os ios --architecture arm --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/ios_arm64_${{ matrix.compiletype }} --os ios --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/ios_x64_${{ matrix.compiletype }} --os ios --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/macos_arm64_${{ matrix.compiletype }} --os macos --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/macos_x64_${{ matrix.compiletype }} --os macos --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}

- name: Build Mac data
if: matrix.os == 'macos-latest' && matrix.compiletype == 'static'
Expand All @@ -134,9 +134,9 @@ jobs:
cd ffi/dart
dart pub get
cd ../..
dart run ffi/dart/tool/build_libs.dart bin/windows_arm64_${{ matrix.compiletype }} windows_arm64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/windows_ia32_${{ matrix.compiletype }} windows_ia32 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart bin/windows_x64_${{ matrix.compiletype }} windows_x64 ${{ matrix.compiletype }} icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/windows_arm64_${{ matrix.compiletype }} --os windows --architecture arm64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/windows_ia32_${{ matrix.compiletype }} --os windows --architecture ia32 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}
dart run ffi/dart/tool/build_libs.dart --file bin/windows_x64_${{ matrix.compiletype }} --os windows --architecture x64 --compile_type ${{ matrix.compiletype }} --cargo_features icu_collator,icu_datetime,icu_list,icu_decimal,icu_plurals,experimental_components${{ env.DATA }}

- name: Build Windows data
if: matrix.os == 'windows-latest' && matrix.compiletype == 'static'
Expand Down
1 change: 1 addition & 0 deletions pkgs/intl4x/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.11.0-wip

- Remove dep on package:js.
- Introduce link hook.

## 0.10.1

Expand Down
4 changes: 4 additions & 0 deletions pkgs/intl4x/example_native/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/
bin/example_native/
2 changes: 2 additions & 0 deletions pkgs/intl4x/example_native/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.
30 changes: 30 additions & 0 deletions pkgs/intl4x/example_native/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
9 changes: 9 additions & 0 deletions pkgs/intl4x/example_native/bin/example_native.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:intl4x/intl4x.dart';

void main(List<String> arguments) {
print(Intl().numberFormat().format(3));
}
19 changes: 19 additions & 0 deletions pkgs/intl4x/example_native/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: example_native
description: A sample application using intl4x.

environment:
sdk: ^3.6.0

publish_to: none

dependencies:
intl4x:
path: ../

dev_dependencies:
lints: ^5.0.0

hook:
intl4x:
buildMode: fetch
treeshake: true
2 changes: 1 addition & 1 deletion pkgs/intl4x/hook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
1. Create PR.
2. Run `bash tools/regenerate_bindings.sh`, and fix resulting errors.
3. Update `const version` in `version.dart` to tag.
4. Regenerate hashes using `cd pkgs/intl4x/; dart --enable-experiment=native-assets run tool/regenerate_hashes.dart`.
4. Regenerate hashes using `cd pkgs/intl4x/; dart --enable-experiment=native-assets tool/regenerate_hashes.dart`.
5. Land PR.
Loading
Loading