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

[infra] Use Pub Workspaces #1884

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e2d528f
Added ffi to workspace
Levi-Lesches Jan 12, 2025
935a52c
Added ffigen to workspace
Levi-Lesches Jan 12, 2025
4abff69
Added jni to workspace (FAILED)
Levi-Lesches Jan 12, 2025
58df689
Fixed jni issues
Levi-Lesches Jan 13, 2025
6d1fb6b
Fixed issues in ffigen
Levi-Lesches Jan 13, 2025
2998552
Added jnigen to workspace
Levi-Lesches Jan 13, 2025
fefc30f
Added native_assets_builder to the workspace
Levi-Lesches Jan 13, 2025
349c05c
Fixed issues with native_assets_builder/test_data/*
Levi-Lesches Jan 13, 2025
aad35e2
Fix lints
Levi-Lesches Jan 13, 2025
d512ee2
Fixed issues in native_assets_cli
Levi-Lesches Jan 13, 2025
c6069a0
Added objective_c to the workspace
Levi-Lesches Jan 13, 2025
7394804
Added swift2objc ot the workspace
Levi-Lesches Jan 13, 2025
c1ec515
Added swiftgen to the workspace
Levi-Lesches Jan 13, 2025
eaf70d0
Bumped publish CI to stable channel (from dev)
Levi-Lesches Jan 13, 2025
234310e
Added ffi and ffigen to workspace analysis_options.yaml
Levi-Lesches Jan 13, 2025
04efe21
Added jni to analysis_options.yaml and fixed lints
Levi-Lesches Jan 13, 2025
0285b9a
Added jnigen to analysis_options.yaml and fixed lints
Levi-Lesches Jan 13, 2025
4c21c13
Added native_assets_builder to analysis_options.yaml
Levi-Lesches Jan 13, 2025
2cdbf2c
Added native_assets_cli to analysis_options.yaml
Levi-Lesches Jan 13, 2025
788f876
Added native_toolchain_c and objective_c to analysis_options
Levi-Lesches Jan 13, 2025
b0d1609
Added swift2objc to analysis_options and fixed lints
Levi-Lesches Jan 13, 2025
29536dc
Added swiftgen to analysis_options
Levi-Lesches Jan 13, 2025
4f0391a
Formatted and fixed lints
Levi-Lesches Jan 13, 2025
1e939dd
Added all native_assets_builder/test_data to workspace
Levi-Lesches Jan 13, 2025
e449145
Revert "Added all native_assets_builder/test_data to workspace"
Levi-Lesches Jan 13, 2025
466625f
Fixed wrong_linker name
Levi-Lesches Jan 13, 2025
b69058e
Fixed fail_on_os_sdk_version_link name
Levi-Lesches Jan 13, 2025
92c57ac
Fixed native_add_source name
Levi-Lesches Jan 13, 2025
27286a9
Fixed native_add_version_skew name
Levi-Lesches Jan 13, 2025
bad52ba
Added all test_data to the workspace (not version_skew)
Levi-Lesches Jan 13, 2025
815671e
Updated CI to use Flutter and dev -> beta channel
Levi-Lesches Jan 13, 2025
ca1602f
CI: Replaced beta -> main channel
Levi-Lesches Jan 14, 2025
33640fa
Reworked native_assets_builder test helpers to remove workspace
Levi-Lesches Jan 14, 2025
58f28cd
Fixed more CI checks
Levi-Lesches Jan 14, 2025
f389a65
Removed extra pub gets from CI
Levi-Lesches Jan 14, 2025
bc7ec72
Added native_assets_cli/example/* to workspace
Levi-Lesches Jan 15, 2025
29c6eea
Added ffigen/example/* to the workspace
Levi-Lesches Jan 15, 2025
fbe5cd4
Merge branch 'main' into workspaces
Levi-Lesches Jan 15, 2025
b3f91b2
Merged main branch
Levi-Lesches Jan 15, 2025
e7e5adb
Bumped versions and added Dart 3.6 to changelogs
Levi-Lesches Jan 15, 2025
c4fe35c
Fix some more CIs
Levi-Lesches Jan 15, 2025
a2f412a
Fix even more CI
Levi-Lesches Jan 15, 2025
1d86663
Fix package:jni ffigen issues
HosseinYousefi Jan 21, 2025
bf5d11c
Merged main
Levi-Lesches Jan 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
11 changes: 5 additions & 6 deletions .github/workflows/ffi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ env:

jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
defaults:
Expand All @@ -29,10 +28,10 @@ jobs:
strategy:
fail-fast: false
matrix:
sdk: [dev]
sdk: [main]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
- uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
sdk: ${{ matrix.sdk }}
- id: install
Expand All @@ -47,7 +46,7 @@ jobs:

# Run tests on a matrix consisting of two dimensions:
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
# 2. release channel: dev
# 2. release channel: main
test:
needs: analyze
runs-on: ${{ matrix.os }}
Expand All @@ -59,10 +58,10 @@ jobs:
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [beta, dev]
sdk: [main]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
- uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
sdk: ${{ matrix.sdk }}
- id: install
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/ffigen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
channel: 'stable'
- id: install
name: Install dependencies
run: flutter pub get && flutter pub get --directory="example/shared_bindings" && flutter pub get --directory="../objective_c"
run: flutter pub get && flutter pub get --directory="example/shared_bindings"
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
with:
channel: 'stable'
- name: Install dependencies
run: flutter pub get && flutter pub get --directory="../objective_c"
run: flutter pub get
- name: Build test dylib and bindings
run: dart test/setup.dart
- name: Run VM tests and collect coverage
Expand Down Expand Up @@ -109,8 +109,10 @@ jobs:
- uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
- name: Configure native-assets
run: flutter config --enable-native-assets
- name: Install dependencies
run: flutter pub get && flutter pub get --directory="../objective_c"
run: flutter pub get
- name: Build test dylib and bindings
run: dart test/setup.dart --main-thread-dispatcher
- name: Run Flutter tests
Expand Down Expand Up @@ -142,7 +144,7 @@ jobs:
# If we need to change the generated code, we should temporarily disable this
# test, or temporarily disable the requirement for all bots to be green to
# merge PRs.
# Running this sanity check on one OS should be sufficient. Chosing Windows
# Running this sanity check on one OS should be sufficient. Choosing Windows
# because it is the most likely to break.
test-windows-flutter:
needs: analyze
Expand All @@ -155,9 +157,11 @@ jobs:
- uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: "master"
- name: Configure native-assets
run: flutter config --enable-native-assets
- name: Install dependencies
run: flutter pub get
- name: Build test dylib and bindings
run: dart test/setup.dart
- name: Run VM tests
run: flutter pub run test test_flutter/
run: flutter test test_flutter/
4 changes: 3 additions & 1 deletion .github/workflows/ffigen_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ jobs:
- uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
- name: Configure native-assets
run: flutter config --enable-native-assets
- name: Install dependencies
run: flutter pub get && flutter pub get --directory="../objective_c"
run: flutter pub get
- name: Build test dylib and bindings
run: dart test/setup.dart --main-thread-dispatcher
- name: Run VM tests
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/jnigen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
args: '--set-exit-if-changed'
- id: install
name: Install dependencies
run: dart pub get
run: flutter pub get
- name: install dependencies for android test runner
run: flutter pub get
working-directory: ./pkgs/jnigen/android_test_runner
Expand All @@ -74,7 +74,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
sdk: [stable, beta]
sdk: [stable, main]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
Expand All @@ -94,7 +94,7 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y clang-format
- name: Install dependencies
run: dart pub get
run: flutter pub get
- name: build in_app_java APK
run: flutter build apk --target-platform=android-arm64
working-directory: ./pkgs/jnigen/example/in_app_java
Expand Down Expand Up @@ -147,6 +147,7 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y clang-format build-essential cmake
- run: flutter pub get
- run: flutter pub get -C example
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
- name: Run lints
Expand Down Expand Up @@ -179,10 +180,9 @@ jobs:
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libclang-dev
- run: dart pub get
- run: dart run jni:setup
- name: Get dependencies
run: dart pub get
run: flutter pub get
- name: Run tests
run: dart test --test-randomize-ordering-seed random
- name: Install coverage
Expand Down Expand Up @@ -226,7 +226,7 @@ jobs:
distribution: 'zulu'
java-version: '17'
- run: Add-Content $env:GITHUB_PATH "$env:JAVA_HOME\bin\server"
- run: dart pub get
- run: flutter pub get
- run: dart run jni:setup
- run: dart test --test-randomize-ordering-seed random

Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
java-version: '17'
- run: git config --global core.autocrlf true
- run: Add-Content $env:GITHUB_PATH "$env:JAVA_HOME\bin\server"
- run: dart pub get
- run: flutter pub get
- run: dart run jnigen:setup
- name: Build summarizer
run: dart run jnigen:setup
Expand All @@ -278,7 +278,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- run: dart pub get
- run: flutter pub get
- run: dart run jni:setup
- run: dart test --test-randomize-ordering-seed random

Expand All @@ -304,7 +304,7 @@ jobs:
distribution: 'temurin'
java-version: '17'
- run: git config --global core.autocrlf true
- run: dart pub get
- run: flutter pub get
- name: Build summarizer
run: dart run jnigen:setup
- name: Run tests
Expand Down Expand Up @@ -393,7 +393,7 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev clang-format
- run: flutter config --enable-linux-desktop
- run: dart pub get
- run: flutter pub get
- name: Generate full bindings
run: dart run jnigen --config jnigen.yaml --override classes="org.apache.pdfbox"
- name: Analyze generated bindings
Expand All @@ -402,7 +402,7 @@ jobs:
flutter analyze
- name: Run standalone example
run: |
dart pub get
flutter pub get
dart run jni:setup
wget 'https://raw.githubusercontent.com/dart-lang/site-www/a7f170389e210adc2aef810cc9a6fdbfa78059a5/src/guides/language/specifications/DartLangSpec-v2.2.pdf'
dart run bin/pdf_info.dart DartLangSpec-v2.2.pdf
Expand Down
100 changes: 10 additions & 90 deletions .github/workflows/native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
sdk: [stable, dev]
sdk: [stable, main]
package: [native_assets_builder, native_assets_cli, native_toolchain_c]
# Breaking changes temporarily break the example run on the Dart SDK until native_assets_builder is rolled into the Dart SDK dev build.
breaking-change: [false]
Expand All @@ -46,7 +46,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
- uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
sdk: ${{ matrix.sdk }}

Expand All @@ -57,89 +57,9 @@ jobs:

- run: dart pub get

- run: dart pub get -C test_data/dart_app/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/native_add/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/native_add_duplicate/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/native_add_add_source/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/native_add_version_skew/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/native_subtract/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/package_reading_metadata/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/package_with_metadata/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/simple_link/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/complex_link/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/complex_link_helper/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/drop_dylib_link/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/add_asset_link/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/transformer/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/treeshaking_native_libs/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/native_dynamic_linking/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C example/build/download_asset/
if: ${{ matrix.package == 'native_assets_cli' }}

- run: dart pub get -C example/build/native_dynamic_linking/
if: ${{ matrix.package == 'native_assets_cli' }}

- run: dart pub get -C example/build/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' }}

- run: dart pub get -C example/build/native_add_library/
if: ${{ matrix.package == 'native_assets_cli' }}

- run: dart pub get -C example/build/use_dart_api/
if: ${{ matrix.package == 'native_assets_cli' }}

- run: dart pub get -C example/build/system_library/
if: ${{ matrix.package == 'native_assets_cli' }}

- run: dart pub get -C example/link/package_with_assets/
if: ${{ matrix.package == 'native_assets_cli' }}

- run: dart pub get -C example/link/app_with_asset_treeshaking/
if: ${{ matrix.package == 'native_assets_cli' }}
- run: dart pub get -C test_data/fail_build/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/depend_on_fail_build/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/depend_on_fail_build_app/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart pub get -C test_data/system_library/
if: ${{ matrix.package == 'native_assets_builder' }}

- run: dart analyze --fatal-infos
# Run on dev to ensure we're not depending on deprecated SDK things.

Expand All @@ -156,32 +76,32 @@ jobs:
# TODO(https://github.com/dart-lang/native/issues/190): Enable on windows once
# https://github.com/dart-lang/sdk/commit/903eea6bfb8ee405587f0866a1d1e92eea45d29e
# has landed in dev channel.
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change && matrix.os != 'windows' }}
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'main' && !matrix.breaking-change && matrix.os != 'windows' }}

- run: dart --enable-experiment=native-assets test
working-directory: pkgs/${{ matrix.package }}/example/build/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'main' && !matrix.breaking-change }}

- run: dart --enable-experiment=native-assets run
working-directory: pkgs/${{ matrix.package }}/example/build/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'main' && !matrix.breaking-change }}

- run: dart --enable-experiment=native-assets build bin/native_add_app.dart
working-directory: pkgs/${{ matrix.package }}/example/build/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'main' && !matrix.breaking-change }}

- run: ./native_add_app.exe
working-directory: pkgs/${{ matrix.package }}/example/build/native_add_app/bin/native_add_app/
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'main' && !matrix.breaking-change }}

- run: dart --enable-experiment=native-assets test
working-directory: pkgs/${{ matrix.package }}/example/build/use_dart_api/
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'main' && !matrix.breaking-change }}

# TODO(https://github.com/dart-lang/native/issues/1879): Enable this when the fix has rolled into Dart.
# - run: dart --enable-experiment=native-assets test
# working-directory: pkgs/${{ matrix.package }}/example/build/system_library/
# if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change }}
# if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'main' && !matrix.breaking-change }}

- name: Install coverage
run: dart pub global activate coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/native_toolchain_c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
- uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
sdk: ${{ matrix.sdk }}

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/objective_c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
- id: install
name: Install dependencies
run: flutter pub get
- name: Install example dependencies
run: flutter pub get -C example
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
Expand All @@ -57,6 +59,8 @@ jobs:
channel: 'stable'
- name: Install dependencies
run: flutter pub get
- name: Install example dependencies
run: flutter pub get -C example
- name: Build test dylib
# TODO(https://github.com/dart-lang/native/issues/1068): Remove this.
run: dart test/setup.dart
Expand Down
Loading
Loading