diff --git a/.github/ISSUE_TEMPLATE/ffi.md b/.github/ISSUE_TEMPLATE/ffi.md
new file mode 100644
index 000000000..9c42a774e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/ffi.md
@@ -0,0 +1,5 @@
+---
+name: "package:ffi"
+about: "Create a bug or file a feature request against package:ffi."
+labels: "package:ffi"
+---
diff --git a/.github/ISSUE_TEMPLATE/objective_c.md b/.github/ISSUE_TEMPLATE/objective_c.md
index 63039fbd6..97f1aaacf 100644
--- a/.github/ISSUE_TEMPLATE/objective_c.md
+++ b/.github/ISSUE_TEMPLATE/objective_c.md
@@ -3,4 +3,3 @@ name: "package:objective_c"
about: "Create a bug or file a feature request against package:objective_c."
labels: "package:objective_c"
---
-
diff --git a/.github/labeler.yml b/.github/labeler.yml
index 6db74365c..bcbd0bee6 100644
--- a/.github/labeler.yml
+++ b/.github/labeler.yml
@@ -2,40 +2,44 @@
'type-infra':
- changed-files:
- - any-glob-to-any-file: '.github/**'
+ - any-glob-to-any-file: '.github/**'
-'package:ffigen':
+'package:ffi':
- changed-files:
- - any-glob-to-any-file: 'pkgs/ffigen/**'
+ - any-glob-to-any-file: 'pkgs/ffi/**'
-'package:jnigen':
+'package:ffigen':
- changed-files:
- - any-glob-to-any-file: 'pkgs/jnigen/**'
+ - any-glob-to-any-file: 'pkgs/ffigen/**'
'package:jni':
- changed-files:
- - any-glob-to-any-file: 'pkgs/jni/**'
+ - any-glob-to-any-file: 'pkgs/jni/**'
+
+'package:jnigen':
+ - changed-files:
+ - any-glob-to-any-file: 'pkgs/jnigen/**'
'package:native_assets_builder':
- changed-files:
- - any-glob-to-any-file: 'pkgs/native_assets_builder/**'
+ - any-glob-to-any-file: 'pkgs/native_assets_builder/**'
'package:native_assets_cli':
- changed-files:
- - any-glob-to-any-file: 'pkgs/native_assets_cli/**'
+ - any-glob-to-any-file: 'pkgs/native_assets_cli/**'
'package:native_toolchain_c':
- changed-files:
- - any-glob-to-any-file: 'pkgs/native_toolchain_c/**'
+ - any-glob-to-any-file: 'pkgs/native_toolchain_c/**'
'package:objective_c':
- changed-files:
- - any-glob-to-any-file: 'pkgs/objective_c/**'
+ - any-glob-to-any-file: 'pkgs/objective_c/**'
-'package:swiftgen':
+'package:swift2objc':
- changed-files:
- - any-glob-to-any-file: 'pkgs/swiftgen/**'
+ - any-glob-to-any-file: 'pkgs/swift2objc/**'
-'package:swift2objc':
+'package:swiftgen':
- changed-files:
- - any-glob-to-any-file: 'pkgs/swiftgen/swift2objc/**'
+ - any-glob-to-any-file: 'pkgs/swiftgen/**'
diff --git a/.github/workflows/ffi.yaml b/.github/workflows/ffi.yaml
index 2e6692fec..e521a3caf 100644
--- a/.github/workflows/ffi.yaml
+++ b/.github/workflows/ffi.yaml
@@ -31,8 +31,8 @@ jobs:
matrix:
sdk: [dev]
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
@@ -61,8 +61,8 @@ jobs:
os: [ubuntu-latest]
sdk: [beta, dev]
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
diff --git a/.github/workflows/ffigen.yml b/.github/workflows/ffigen.yml
index 22c151b4d..a5a0cc5f1 100644
--- a/.github/workflows/ffigen.yml
+++ b/.github/workflows/ffigen.yml
@@ -31,8 +31,8 @@ jobs:
# strategy:
# fail-fast: false
# steps:
- # - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- # - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ # - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
# with:
# channel: 'stable'
# - id: install
@@ -53,8 +53,8 @@ jobs:
# run:
# working-directory: pkgs/ffigen/
# steps:
- # - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- # - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ # - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
# with:
# channel: 'stable'
# - name: Install dependencies
@@ -74,8 +74,8 @@ jobs:
run:
working-directory: pkgs/ffigen/
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
- name: Install dependencies
@@ -151,8 +151,8 @@ jobs:
# run:
# working-directory: pkgs/ffigen/
# steps:
- # - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- # - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ # - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
# with:
# channel: "master"
# - name: Install dependencies
diff --git a/.github/workflows/ffigen_weekly.yml b/.github/workflows/ffigen_weekly.yml
index e1304365a..863eac384 100644
--- a/.github/workflows/ffigen_weekly.yml
+++ b/.github/workflows/ffigen_weekly.yml
@@ -27,8 +27,8 @@ jobs:
run:
working-directory: pkgs/ffigen/
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
- name: Install dependencies
diff --git a/.github/workflows/jnigen.yaml b/.github/workflows/jnigen.yaml
index e64bf7f9e..462c84f10 100644
--- a/.github/workflows/jnigen.yaml
+++ b/.github/workflows/jnigen.yaml
@@ -40,15 +40,16 @@ jobs:
matrix:
sdk: [stable]
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: ${{ matrix.sdk }}
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: axel-op/googlejavaformat-action@fe78db8a90171b6a836449f8d0e982d5d71e5c5a
+ - uses: axel-op/googlejavaformat-action@0dc4ef525e7ed73d8dff50b1b062a4d441d014b5
name: 'Check Java formatting with google-java-format'
with:
+ version: 'v1.24.0'
args: '--set-exit-if-changed'
- id: install
name: Install dependencies
@@ -75,13 +76,13 @@ jobs:
os: [ubuntu-latest]
sdk: [stable, beta]
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: ${{ matrix.sdk }}
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'zulu'
java-version: '17'
@@ -112,7 +113,7 @@ jobs:
- name: Collect coverage
run: dart pub global run coverage:test_with_coverage
- name: Upload coverage
- uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8
with:
flag-name: jnigen
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -126,19 +127,20 @@ jobs:
run:
working-directory: ./pkgs/jni
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'zulu'
java-version: '17'
- - uses: axel-op/googlejavaformat-action@fe78db8a90171b6a836449f8d0e982d5d71e5c5a
+ - uses: axel-op/googlejavaformat-action@0dc4ef525e7ed73d8dff50b1b062a4d441d014b5
name: 'Check Java formatting with google-java-format'
with:
+ version: 'v1.24.0'
args: '--set-exit-if-changed'
- name: install clang tools & CMake
run: |
@@ -164,13 +166,13 @@ jobs:
run:
working-directory: ./pkgs/jni
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'zulu'
java-version: '17'
@@ -188,7 +190,7 @@ jobs:
- name: Collect coverage
run: dart pub global run coverage:test_with_coverage
- name: Upload coverage
- uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8
with:
flag-name: jni
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -213,13 +215,13 @@ jobs:
run:
working-directory: ./pkgs/jni
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'zulu'
java-version: '17'
@@ -235,18 +237,18 @@ jobs:
run:
working-directory: ./pkgs/jnigen
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup clang
uses: egor-tensin/setup-clang@ef434b41eb33a70396fb336b1bae39c76d740c3d
with:
version: latest
platform: x64
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'zulu'
java-version: '17'
@@ -266,13 +268,13 @@ jobs:
run:
working-directory: ./pkgs/jni
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'temurin'
java-version: '17'
@@ -287,17 +289,17 @@ jobs:
run:
working-directory: ./pkgs/jnigen
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup clang format
uses: ConorMacBride/install-package@3e7ad059e07782ee54fa35f827df52aae0626f30
with:
brew: clang-format
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'temurin'
java-version: '17'
@@ -314,13 +316,13 @@ jobs:
run:
working-directory: ./pkgs/jni/example
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'zulu'
java-version: '17'
@@ -338,13 +340,13 @@ jobs:
run:
working-directory: ./pkgs/jni/example
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'zulu'
java-version: '17'
@@ -358,12 +360,12 @@ jobs:
run:
working-directory: ./pkgs/jni/example
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'zulu'
java-version: '17'
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
@@ -377,13 +379,13 @@ jobs:
run:
working-directory: ./pkgs/jnigen/example/pdfbox_plugin
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
- - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
+ - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
distribution: 'zulu'
java-version: '17'
@@ -416,7 +418,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Coveralls finished
- uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8
with:
carryforward: "ffigen,jni,jnigen,native_assets_builder_macos,native_assets_builder_ubuntu,native_assets_builder_windows,native_assets_cli_macos,native_assets_cli_ubuntu,native_assets_cli_windows,native_toolchain_c_macos,native_toolchain_c_ubuntu,native_toolchain_c_windows,objective_c,swift2objc"
github-token: ${{ secrets.github_token }}
diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml
index c88245d2b..84ea83274 100644
--- a/.github/workflows/native.yaml
+++ b/.github/workflows/native.yaml
@@ -7,7 +7,7 @@ permissions: read-all
on:
pull_request:
- branches: [main]
+ # No `branches:` to enable stacked PRs on GitHub.
paths:
- ".github/workflows/native.yaml"
- "pkgs/native_assets_builder/**"
@@ -44,9 +44,9 @@ jobs:
working-directory: pkgs/${{ matrix.package }}
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
+ - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
@@ -120,6 +120,15 @@ jobs:
- 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 analyze --fatal-infos
# Run on dev to ensure we're not depending on deprecated SDK things.
@@ -133,6 +142,9 @@ jobs:
- run: dart --enable-experiment=native-assets test
working-directory: pkgs/${{ matrix.package }}/example/build/native_dynamic_linking/
+ # 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' }}
- run: dart --enable-experiment=native-assets test
@@ -162,7 +174,7 @@ jobs:
run: dart pub global run coverage:test_with_coverage
- name: Upload coverage
- uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8
with:
flag-name: ${{ matrix.package }}_${{ matrix.os }}
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -173,7 +185,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Upload coverage
- uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8
with:
carryforward: "ffigen,jni,jnigen,native_assets_builder_macos,native_assets_builder_ubuntu,native_assets_builder_windows,native_assets_cli_macos,native_assets_cli_ubuntu,native_assets_cli_windows,native_toolchain_c_macos,native_toolchain_c_ubuntu,native_toolchain_c_windows,objective_c,swift2objc"
github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/native_toolchain_c.yaml b/.github/workflows/native_toolchain_c.yaml
index f438d2ba8..5af91a33d 100644
--- a/.github/workflows/native_toolchain_c.yaml
+++ b/.github/workflows/native_toolchain_c.yaml
@@ -32,9 +32,9 @@ jobs:
working-directory: pkgs/${{ matrix.package }}
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
+ - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
diff --git a/.github/workflows/objective_c.yaml b/.github/workflows/objective_c.yaml
index 5a9d94361..2c2ee64cb 100644
--- a/.github/workflows/objective_c.yaml
+++ b/.github/workflows/objective_c.yaml
@@ -30,8 +30,8 @@ jobs:
strategy:
fail-fast: false
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
- id: install
@@ -51,8 +51,8 @@ jobs:
run:
working-directory: pkgs/objective_c/
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
- name: Install dependencies
@@ -67,14 +67,14 @@ jobs:
# any git-diffs at this point, it means the generated code is outdated.
run: if [[ -n $(git status --porcelain | tee /dev/stderr) ]]; then echo -e "\nDIFF:"; git diff; false; fi
- name: Upload coverage
- uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8
with:
flag-name: objective_c
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
path-to-lcov: pkgs/objective_c/coverage/lcov.info
- name: Upload coverage
- uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8
with:
carryforward: "ffigen,jni,jnigen,native_assets_builder_macos,native_assets_builder_ubuntu,native_assets_builder_windows,native_assets_cli_macos,native_assets_cli_ubuntu,native_assets_cli_windows,native_toolchain_c_macos,native_toolchain_c_ubuntu,native_toolchain_c_windows,objective_c,swift2objc"
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -87,8 +87,8 @@ jobs:
run:
working-directory: pkgs/objective_c/example/
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
with:
channel: 'stable'
- name: Install dependencies
diff --git a/.github/workflows/swift2objc.yaml b/.github/workflows/swift2objc.yaml
index 26446a011..ddd79dd8e 100644
--- a/.github/workflows/swift2objc.yaml
+++ b/.github/workflows/swift2objc.yaml
@@ -28,8 +28,8 @@ jobs:
strategy:
fail-fast: false
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: stable
- id: install
@@ -49,8 +49,8 @@ jobs:
run:
working-directory: pkgs/swift2objc/
steps:
- - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
+ - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: stable
- name: Install dependencies
@@ -58,14 +58,14 @@ jobs:
- name: Run VM tests and collect coverage
run: dart run coverage:test_with_coverage --scope-output=swift2objc
- name: Upload coverage
- uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8
with:
flag-name: swift2objc
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
path-to-lcov: pkgs/swift2objc/coverage/lcov.info
- name: Upload coverage
- uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
+ uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8
with:
carryforward: "ffigen,jni,jnigen,native_assets_builder_macos,native_assets_builder_ubuntu,native_assets_builder_windows,native_assets_cli_macos,native_assets_cli_ubuntu,native_assets_cli_windows,native_toolchain_c_macos,native_toolchain_c_ubuntu,native_toolchain_c_windows,objective_c,swift2objc"
github-token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/README.md b/README.md
index 284111fec..b432d9de0 100644
--- a/README.md
+++ b/README.md
@@ -7,18 +7,29 @@ building and bundling.
## Packages
-| Package | Description | Version |
-| --- | --- | --- |
-| [ffi](pkgs/ffi/) | Utilities for working with Foreign Function Interface (FFI) code. | [![pub package](https://img.shields.io/pub/v/ffi.svg)](https://pub.dev/packages/ffi) |
-| [ffigen](pkgs/ffigen/) | Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files. | [![pub package](https://img.shields.io/pub/v/ffigen.svg)](https://pub.dev/packages/ffigen) |
-| [objective_c](pkgs/objective_c/) | A library to access Objective C from Flutter that acts as a support library for package:ffigen. | [![pub package](https://img.shields.io/pub/v/objective_c.svg)](https://pub.dev/packages/objective_c) |
-| [jni](pkgs/jni/) | A library to access JNI from Dart and Flutter that acts as a support library for `package:jnigen`. | [![pub package](https://img.shields.io/pub/v/jni.svg)](https://pub.dev/packages/jni) |
-| [jnigen](pkgs/jnigen/) | A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. | [![pub package](https://img.shields.io/pub/v/jnigen.svg)](https://pub.dev/packages/jnigen) |
-| [swift2objc](pkgs/swift2objc/) | Generates ObjC compatibility wrappers for Swift APIs. | [![pub package](https://img.shields.io/pub/v/swift2objc.svg)](https://pub.dev/packages/swift2objc) |
-| [swiftgen](pkgs/swiftgen/) | A Dart bindings generator for Swift. | [![pub package](https://img.shields.io/pub/v/swiftgen.svg)](https://pub.dev/packages/swiftgen) |
-| [native_assets_builder](pkgs/native_assets_builder/) | This package is the backend that invokes build hooks. | [![pub package](https://img.shields.io/pub/v/native_assets_builder.svg)](https://pub.dev/packages/native_assets_builder) |
-| [native_assets_cli](pkgs/native_assets_cli/) | A library that contains the argument and file formats for implementing a native assets CLI. | [![pub package](https://img.shields.io/pub/v/native_assets_cli.svg)](https://pub.dev/packages/native_assets_cli) |
-| [native_toolchain_c](pkgs/native_toolchain_c/) | A library to invoke the native C compiler installed on the host machine. | [![pub package](https://img.shields.io/pub/v/native_toolchain_c.svg)](https://pub.dev/packages/native_toolchain_c) |
+| Package | Description | Issues | Version |
+| --- | --- | --- | --- |
+| [ffi](pkgs/ffi/) | Utilities for working with Foreign Function Interface (FFI) code. | [![issues](https://img.shields.io/badge/package:ffi-4774bc)][ffi_issues] | [![pub package](https://img.shields.io/pub/v/ffi.svg)](https://pub.dev/packages/ffi) |
+| [ffigen](pkgs/ffigen/) | Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files. | [![issues](https://img.shields.io/badge/package:ffigen-4774bc)][ffigen_issues] | [![pub package](https://img.shields.io/pub/v/ffigen.svg)](https://pub.dev/packages/ffigen) |
+| [jni](pkgs/jni/) | A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. | [![issues](https://img.shields.io/badge/package:jni-4774bc)][jni_issues] | [![pub package](https://img.shields.io/pub/v/jni.svg)](https://pub.dev/packages/jni) |
+| [jnigen](pkgs/jnigen/) | A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. | [![issues](https://img.shields.io/badge/package:jnigen-4774bc)][jnigen_issues] | [![pub package](https://img.shields.io/pub/v/jnigen.svg)](https://pub.dev/packages/jnigen) |
+| [native_assets_builder](pkgs/native_assets_builder/) | This package is the backend that invokes build hooks. | [![issues](https://img.shields.io/badge/package:native__assets__builder-4774bc)][native_assets_builder_issues] | |
+| [native_assets_cli](pkgs/native_assets_cli/) | A library that contains the argument and file formats for implementing a native assets CLI. | [![issues](https://img.shields.io/badge/package:native__assets__cli-4774bc)][native_assets_cli_issues] | |
+| [native_toolchain_c](pkgs/native_toolchain_c/) | A library to invoke the native C compiler installed on the host machine. | [![issues](https://img.shields.io/badge/package:native__toolchain__c-4774bc)][native_toolchain_c_issues] | |
+| [objective_c](pkgs/objective_c/) | A library to access Objective C from Flutter that acts as a support library for package:ffigen. | [![issues](https://img.shields.io/badge/package:objective__c-4774bc)][objective_c_issues] | [![pub package](https://img.shields.io/pub/v/objective_c.svg)](https://pub.dev/packages/objective_c) |
+| [swift2objc](pkgs/swift2objc/) | A tool for generating bindings that allow interop between Dart and Swift code. | [![issues](https://img.shields.io/badge/package:swift2objc-4774bc)][swift2objc_issues] | [![pub package](https://img.shields.io/pub/v/swift2objc.svg)](https://pub.dev/packages/swift2objc) |
+| [swiftgen](pkgs/swiftgen/) | A tool for generating bindings that allow interop between Dart and Swift code. | [![issues](https://img.shields.io/badge/package:swiftgen-4774bc)][swiftgen_issues] | [![pub package](https://img.shields.io/pub/v/swiftgen.svg)](https://pub.dev/packages/swiftgen) |
+
+[ffi_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Affi
+[ffigen_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Affigen
+[jni_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajni
+[jnigen_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajnigen
+[native_assets_builder_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Anative_assets_builder
+[native_assets_cli_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Anative_assets_cli
+[native_toolchain_c_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Anative_toolchain_c
+[objective_c_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aobjective_c
+[swift2objc_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aswift2objc
+[swiftgen_issues]: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aswiftgen
## External packages
diff --git a/pkgs/ffi/pubspec.yaml b/pkgs/ffi/pubspec.yaml
index 1a3e9d240..55261524e 100644
--- a/pkgs/ffi/pubspec.yaml
+++ b/pkgs/ffi/pubspec.yaml
@@ -2,6 +2,7 @@ name: ffi
version: 2.1.3
description: Utilities for working with Foreign Function Interface (FFI) code.
repository: https://github.com/dart-lang/native/tree/main/pkgs/ffi
+issue_tracker: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Affi
topics:
- interop
diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md
index 46c97e3b8..964eaee34 100644
--- a/pkgs/ffigen/CHANGELOG.md
+++ b/pkgs/ffigen/CHANGELOG.md
@@ -1,6 +1,40 @@
-## 15.1.0-wip
+## 16.0.1-wip
+
+- Ensure that required symbols are available to FFI even when the final binary
+ is linked with `-dead_strip`.
+- Handle dart typedefs in import/export of symbol files.
+
+## 16.0.0
- Ensure all protocols referenced in bindings are available at runtime.
+- Use `package:dart_style` directly to format generated Dart code, rather than
+ subprocessing to `dart format`.
+- Use package:objective_c 4.0.0
+- Fix various small bugs todo with config filters:
+ - https://github.com/dart-lang/native/issues/1582
+ - https://github.com/dart-lang/native/issues/1594
+ - https://github.com/dart-lang/native/issues/1595
+- Fix [a bug](https://github.com/dart-lang/native/issues/1701) where nullable
+ typealiases were treated as non-null.
+- Allow static and instance methods to have the same name:
+ https://github.com/dart-lang/native/issues/1136
+- __Breaking change__: Change the way ObjC categories are generated. Instead of
+ inserting their methods into the interface, generate Dart extension methods.
+ For instance methods this makes no difference to user code (as long as the
+ extension methods are imported correctly). But for static methods it means
+ `MyInterface.staticMethod` must change to `MyCategory.staticMethod`.
+ Categories are included/excluded by the `objc-categories` config entry.
+- Add `include-transitive-objc-interfaces`, `include-transitive-objc-protocols`,
+ and `include-transitive-objc-categories` config flags, which control whether
+ transitively included ObjC interfaces, protocols, and categories are
+ generated.
+- __Breaking change__: `include-transitive-objc-interfaces` defaults to false,
+ which changes the default behavior from pulling in all transitive deps, to
+ generating them as stubs. `include-transitive-objc-protocols` defaults to
+ false, and `include-transitive-objc-categories` defaults to true, but these
+ both replicate the existing behavior.
+- Fix [bugs](https://github.com/dart-lang/native/issues/1220) caused by
+ mismatches between ObjC and Dart's inheritance rules.
## 15.0.0
diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md
index 4ddf5255a..5077f7139 100644
--- a/pkgs/ffigen/README.md
+++ b/pkgs/ffigen/README.md
@@ -719,12 +719,14 @@ external-versions:
- objc-interfaces
objc-protocols
+ objc-interfaces
+ objc-protocols
+ objc-categories
|
- Filters for Objective C interface and protocol declarations. This option
- works the same as other declaration filters like `functions` and
- `structs`.
+ Filters for Objective C interface, protocol, and category declarations.
+ This option works the same as other declaration filters like `functions`
+ and `structs`.
|
@@ -745,6 +747,10 @@ objc-protocols:
include:
# Generates bindings for a specific protocol.
- MyProtocol
+objc-category:
+ include:
+ # Generates bindings for a specific category.
+ - MyCategory
```
|
@@ -752,12 +758,15 @@ objc-protocols:
- objc-interfaces.module
objc-protocols.module
+ objc-interfaces.module
+ objc-protocols.module
|
Adds a module prefix to the interface/protocol name when loading it
from the dylib. This is only relevent for ObjC headers that are generated
wrappers for a Swift library. See example/swift for more information.
+
+ This is not necessary for objc-categories.
|
@@ -782,7 +791,9 @@ objc-interfaces:
|
- objc-interfaces.member-filter
objc-protocols.member-filter
+ objc-interfaces.member-filter
+ objc-protocols.member-filter
+ objc-categories.member-filter
|
Filters interface and protocol methods and properties. This is a map from
@@ -806,10 +817,67 @@ objc-protocols:
NS.*: # Matches all protocols starting with NS.
exclude:
- copy.* # Remove all copy methods from these protocols.
+objc-categories:
+ member-filter:
+ MyCategory:
+ include:
+ - init.* # Include all init methods.
```
|
+
+
+
+ include-transitive-objc-interfaces
+ include-transitive-objc-protocols
+ |
+
+ By default, Objective-C interfaces and protocols that are not directly
+ included by the inclusion rules, but are transitively depended on by
+ the inclusions, are not fully code genned. Transitively included
+ interfaces are generated as stubs, and transitive protocols are omitted.
+
+ If these flags are enabled, transitively included interfaces and protocols
+ are fully code genned.
+
+ Default: false
+ |
+
+
+```yaml
+include-transitive-objc-interfaces: true
+include-transitive-objc-protocols: true
+```
+ |
+
+
+
+
+ include-transitive-objc-categories
+ |
+
+ By default, if an Objective-C interface is included in the bindings, all
+ the categories that extend it are also included. To filter them, set this
+ flag to false, then use objc-categories to include/exclude particular
+ categories.
+
+ Transitive categories are generated by default because it's not always
+ obvious from the Apple documentation which interface methods are declared
+ directly in the interface, and which are declared in categories. So it may
+ appear that the interface is missing methods, when in fact those methods
+ are part of a category. This would be a difficult problem to diagnose if
+ transitive categories were not generated by default.
+
+ Default: true
+ |
+
+
+```yaml
+include-transitive-objc-categories: false
+```
+ |
+
diff --git a/pkgs/ffigen/example/libclang-example/generated_bindings.dart b/pkgs/ffigen/example/libclang-example/generated_bindings.dart
index 3373a0f3e..3285e6587 100644
--- a/pkgs/ffigen/example/libclang-example/generated_bindings.dart
+++ b/pkgs/ffigen/example/libclang-example/generated_bindings.dart
@@ -7672,10 +7672,25 @@ typedef NativeClang_disposeStringSet = ffi.Void Function(
typedef DartClang_disposeStringSet = void Function(
ffi.Pointer set1);
+/// An "index" that consists of a set of translation units that would
+/// typically be linked together into an executable or library.
+typedef CXIndex = ffi.Pointer;
+
final class CXTargetInfoImpl extends ffi.Opaque {}
+/// An opaque type representing target information for a given translation
+/// unit.
+typedef CXTargetInfo = ffi.Pointer;
+
final class CXTranslationUnitImpl extends ffi.Opaque {}
+/// A single translation unit, which resides in an index.
+typedef CXTranslationUnit = ffi.Pointer;
+
+/// Opaque pointer representing client data that will be passed through
+/// to various callbacks and visitors.
+typedef CXClientData = ffi.Pointer;
+
/// Provides the contents of a file that has not yet been saved to disk.
///
/// Each CXUnsavedFile instance provides the name of a file on the
@@ -7695,6 +7710,37 @@ final class CXUnsavedFile extends ffi.Struct {
external int Length;
}
+/// Describes the availability of a particular entity, which indicates
+/// whether the use of this entity will result in a warning or error due to
+/// it being deprecated or unavailable.
+enum CXAvailabilityKind {
+ /// The entity is available.
+ CXAvailability_Available(0),
+
+ /// The entity is available, but has been deprecated (and its use is
+ /// not recommended).
+ CXAvailability_Deprecated(1),
+
+ /// The entity is not available; any use of it will be an error.
+ CXAvailability_NotAvailable(2),
+
+ /// The entity is available, but not accessible; any use of it will be
+ /// an error.
+ CXAvailability_NotAccessible(3);
+
+ final int value;
+ const CXAvailabilityKind(this.value);
+
+ static CXAvailabilityKind fromValue(int value) => switch (value) {
+ 0 => CXAvailability_Available,
+ 1 => CXAvailability_Deprecated,
+ 2 => CXAvailability_NotAvailable,
+ 3 => CXAvailability_NotAccessible,
+ _ =>
+ throw ArgumentError("Unknown value for CXAvailabilityKind: $value"),
+ };
+}
+
/// Describes a version number of the form major.minor.subminor.
final class CXVersion extends ffi.Struct {
/// The major version number, e.g., the '10' in '10.7.3'. A negative
@@ -7715,9 +7761,6 @@ final class CXVersion extends ffi.Struct {
external int Subminor;
}
-/// An "index" that consists of a set of translation units that would
-/// typically be linked together into an executable or library.
-typedef CXIndex = ffi.Pointer;
typedef NativeClang_createIndex = CXIndex Function(
ffi.Int excludeDeclarationsFromPCH, ffi.Int displayDiagnostics);
typedef DartClang_createIndex = CXIndex Function(
@@ -7789,9 +7832,6 @@ typedef NativeClang_getFileUniqueID = ffi.Int Function(
CXFile file, ffi.Pointer outID);
typedef DartClang_getFileUniqueID = int Function(
CXFile file, ffi.Pointer outID);
-
-/// A single translation unit, which resides in an index.
-typedef CXTranslationUnit = ffi.Pointer;
typedef NativeClang_isFileMultipleIncludeGuarded = ffi.UnsignedInt Function(
CXTranslationUnit tu, CXFile file);
typedef DartClang_isFileMultipleIncludeGuarded = int Function(
@@ -7963,15 +8003,51 @@ typedef NativeClang_disposeSourceRangeList = ffi.Void Function(
typedef DartClang_disposeSourceRangeList = void Function(
ffi.Pointer ranges);
+/// Describes the severity of a particular diagnostic.
+enum CXDiagnosticSeverity {
+ /// A diagnostic that has been suppressed, e.g., by a command-line
+ /// option.
+ CXDiagnostic_Ignored(0),
+
+ /// This diagnostic is a note that should be attached to the
+ /// previous (non-note) diagnostic.
+ CXDiagnostic_Note(1),
+
+ /// This diagnostic indicates suspicious code that may not be
+ /// wrong.
+ CXDiagnostic_Warning(2),
+
+ /// This diagnostic indicates that the code is ill-formed.
+ CXDiagnostic_Error(3),
+
+ /// This diagnostic indicates that the code is ill-formed such
+ /// that future parser recovery is unlikely to produce useful
+ /// results.
+ CXDiagnostic_Fatal(4);
+
+ final int value;
+ const CXDiagnosticSeverity(this.value);
+
+ static CXDiagnosticSeverity fromValue(int value) => switch (value) {
+ 0 => CXDiagnostic_Ignored,
+ 1 => CXDiagnostic_Note,
+ 2 => CXDiagnostic_Warning,
+ 3 => CXDiagnostic_Error,
+ 4 => CXDiagnostic_Fatal,
+ _ =>
+ throw ArgumentError("Unknown value for CXDiagnosticSeverity: $value"),
+ };
+}
+
+/// A single diagnostic, containing the diagnostic's severity,
+/// location, text, source ranges, and fix-it hints.
+typedef CXDiagnostic = ffi.Pointer;
+
/// A group of CXDiagnostics.
typedef CXDiagnosticSet = ffi.Pointer;
typedef NativeClang_getNumDiagnosticsInSet = ffi.UnsignedInt Function(
CXDiagnosticSet Diags);
typedef DartClang_getNumDiagnosticsInSet = int Function(CXDiagnosticSet Diags);
-
-/// A single diagnostic, containing the diagnostic's severity,
-/// location, text, source ranges, and fix-it hints.
-typedef CXDiagnostic = ffi.Pointer;
typedef NativeClang_getDiagnosticInSet = CXDiagnostic Function(
CXDiagnosticSet Diags, ffi.UnsignedInt Index);
typedef DartClang_getDiagnosticInSet = CXDiagnostic Function(
@@ -8043,43 +8119,6 @@ typedef DartClang_formatDiagnostic = CXString Function(
typedef NativeClang_defaultDiagnosticDisplayOptions = ffi.UnsignedInt
Function();
typedef DartClang_defaultDiagnosticDisplayOptions = int Function();
-
-/// Describes the severity of a particular diagnostic.
-enum CXDiagnosticSeverity {
- /// A diagnostic that has been suppressed, e.g., by a command-line
- /// option.
- CXDiagnostic_Ignored(0),
-
- /// This diagnostic is a note that should be attached to the
- /// previous (non-note) diagnostic.
- CXDiagnostic_Note(1),
-
- /// This diagnostic indicates suspicious code that may not be
- /// wrong.
- CXDiagnostic_Warning(2),
-
- /// This diagnostic indicates that the code is ill-formed.
- CXDiagnostic_Error(3),
-
- /// This diagnostic indicates that the code is ill-formed such
- /// that future parser recovery is unlikely to produce useful
- /// results.
- CXDiagnostic_Fatal(4);
-
- final int value;
- const CXDiagnosticSeverity(this.value);
-
- static CXDiagnosticSeverity fromValue(int value) => switch (value) {
- 0 => CXDiagnostic_Ignored,
- 1 => CXDiagnostic_Note,
- 2 => CXDiagnostic_Warning,
- 3 => CXDiagnostic_Error,
- 4 => CXDiagnostic_Fatal,
- _ =>
- throw ArgumentError("Unknown value for CXDiagnosticSeverity: $value"),
- };
-}
-
typedef NativeClang_getDiagnosticSeverity = ffi.UnsignedInt Function(
CXDiagnostic arg0);
typedef DartClang_getDiagnosticSeverity = int Function(CXDiagnostic arg0);
@@ -8363,10 +8402,6 @@ typedef NativeClang_disposeCXTUResourceUsage = ffi.Void Function(
CXTUResourceUsage usage);
typedef DartClang_disposeCXTUResourceUsage = void Function(
CXTUResourceUsage usage);
-
-/// An opaque type representing target information for a given translation
-/// unit.
-typedef CXTargetInfo = ffi.Pointer;
typedef NativeClang_getTranslationUnitTargetInfo = CXTargetInfo Function(
CXTranslationUnit CTUnit);
typedef DartClang_getTranslationUnitTargetInfo = CXTargetInfo Function(
@@ -9597,38 +9632,6 @@ enum CXVisibilityKind {
typedef NativeClang_getCursorVisibility = ffi.UnsignedInt Function(
CXCursor cursor);
typedef DartClang_getCursorVisibility = int Function(CXCursor cursor);
-
-/// Describes the availability of a particular entity, which indicates
-/// whether the use of this entity will result in a warning or error due to
-/// it being deprecated or unavailable.
-enum CXAvailabilityKind {
- /// The entity is available.
- CXAvailability_Available(0),
-
- /// The entity is available, but has been deprecated (and its use is
- /// not recommended).
- CXAvailability_Deprecated(1),
-
- /// The entity is not available; any use of it will be an error.
- CXAvailability_NotAvailable(2),
-
- /// The entity is available, but not accessible; any use of it will be
- /// an error.
- CXAvailability_NotAccessible(3);
-
- final int value;
- const CXAvailabilityKind(this.value);
-
- static CXAvailabilityKind fromValue(int value) => switch (value) {
- 0 => CXAvailability_Available,
- 1 => CXAvailability_Deprecated,
- 2 => CXAvailability_NotAvailable,
- 3 => CXAvailability_NotAccessible,
- _ =>
- throw ArgumentError("Unknown value for CXAvailabilityKind: $value"),
- };
-}
-
typedef NativeClang_getCursorAvailability = ffi.UnsignedInt Function(
CXCursor cursor);
typedef DartClang_getCursorAvailability = int Function(CXCursor cursor);
@@ -10038,6 +10041,64 @@ enum CXTypeKind {
}
}
+/// Describes the calling convention of a function type
+enum CXCallingConv {
+ CXCallingConv_Default(0),
+ CXCallingConv_C(1),
+ CXCallingConv_X86StdCall(2),
+ CXCallingConv_X86FastCall(3),
+ CXCallingConv_X86ThisCall(4),
+ CXCallingConv_X86Pascal(5),
+ CXCallingConv_AAPCS(6),
+ CXCallingConv_AAPCS_VFP(7),
+ CXCallingConv_X86RegCall(8),
+ CXCallingConv_IntelOclBicc(9),
+ CXCallingConv_Win64(10),
+ CXCallingConv_X86_64SysV(11),
+ CXCallingConv_X86VectorCall(12),
+ CXCallingConv_Swift(13),
+ CXCallingConv_PreserveMost(14),
+ CXCallingConv_PreserveAll(15),
+ CXCallingConv_AArch64VectorCall(16),
+ CXCallingConv_Invalid(100),
+ CXCallingConv_Unexposed(200);
+
+ static const CXCallingConv_X86_64Win64 = CXCallingConv_Win64;
+
+ final int value;
+ const CXCallingConv(this.value);
+
+ static CXCallingConv fromValue(int value) => switch (value) {
+ 0 => CXCallingConv_Default,
+ 1 => CXCallingConv_C,
+ 2 => CXCallingConv_X86StdCall,
+ 3 => CXCallingConv_X86FastCall,
+ 4 => CXCallingConv_X86ThisCall,
+ 5 => CXCallingConv_X86Pascal,
+ 6 => CXCallingConv_AAPCS,
+ 7 => CXCallingConv_AAPCS_VFP,
+ 8 => CXCallingConv_X86RegCall,
+ 9 => CXCallingConv_IntelOclBicc,
+ 10 => CXCallingConv_Win64,
+ 11 => CXCallingConv_X86_64SysV,
+ 12 => CXCallingConv_X86VectorCall,
+ 13 => CXCallingConv_Swift,
+ 14 => CXCallingConv_PreserveMost,
+ 15 => CXCallingConv_PreserveAll,
+ 16 => CXCallingConv_AArch64VectorCall,
+ 100 => CXCallingConv_Invalid,
+ 200 => CXCallingConv_Unexposed,
+ _ => throw ArgumentError("Unknown value for CXCallingConv: $value"),
+ };
+
+ @override
+ String toString() {
+ if (this == CXCallingConv_Win64)
+ return "CXCallingConv.CXCallingConv_Win64, CXCallingConv.CXCallingConv_X86_64Win64";
+ return super.toString();
+ }
+}
+
/// The type of an element in the abstract syntax tree.
final class CXType extends ffi.Struct {
@ffi.UnsignedInt()
@@ -10070,9 +10131,6 @@ typedef DartClang_Cursor_getNumArguments = int Function(CXCursor C);
typedef NativeClang_Cursor_getArgument = CXCursor Function(
CXCursor C, ffi.UnsignedInt i);
typedef DartClang_Cursor_getArgument = CXCursor Function(CXCursor C, int i);
-typedef NativeClang_Cursor_getNumTemplateArguments = ffi.Int Function(
- CXCursor C);
-typedef DartClang_Cursor_getNumTemplateArguments = int Function(CXCursor C);
/// Describes the kind of a template argument.
///
@@ -10109,6 +10167,9 @@ enum CXTemplateArgumentKind {
};
}
+typedef NativeClang_Cursor_getNumTemplateArguments = ffi.Int Function(
+ CXCursor C);
+typedef DartClang_Cursor_getNumTemplateArguments = int Function(CXCursor C);
typedef NativeClang_Cursor_getTemplateArgumentKind = ffi.UnsignedInt Function(
CXCursor C, ffi.UnsignedInt I);
typedef DartClang_Cursor_getTemplateArgumentKind = int Function(
@@ -10160,65 +10221,6 @@ typedef NativeClang_Type_getObjCEncoding = CXString Function(CXType type);
typedef DartClang_Type_getObjCEncoding = CXString Function(CXType type);
typedef NativeClang_getTypeKindSpelling = CXString Function(ffi.UnsignedInt K);
typedef DartClang_getTypeKindSpelling = CXString Function(int K);
-
-/// Describes the calling convention of a function type
-enum CXCallingConv {
- CXCallingConv_Default(0),
- CXCallingConv_C(1),
- CXCallingConv_X86StdCall(2),
- CXCallingConv_X86FastCall(3),
- CXCallingConv_X86ThisCall(4),
- CXCallingConv_X86Pascal(5),
- CXCallingConv_AAPCS(6),
- CXCallingConv_AAPCS_VFP(7),
- CXCallingConv_X86RegCall(8),
- CXCallingConv_IntelOclBicc(9),
- CXCallingConv_Win64(10),
- CXCallingConv_X86_64SysV(11),
- CXCallingConv_X86VectorCall(12),
- CXCallingConv_Swift(13),
- CXCallingConv_PreserveMost(14),
- CXCallingConv_PreserveAll(15),
- CXCallingConv_AArch64VectorCall(16),
- CXCallingConv_Invalid(100),
- CXCallingConv_Unexposed(200);
-
- static const CXCallingConv_X86_64Win64 = CXCallingConv_Win64;
-
- final int value;
- const CXCallingConv(this.value);
-
- static CXCallingConv fromValue(int value) => switch (value) {
- 0 => CXCallingConv_Default,
- 1 => CXCallingConv_C,
- 2 => CXCallingConv_X86StdCall,
- 3 => CXCallingConv_X86FastCall,
- 4 => CXCallingConv_X86ThisCall,
- 5 => CXCallingConv_X86Pascal,
- 6 => CXCallingConv_AAPCS,
- 7 => CXCallingConv_AAPCS_VFP,
- 8 => CXCallingConv_X86RegCall,
- 9 => CXCallingConv_IntelOclBicc,
- 10 => CXCallingConv_Win64,
- 11 => CXCallingConv_X86_64SysV,
- 12 => CXCallingConv_X86VectorCall,
- 13 => CXCallingConv_Swift,
- 14 => CXCallingConv_PreserveMost,
- 15 => CXCallingConv_PreserveAll,
- 16 => CXCallingConv_AArch64VectorCall,
- 100 => CXCallingConv_Invalid,
- 200 => CXCallingConv_Unexposed,
- _ => throw ArgumentError("Unknown value for CXCallingConv: $value"),
- };
-
- @override
- String toString() {
- if (this == CXCallingConv_Win64)
- return "CXCallingConv.CXCallingConv_Win64, CXCallingConv.CXCallingConv_X86_64Win64";
- return super.toString();
- }
-}
-
typedef NativeClang_getFunctionTypeCallingConv = ffi.UnsignedInt Function(
CXType T);
typedef DartClang_getFunctionTypeCallingConv = int Function(CXType T);
@@ -10321,12 +10323,6 @@ typedef DartClang_Cursor_isAnonymousRecordDecl = int Function(CXCursor C);
typedef NativeClang_Cursor_isInlineNamespace = ffi.UnsignedInt Function(
CXCursor C);
typedef DartClang_Cursor_isInlineNamespace = int Function(CXCursor C);
-typedef NativeClang_Type_getNumTemplateArguments = ffi.Int Function(CXType T);
-typedef DartClang_Type_getNumTemplateArguments = int Function(CXType T);
-typedef NativeClang_Type_getTemplateArgumentAsType = CXType Function(
- CXType T, ffi.UnsignedInt i);
-typedef DartClang_Type_getTemplateArgumentAsType = CXType Function(
- CXType T, int i);
enum CXRefQualifierKind {
/// No ref-qualifier was provided.
@@ -10350,6 +10346,12 @@ enum CXRefQualifierKind {
};
}
+typedef NativeClang_Type_getNumTemplateArguments = ffi.Int Function(CXType T);
+typedef DartClang_Type_getNumTemplateArguments = int Function(CXType T);
+typedef NativeClang_Type_getTemplateArgumentAsType = CXType Function(
+ CXType T, ffi.UnsignedInt i);
+typedef DartClang_Type_getTemplateArgumentAsType = CXType Function(
+ CXType T, int i);
typedef NativeClang_Type_getCXXRefQualifier = ffi.UnsignedInt Function(
CXType T);
typedef DartClang_Type_getCXXRefQualifier = int Function(CXType T);
@@ -10453,9 +10455,6 @@ enum CXChildVisitResult {
};
}
-/// Opaque pointer representing client data that will be passed through
-/// to various callbacks and visitors.
-typedef CXClientData = ffi.Pointer;
typedef CXCursorVisitorFunction = ffi.UnsignedInt Function(
CXCursor cursor, CXCursor parent, CXClientData client_data);
typedef DartCXCursorVisitorFunction = CXChildVisitResult Function(
@@ -10750,19 +10749,6 @@ typedef NativeClang_getCursorReferenceNameRange = CXSourceRange Function(
typedef DartClang_getCursorReferenceNameRange = CXSourceRange Function(
CXCursor C, int NameFlags, int PieceIndex);
-/// Describes a single preprocessing token.
-final class CXToken extends ffi.Struct {
- @ffi.Array.multi([4])
- external ffi.Array int_data;
-
- external ffi.Pointer ptr_data;
-}
-
-typedef NativeClang_getToken = ffi.Pointer Function(
- CXTranslationUnit TU, CXSourceLocation Location);
-typedef DartClang_getToken = ffi.Pointer Function(
- CXTranslationUnit TU, CXSourceLocation Location);
-
/// Describes a kind of token.
enum CXTokenKind {
/// A token that contains some kind of punctuation.
@@ -10793,6 +10779,18 @@ enum CXTokenKind {
};
}
+/// Describes a single preprocessing token.
+final class CXToken extends ffi.Struct {
+ @ffi.Array.multi([4])
+ external ffi.Array int_data;
+
+ external ffi.Pointer ptr_data;
+}
+
+typedef NativeClang_getToken = ffi.Pointer Function(
+ CXTranslationUnit TU, CXSourceLocation Location);
+typedef DartClang_getToken = ffi.Pointer Function(
+ CXTranslationUnit TU, CXSourceLocation Location);
typedef NativeClang_getTokenKind = ffi.UnsignedInt Function(CXToken arg0);
typedef DartClang_getTokenKind = int Function(CXToken arg0);
typedef NativeClang_getTokenSpelling = CXString Function(
@@ -11230,11 +11228,6 @@ typedef NativeClang_getInclusions = ffi.Void Function(
typedef DartClang_getInclusions = void Function(
CXTranslationUnit tu, CXInclusionVisitor visitor, CXClientData client_data);
-/// Evaluation result of a cursor
-typedef CXEvalResult = ffi.Pointer;
-typedef NativeClang_Cursor_Evaluate = CXEvalResult Function(CXCursor C);
-typedef DartClang_Cursor_Evaluate = CXEvalResult Function(CXCursor C);
-
enum CXEvalResultKind {
CXEval_Int(1),
CXEval_Float(2),
@@ -11259,6 +11252,10 @@ enum CXEvalResultKind {
};
}
+/// Evaluation result of a cursor
+typedef CXEvalResult = ffi.Pointer;
+typedef NativeClang_Cursor_Evaluate = CXEvalResult Function(CXCursor C);
+typedef DartClang_Cursor_Evaluate = CXEvalResult Function(CXCursor C);
typedef NativeClang_EvalResult_getKind = ffi.UnsignedInt Function(
CXEvalResult E);
typedef DartClang_EvalResult_getKind = int Function(CXEvalResult E);
@@ -11366,6 +11363,20 @@ typedef NativeClang_findIncludesInFile = ffi.UnsignedInt Function(
typedef DartClang_findIncludesInFile = int Function(
CXTranslationUnit TU, CXFile file, CXCursorAndRangeVisitor visitor);
+/// The client's data object that is associated with a CXFile.
+typedef CXIdxClientFile = ffi.Pointer;
+
+/// The client's data object that is associated with a semantic entity.
+typedef CXIdxClientEntity = ffi.Pointer;
+
+/// The client's data object that is associated with a semantic container
+/// of entities.
+typedef CXIdxClientContainer = ffi.Pointer;
+
+/// The client's data object that is associated with an AST file (PCH
+/// or module).
+typedef CXIdxClientASTFile = ffi.Pointer;
+
/// Source location passed to index callbacks.
final class CXIdxLoc extends ffi.Struct {
@ffi.Array.multi([2])
@@ -11415,35 +11426,6 @@ final class CXIdxImportedASTFileInfo extends ffi.Struct {
external int isImplicit;
}
-enum CXIdxAttrKind {
- CXIdxAttr_Unexposed(0),
- CXIdxAttr_IBAction(1),
- CXIdxAttr_IBOutlet(2),
- CXIdxAttr_IBOutletCollection(3);
-
- final int value;
- const CXIdxAttrKind(this.value);
-
- static CXIdxAttrKind fromValue(int value) => switch (value) {
- 0 => CXIdxAttr_Unexposed,
- 1 => CXIdxAttr_IBAction,
- 2 => CXIdxAttr_IBOutlet,
- 3 => CXIdxAttr_IBOutletCollection,
- _ => throw ArgumentError("Unknown value for CXIdxAttrKind: $value"),
- };
-}
-
-final class CXIdxAttrInfo extends ffi.Struct {
- @ffi.UnsignedInt()
- external int kindAsInt;
-
- CXIdxAttrKind get kind => CXIdxAttrKind.fromValue(kindAsInt);
-
- external CXCursor cursor;
-
- external CXIdxLoc loc;
-}
-
enum CXIdxEntityKind {
CXIdxEntity_Unexposed(0),
CXIdxEntity_Typedef(1),
@@ -11508,6 +11490,27 @@ enum CXIdxEntityKind {
};
}
+enum CXIdxEntityLanguage {
+ CXIdxEntityLang_None(0),
+ CXIdxEntityLang_C(1),
+ CXIdxEntityLang_ObjC(2),
+ CXIdxEntityLang_CXX(3),
+ CXIdxEntityLang_Swift(4);
+
+ final int value;
+ const CXIdxEntityLanguage(this.value);
+
+ static CXIdxEntityLanguage fromValue(int value) => switch (value) {
+ 0 => CXIdxEntityLang_None,
+ 1 => CXIdxEntityLang_C,
+ 2 => CXIdxEntityLang_ObjC,
+ 3 => CXIdxEntityLang_CXX,
+ 4 => CXIdxEntityLang_Swift,
+ _ =>
+ throw ArgumentError("Unknown value for CXIdxEntityLanguage: $value"),
+ };
+}
+
/// Extra C++ template information for an entity. This can apply to:
/// CXIdxEntity_Function
/// CXIdxEntity_CXXClass
@@ -11535,27 +11538,35 @@ enum CXIdxEntityCXXTemplateKind {
};
}
-enum CXIdxEntityLanguage {
- CXIdxEntityLang_None(0),
- CXIdxEntityLang_C(1),
- CXIdxEntityLang_ObjC(2),
- CXIdxEntityLang_CXX(3),
- CXIdxEntityLang_Swift(4);
+enum CXIdxAttrKind {
+ CXIdxAttr_Unexposed(0),
+ CXIdxAttr_IBAction(1),
+ CXIdxAttr_IBOutlet(2),
+ CXIdxAttr_IBOutletCollection(3);
final int value;
- const CXIdxEntityLanguage(this.value);
+ const CXIdxAttrKind(this.value);
- static CXIdxEntityLanguage fromValue(int value) => switch (value) {
- 0 => CXIdxEntityLang_None,
- 1 => CXIdxEntityLang_C,
- 2 => CXIdxEntityLang_ObjC,
- 3 => CXIdxEntityLang_CXX,
- 4 => CXIdxEntityLang_Swift,
- _ =>
- throw ArgumentError("Unknown value for CXIdxEntityLanguage: $value"),
+ static CXIdxAttrKind fromValue(int value) => switch (value) {
+ 0 => CXIdxAttr_Unexposed,
+ 1 => CXIdxAttr_IBAction,
+ 2 => CXIdxAttr_IBOutlet,
+ 3 => CXIdxAttr_IBOutletCollection,
+ _ => throw ArgumentError("Unknown value for CXIdxAttrKind: $value"),
};
}
+final class CXIdxAttrInfo extends ffi.Struct {
+ @ffi.UnsignedInt()
+ external int kindAsInt;
+
+ CXIdxAttrKind get kind => CXIdxAttrKind.fromValue(kindAsInt);
+
+ external CXCursor cursor;
+
+ external CXIdxLoc loc;
+}
+
final class CXIdxEntityInfo extends ffi.Struct {
@ffi.UnsignedInt()
external int kindAsInt;
@@ -11817,6 +11828,67 @@ final class CXIdxEntityRefInfo extends ffi.Struct {
CXSymbolRole get role => CXSymbolRole.fromValue(roleAsInt);
}
+/// A group of callbacks used by #clang_indexSourceFile and
+/// #clang_indexTranslationUnit.
+final class IndexerCallbacks extends ffi.Struct {
+ /// Called periodically to check whether indexing should be aborted.
+ /// Should return 0 to continue, and non-zero to abort.
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Int Function(
+ CXClientData client_data, ffi.Pointer reserved)>>
+ abortQuery;
+
+ /// Called at the end of indexing; passes the complete diagnostic set.
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(
+ CXClientData, CXDiagnosticSet, ffi.Pointer)>>
+ diagnostic;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ CXIdxClientFile Function(CXClientData client_data, CXFile mainFile,
+ ffi.Pointer reserved)>> enteredMainFile;
+
+ /// Called when a file gets \#included/\#imported.
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ CXIdxClientFile Function(
+ CXClientData, ffi.Pointer)>>
+ ppIncludedFile;
+
+ /// Called when a AST file (PCH or module) gets imported.
+ ///
+ /// AST files will not get indexed (there will not be callbacks to index all
+ /// the entities in an AST file). The recommended action is that, if the AST
+ /// file is not already indexed, to initiate a new indexing job specific to
+ /// the AST file.
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ CXIdxClientASTFile Function(
+ CXClientData, ffi.Pointer)>>
+ importedASTFile;
+
+ /// Called at the beginning of indexing a translation unit.
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ CXIdxClientContainer Function(
+ CXClientData client_data, ffi.Pointer reserved)>>
+ startedTranslationUnit;
+
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(CXClientData, ffi.Pointer)>>
+ indexDeclaration;
+
+ /// Called to index a reference of an entity.
+ external ffi.Pointer<
+ ffi.NativeFunction<
+ ffi.Void Function(CXClientData, ffi.Pointer)>>
+ indexEntityReference;
+}
+
typedef NativeClang_index_isEntityObjCContainerKind = ffi.Int Function(
ffi.UnsignedInt arg0);
typedef DartClang_index_isEntityObjCContainerKind = int Function(int arg0);
@@ -11861,10 +11933,6 @@ typedef NativeClang_index_getCXXClassDeclInfo
ffi.Pointer arg0);
typedef DartClang_index_getCXXClassDeclInfo = ffi.Pointer
Function(ffi.Pointer arg0);
-
-/// The client's data object that is associated with a semantic container
-/// of entities.
-typedef CXIdxClientContainer = ffi.Pointer;
typedef NativeClang_index_getClientContainer = CXIdxClientContainer Function(
ffi.Pointer arg0);
typedef DartClang_index_getClientContainer = CXIdxClientContainer Function(
@@ -11873,9 +11941,6 @@ typedef NativeClang_index_setClientContainer = ffi.Void Function(
ffi.Pointer arg0, CXIdxClientContainer arg1);
typedef DartClang_index_setClientContainer = void Function(
ffi.Pointer arg0, CXIdxClientContainer arg1);
-
-/// The client's data object that is associated with a semantic entity.
-typedef CXIdxClientEntity = ffi.Pointer;
typedef NativeClang_index_getClientEntity = CXIdxClientEntity Function(
ffi.Pointer arg0);
typedef DartClang_index_getClientEntity = CXIdxClientEntity Function(
@@ -11892,75 +11957,6 @@ typedef NativeClang_IndexAction_create = CXIndexAction Function(CXIndex CIdx);
typedef DartClang_IndexAction_create = CXIndexAction Function(CXIndex CIdx);
typedef NativeClang_IndexAction_dispose = ffi.Void Function(CXIndexAction arg0);
typedef DartClang_IndexAction_dispose = void Function(CXIndexAction arg0);
-
-/// The client's data object that is associated with a CXFile.
-typedef CXIdxClientFile = ffi.Pointer;
-
-/// The client's data object that is associated with an AST file (PCH
-/// or module).
-typedef CXIdxClientASTFile = ffi.Pointer;
-
-/// A group of callbacks used by #clang_indexSourceFile and
-/// #clang_indexTranslationUnit.
-final class IndexerCallbacks extends ffi.Struct {
- /// Called periodically to check whether indexing should be aborted.
- /// Should return 0 to continue, and non-zero to abort.
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Int Function(
- CXClientData client_data, ffi.Pointer reserved)>>
- abortQuery;
-
- /// Called at the end of indexing; passes the complete diagnostic set.
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(
- CXClientData, CXDiagnosticSet, ffi.Pointer)>>
- diagnostic;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- CXIdxClientFile Function(CXClientData client_data, CXFile mainFile,
- ffi.Pointer reserved)>> enteredMainFile;
-
- /// Called when a file gets \#included/\#imported.
- external ffi.Pointer<
- ffi.NativeFunction<
- CXIdxClientFile Function(
- CXClientData, ffi.Pointer)>>
- ppIncludedFile;
-
- /// Called when a AST file (PCH or module) gets imported.
- ///
- /// AST files will not get indexed (there will not be callbacks to index all
- /// the entities in an AST file). The recommended action is that, if the AST
- /// file is not already indexed, to initiate a new indexing job specific to
- /// the AST file.
- external ffi.Pointer<
- ffi.NativeFunction<
- CXIdxClientASTFile Function(
- CXClientData, ffi.Pointer)>>
- importedASTFile;
-
- /// Called at the beginning of indexing a translation unit.
- external ffi.Pointer<
- ffi.NativeFunction<
- CXIdxClientContainer Function(
- CXClientData client_data, ffi.Pointer reserved)>>
- startedTranslationUnit;
-
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(CXClientData, ffi.Pointer)>>
- indexDeclaration;
-
- /// Called to index a reference of an entity.
- external ffi.Pointer<
- ffi.NativeFunction<
- ffi.Void Function(CXClientData, ffi.Pointer)>>
- indexEntityReference;
-}
-
typedef NativeClang_indexSourceFile = ffi.Int Function(
CXIndexAction arg0,
CXClientData client_data,
diff --git a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart
index 2d1445a21..1949f0b09 100644
--- a/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart
+++ b/pkgs/ffigen/example/objective_c/avf_audio_bindings.dart
@@ -10,40995 +10,8 @@
// ignore_for_file: type=lint
import 'dart:ffi' as ffi;
import 'package:objective_c/objective_c.dart' as objc;
-import 'package:ffi/ffi.dart' as pkg_ffi;
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_ksby9f(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_1k41wmu(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_sjfpmz(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_1j7ar3u(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_rvgf02(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_ukcdfq(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_1tjlcwl(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_hepzs(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_117qins(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_9w6y6n(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_tenbla(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_hfhq9m(
- ffi.Pointer block,
-);
-
-@ffi.Native<
- ffi.Pointer Function(
- ffi.Pointer)>(isLeaf: true)
-external ffi.Pointer _wrapListenerBlock_1ej8563(
- ffi.Pointer block,
-);
-
-late final _class_NSProgress = objc.getClass("NSProgress");
-late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:");
-final _objc_msgSend_l8lotg = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Bool Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer)>>()
- .asFunction<
- bool Function(ffi.Pointer,
- ffi.Pointer, ffi.Pointer)>();
-late final _sel_currentProgress = objc.registerName("currentProgress");
-final _objc_msgSend_1unuoxw = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Pointer Function(ffi.Pointer,
- ffi.Pointer)>>()
- .asFunction<
- ffi.Pointer Function(
- ffi.Pointer, ffi.Pointer)>();
-late final _sel_progressWithTotalUnitCount_ =
- objc.registerName("progressWithTotalUnitCount:");
-final _objc_msgSend_n9eq1n = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Pointer Function(ffi.Pointer,
- ffi.Pointer, ffi.Int64)>>()
- .asFunction<
- ffi.Pointer Function(ffi.Pointer,
- ffi.Pointer, int)>();
-late final _sel_discreteProgressWithTotalUnitCount_ =
- objc.registerName("discreteProgressWithTotalUnitCount:");
-late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_ =
- objc.registerName("progressWithTotalUnitCount:parent:pendingUnitCount:");
-final _objc_msgSend_105mybv = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Pointer Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Int64,
- ffi.Pointer,
- ffi.Int64)>>()
- .asFunction<
- ffi.Pointer Function(
- ffi.Pointer,
- ffi.Pointer,
- int,
- ffi.Pointer,
- int)>();
-typedef instancetype = ffi.Pointer;
-typedef Dartinstancetype = objc.ObjCObjectBase;
-late final _sel_initWithParent_userInfo_ =
- objc.registerName("initWithParent:userInfo:");
-final _objc_msgSend_iq11qg = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Pointer Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer)>>()
- .asFunction<
- ffi.Pointer Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer)>();
-late final _sel_becomeCurrentWithPendingUnitCount_ =
- objc.registerName("becomeCurrentWithPendingUnitCount:");
-final _objc_msgSend_rrr3q = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer,
- ffi.Pointer, ffi.Int64)>>()
- .asFunction<
- void Function(ffi.Pointer,
- ffi.Pointer, int)>();
-void _ObjCBlock_ffiVoid_fnPtrTrampoline(
- ffi.Pointer block,
-) =>
- block.ref.target
- .cast>()
- .asFunction()();
-ffi.Pointer _ObjCBlock_ffiVoid_fnPtrCallable = ffi.Pointer
- .fromFunction)>(
- _ObjCBlock_ffiVoid_fnPtrTrampoline)
- .cast();
-void _ObjCBlock_ffiVoid_closureTrampoline(
- ffi.Pointer block,
-) =>
- (objc.getBlockClosure(block) as void Function())();
-ffi.Pointer _ObjCBlock_ffiVoid_closureCallable = ffi.Pointer
- .fromFunction)>(
- _ObjCBlock_ffiVoid_closureTrampoline)
- .cast();
-void _ObjCBlock_ffiVoid_listenerTrampoline(
- ffi.Pointer block,
-) {
- (objc.getBlockClosure(block) as void Function())();
- objc.objectRelease(block.cast());
-}
-
-ffi.NativeCallable)>
- _ObjCBlock_ffiVoid_listenerCallable = ffi.NativeCallable<
- ffi.Void Function(ffi.Pointer)>.listener(
- _ObjCBlock_ffiVoid_listenerTrampoline)
- ..keepIsolateAlive = false;
-
-/// Construction methods for `objc.ObjCBlock`.
-abstract final class ObjCBlock_ffiVoid {
- /// Returns a block that wraps the given raw block pointer.
- static objc.ObjCBlock castFromPointer(
- ffi.Pointer pointer,
- {bool retain = false,
- bool release = false}) =>
- objc.ObjCBlock(pointer,
- retain: retain, release: release);
-
- /// Creates a block from a C function pointer.
- ///
- /// This block must be invoked by native code running on the same thread as
- /// the isolate that registered it. Invoking the block on the wrong thread
- /// will result in a crash.
- static objc.ObjCBlock fromFunctionPointer(
- ffi.Pointer> ptr) =>
- objc.ObjCBlock(
- objc.newPointerBlock(_ObjCBlock_ffiVoid_fnPtrCallable, ptr.cast()),
- retain: false,
- release: true);
-
- /// Creates a block from a Dart function.
- ///
- /// This block must be invoked by native code running on the same thread as
- /// the isolate that registered it. Invoking the block on the wrong thread
- /// will result in a crash.
- static objc.ObjCBlock fromFunction(void Function() fn) =>
- objc.ObjCBlock(
- objc.newClosureBlock(_ObjCBlock_ffiVoid_closureCallable, () => fn()),
- retain: false,
- release: true);
-
- /// Creates a listener block from a Dart function.
- ///
- /// This is based on FFI's NativeCallable.listener, and has the same
- /// capabilities and limitations. This block can be invoked from any thread,
- /// but only supports void functions, and is not run synchronously. See
- /// NativeCallable.listener for more details.
- ///
- /// Note that unlike the default behavior of NativeCallable.listener, listener
- /// blocks do not keep the isolate alive.
- static objc.ObjCBlock listener(void Function() fn) {
- final raw = objc.newClosureBlock(
- _ObjCBlock_ffiVoid_listenerCallable.nativeFunction.cast(), () => fn());
- final wrapper = _wrapListenerBlock_ksby9f(raw);
- objc.objectRelease(raw.cast());
- return objc.ObjCBlock(wrapper,
- retain: false, release: true);
- }
-}
-
-/// Call operator for `objc.ObjCBlock`.
-extension ObjCBlock_ffiVoid_CallExtension
- on objc.ObjCBlock {
- void call() => ref.pointer.ref.invoke
- .cast<
- ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer block)>>()
- .asFunction)>()(
- ref.pointer,
- );
-}
-
-late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_ =
- objc.registerName("performAsCurrentWithPendingUnitCount:usingBlock:");
-final _objc_msgSend_19q84do = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Int64,
- ffi.Pointer)>>()
- .asFunction<
- void Function(
- ffi.Pointer,
- ffi.Pointer,
- int,
- ffi.Pointer)>();
-late final _sel_resignCurrent = objc.registerName("resignCurrent");
-final _objc_msgSend_ksby9f = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer,
- ffi.Pointer)>>()
- .asFunction<
- void Function(
- ffi.Pointer, ffi.Pointer)>();
-late final _sel_addChild_withPendingUnitCount_ =
- objc.registerName("addChild:withPendingUnitCount:");
-final _objc_msgSend_2citz1 = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer,
- ffi.Int64)>>()
- .asFunction<
- void Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer,
- int)>();
-late final _sel_totalUnitCount = objc.registerName("totalUnitCount");
-final _objc_msgSend_1voti03 = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Int64 Function(ffi.Pointer,
- ffi.Pointer)>>()
- .asFunction<
- int Function(
- ffi.Pointer, ffi.Pointer)>();
-late final _sel_setTotalUnitCount_ = objc.registerName("setTotalUnitCount:");
-late final _sel_completedUnitCount = objc.registerName("completedUnitCount");
-late final _sel_setCompletedUnitCount_ =
- objc.registerName("setCompletedUnitCount:");
-late final _sel_localizedDescription =
- objc.registerName("localizedDescription");
-late final _sel_setLocalizedDescription_ =
- objc.registerName("setLocalizedDescription:");
-final _objc_msgSend_ukcdfq = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer)>>()
- .asFunction<
- void Function(ffi.Pointer,
- ffi.Pointer, ffi.Pointer)>();
-late final _sel_localizedAdditionalDescription =
- objc.registerName("localizedAdditionalDescription");
-late final _sel_setLocalizedAdditionalDescription_ =
- objc.registerName("setLocalizedAdditionalDescription:");
-late final _sel_isCancellable = objc.registerName("isCancellable");
-final _objc_msgSend_olxnu1 = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Bool Function(ffi.Pointer,
- ffi.Pointer)>>()
- .asFunction<
- bool Function(
- ffi.Pointer, ffi.Pointer)>();
-late final _sel_setCancellable_ = objc.registerName("setCancellable:");
-final _objc_msgSend_117qins = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Void Function(ffi.Pointer,
- ffi.Pointer, ffi.Bool)>>()
- .asFunction<
- void Function(ffi.Pointer,
- ffi.Pointer, bool)>();
-late final _sel_isPausable = objc.registerName("isPausable");
-late final _sel_setPausable_ = objc.registerName("setPausable:");
-late final _sel_isCancelled = objc.registerName("isCancelled");
-late final _sel_isPaused = objc.registerName("isPaused");
-late final _sel_cancellationHandler = objc.registerName("cancellationHandler");
-final _objc_msgSend_2osec1 = objc.msgSendPointer
- .cast<
- ffi.NativeFunction<
- ffi.Pointer Function(
- ffi.Pointer,
- ffi.Pointer)>>()
- .asFunction<
- ffi.Pointer Function(
- ffi.Pointer, ffi.Pointer)>();
-late final _sel_setCancellationHandler_ =
- objc.registerName("setCancellationHandler:");
-void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline(
- ffi.Pointer block,
- ffi.Pointer arg0,
- ffi.Pointer arg1,
- ffi.Pointer arg2) =>
- block.ref.target
- .cast<
- ffi.NativeFunction<
- ffi.Void Function(
- ffi.Pointer arg0,
- ffi.Pointer arg1,
- ffi.Pointer arg2)>>()
- .asFunction<
- void Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer)>()(arg0, arg1, arg2);
-ffi.Pointer
- _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrCallable =
- ffi.Pointer.fromFunction<
- ffi.Void Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer)>(
- _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_fnPtrTrampoline)
- .cast();
-void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline(
- ffi.Pointer block,
- ffi.Pointer arg0,
- ffi.Pointer arg1,
- ffi.Pointer arg2) =>
- (objc.getBlockClosure(block) as void Function(ffi.Pointer,
- ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2);
-ffi.Pointer
- _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureCallable =
- ffi.Pointer.fromFunction<
- ffi.Void Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer)>(
- _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_closureTrampoline)
- .cast();
-void _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerTrampoline(
- ffi.Pointer block,
- ffi.Pointer arg0,
- ffi.Pointer arg1,
- ffi.Pointer arg2) {
- (objc.getBlockClosure(block) as void Function(ffi.Pointer,
- ffi.Pointer, ffi.Pointer))(arg0, arg1, arg2);
- objc.objectRelease(block.cast());
-}
-
-ffi.NativeCallable<
- ffi.Void Function(
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer,
- ffi.Pointer)>
- _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_bool_listenerCallable = ffi
- .NativeCallable<
- ffi.Void Function(
- ffi.Pointer