1. 10 Sep, 2023 1 commit
    • Daco Harkes's avatar
      Native assets support for MacOS and iOS (#130494) · aa36db1d
      Daco Harkes authored
      Support for FFI calls with `@Native external` functions through Native assets on MacOS and iOS. This enables bundling native code without any build-system boilerplate code.
      
      For more info see:
      
      * https://github.com/flutter/flutter/issues/129757
      
      ### Implementation details for MacOS and iOS.
      
      Dylibs are bundled by (1) making them fat binaries if multiple architectures are targeted, (2) code signing these, and (3) copying them to the frameworks folder. These steps are done manual rather than via CocoaPods. CocoaPods would have done the same steps, but (a) needs the dylibs to be there before the `xcodebuild` invocation (we could trick it, by having a minimal dylib in the place and replace it during the build process, that works), and (b) can't deal with having no dylibs to be bundled (we'd have to bundle a dummy dylib or include some dummy C code in the build file).
      
      The dylibs are build as a new target inside flutter assemble, as that is the moment we know what build-mode and architecture to target.
      
      The mapping from asset id to dylib-path is passed in to every kernel compilation path. The interesting case is hot-restart where the initial kernel file is compiled by the "inner" flutter assemble, while after hot restart the "outer" flutter run compiled kernel file is pushed to the device. Both kernel files need to contain the mapping. The "inner" flutter assemble gets its mapping from the NativeAssets target which builds the native assets. The "outer" flutter run get its mapping from a dry-run invocation. Since this hot restart can be used for multiple target devices (`flutter run -d all`) it contains the mapping for all known targets.
      
      ### Example vs template
      
      The PR includes a new template that uses the new native assets in a package and has an app importing that. Separate discussion in: https://github.com/flutter/flutter/issues/131209.
      
      ### Tests
      
      This PR adds new tests to cover the various use cases.
      
      * dev/devicelab/bin/tasks/native_assets_ios.dart
        * Runs an example app with native assets in all build modes, doing hot reload and hot restart in debug mode.
      * dev/devicelab/bin/tasks/native_assets_ios_simulator.dart
        * Runs an example app with native assets, doing hot reload and hot restart.
      * packages/flutter_tools/test/integration.shard/native_assets_test.dart
        * Runs (incl hot reload/hot restart), builds, builds frameworks for iOS, MacOS and flutter-tester.
      * packages/flutter_tools/test/general.shard/build_system/targets/native_assets_test.dart
        * Unit tests the new Target in the backend.
      * packages/flutter_tools/test/general.shard/ios/native_assets_test.dart
      * packages/flutter_tools/test/general.shard/macos/native_assets_test.dart
        * Unit tests the native assets being packaged on a iOS/MacOS build.
      
      It also extends various existing tests:
      
      * dev/devicelab/bin/tasks/module_test_ios.dart
         * Exercises the add2app scenario.
      * packages/flutter_tools/test/general.shard/features_test.dart
         * Unit test the new feature flag.
      aa36db1d
  2. 31 Aug, 2023 1 commit
  3. 30 Aug, 2023 2 commits
  4. 09 Aug, 2023 1 commit
    • Victoria Ashworth's avatar
      New tooling for iOS 17 physical devices (#131865) · d631b262
      Victoria Ashworth authored
      This PR includes the following changes. These changes only apply to iOS 17 physical devices.
      
      | Command | Change Description  | Changes to User Experience |
      | ------------- | ------------- | ------------- |
      | `flutter run --release` | Uses `devicectl` to install and launch application in release mode.  | No change.  |
      | `flutter run`  | Uses Xcode via automation scripting to run application in debug and profile mode. | Xcode will be opened in the background. Errors/crashes may be caught in Xcode and therefore may not show in terminal. |
      | `flutter run --use-application-binary=xxxx` | Creates temporary empty Xcode project and use Xcode to run via automation scripting in debug and profile. | Xcode will be opened in the background. Errors/crashes may be caught in Xcode and therefore may not show in terminal.  |
      | `flutter install` | Uses `devicectl` to check installed apps, install app, uninstall app.  | No change.  |
      | `flutter screenshot` | Will return error.  | Will return error.  |
      
      Other changes include:
      * Using `devicectl` to get information about the device
      * Using `idevicesyslog` and Dart VM logging for device logs
      
      Note:
      Xcode automation scripting (used in `flutter run` for debug and profile) does not work in a headless (without a UI) interface. No known workaround.
      
      Fixes https://github.com/flutter/flutter/issues/128827, https://github.com/flutter/flutter/issues/128531.
      d631b262
  5. 31 Jul, 2023 2 commits
  6. 27 Jul, 2023 1 commit
  7. 06 Jul, 2023 1 commit
  8. 01 Jul, 2023 1 commit
  9. 29 Jun, 2023 1 commit
  10. 20 Jun, 2023 1 commit
  11. 06 Jun, 2023 1 commit
  12. 02 Jun, 2023 1 commit
  13. 31 May, 2023 1 commit
  14. 23 May, 2023 1 commit
  15. 19 May, 2023 1 commit
  16. 12 May, 2023 1 commit
  17. 05 May, 2023 1 commit
    • Alberto Azinar's avatar
      improvement : removed required kotlin dependency (#125002) · 4d4b3cf2
      Alberto Azinar authored
      This PR removed the non-necessary required Koltin dependency. This is because the Kotlin Gradle adds the dependency on the standard library automatically. 
      
      Fixes #98212
      
      *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy]. *
      4d4b3cf2
  18. 02 May, 2023 1 commit
    • Jenn Magder's avatar
      Migrate Xcode projects last version checks to Xcode 14.3 (#125827) · 1861ac47
      Jenn Magder authored
      1. Add iOS and macOS migration to mark "last upgraded" Xcode version to 14.3 to prevent `Update to recommended settings` warning.
      2. Update iOS and macOS templates to same.
      3. Update iOS template to set `BuildIndependentTargetsInParallel` to YES as suggested.  I didn't add a migration for this since it seems like a minor optimization and I don't think it's worth a potentially botched/corrupted migration.
      4. Run all example/integration test project to see migrator work.
      5. Add some missing test projects to the build shard since I noticed they were missing and I had to build those manually outside `SHARD=build_tests`.
      
      Fixes https://github.com/flutter/flutter/issues/125817
      See https://github.com/flutter/flutter/pull/90304 for Xcode 13 example.
      1861ac47
  19. 28 Apr, 2023 1 commit
  20. 27 Apr, 2023 1 commit
  21. 19 Apr, 2023 1 commit
  22. 14 Apr, 2023 1 commit
  23. 06 Apr, 2023 1 commit
  24. 05 Apr, 2023 1 commit
  25. 29 Mar, 2023 1 commit
  26. 28 Mar, 2023 1 commit
  27. 21 Mar, 2023 2 commits
  28. 17 Mar, 2023 2 commits
  29. 16 Mar, 2023 1 commit
  30. 23 Feb, 2023 1 commit
  31. 16 Feb, 2023 1 commit
  32. 15 Feb, 2023 2 commits
    • stuartmorgan's avatar
      Add Linux unit tests to plugin template (#120814) · e65dfba8
      stuartmorgan authored
      * Add Linux unit tests to plugin template
      
      Adds an example native unit test to the plugin template for Linux,
      matching the structure we use for our 1P plugin unit tests. Once these
      have been added for all platforms+languages, they will be documented on
      a new plugin development page to explain their use.
      
      While ideally we would adjust the engine APIs first to allow for testing
      the method call handler directly, it's unclear when we will have time
      for that work, and for a complex plugin most of the testing wouldn't be
      at that layer anyway, so having the structure in place with the
      limitations documented is still a significant improvement over having
      nothing in the template.
      
      Part of https://github.com/flutter/flutter/issues/82458
      
      * Add creation test
      
      * Add integration tests
      
      * Missing newlines
      
      * test owner
      
      * Typo
      e65dfba8
    • stuartmorgan's avatar
      Add Android unit tests to plugin template (#120720) · ef49f566
      stuartmorgan authored
      * Add Java tests
      
      * Add Kotlin
      
      * Add integration testing
      
      * Add cerate tests
      ef49f566
  33. 13 Feb, 2023 1 commit
  34. 02 Feb, 2023 1 commit
  35. 24 Jan, 2023 1 commit
    • stuartmorgan's avatar
      Add Windows unit tests to plugin template (#118638) · e3c51a2f
      stuartmorgan authored
      * Add Windows unit tests to plugin template
      
      Adds an example native unit test to the plugin template for Windows,
      matching the format we use for our 1P plugin example app unit tests.
      Once these have been added for all platforms+languages, they will be
      documented on a new plugin development page to explain their use.
      
      Since we don't appear to be running our current plugin e2e tests for
      Windows, this adds a new configuration to run them. I haven't
      `led`-tested this, so it may not work, but this will give a starting
      point for getting them running.
      
      Part of https://github.com/flutter/flutter/issues/82458
      
      * Minor fix
      
      * Add test owner
      
      * Fix typo
      
      * Fix test feature flag
      e3c51a2f