fuchsia_tester.dart still assumes Dart 1. Previously, it ran tests directly
from source, flutter_platform.dart automatically runs a kernel compile when
operating in Dart 2 mode, but this assumes a functional Dart SDK is available
in the artifacts directly, and fuchsia_tester.dart mocks out the artifacts
directory with an empty temp dir.
Remaining work is:
1. Get the frontend server building as a dependency on Fuchsia.
2. Patch fuchsia_tester.dart to use a valid Dart SDK and frontend server.
This also reverts migration to Dart 2 typedef syntax.
This reverts commit 6c56bb2. (#18362)
This reverts commit 3daebd0. (#18316)
* It's time to #deleteDart1 (#18293)
Eliminates support for Dart 1 in flutter_tools, and drops our Dart 1
benchmarks. All commands now run in Dart 1 mode only.
Eliminates --preview-dart-2 / --no-preview-dart-2 support.
* Fix indentation, remove no longer necessary .toList()
* Only push udpated kernel if >0 invalidated srcs
Eliminates support for Dart 1 in flutter_tools, and drops our Dart 1
benchmarks. All commands now run in Dart 1 mode only.
Eliminates --preview-dart-2 / --no-preview-dart-2 support.
This updates the Android build to declare the kernel compile depfile as
an output and its contents as inputs when running with --preview-dart-2
(the default mode).
The 'flutter build aot' command behaves differently depending on whether
it's running in Dart 1 or Dart 2 mode:
* Dart 1: the entrypoint Dart file (typically main.dart) is passed
directly to gen_snapshot, which then emits snapshot.d, whose contents
list the transitive closure of Dart dependencies (input files) for the
snapshot. snapshot.d is a declared output, its contents (plus
gen_snapshot itself) constitute the set of input files to the Gradle
build action.
* Dart 2: then entrypoint Dart file (typically main.dart) is first
compiled with the Dart kernel frontend. This emits kernel_compile.d,
whose contents list the transitive closure of Dart dependencies (input
files) for the kernel 'dill' output file. This 'dill' file is then
passed to gen_snapshot, which emits snapshot.d, whose contents are
empty. As of this change, both snapshot.d and kernel_compile.d are
declared outputs, and their contents (plus gen_snapshot and the
frontend compiler themselves) constitute the set of input files to the
Gradle build action.
This fixes a bug wherein profile/release AOT outputs were not
invalidated due to snapshot.d being empty, and kernel_compile.d being
ignored. This was introduced during recent refactoring of the AOT build
code, wherein the kernel compile and gen_snapshot actions were changed
to emit independent depfiles (previously one stomped -- or failed to --
on the other's output).
* Use depfile in --preview-dart-2 mode.
* Generate and use frontend_server.d to guard against reusing outdated dill files when frontend_server changes.
* Plumb a --strong option through to the front end server and the engine
so that we can run flutter apps in preview-dart-2 and strong mode
* - Address analyzer lint issues
*- correctly set up strong mode option in the case of AOT builds
* Revert "Include a directory with Flutter assets (#12944)"
This reverts commit 3af6b9cbf5.
* Revert "Upgrade project.pbxproj to include flutter_assets (#13011)"
This reverts commit 08128cb29b.
* Revert "Upgrade complex_layout project.pbxproj to include flutter_assets (#13544)"
This reverts commit 35f1a04195.
* mark complex_layout_ios__start_up as flaky
* Add support for NDK discovery and add --prefer-shared-library option
We would like to be able to use native tools (e.g. simpleperf, gdb) with
precompiled flutter apps. The native tools work much better with *.so
files instead of the custom formats the Dart VM uses by default.
The reason for using blobs / instruction snapshots is that we do not
want to force flutter users to install the Android NDK.
This CL adds a `--prefer-shared-library` flag to e.g. `flutter build
apk` which will use the NDK compiler (if available) to turn the
precompiled app assembly file to an `*.so` file. If the NDK compiler is
not available it will default to the default behavior.
* Rebase, add test for NDK detection, augment flutter.gradle with @Input for flag
* Use InMemoryFileSystem for test
* Remove unused import
* Address some analyzer warnings
This CL introduces 2 hidden options to 'flutter build aot' and 'flutter run' for passing arbitrary arguments to front-end server and to gen_snapshot tool when building and running flutter app in --profile or --release modes.
The ability to pass arbitrary options simplifies various experiments, as it removes the need to change defaults and rebuild flutter engine for every tested configuration.
Eagerly generate local.properties, and always update the flutter.sdk
setting in it, in case FLUTTER_ROOT has changed.
Fixes#8365.
Fixes#9716 - at least the specific issue reported. My Android Studio
still complains about Gradle versions - it ships with v3.2, but requires
v3.3...
Add a 'generate dependencies' task to the Gradle build, which checks if
the snapshot dependencies file exists, and runs an extra build before
the actual FlutterTask if it doesn't. This makes the first build slower,
but sub-sequent builds (without source changes) much faster.
Fixes#9717.
Go through all packages brought in by pub, and write the name and path of every one that is a flutter plugin into .flutter-plugins.
In android/settings.gradle and ios/Podfile, read in .flutter-plugins, if that file exists. The Android / iOS code from the plugins is automatically added as dependencies of the native code of the app.
* Revert "use color.shadeXxx instead of color[Xxx] (#8932)"
This reverts commit 578ca0a295.
* Revert "add missing const keyword (#8931)"
This reverts commit fac2fac1d6.
* Revert "Make min/max fling velocity and min fling distance ScrollPhysics properties (#8928)"
This reverts commit dac80aac89.
* Revert "Defer to operating system for whichAll (#8921)"
This reverts commit 14933de986.
* Revert "Update gradle wrapper and build-tools version for flutter create. (#8914)"
This reverts commit deb71cc6dc.
* Update gradle wrapper and build-tools version.
Tested manually by "flutter create" with Idea "flutter run" and from android studio "run" android app.
* Update com.android.tools.build to 2.3.0
* Remove legacy .apk build.
Print out an error message telling the user to upgrade the project if
it's not Gradle-based. Removed all the obvious traces of the legacy
build.
Added support for Dart VM kernel snapshots in Gradle builds.
Fixed Android installs to verify that the app is actually installed, and
not just rely on the presence of the .sha1 file.
Changed the default build output directory in the new project template
to build/, instead of android/build/ and android/app/build/.
Updated tools to ask the Gradle scripts what the build directory is,
since this is configurable in the build scripts, and we need to know
where the build output actually is.
Silenced output from 'flutter build aot' when invoked from Gradle, since
the output was confusing in this case.
Fixes#8723Fixes#8656Fixes#8138
* Use snapshot's .d file as source inputs in Gradle build.
If we don't yet have a .d file (first build), fall back to using the
.dart files in the current directory. This enables us to detect changes
in dependent source files (Flutter framework, packages outside the
source directory, etc.), and re-generate the snapshots as needed.
Unfortunately, Gradle requires knowing the source files before executing
the task, and can't update them after building, so Gradle considers the
second build to be out-of-date (because it has more input files than the
first build). Sub-sequent builds have the correct dependency
information, and will be skipped if the source files haven't changed.
Also added a dependency on gen_snapshot. The snapshot ABI isn't stable,
so we need to re-generate the snapshots when we roll the Dart SDK
dependency.
Fixes#8315Fixes#8687Fixes#8607
If a target file is specified on the flutter tools command line, pass it
through to Gradle.
It is still possible to statically specify a target file in the flutter
section of build.gradle, but it is now possible to specify it on the
command line as well. The command line option takes precedence.
Fixes#8175.
The "old" APK build did not include Roboto fonts, but the new
Gradle-based build did. This is due to `flutter build flx` defaulting to
include the fonts, where the old `flutter build apk` defaulted to NOT
include them.
So let's change the Gradle build to also not include Roboto fonts.
Fixes#8149
* Make new project template gradle-based for Android.
With this change, the 'new project' template uses the same gradle-based build for Android as the hello_services example. This has some implications on build performance, since we're now building a complete Android app instead of just combining a pre-compiled .dex with the Flutter assets.
The very first build is a little over 2x slower, since it needs to download gradle and build the build scripts before getting to the actual code. Subsequent builds with changes to the code are comparable to the old builds. Null builds are faster. Enabling the gradle daemon speeds up subsequent builds by around 5s.
* Move Flutter Gradle plugin to Flutter root.