diff --git a/.github/workflows/ffi.yaml b/.github/workflows/ffi.yaml deleted file mode 100644 index beedc6179b..0000000000 --- a/.github/workflows/ffi.yaml +++ /dev/null @@ -1,73 +0,0 @@ -name: ffi - -on: - # Run on PRs and pushes to the default branch. - push: - branches: [main] - paths: - - '.github/workflows/ffi.yaml' - - 'pkgs/ffi/**' - pull_request: - branches: [main] - paths: - - '.github/workflows/ffi.yaml' - - 'pkgs/ffi/**' - schedule: - - cron: "0 0 * * 0" - -env: - PUB_ENVIRONMENT: bot.github - -jobs: - # Check code formatting and static analysis on a single OS (linux) - # against Dart dev. - analyze: - runs-on: ubuntu-latest - defaults: - run: - working-directory: pkgs/ffi/ - strategy: - fail-fast: false - matrix: - sdk: [dev] - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: ${{ matrix.sdk }} - - id: install - name: Install dependencies - run: dart pub get - - name: Check formatting - run: dart format --output=none --set-exit-if-changed . - if: always() && steps.install.outcome == 'success' - - name: Analyze code - run: dart analyze --fatal-infos - if: always() && steps.install.outcome == 'success' - - # Run tests on a matrix consisting of two dimensions: - # 1. OS: ubuntu-latest, (macos-latest, windows-latest) - # 2. release channel: dev - test: - needs: analyze - runs-on: ${{ matrix.os }} - defaults: - run: - working-directory: pkgs/ffi/ - strategy: - fail-fast: false - matrix: - # Add macos-latest and/or windows-latest if relevant for this package. - os: [ubuntu-latest] - sdk: [beta, dev] - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - - uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c - with: - sdk: ${{ matrix.sdk }} - - id: install - name: Install dependencies - run: dart pub get - - name: Run VM tests - run: dart test --platform vm - if: always() && steps.install.outcome == 'success' diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml index 1b1d29d37f..7e6bcfca54 100644 --- a/.github/workflows/native.yaml +++ b/.github/workflows/native.yaml @@ -12,11 +12,16 @@ on: - ".github/workflows/native.yaml" - "pkgs/code_assets/**" - "pkgs/data_assets/**" - - "pkgs/hooks_runner/**" + - "pkgs/ffi/**" + - "pkgs/ffigen/**" - "pkgs/hooks/**" + - "pkgs/hooks_runner/**" - "pkgs/json_syntax_generator/**" - "pkgs/native_test_helpers/**" - "pkgs/native_toolchain_c/**" + - "pkgs/objective_c/**" + - "pkgs/pub_formats/**" + - "pkgs/record_use/**" - "pkgs/repo_lint_rules/**" - "tool/**" push: @@ -25,11 +30,16 @@ on: - ".github/workflows/native.yaml" - "pkgs/code_assets/**" - "pkgs/data_assets/**" - - "pkgs/hooks_runner/**" + - "pkgs/ffi/**" + - "pkgs/ffigen/**" - "pkgs/hooks/**" + - "pkgs/hooks_runner/**" - "pkgs/json_syntax_generator/**" - "pkgs/native_test_helpers/**" - "pkgs/native_toolchain_c/**" + - "pkgs/objective_c/**" + - "pkgs/pub_formats/**" + - "pkgs/record_use/**" - "pkgs/repo_lint_rules/**" - "tool/**" schedule: @@ -67,14 +77,11 @@ jobs: - run: dart pub get - - name: Run pub get, analysis, formatting, generators, and tests. - # Don't run examples on stable, the experiment is not available on stable. - run: dart tool/ci.dart --all --no-example - if: ${{ matrix.sdk == 'stable' }} + - name: Build test dylib and bindings + run: dart --enable-asserts pkgs/ffigen/test/setup.dart - name: Run pub get, analysis, formatting, generators, tests, and examples. run: dart tool/ci.dart --all - if: ${{ matrix.sdk != 'stable' }} - name: Upload coverage uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000000..d2ddce3285 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,5 @@ +analyzer: + exclude: + # The following packages require Flutter and therefore cannot be analyzed as + # part of `dart analyze` for the workspace. + - pkgs/objective_c/example/flutter_app diff --git a/pkgs/code_assets/pubspec.yaml b/pkgs/code_assets/pubspec.yaml index 073baa6dea..d7c686c34c 100644 --- a/pkgs/code_assets/pubspec.yaml +++ b/pkgs/code_assets/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: hooks: ^1.0.0 dev_dependencies: - custom_lint: ^0.7.5 + custom_lint: ^0.8.1 dart_flutter_team_lints: ^3.5.2 json_schema: ^5.2.0 # May only be used in tool/ and test/json_schema/. native_test_helpers: diff --git a/pkgs/data_assets/pubspec.yaml b/pkgs/data_assets/pubspec.yaml index 8738386860..3bb42d2024 100644 --- a/pkgs/data_assets/pubspec.yaml +++ b/pkgs/data_assets/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: hooks: ^1.0.0 dev_dependencies: - custom_lint: ^0.7.5 + custom_lint: ^0.8.1 dart_flutter_team_lints: ^3.5.2 json_schema: ^5.2.0 # May only be used in tool/ and test/json_schema/. native_test_helpers: diff --git a/pkgs/ffi/pubspec.yaml b/pkgs/ffi/pubspec.yaml index 2a896eb52e..f81daa8813 100644 --- a/pkgs/ffi/pubspec.yaml +++ b/pkgs/ffi/pubspec.yaml @@ -9,6 +9,8 @@ topics: - ffi - codegen +resolution: workspace + environment: sdk: '>=3.7.0 <4.0.0' diff --git a/pkgs/ffigen/example/add/pubspec.yaml b/pkgs/ffigen/example/add/pubspec.yaml index 74488a76e1..68f05b8f64 100644 --- a/pkgs/ffigen/example/add/pubspec.yaml +++ b/pkgs/ffigen/example/add/pubspec.yaml @@ -2,6 +2,8 @@ name: add description: A simple end-to-end example showcasing FFIgen. publish_to: none +resolution: workspace + environment: sdk: '>=3.8.0 <4.0.0' diff --git a/pkgs/ffigen/example/c_json/pubspec.yaml b/pkgs/ffigen/example/c_json/pubspec.yaml index e218628ba5..8adf6e4eb3 100644 --- a/pkgs/ffigen/example/c_json/pubspec.yaml +++ b/pkgs/ffigen/example/c_json/pubspec.yaml @@ -4,6 +4,8 @@ name: c_json_example +resolution: workspace + environment: sdk: '>=3.8.0 <4.0.0' diff --git a/pkgs/ffigen/example/ffinative/pubspec.yaml b/pkgs/ffigen/example/ffinative/pubspec.yaml index e3a1b3d77f..d50662fc97 100644 --- a/pkgs/ffigen/example/ffinative/pubspec.yaml +++ b/pkgs/ffigen/example/ffinative/pubspec.yaml @@ -4,6 +4,8 @@ name: ffinative_example +resolution: workspace + environment: sdk: '>=3.8.0 <4.0.0' diff --git a/pkgs/ffigen/example/libclang-example/pubspec.yaml b/pkgs/ffigen/example/libclang-example/pubspec.yaml index c2a2e38632..1d5c04f390 100644 --- a/pkgs/ffigen/example/libclang-example/pubspec.yaml +++ b/pkgs/ffigen/example/libclang-example/pubspec.yaml @@ -4,6 +4,8 @@ name: libclang_example +resolution: workspace + environment: sdk: '>=3.8.0 <4.0.0' diff --git a/pkgs/ffigen/example/objective_c/pubspec.yaml b/pkgs/ffigen/example/objective_c/pubspec.yaml index bced920489..86bd9c051f 100644 --- a/pkgs/ffigen/example/objective_c/pubspec.yaml +++ b/pkgs/ffigen/example/objective_c/pubspec.yaml @@ -4,6 +4,8 @@ name: objective_c_example +resolution: workspace + environment: sdk: '>=3.8.0 <4.0.0' @@ -11,13 +13,8 @@ dependencies: args: ^2.6.0 ffi: ^2.0.1 logging: ^1.3.0 - objective_c: ^0.0.1 + objective_c: ^9.2.1 dev_dependencies: dart_flutter_team_lints: ^3.5.2 - ffigen: - path: ../../ - -dependency_overrides: - objective_c: - path: ../../../objective_c/ + ffigen: ^20.1.1 diff --git a/pkgs/ffigen/example/shared_bindings/pubspec.yaml b/pkgs/ffigen/example/shared_bindings/pubspec.yaml index cc1256fb55..ce7344ddcc 100644 --- a/pkgs/ffigen/example/shared_bindings/pubspec.yaml +++ b/pkgs/ffigen/example/shared_bindings/pubspec.yaml @@ -4,6 +4,8 @@ name: shared_bindings +resolution: workspace + environment: sdk: '>=3.8.0 <4.0.0' diff --git a/pkgs/ffigen/example/simple/pubspec.yaml b/pkgs/ffigen/example/simple/pubspec.yaml index 4b6df34dcf..8c02f8f78d 100644 --- a/pkgs/ffigen/example/simple/pubspec.yaml +++ b/pkgs/ffigen/example/simple/pubspec.yaml @@ -4,6 +4,8 @@ name: simple_example +resolution: workspace + environment: sdk: '>=3.8.0 <4.0.0' diff --git a/pkgs/ffigen/example/swift/pubspec.yaml b/pkgs/ffigen/example/swift/pubspec.yaml index 6465873724..e8d811e175 100644 --- a/pkgs/ffigen/example/swift/pubspec.yaml +++ b/pkgs/ffigen/example/swift/pubspec.yaml @@ -4,19 +4,16 @@ name: swift_example +resolution: workspace + environment: sdk: '>=3.8.0 <4.0.0' dependencies: args: ^2.6.0 ffi: ^2.0.1 - objective_c: ^0.0.1 + objective_c: ^9.2.1 dev_dependencies: dart_flutter_team_lints: ^3.5.2 - ffigen: - path: ../../ - -dependency_overrides: - objective_c: - path: ../../../objective_c/ + ffigen: ^20.1.1 diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index da0af1b3e2..a2ebc522f1 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -15,6 +15,8 @@ topics: - ffi - codegen +resolution: workspace + environment: sdk: '>=3.8.0 <4.0.0' @@ -39,16 +41,6 @@ dev_dependencies: async: ^2.11.0 dart_flutter_team_lints: ^3.5.2 json_schema: ^5.1.1 - leak_tracker: ^10.0.7 - objective_c: ^9.2.0 + leak_tracker: ^11.0.2 + objective_c: ^9.2.1 test: ^1.26.2 - -dependency_overrides: - code_assets: - path: ../code_assets - hooks: - path: ../hooks - native_toolchain_c: - path: ../native_toolchain_c - objective_c: - path: ../objective_c diff --git a/pkgs/hooks/pubspec.yaml b/pkgs/hooks/pubspec.yaml index fbda872693..38297a7b31 100644 --- a/pkgs/hooks/pubspec.yaml +++ b/pkgs/hooks/pubspec.yaml @@ -30,7 +30,7 @@ dependencies: dev_dependencies: args: ^2.6.0 code_assets: ^1.0.0 # Used for running tests with real asset types. - custom_lint: ^0.7.5 + custom_lint: ^0.8.1 dart_flutter_team_lints: ^3.5.2 data_assets: any # Used for running tests with real asset types. file_testing: ^3.0.2 diff --git a/pkgs/hooks_runner/pubspec.yaml b/pkgs/hooks_runner/pubspec.yaml index 7f113d1647..cb7143deea 100644 --- a/pkgs/hooks_runner/pubspec.yaml +++ b/pkgs/hooks_runner/pubspec.yaml @@ -26,7 +26,7 @@ dependencies: dev_dependencies: args: any - custom_lint: ^0.7.5 + custom_lint: ^0.8.1 dart_flutter_team_lints: ^3.5.2 data_assets: any # Used in tests. file_testing: ^3.0.2 diff --git a/pkgs/json_syntax_generator/pubspec.yaml b/pkgs/json_syntax_generator/pubspec.yaml index 7a9a8effc2..5d25c73125 100644 --- a/pkgs/json_syntax_generator/pubspec.yaml +++ b/pkgs/json_syntax_generator/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: json_schema: ^5.2.0 dev_dependencies: - custom_lint: ^0.7.5 + custom_lint: ^0.8.1 dart_flutter_team_lints: ^3.5.2 native_test_helpers: path: ../native_test_helpers/ diff --git a/pkgs/native_toolchain_c/pubspec.yaml b/pkgs/native_toolchain_c/pubspec.yaml index 1a3e16f778..dac6b76583 100644 --- a/pkgs/native_toolchain_c/pubspec.yaml +++ b/pkgs/native_toolchain_c/pubspec.yaml @@ -26,7 +26,7 @@ dependencies: dev_dependencies: collection: ^1.19.1 - custom_lint: ^0.7.5 + custom_lint: ^0.8.1 dart_flutter_team_lints: ^3.5.2 native_test_helpers: path: ../native_test_helpers/ diff --git a/pkgs/objective_c/example/command_line/pubspec.yaml b/pkgs/objective_c/example/command_line/pubspec.yaml index ff6cf0f7ad..337744bcda 100644 --- a/pkgs/objective_c/example/command_line/pubspec.yaml +++ b/pkgs/objective_c/example/command_line/pubspec.yaml @@ -3,6 +3,8 @@ description: "Demonstrates using package:objective_c" version: 1.0.0 publish_to: none +resolution: workspace + environment: sdk: '>=3.9.0-21.0.dev <4.0.0' @@ -11,5 +13,5 @@ dependencies: path: ../.. dev_dependencies: - lints: ^5.0.0 + lints: ^6.0.0 test: ^1.27.0 diff --git a/pkgs/objective_c/pubspec.yaml b/pkgs/objective_c/pubspec.yaml index b554292074..47ef4cdc58 100644 --- a/pkgs/objective_c/pubspec.yaml +++ b/pkgs/objective_c/pubspec.yaml @@ -14,34 +14,26 @@ topics: - objective-c - codegen +resolution: workspace + environment: sdk: '>=3.10.0 <4.0.0' dependencies: - code_assets: ^0.19.0 + code_assets: ^1.0.0 collection: ^1.19.1 ffi: ^2.1.0 - hooks: ^0.20.5 + hooks: ^1.0.0 logging: ^1.3.0 - native_toolchain_c: ^0.17.2 + native_toolchain_c: ^0.17.4 pub_semver: ^2.1.4 dev_dependencies: args: ^2.6.0 dart_flutter_team_lints: ^3.5.2 - ffigen: ^20.1.0 + ffigen: ^20.1.1 native_test_helpers: path: ../native_test_helpers/ path: ^1.9.0 test: ^1.26.2 yaml: ^3.1.0 - -dependency_overrides: - code_assets: - path: ../code_assets - ffigen: - path: ../ffigen - hooks: - path: ../hooks - native_toolchain_c: - path: ../native_toolchain_c diff --git a/pkgs/repo_lint_rules/lib/src/avoid_import_outside_src_rule.dart b/pkgs/repo_lint_rules/lib/src/avoid_import_outside_src_rule.dart index 6af5bd3aa4..d99dc71c1e 100644 --- a/pkgs/repo_lint_rules/lib/src/avoid_import_outside_src_rule.dart +++ b/pkgs/repo_lint_rules/lib/src/avoid_import_outside_src_rule.dart @@ -20,7 +20,7 @@ class AvoidImportOutsideSrcRule extends DartLintRule { @override void run( CustomLintResolver resolver, - ErrorReporter reporter, + DiagnosticReporter reporter, CustomLintContext context, ) { context.registry.addImportDirective((node) { diff --git a/pkgs/repo_lint_rules/pubspec.yaml b/pkgs/repo_lint_rules/pubspec.yaml index f881794329..74547cbc5c 100644 --- a/pkgs/repo_lint_rules/pubspec.yaml +++ b/pkgs/repo_lint_rules/pubspec.yaml @@ -10,10 +10,10 @@ environment: sdk: '>=3.9.0 <4.0.0' dependencies: - analyzer: ^7.3.0 - custom_lint_builder: ^0.7.5 + analyzer: ^8.4.0 + custom_lint_builder: ^0.8.1 dart_flutter_team_lints: ^3.5.2 path: ^1.9.1 dev_dependencies: - custom_lint: ^0.7.5 + custom_lint: ^0.8.1 diff --git a/pubspec.yaml b/pubspec.yaml index e7a0307e49..ab4018a212 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,26 @@ workspace: - pkgs/code_assets/example/sqlite_prebuilt - pkgs/code_assets/example/stb_image - pkgs/data_assets + - pkgs/ffi/ + - pkgs/ffigen + - pkgs/ffigen/example/add + - pkgs/ffigen/example/c_json + - pkgs/ffigen/example/ffinative + - pkgs/ffigen/example/libclang-example + - pkgs/ffigen/example/objective_c + - pkgs/ffigen/example/shared_bindings + - pkgs/ffigen/example/simple + - pkgs/ffigen/example/swift - pkgs/hooks + - pkgs/hooks/example/build/download_asset + - pkgs/hooks/example/build/local_asset + - pkgs/hooks/example/build/native_add_app + - pkgs/hooks/example/build/native_add_library + - pkgs/hooks/example/build/native_dynamic_linking + - pkgs/hooks/example/build/system_library + - pkgs/hooks/example/build/use_dart_api + - pkgs/hooks/example/link/app_with_asset_treeshaking + - pkgs/hooks/example/link/package_with_assets - pkgs/hooks_runner - pkgs/hooks_runner/test_data/add_asset_link - pkgs/hooks_runner/test_data/complex_link @@ -42,9 +61,12 @@ workspace: - pkgs/hooks_runner/test_data/native_add - pkgs/hooks_runner/test_data/native_add_add_source - pkgs/hooks_runner/test_data/native_add_duplicate + # - pkgs/hooks_runner/test_data/native_add_version_skew # TODO + # - pkgs/hooks_runner/test_data/native_add_version_skew_2 # TODO - pkgs/hooks_runner/test_data/native_dynamic_linking - pkgs/hooks_runner/test_data/native_subtract - pkgs/hooks_runner/test_data/no_asset_for_link + - pkgs/hooks_runner/test_data/no_build_output - pkgs/hooks_runner/test_data/no_hook - pkgs/hooks_runner/test_data/package_reading_metadata - pkgs/hooks_runner/test_data/package_with_metadata @@ -64,23 +86,33 @@ workspace: - pkgs/hooks_runner/test_data/wrong_build_output_3 - pkgs/hooks_runner/test_data/wrong_linker - pkgs/hooks_runner/test_data/wrong_namespace_asset - - pkgs/hooks/example/build/download_asset - - pkgs/hooks/example/build/local_asset - - pkgs/hooks/example/build/native_add_app - - pkgs/hooks/example/build/native_add_library - - pkgs/hooks/example/build/native_dynamic_linking - - pkgs/hooks/example/build/system_library - - pkgs/hooks/example/build/use_dart_api - - pkgs/hooks/example/link/app_with_asset_treeshaking - - pkgs/hooks/example/link/package_with_assets + # - pkgs/jni # TODO + # - pkgs/jni/example # TODO + # - pkgs/jnigen # TODO + # - pkgs/jnigen/android_test_runner # TODO + # - pkgs/jnigen/example/in_app_java # TODO + # - pkgs/jnigen/example/kotlin_plugin # TODO + # - pkgs/jnigen/example/kotlin_plugin/example # TODO + # - pkgs/jnigen/example/notification_plugin # TODO + # - pkgs/jnigen/example/notification_plugin/example # TODO + # - pkgs/jnigen/example/pdfbox_plugin # TODO + # - pkgs/jnigen/example/pdfbox_plugin/dart_example # TODO + # - pkgs/jnigen/example/pdfbox_plugin/example # TODO - pkgs/json_syntax_generator + # - pkgs/native_doc_dartifier # TODO - pkgs/native_test_helpers - pkgs/native_toolchain_c + - pkgs/objective_c + - pkgs/objective_c/example/command_line + # - pkgs/objective_c/example/flutter_app # Requires Flutter. - pkgs/pub_formats - pkgs/record_use - pkgs/record_use/test_data/drop_data_asset - pkgs/record_use/test_data/drop_dylib_recording - pkgs/repo_lint_rules + # - pkgs/swift2objc # TODO + # - pkgs/swiftgen # TODO + # - pkgs/swiftgen/example # TODO # Hook user-defines are specified in the pub workspace. hooks: diff --git a/tool/ci.dart b/tool/ci.dart index a96dd1ba35..c312d52e94 100644 --- a/tool/ci.dart +++ b/tool/ci.dart @@ -2,8 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:io'; import 'dart:ffi'; +import 'dart:io'; import 'package:args/args.dart'; import 'package:yaml/yaml.dart';