Commit Graph

26 Commits

Author SHA1 Message Date
Loïc Sharma
29f332c822
Add migration to git ignore SwiftPM build directories (#152766)
Opening a Swift package in Xcode generates `.build` and `.swiftpm` directories. These should be ignored as they contain intermediary build artifacts that aren't meant to be checked-in.

Part of https://github.com/flutter/flutter/issues/148018
2024-08-05 20:26:16 +00:00
Parker Lougheed
c946a5a526
Switch to more reliable flutter.dev link destinations in the tool (#150587)
Contributes to https://github.com/flutter/website/issues/10363.
2024-06-26 23:30:39 +00:00
Michael Goderbauer
2bfb1b0e2f
Bump flutter_lints to 4.0 (#148020)
Follow-up to https://github.com/flutter/packages/pull/6695.
2024-05-09 18:07:51 +00:00
Victoria Ashworth
5a63b1df95
Add create app and plugin templates for Swift Package Manager (#147082)
When Swift Package Manager feature is enabled, create app and create plugin will have Swift Package Manager integration already added and will not need to undergo a migration.

Fixes https://github.com/flutter/flutter/issues/146371.

```
flutter config --enable-swift-package-manager

flutter create --ios-language swift --platforms ios,macos swift_app_name

flutter create --ios-language objc --platforms ios objc_app_name

flutter create --template=plugin --ios-language swift --platforms ios,macos swift_plugin_name

flutter create --template=plugin --ios-language objc --platforms ios objc_plugin_name
```
2024-04-24 22:46:20 +00:00
Jackson Gardner
31209d04ff
flutter test --wasm support (#145347)
* Adds support for `flutter test --wasm`.
  * The test compilation flow is a bit different now, so that it supports compilers other than DDC. Specifically, when we run a set of unit tests, we generate a "switchboard" main function that imports each unit test and runs the main function for a specific one based off of a value set by the JS bootstrapping code. This way, there is one compile step and the same compile output is invoked for each unit test file.
* Also, removes all references to `dart:html` from flutter/flutter.
* Adds CI steps for running the framework unit tests with dart2wasm+skwasm
  * These steps are marked as `bringup: true`, so we don't know what kind of failures they will result in. Any failures they have will not block the tree at all yet while we're still in `bringup: true`. Once this PR is merged, I plan on looking at any failures and either fixing them or disabling them so we can get these CI steps running on presubmit.

This fixes https://github.com/flutter/flutter/issues/126692
2024-03-21 20:08:07 +00:00
Daco Harkes
8bc0901076
Roll deps from dart-lang/native in templates (#142322)
Update packages from https://github.com/dart-lang/native to the last published stable versions in templates.
2024-01-26 21:42:33 +00:00
Daco Harkes
7634609062
Pin dart-lang/native dependencies (#137601)
Pin the dependencies from dart-lang/native to a specific version during testing (rather than having them auto-upgrade during pub resolution). This will prevent tests using the template to start failing if a bad version is published to pub.

Closes: https://github.com/flutter/flutter/issues/137418

Also bumps dep in flutter_tools.
2023-11-03 22:16:04 +00:00
Michael Goderbauer
571039f6ee
Bump flutter_lints to 3.0 (#136841)
Follow-up to https://github.com/flutter/packages/pull/5177
2023-10-18 23:53:08 +00:00
Daco Harkes
aa36db1d29
Native assets support for MacOS and iOS (#130494)
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.
2023-09-10 08:07:13 +00:00
Parker Lougheed
670d011b71
No longer include .packages in created .gitignore files (#133484)
The `.packages` file was deprecated in Dart 2.8 and slowly discontinued until support being fully removed in Dart 2.19. The file will no longer be created, so it can be safely dropped from the generated `.gitignore` files.
2023-08-30 00:40:01 +00:00
Midori
87324ec09d
[Refactor] fix quote style in template (#127762)
*Just replaced double quote to single.*

*this looks weird to me.*
![screenshot](https://github.com/flutter/flutter/assets/50433979/0bed4730-7fce-411e-b12f-24d478be13c3)
2023-06-02 16:11:51 +00:00
Victoria Ashworth
9136a47458
Set plugin template minimum iOS version to 11.0 (#122625)
Set plugin template minimum iOS version to 11.0
2023-03-21 16:40:50 +00:00
Nate Bosch
4d5c68c4eb
Remove .pub directories from iml templates (#109622) 2022-09-09 22:20:12 +00:00
Daco Harkes
d34801a8da
FFI plugin bump FFIgen to 6.1.2 (#110246) 2022-08-25 19:33:05 +00:00
Daco Harkes
fe7b6de4df
Plugin FFI template bump ffigen to 6.0.1 (#108792) 2022-08-05 07:04:08 +00:00
Daco Harkes
7342574069
Fix plugin_ffi bindings regen command and bump ffigen (#104844) 2022-05-27 15:08:07 -07:00
Ahmed Ashour
2268aebbae
Remove the end period of a URL in project template (#99816) 2022-03-25 16:15:13 -07:00
Michael Goderbauer
8560d914eb
Upgrade to flutter_lints 2.0 (#99881) 2022-03-22 11:00:23 -07:00
Gary Qian
63ff7a199b
MigrateConfig and migrate integration testing base (#99092) 2022-03-16 11:10:22 -07:00
Jeff Ward
0aab22807c
First pass at using platform abstraction for plugins (#92672) 2022-03-09 14:10:21 -08:00
stuartmorgan
7eb1035af6
Restructure Windows plugin template (#93511) 2022-02-03 20:30:18 -08:00
Daco Harkes
bc621327d9
Pin package:ffi in plugin_ffi template (#97720) 2022-02-03 19:42:07 +01:00
Collin Jackson
10fbbafe09
[flutter_tools] Use proper project name in templates (#96373) 2022-02-02 06:50:14 -08:00
Daco Harkes
0e2f51dfd0
FFI plugins (#96225) 2022-01-26 23:44:45 +01:00
Zachary Anderson
65c6e88223
Revert "FFI plugins (#94101)" (#96122)
This reverts commit 5257f0290c.
2022-01-04 08:09:12 -08:00
Daco Harkes
5257f0290c
FFI plugins (#94101)
* Building shared C source code as part of the native build for platforms Android, iOS, Linux desktop, MacOS desktop, and Windows desktop.
* Sample code doing a synchronous FFI call.
* Sample code doing a long running synchronous FFI call on a helper isolate.
* Use of `package:ffigen` to generate the bindings.
2022-01-04 10:14:27 +01:00