Skip to content

Commit 6a8f9c7

Browse files
Move logic to package:icu4x (#993)
* Move logic to package:icu4x * Use icu4x * use local file * remove treeshake * Remove copy code * Add license * Add changelog * update * ci * allow path dep * more ci * overrides * using fetch * https * dylib name * Remvoe unused * format * remove dep override * Remove submodules * Upgrade deps * Prep for publish * Remove impossible condition * undo * undo * Don't collect web coverage --------- Co-authored-by: Robert Bastian <[email protected]>
1 parent c28ad5e commit 6a8f9c7

File tree

221 files changed

+115
-23665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+115
-23665
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/health.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ jobs:
88
health:
99
uses: dart-lang/ecosystem/.github/workflows/health.yaml@main
1010
with:
11-
coverage_web: true
12-
checkout_submodules: true
1311
sdk: main
1412
ignore_license: "**.g.dart,pkgs/intl_translation/example/lib/generated/**,pkgs/intl_translation/test/generate_localized/**,pkgs/intl_translation/test/two_components/**"
1513
ignore_coverage: "**.g.dart"
16-
ignore_packages: "submodules"
1714
permissions:
1815
pull-requests: write

.github/workflows/intl4x.yml

Lines changed: 4 additions & 242 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,16 @@ on:
1010
paths:
1111
- ".github/workflows/intl4x.yml"
1212
- "pkgs/intl4x/**"
13-
- "submodules/**"
1413
push:
1514
branches: [main]
1615
paths:
1716
- ".github/workflows/intl4x.yml"
1817
- "pkgs/intl4x/**"
19-
- "submodules/**"
2018
schedule:
2119
- cron: "0 0 * * 0" # weekly
2220

2321
jobs:
24-
# This job will determine if the 'skip-fetch' tag is present
25-
check_skip_fetch:
26-
runs-on: ubuntu-latest
27-
outputs:
28-
skip_fetch: ${{ steps.get-labels.outputs.skip_fetch }}
29-
permissions:
30-
pull-requests: read
31-
if: github.event_name == 'pull_request'
32-
steps:
33-
- name: Get PR Labels
34-
id: get-labels
35-
run: |
36-
labels="$(gh api repos/$OWNER/$REPO_NAME/pulls/$PULL_REQUEST_NUMBER --jq '.labels.[].name')"
37-
echo "Found labels: $labels"
38-
if echo "$labels" | grep -q "skip-fetch"; then
39-
echo "skip_fetch=true" >> "$GITHUB_OUTPUT"
40-
else
41-
echo "skip_fetch=false" >> "$GITHUB_OUTPUT"
42-
fi
43-
shell: bash
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
OWNER: ${{ github.repository_owner }}
47-
REPO_NAME: ${{ github.event.repository.name }}
48-
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
49-
50-
build_checkout:
22+
build:
5123
runs-on: ${{ matrix.os }}
5224

5325
defaults:
@@ -58,47 +30,13 @@ jobs:
5830
os: [ubuntu-latest, macos-latest, windows-latest]
5931
steps:
6032
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
61-
with:
62-
submodules: true
6333

6434
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
6535
with:
6636
sdk: main
6737

68-
- name: Install Rust toolchains
69-
run: |
70-
rustup toolchain install stable
71-
rustup toolchain install nightly
72-
73-
- name: Show the selected Rust toolchain
74-
run: rustup show
75-
76-
- name: Set up toolchain for Linux
77-
if: matrix.os == 'ubuntu-latest'
78-
run: |
79-
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
80-
81-
- name: Set up toolchain for Mac
82-
if: matrix.os == 'macos-latest'
83-
run: |
84-
rustup component add rust-src --toolchain nightly-aarch64-apple-darwin
85-
86-
- name: Set up toolchain for Windows
87-
if: matrix.os == 'windows-latest'
88-
run: |
89-
rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
90-
9138
- run: dart pub get
9239

93-
- run: dart tool/write_option_file.dart pubspec.yaml checkout $(realpath ${{ github.workspace }}/submodules/icu4x)
94-
if: matrix.os == 'ubuntu-latest'
95-
96-
- run: dart tool/write_option_file.dart pubspec.yaml checkout $(realpath ${{ github.workspace }}/submodules/icu4x)
97-
if: matrix.os == 'macos-latest'
98-
99-
- run: dart tool/write_option_file.dart pubspec.yaml checkout (Get-Item ${{ github.workspace }}\submodules\icu4x).FullName -replace '/', '\'
100-
if: matrix.os == 'windows-latest'
101-
10240
- run: dart analyze --fatal-infos
10341

10442
- run: dart format --output=none --set-exit-if-changed .
@@ -110,15 +48,6 @@ jobs:
11048
- run: dart pub get
11149
working-directory: pkgs/intl4x/example_native
11250

113-
- run: dart tool/write_option_file.dart example_native/pubspec.yaml checkout $(realpath ${{ github.workspace }}/submodules/icu4x)
114-
if: matrix.os == 'ubuntu-latest'
115-
116-
- run: dart tool/write_option_file.dart example_native/pubspec.yaml checkout $(realpath ${{ github.workspace }}/submodules/icu4x)
117-
if: matrix.os == 'macos-latest'
118-
119-
- run: dart tool/write_option_file.dart example_native/pubspec.yaml checkout (Get-Item ${{ github.workspace }}\submodules\icu4x).FullName -replace '/', '\'
120-
if: matrix.os == 'windows-latest'
121-
12251
- run: dart --enable-experiment=record-use build cli bin/example_native.dart
12352
working-directory: pkgs/intl4x/example_native
12453

@@ -134,7 +63,7 @@ jobs:
13463
working-directory: pkgs/intl4x/example_native
13564
if: matrix.os == 'ubuntu-latest'
13665
run: |
137-
FILE_PATH="build/cli/linux_x64/bundle/lib/libintl4x.so"
66+
FILE_PATH="build/cli/linux_x64/bundle/lib/libicu4x.so"
13867
FILE_SIZE=$(stat -c %s "$FILE_PATH")
13968
echo "Linux executable size: $FILE_SIZE bytes"
14069
if [ "$FILE_SIZE" -gt 10485760 ]; then
@@ -151,7 +80,7 @@ jobs:
15180
working-directory: pkgs/intl4x/example_native
15281
if: matrix.os == 'macos-latest'
15382
run: |
154-
FILE_PATH="build/cli/macos_arm64/bundle/lib/libintl4x.dylib"
83+
FILE_PATH="build/cli/macos_arm64/bundle/lib/libicu4x.dylib"
15584
FILE_SIZE=$(stat -f %z "$FILE_PATH")
15685
echo "macOS executable size: $FILE_SIZE bytes"
15786
if [ "$FILE_SIZE" -gt 10485760 ]; then
@@ -167,177 +96,10 @@ jobs:
16796
working-directory: pkgs/intl4x/example_native
16897
if: matrix.os == 'windows-latest'
16998
run: |
170-
$filePath = ".\build\cli\windows_x64\bundle\lib\intl4x.dll"
99+
$filePath = ".\build\cli\windows_x64\bundle\lib\icu4x.dll"
171100
$fileSize = (Get-Item $filePath).Length
172101
Write-Host "Windows executable size: $fileSize bytes"
173102
if ($fileSize -gt 10485760) {
174103
Write-Host "Error: Windows executable size ($fileSize bytes) exceeds 10MB limit (10485760 bytes)."
175104
exit 1
176105
}
177-
178-
build_fetch:
179-
runs-on: ${{ matrix.os }}
180-
needs: [check_skip_fetch]
181-
# Only run if not PR, or if PR and skip_fetch is false
182-
if: github.event_name != 'pull_request' || needs.check_skip_fetch.outputs.skip_fetch == 'false'
183-
184-
strategy:
185-
matrix:
186-
os: [ubuntu-latest, macos-latest, windows-latest]
187-
188-
defaults:
189-
run:
190-
working-directory: pkgs/intl4x
191-
192-
steps:
193-
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
194-
with:
195-
submodules: true
196-
197-
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
198-
with:
199-
sdk: main
200-
201-
- run: dart pub get
202-
203-
- run: |
204-
dart tool/write_option_file.dart pubspec.yaml fetch
205-
dart tool/write_option_file.dart example_native/pubspec.yaml fetch
206-
207-
- run: dart test
208-
209-
- run: dart pub get
210-
working-directory: pkgs/intl4x/example_native
211-
212-
- run: dart --enable-experiment=record-use build cli bin/example_native.dart
213-
working-directory: pkgs/intl4x/example_native
214-
215-
- name: Run example_native (Linux)
216-
working-directory: pkgs/intl4x/example_native
217-
if: matrix.os == 'ubuntu-latest'
218-
run: ./build/cli/linux_x64/bundle/bin/example_native
219-
220-
- name: Print file size and check limit for example_native (Linux)
221-
working-directory: pkgs/intl4x/example_native
222-
if: matrix.os == 'ubuntu-latest'
223-
run: |
224-
FILE_PATH="build/cli/linux_x64/bundle/lib/libintl4x.so"
225-
FILE_SIZE=$(stat -c %s "$FILE_PATH")
226-
echo "Linux executable size: $FILE_SIZE bytes"
227-
if [ "$FILE_SIZE" -gt 10485760 ]; then
228-
echo "Error: Linux executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
229-
exit 1
230-
fi
231-
232-
- name: Run example_native (Mac)
233-
working-directory: pkgs/intl4x/example_native
234-
if: matrix.os == 'macos-latest'
235-
run: ./build/cli/macos_arm64/bundle/bin/example_native
236-
237-
- name: Print file size and check limit for example_native (Mac)
238-
working-directory: pkgs/intl4x/example_native
239-
if: matrix.os == 'macos-latest'
240-
run: |
241-
FILE_PATH="build/cli/macos_arm64/bundle/lib/libintl4x.dylib"
242-
FILE_SIZE=$(stat -f %z "$FILE_PATH")
243-
echo "macOS executable size: $FILE_SIZE bytes"
244-
if [ "$FILE_SIZE" -gt 10485760 ]; then
245-
echo "Error: macOS executable size ($FILE_SIZE bytes) exceeds 10MB limit (10485760 bytes)."
246-
exit 1
247-
fi
248-
249-
- name: Run example_native (Windows)
250-
working-directory: pkgs/intl4x/example_native
251-
if: matrix.os == 'windows-latest'
252-
run: .\build\cli\windows_x64\bundle\bin\example_native.exe
253-
254-
- name: Print file size and check limit for example_native (Windows)
255-
working-directory: pkgs/intl4x/example_native
256-
if: matrix.os == 'windows-latest'
257-
run: |
258-
$filePath = ".\build\cli\windows_x64\bundle\lib\intl4x.dll"
259-
$fileSize = (Get-Item $filePath).Length
260-
Write-Host "Windows executable size: $fileSize bytes"
261-
if ($fileSize -gt 10485760) {
262-
Write-Host "Error: Windows executable size ($fileSize bytes) exceeds 10MB limit (10485760 bytes)."
263-
exit 1
264-
}
265-
266-
build_local:
267-
strategy:
268-
fail-fast: false
269-
matrix:
270-
os: [ubuntu-latest, macos-latest, windows-latest]
271-
runs-on: ${{ matrix.os }}
272-
273-
steps:
274-
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
275-
with:
276-
submodules: true
277-
278-
- name: Install Rust toolchains
279-
run: |
280-
rustup toolchain install stable
281-
rustup toolchain install nightly
282-
283-
- name: Show the selected Rust toolchain
284-
run: rustup show
285-
286-
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
287-
with:
288-
sdk: main
289-
290-
- name: Prep build
291-
run: |
292-
(cd pkgs/intl4x && dart pub get)
293-
294-
- name: Build Linux
295-
if: matrix.os == 'ubuntu-latest'
296-
run: |
297-
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
298-
299-
dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/linux_x64 --os linux --architecture x64 --compile_type dynamic --cargo_features collator,datetime,list,decimal,plurals,casemap,experimental,compiled_data
300-
301-
- name: Build Mac
302-
if: matrix.os == 'macos-latest'
303-
run: |
304-
rustup component add rust-src --toolchain nightly-aarch64-apple-darwin
305-
306-
dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/macos_arm64 --os macos --architecture arm64 --compile_type dynamic --cargo_features collator,datetime,list,decimal,plurals,casemap,experimental,compiled_data
307-
308-
- name: Build Windows
309-
if: matrix.os == 'windows-latest'
310-
run: |
311-
rustup component add rust-src --toolchain nightly-x86_64-pc-windows-msvc
312-
313-
dart pkgs/intl4x/lib/src/hook_helpers/build_libs.g.dart --working_directory submodules/icu4x --file submodules/icu4x/bin/windows_x64 --os windows --architecture x64 --compile_type dynamic --cargo_features collator,datetime,list,decimal,plurals,casemap,experimental,compiled_data
314-
315-
- name: Run `dart pub get`
316-
run: |
317-
cd pkgs/intl4x
318-
dart pub get
319-
320-
- run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local $(realpath submodules/icu4x/bin/linux_x64)
321-
if: matrix.os == 'ubuntu-latest'
322-
323-
- run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local $(realpath submodules/icu4x/bin/macos_arm64)
324-
if: matrix.os == 'macos-latest'
325-
326-
- run: dart pkgs/intl4x/tool/write_option_file.dart pkgs/intl4x/pubspec.yaml local (Get-Item submodules\icu4x\bin\windows_x64).FullName -replace '/', '\'
327-
if: matrix.os == 'windows-latest'
328-
329-
- run: echo $LOCAL_ICU4X_BINARY
330-
331-
- name: Display structure of downloaded files
332-
run: ls -R
333-
334-
- name: Run `dart test`
335-
run: |
336-
cd pkgs/intl4x
337-
dart test
338-
339-
- run: dart pub get
340-
working-directory: pkgs/intl4x/example_native
341-
342-
- run: dart --enable-experiment=record-use build cli
343-
working-directory: pkgs/intl4x/example_native

0 commit comments

Comments
 (0)