Commit graph

313 commits

Author SHA1 Message Date
Jonah Williams bda9d90804
[flutter_tool] Reland: support --fast-start for Android applications (as an opt-in) (#46140) 2019-12-10 10:26:14 -08:00
Emmanuel Garcia f264d6c277
Allow plugins that don't support the Android platform (#46282) 2019-12-08 20:04:19 -08:00
Jenn Magder d01de941b9
Revert "Support --fast-start for Android applications (as an opt-in) (#45431)" (#46138)
This reverts commit 2a113165c0.
2019-12-04 18:12:57 -08:00
Jonah Williams 2a113165c0
Support --fast-start for Android applications (as an opt-in) (#45431) 2019-12-04 17:34:25 -08:00
Ian Hickson 449f4a6673
License update (#45373)
* Update project.pbxproj files to say Flutter rather than Chromium

Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.

* Update the copyright notice checker to require a standard notice on all files

* Update copyrights on Dart files. (This was a mechanical commit.)

* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.

Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).

* Clean up the copyrights in non-Dart files. (Manual edits.)

Also, make sure templates don't have copyrights.

* Fix some more ORGANIZATIONNAMEs
2019-11-27 15:04:02 -08:00
Emmanuel Garcia b6e92003c8
Add .flutter-plugins-dependencies to the project, which contains the app's plugin dependency graph (#45379) 2019-11-22 15:02:20 -08:00
Jonah Williams df3505c1f3
Improve performance of build APK (~50%) by running gen_snapshot concurrently (#44534) 2019-11-19 11:26:07 -08:00
Jonah Williams 978fada33c
Refactor flutter.gradle to use assemble directly (#43876)
Removes multiple re-entrant calls of bundle and aot and replaces them with a single call to assemble. This restores full caching and will allow follow-up performance improvements when building multiple ABIs
2019-11-08 12:41:24 -08:00
Emmanuel Garcia 114150b791
Don't add x86 nor x64 when building a local engine in debug mode (#44302) 2019-11-06 15:22:54 -08:00
Emmanuel Garcia bb8cf609ec
Build local maven repo when using local engine (#44243) 2019-11-06 12:52:37 -08:00
Emmanuel Garcia ee032f67c7
flutter build aar should also build plugins as AARs (#43994) 2019-11-02 09:46:25 -07:00
Jonah Williams 79bc6cafc5
implement build aot with assemble for Android target platforms (#43282) 2019-10-30 15:23:25 -07:00
Emmanuel Garcia 53cc59f82c
Add transitive dependencies back (#42441) 2019-10-10 12:47:34 -07:00
Jonah Williams 10ddb7db78 remove println (#42378) 2019-10-09 17:49:31 -07:00
Emmanuel Garcia 1d2eaaf204
Ensure that flutter assets are copied in the AAR (#42306) 2019-10-09 16:29:20 -07:00
Emmanuel Garcia 00f82d9021 Use mergeResourcesProvider instead of deprecated mergeResources (#41942) 2019-10-03 20:42:43 -07:00
Emmanuel Garcia ed49a79516 Include embedding transitive dependencies in plugins (#41885) 2019-10-03 20:42:24 -07:00
Emmanuel Garcia 2466ca5bb0
Copy Flutter assets before merging the rest of resources (#41333) 2019-09-27 10:53:37 -07:00
Emmanuel Garcia 975e770e13
Add embedding as API dependency instead of compile only dependency (#41142) 2019-09-25 17:59:17 -07:00
Emmanuel Garcia 16d408a7a0
Reland #40810: Re-enable AAR plugins when an AndroidX failure occurred (#41160) 2019-09-24 16:16:22 -07:00
Emmanuel Garcia 2c8813c86c
Revert "Re-enable AAR plugins when an AndroidX failure occurred (#40810)" (#41042)
This reverts commit 96482eeb5c.
2019-09-23 09:28:38 -07:00
Emmanuel Garcia 407668f4d5
Stop using deprecated features from Gradle (#40900) 2019-09-20 08:29:53 -07:00
Emmanuel Garcia 96482eeb5c
Re-enable AAR plugins when an AndroidX failure occurred (#40810) 2019-09-20 08:28:52 -07:00
Amir Hardon 4e108b6f90
Exclude non Android plugins from Gradle build (#40640)
Before this change, having an Android app depend on a plugin that has no android implementation resulted in a Gradle build failure.

This scenario is likely to become more common if we're enabling federated plugins, as the package implementing just the desktop implementation of a plugin won't have an Android implementation.

This changes the Gradle plugin to not try to build any plugins that doesn't have an android/build.gradle file.
2019-09-18 16:42:20 -07:00
Emmanuel Garcia 8a1bf5b827
Reland #39157 (#39798) 2019-09-17 08:19:33 -07:00
Emmanuel Garcia 0df1594ba2
Enable the resource shrinker (#40610) 2019-09-16 15:27:05 -07:00
Emmanuel Garcia 4d404da6df
Update Kotlin and Gradle version (#40181) 2019-09-13 19:37:07 -07:00
Emmanuel Garcia 2c857b9370
Enable R8 (#40453) 2019-09-13 19:06:40 -07:00
Emmanuel Garcia f29524a150
Rename useProguard method, so Gradle doesn't get confused (#40440) 2019-09-13 13:02:16 -07:00
Emmanuel Garcia f098de1fde
Enable Proguard by default on release mode (#39986) 2019-09-10 17:22:55 -07:00
Emmanuel Garcia d230234d67
Revert Maven dependencies (#39747) (39157) (#39784) 2019-09-03 17:49:10 -07:00
Emmanuel Garcia 1b429bdb47
Fix type mismatch in Gradle (#39747) 2019-09-03 11:39:30 -07:00
Emmanuel Garcia b63cb44105
Use new Maven artifacts from Gradle (#39157) 2019-09-02 10:35:17 -07:00
Emmanuel Garcia 9f39cad4ed
Allow flavors and custom build types in host app (#36805)
Fixes these issues:
#30916
#34089
#36479
#29648
2019-07-29 09:26:41 -07:00
Emmanuel Garcia c469b1fea9
Add annotation dependency to plugins (#36886)
Fixes #36817
2019-07-25 08:49:24 -07:00
Emmanuel Garcia 242a4225a1
Flutter build aar (#36732)
`flutter build aar`

This new build command works just like `flutter build apk` or `flutter build appbundle`, but for plugin and module projects.

This PR also refactors how plugins are included in app or module projects. By building the plugins as AARs, the Android Gradle plugin is able to use Jetifier to translate support libraries into AndroidX libraries for all the plugin's native code. Thus, reducing the error rate when using AndroidX in apps.

This change also allows to build modules as AARs, so developers can take these artifacts and distribute them along with the native host app without the need of the Flutter tool. This is a requirement for add to app.

`flutter build aar` generates POM artifacts (XML files) which contain metadata about the native dependencies used by the plugin. This allows Gradle to resolve dependencies at the app level. The result of this new build command is a single build/outputs/repo, the local repository that contains all the generated AARs and POM files.

In a Flutter app project, this local repo is used by the Flutter Gradle plugin to resolve the plugin dependencies. In add to app case, the developer needs to configure the local repo and the dependency manually in `build.gradle`:


repositories {
    maven {
        url "<path-to-flutter-module>build/host/outputs/repo"
    }
}

dependencies {
    implementation("<package-name>:flutter_<build-mode>:1.0@aar") {
       transitive = true
    }
}
2019-07-23 09:27:42 -07:00
Emmanuel Garcia c9b466f9e2
Revert "Add flutter build aar (#35217)" (#36731)
This reverts commit 11460b8378.
2019-07-22 22:07:59 -07:00
Emmanuel Garcia 11460b8378
Add flutter build aar (#35217)
`flutter build aar`

This new build command works just like `flutter build apk` or `flutter build appbundle`, but for plugin and module projects.

This PR also refactors how plugins are included in app or module projects. By building the plugins as AARs, the Android Gradle plugin is able to use Jetifier to translate support libraries into AndroidX libraries for all the plugin's native code. Thus, reducing the error rate when using AndroidX in apps.

This change also allows to build modules as AARs, so developers can take these artifacts and distribute them along with the native host app without the need of the Flutter tool. This is a requirement for add to app.

`flutter build aar` generates POM artifacts (XML files) which contain metadata about the native dependencies used by the plugin. This allows Gradle to resolve dependencies at the app level. The result of this new build command is a single build/outputs/repo, the local repository that contains all the generated AARs and POM files.

In a Flutter app project, this local repo is used by the Flutter Gradle plugin to resolve the plugin dependencies. In add to app case, the developer needs to configure the local repo and the dependency manually in `build.gradle`:


repositories {
    maven {
        url "<path-to-flutter-module>build/host/outputs/repo"
    }
}

dependencies {
    implementation("<package-name>:flutter_<build-mode>:1.0@aar") {
       transitive = true
    }
}
2019-07-22 20:46:01 -07:00
xster 03220cacd1
Make sure add-to-app build bundle from outer xcodebuild/gradlew sends analytics (#36122) 2019-07-17 11:17:04 -07:00
Josh Burton 577c2fc48c Ensures flutter jar is added to all build types on plugin projects (#34573) 2019-06-25 10:40:55 -07:00
Todd Volkert bb6c3f8131
Remove flutter_tools support for old AOT snapshotting (#34895)
Android now exclusively uses ELF shared libraries, and
iOS uses assembly.
2019-06-22 19:30:24 -07:00
Emmanuel Garcia c50fa3d2bd Re-land config lib dependencies for flavors (#34668) 2019-06-18 22:37:42 -07:00
Emmanuel Garcia 9dbc66979a
Revert "Config lib dependencies when using flavors (#34592)" (#34655)
This reverts commit 358b9bd381.
2019-06-18 15:30:59 -07:00
Jason Simmons c19f78866d
Remove portions of the Gradle script related to dynamic patching (#34606) 2019-06-18 11:11:38 -07:00
Emmanuel Garcia 358b9bd381
Config lib dependencies when using flavors (#34592) 2019-06-17 15:05:16 -07:00
Emmanuel Garcia 09c09bf14b
Add back ability to override the local engine in Gradle (#34460) 2019-06-16 21:52:44 -07:00
Emmanuel Garcia 1c6cda9a0d
Refactor Gradle plugin (#34353) 2019-06-13 16:05:28 -07:00
Emmanuel Garcia d9c1962973
Instrument usage of include_flutter.groovy and xcode_backend.sh (#34189)
This is done via `flutter build bundle`.   As a consequence, this PR introduces a new way to disable analytics via the `FLUTTER_SUPPRESS_ANALYTICS` env flag.
2019-06-11 14:46:00 -07:00
Emmanuel Garcia 8627ff433b
Allow multi-abi shared libraries in APKs and App bundles (#34123)
* Gradle generates ELF shared libraries instead of AOT snapshots.
* `flutter build apk/appbundle` supports multiple `--target-platform` and defaults to `android-arm` and `android-arm64`.
* `flutter build apk` now has a flag called `--split-per-abi`.
2019-06-10 13:16:09 -07:00
Jonah Williams f8f7b89976
Revert "Generate ELF shared libraries and allow multi-abi libs in APKs and App bundles (#33696)" (#34121) 2019-06-08 18:43:25 -07:00
Emmanuel Garcia 966b15b4a4
Generate ELF shared libraries and allow multi-abi libs in APKs and App bundles (#33696)
* Gradle generates ELF shared libraries instead of AOT snapshots.
* `flutter build apk/appbundle` supports multiple `--target-platform` and defaults to `android-arm` and `android-arm64`.
*  `flutter build apk` now has a flag called `--split-per-abi`.
2019-06-08 18:02:32 -07:00
Luiz Dubas 841e1cf0af Add mustRunAfter on mergeAssets task to force task ordering (#33272)
Co-authored-by: Miguel Lemos <miguelslemos@gmail.com>
2019-05-28 10:01:19 -07:00
Emmanuel Garcia dc28ba8919
Remove colon from Gradle task name since it's deprecated (#33191) 2019-05-22 09:58:08 -07:00
Emmanuel Garcia 90f38907d7
Support ARM 32 and 64 bits in app bundles 2019-05-20 13:09:20 -07:00
Todd Volkert 3d09f939ba
Make Gradle error message more specific (#31850) 2019-05-01 10:28:57 -07:00
Jason Simmons 427fcebcc5
Remove the flutter_shared assets directory from the Gradle script (#27572)
flutter_shared was used to package the icudtl.dat file, but that data is
now embedded inside libflutter.so
2019-03-06 11:23:27 -08:00
KyleWong 7c19ec6ca8 Add2App: Fix crash resulted from hard-code module 'app' based resource copy. (#27154) 2019-01-30 10:29:29 -08:00
Jason Simmons 7bfbc28505
Revert "Upgrade the Gradle script to Android plugin version 3.3.0 (#26913)" (#27045)
This reverts commit 30f33d6c7d.
2019-01-24 14:29:08 -08:00
Jason Simmons 30f33d6c7d
Upgrade the Gradle script to Android plugin version 3.3.0 (#26913)
Fixes https://github.com/flutter/flutter/issues/26544
2019-01-24 12:21:11 -08:00
Jason Simmons f4c5e3eef2
[Gradle] Copy ICU data to flutter_shared only when building an AAR module (#26668)
This is based on 9880baa396
but will support building APKs with --local-engine
2019-01-17 16:33:14 -08:00
Vyacheslav Egorov 7c434a5cf2
Revert "Add flutter_shared assets to module artifact (#23782)" (#26644)
This reverts commit 9880baa396.

Reason for revert: broke `--local-engine` command line option.
2019-01-16 21:23:18 +01:00
Igor Borges 9880baa396 Add flutter_shared assets to module artifact (#23782)
copySharedFlutterAssetsTask copies the `flutter_shared` folder assets to android's `src/main` folder of Flutter project, so that folder is bundled on the generated AAR
2019-01-15 10:23:19 -08:00
Stanislav Baranov 6d6ada14a0
Friendlier flags for Dart compilation training. (#25645)
* Renamed --save-compilation-trace to flutter run --train.
* Renamed --precompile=<file> to --compilation-trace-file=<file>.
* In dynamic mode, made JIT snapshot the default, instead of kernel file.
2018-12-21 12:27:59 -08:00
Stanislav Baranov 55f3da7afc
Flutter tool support for building dynamic updates (#25576) 2018-12-19 16:27:47 -08:00
Dan Field 0a798105ef
Support Java 1.8 (#25470) 2018-12-17 14:40:48 -08:00
Stefan Mitev 125b5d623c Fixes gradle error: 'Could not find lint-gradle-api.jar' (#23095) (#23397)
* Fixes gradle error: 'Could not find lint-gradle-api.jar' (#23095)
2018-10-24 14:33:39 -07:00
Stanislav Baranov 323d1574c6
newly created apps / plugins should use latest gradle dependencies (#22790) (#23314) 2018-10-19 19:07:06 -07:00
Alexander Aprelev dd789e645b
Handle escaped spaces in deps-file. (#23273) 2018-10-18 20:44:38 -07:00
Alexander Aprelev 51160b7d56
Revert "Handle escaped spaces in deps-file. (#23249)" (#23270)
This reverts commit 617e8f65b9 as it
breaks deps-processing on Windows.
2018-10-18 15:13:40 -07:00
Alexander Aprelev 617e8f65b9
Handle escaped spaces in deps-file. (#23249)
Fixes https://github.com/flutter/flutter/issues/23236
2018-10-18 14:50:15 -07:00
Yegor 82d6589590
Revert "newly created apps / plugins should use latest gradle dependencies (#22790)" (#23263)
This reverts commit 751c083f7d.

Our buildbots need to be upgraded to a newer version of the Android SDK.
2018-10-18 14:17:47 -07:00
Sebastian Roth 751c083f7d newly created apps / plugins should use latest gradle dependencies (#22790) 2018-10-18 12:56:18 -07:00
Jacob Richman f86bdf1aa2
Fix bug where gradle build rule would rerun on switching from (#23183)
--track-widget-creation=false to
--track-widget-creation=true
but not when switching from
--track-widget-creation=true
to
--track-widget-creation=false

due to the surprising behavior of Gradle @Optional inputs.
2018-10-17 07:39:20 -07:00
Jason Simmons 52e5a9a70a
Add a profile build type to the Android app template (with plugin support) (#22884)
This is required in order to support "flutter run --profile"
2018-10-10 09:54:57 -07:00
Stanislav Baranov 570ae840f2
Remove unused deps and flags from flutter tool. (#22571) 2018-10-09 13:04:06 -07:00
Stanislav Baranov 9a22f5a117
Ensure that VM snapshot is copied from artifacts before gradle merges assets. (#22707)
Gradle plugin support for adding flutter as subproject to another Android app
2018-10-09 10:40:03 -07:00
Stanislav Baranov 54c10f44b2
Implement build flow for hot updates on Android (#22391)
This also involves switching from Core JIT to App JIT snapshot, and replacing per-isolate VM snapshot with the shared VM snapshot.

For now there is no separate update bundle file, as the generated update gets packaged directly into the APK for testing purposes.
2018-09-28 13:58:37 -07:00
Greg Spencer efcd9a8001
Simplify Gradle compiler output. (#21760)
This changes the compiler output for gradle to be less verbose and more easily read.

This only applies to compilation error messages: other gradle messages will continue to print as before.

It also fixes a small problem with the performance measurement printing (see that "7.1s" on it's own line in the original?) so that if something is expected to have multiple lines of output, it prints an initial line, and a "Done" line with the elapsed time, so that it's possible to know what the time applies to.

It also updates the spinner to be fancier, at least on platforms other than Windows (which is missing a lot of symbols in its console font).

Addresses #17307
2018-09-20 15:45:48 -07:00
Chris Bracken 5ab9e70727
Revert "Eliminate snapshot/depfile options to build bundle (#21507)" (#21563)
This tickled a bug in KernelCompiler.compile() where the fingerprinter
doesn't include the outputFilePath in its list of dependencies. As such,
if the output .dill file is missing or corrupted, the fingerprint still
matches and re-compile is skipped, even though it shouldn't be. I'll fix
that in a followup, then look at how this triggered that issue. My
hypothesis is that that it's due to the aot kernel compile and bundle
kernel compile have separate output directories for the .dill files
(build/ vs build/aot) but the same output directory for the associated
depfiles (due to this patch).

This reverts commit 43a106e95a.
2018-09-07 12:33:05 -07:00
Chris Bracken 43a106e95a
Eliminate snapshot/depfile options to build bundle (#21507)
The --snapshot argument was only necessary in Dart 1. The --depfile
argument was only used in Dart 2 mode to pass to the kernel compiler,
but was inconsistent with the 'build aot' command, where the depfile was
always set to build/kernel_compile.d.

This patch updates 'build bundle' to emit the depfile to a location
consistent with the 'build aot' command; since it's not intended to be
user-configurable and flutter.gradle hardcodes the location to
build/kernel_compile.d either way, this patch also eliminates the
ability to configure the filename altogether.
2018-09-07 10:21:55 -07:00
Jason Simmons 4fc5048efd
gradle: add a dependency on the task that generates the x86 jar instead of the jar file (#21466) 2018-09-06 13:59:41 -07:00
Chris Bracken 041ff621a7
Eliminate --preview-dart-2 flag (#21304)
This patch eliminates the --preview-dart-2/--no-preview-dart-2 flag,
hardcoding all uses to true. It also defaults all previewDart2 method
parameters to true, where they hadn't yet been.

A series of subsequent patches will eliminate all previewDart2
parameters and the associated code from within the codebase.
2018-09-04 08:50:05 -07:00
Stanislav Baranov b5b55447a4
Remove unused snapshot.d depfile parameter (#20584) 2018-08-16 08:47:20 -07:00
Stanislav Baranov 2c0329a103
Replace flutter --build-snapshot with --precompile that takes input (#20574) 2018-08-16 08:46:57 -07:00
Stanislav Baranov 393f9276ca
Reland Flutter tool support for dynamic code #20543 (#20646) 2018-08-16 08:43:41 -07:00
Jonah Williams 58e52cc177
Revert "Flutter tool support for dynamic code" (#20644)
* Revert "iOS Dialog blur, brightness, and layout (#18381)"

This reverts commit 21bc9f1b02.

* Revert "Flutter tool support for dynamic code. (#20543)"

This reverts commit 25ba90aafa.
2018-08-15 13:32:22 -07:00
Stanislav Baranov 25ba90aafa
Flutter tool support for dynamic code. (#20543) 2018-08-15 12:27:35 -07:00
Mikkel Nygaard Ravn 475678fdd8
Make Gradle script support Flutter-as-lib (#18633) 2018-06-20 16:07:05 +02:00
Stanislav Baranov bcaf026c08
Add flutter tool support for creating app-specific VM snapshots. (#18417)
Add flutter tool support for creating app-specific VM snapshots.
2018-06-15 11:53:30 -07:00
Chris Bracken 2ae48845a8
Revert elimination of Dart 1 (#18460)
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)
2018-06-13 12:46:39 -07:00
Chris Bracken 3daebd059c
It's time to #deleteDart1 (again) (#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
2018-06-08 15:49:24 -07:00
Chris Bracken 9495df4bc3
Revert "It's time to #deleteDart1 (#18293)" (#18313)
Several benchmarks started failing during kernel compile:
1. Timeouts:
   * commands_test
   * hot_mode_dev_cycle__benchmark
   * run_machine_concurrent_hot_reload
   * service_extensions_test

2. Kernel compiler crash:
   * hot_mode_dev_cycle_linux__benchmark
   * routing_test

3. Unexpected termination:
   * hot_mode_dev_cycle_win__benchmark

This reverts commit ed63e7082a.
2018-06-08 12:43:11 -07:00
Chris Bracken ed63e7082a
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.
2018-06-08 11:04:57 -07:00
Stanislav Baranov 4a2ed22b0e
Propagate flutter tool verbose flag through gradle to flutter build bundle. (#18246) 2018-06-06 13:43:32 -07:00
Martin Kustermann ec6c4aba89
Rename --prefer-shared-library to --build-shared library consistently (#18164)
The change in 8b8d368d2 has only renamed the flag in a subset of the
places.
2018-06-04 17:44:37 +02:00
Mikkel Nygaard Ravn 8c39c35eb0
Upgradle Gradle dependencies to match Android Studio 3.1.2 (#18080) 2018-06-01 09:57:40 +02:00
Mikkel Nygaard Ravn 87a6e2b497
Revert "Update Gradle dependencies (#18071)" (#18074)
This reverts commit 59bb2dba73.
2018-05-31 19:25:40 +02:00
Mikkel Nygaard Ravn 59bb2dba73
Update Gradle dependencies (#18071) 2018-05-31 17:16:47 +02:00
Mikkel Nygaard Ravn d21b2799a0
Revert "Update Gradle dependencies to match Android Studio 3.1.2 (#17974)" (#17979)
This reverts commit 0f557e720e.
2018-05-28 21:18:13 +02:00
Mikkel Nygaard Ravn 0f557e720e
Update Gradle dependencies to match Android Studio 3.1.2 (#17974) 2018-05-28 21:08:50 +02:00
Mikkel Nygaard Ravn bb88766448
Revert "Update Gradle dependencies to match Android Studio 3.1.2 (#17942)" (#17966)
This reverts commit dac1baf4fa.
2018-05-28 15:10:37 +02:00
Mikkel Nygaard Ravn dac1baf4fa
Update Gradle dependencies to match Android Studio 3.1.2 (#17942) 2018-05-28 14:35:32 +02:00
Mikkel Nygaard Ravn 78e205c8f2
Make Dart2 the default in Gradle script (#17682) 2018-05-17 09:56:21 +02:00
Alexander Markov 4fb7c91ee3
Plumb --extra-front-end-options in flutter build bundle (#17404) 2018-05-14 09:41:58 -07:00
Chris Bracken 752906498a
Include kernel_compile.d in Gradle depfiles (#17175)
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).
2018-05-01 18:11:57 -07:00
Alexander Aprelev a21c93dd70
Fix boolean flag parsing in gradle. Track 'trackWidgetCreation' as property of the build. (#16901) 2018-04-24 09:51:25 -07:00
Sarah Zakarias 4443e4d4cf
Cleanup FLX related code (#16416) 2018-04-12 10:12:26 +02:00
Mikkel Nygaard Ravn 731ed1b11b
Make flutter.gradle support Flutter used as lib (#16300) 2018-04-06 13:11:47 +02:00
Alexander Aprelev 43284d70d9
Reland filesystem options support with fix for Windows test. (#15655)
* Revert "Revert "Reland pass filesystem options (#15622)" (#15651)"

This reverts commit 0f3eada066.

* Fix for windows failing test

* !isEmpty -> isNotEmpty
2018-03-17 12:47:40 -07:00
Alexander Aprelev 0f3eada066
Revert "Reland pass filesystem options (#15622)" (#15651)
This reverts commit bbcf55a5b0 as it breaks hot reload on Windows.
2018-03-17 08:11:52 -07:00
Alexander Aprelev bbcf55a5b0
Reland pass filesystem options (#15622)
* Revert "Revert "Pass filesystem-root, filesystem-scheme options through `flutter run, build` and gradle. (#15592)" (#15621)"

This reverts commit c663e3367d.

* Check whether filesystem-root is emtpy.

* Restore broken merge

* Fix windows test

* Adjust regex in test. Invalidate files by file path.
2018-03-17 06:49:15 -07:00
Vyacheslav Egorov 71b2cfb2a0
Turn Dart 2 mode by default. (#15565) 2018-03-16 20:29:38 +01:00
Alexander Aprelev c663e3367d
Revert "Pass filesystem-root, filesystem-scheme options through flutter run, build and gradle. (#15592)" (#15621)
This reverts commit 0f659fb10b as it
breaks bin/tasks/gradle_plugin_test.dart.
2018-03-16 12:28:30 -07:00
Alexander Aprelev 0f659fb10b
Pass filesystem-root, filesystem-scheme options through flutter run, build and gradle. (#15592)
* Pass filesystem-root, filesystem-scheme options through flutter run/build/gradle.
2018-03-16 11:16:54 -07:00
Alexander Markov dba9584ba1
Pass extra front-end and gen_snapshot options to GenerateDependencies gradle task, as it also runs 'flutter build aot' (#14980) 2018-03-06 09:19:30 -08:00
Alexander Aprelev 673c5485ae
Generate and use dep-file for --preview-dart-2 (#15077)
* Use depfile in --preview-dart-2 mode.

* Generate and use frontend_server.d to guard against reusing outdated dill files when frontend_server changes.
2018-03-02 11:33:13 -08:00
Mikkel Nygaard Ravn 465478dac4
Update google repo url (#14958) 2018-02-28 13:34:45 +01:00
Jacob Richman 2c05ecab9f
Flutter tools support for kernel transformer tracking Widget creation locations. (#13997) 2018-02-12 10:44:31 -08:00
asiva 83e0ca24fd Fuse --strong into --preview-dart-2 option. 2018-02-08 09:18:52 -08:00
Jason Simmons d5149d4457
Toolchain support for Android ARM64 targets (#14394) 2018-02-01 15:14:48 -08:00
Martin Kustermann b2c65e7653
Update path to app.so when using aot compilation to shared library on android (#14302)
This was overlooked in 5e18c07614
2018-01-27 14:21:58 +01:00
Alexander Aprelev 09a6df7461
Clean up output directory before copying over new files (#14085)
* Clean up output directory before copying over new files

* Use standard clean task command
2018-01-14 18:24:07 -08:00
Jason Simmons 4954bbfaf9
Read properties files as UTF-8 in Gradle scripts (#13981)
Fixes https://github.com/flutter/flutter/issues/13972
2018-01-08 13:48:08 -08:00
Siva 426d6b0672
support for --strong option (#13859)
* 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
2018-01-04 10:39:02 -08:00
Sarah Zakarias 2ef379ad12
Remove app.flx from apk (#13647) 2017-12-18 14:33:35 +01:00
Sarah Zakarias 5e18c07614
Reapply flutter_assets (#13567)
* Revert "Revert engine (#13547)"

This reverts commit ee65db11d4.

* Keep flaky mark
2017-12-14 17:27:25 +01:00
Mikkel Nygaard Ravn 5ae507a752
Revert "Refresh template instances (#13563)" (#13565)
This reverts commit 05d6b08ffe.
2017-12-14 15:38:39 +01:00
Mikkel Nygaard Ravn 05d6b08ffe
Refresh template instances (#13563) 2017-12-14 15:19:59 +01:00
Mikkel Nygaard Ravn a2296aa8e3
Simplify project template (#13558) 2017-12-14 11:38:20 +01:00
Yegor ee65db11d4
Revert engine (#13547)
* 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
2017-12-13 16:25:25 -08:00
Sarah Zakarias 3af6b9cbf5
Include a directory with Flutter assets (#12944) 2017-12-13 22:30:32 +01:00
Mikkel Nygaard Ravn e5aac6928b
Support Android Gradle plugin v3.0.1 (#13492) 2017-12-13 12:16:22 +01:00
Martin Kustermann 545ec9efb7
Add support for NDK discovery and add --prefer-shared-library option (#12788)
* 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
2017-11-21 15:44:03 +01:00
Sarah Zakarias f6135107bc Copy snapshot file into assets (#12523) 2017-10-18 14:52:36 +02:00
Alexander Markov 7153dea296 Add hidden options --extra-front-end-options and --extra-gen-snapshot-options to flutter tool (#12219)
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.
2017-10-03 12:55:53 -07:00
Mikkel Nygaard Ravn a1f03977ca Engine artifacts used for snapshots also specified as build inputs (#12014) 2017-09-12 08:35:02 +02:00
Alexander Aprelev c5750cd7ea Introduce --preview-dart-2 option to run new frontend compiler in flutter tools. (#11741)
This adds --preview-dart-2 flag that enables use of Dart 2.0 Frontend in Flutter tools.
2017-08-31 13:35:55 -07:00
Mikkel Nygaard Ravn 79747f4947 Improve Gradle error output in Flutter commands (#11703) 2017-08-24 10:44:32 +02:00
Mikkel Nygaard Ravn 75ef9d02e8 Avoid building x86 jar for profile and release modes (#11486) 2017-08-04 14:57:54 +02:00
Mikkel Nygaard Ravn 87eec719e2 Support for custom build types on Android (#11354) 2017-07-31 13:57:24 +02:00
Seth Ladd 2d79ce8419 don't send analytics when run from another runner (#10789) 2017-06-16 14:33:59 -07:00
Rafal Wachol ee34516491 Moved FLUTTER_HOME to FLUTTER_ROOT in gradle plugin (#10100) 2017-05-22 07:50:31 -07:00
Jakob Andersen 6b54137a15 Improve Android builds. (#9801)
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.
2017-05-05 14:53:51 +02:00
Collin Jackson 60e05e9a0e Remove Android support library in Flutter builds. Fixes #9120, #9102, #9121. (#9123)
This reverts commit 8f9d4a2260.
2017-03-31 09:35:25 -07:00
Jason Simmons 72effdd27c Roll the engine and update for new binary names (#9089) 2017-03-29 15:31:36 -07:00
Collin Jackson 8f9d4a2260 Re-land #9036 (#9068)
This reverts commit e2b49d64d6.
2017-03-28 17:05:04 -07:00
Collin Jackson e2b49d64d6 Revert "Revert "Revert "Include fragment support in Android build to allow use of FragmentActivity in FlutterActivity (#9036)"" (#9046)" (#9047)
Test is still failing with increased timeout.

This reverts commit 864b3c37c6.
2017-03-27 19:16:58 -07:00
Collin Jackson 864b3c37c6 Revert "Revert "Include fragment support in Android build to allow use of FragmentActivity in FlutterActivity (#9036)"" (#9046)
Increased the time limit slightly to allow the microbenchmark test time to finish.
2017-03-27 18:12:14 -07:00
Collin Jackson c346d51dcb Revert "Include fragment support in Android build to allow use of FragmentActivity in FlutterActivity (#9036)" (#9041)
This reverts commit 6bf0ceb02b.
2017-03-27 17:30:39 -07:00
Collin Jackson 6bf0ceb02b Include fragment support in Android build to allow use of FragmentActivity in FlutterActivity (#9036) 2017-03-27 16:08:36 -07:00
xster 3bc3d4a50b Remove various roboto font logic (#8350) 2017-03-23 11:28:03 -07:00
Jakob Andersen b61e169011 Automatically wire dependencies for native plugins (#8891)
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.
2017-03-23 14:59:12 +01:00
Michael Thomsen 15e51a9e3e Revert "Update gradle wrapper and build-tools version for flutter create." (#8940)
* 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.
2017-03-21 17:42:40 -07:00
asaarnak deb71cc6dc Update gradle wrapper and build-tools version for flutter create. (#8914)
* 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
2017-03-21 16:47:32 +01:00
Jakob Andersen 7b2367ed5f Remove legacy .apk build. (#8793)
* 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.
2017-03-20 11:05:55 +01:00
Jakob Andersen 1457f3dbb0 Put Gradle output in build/ (#8759)
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 #8723
Fixes #8656
Fixes #8138
2017-03-15 10:53:22 +01:00
Jakob Andersen 9c6ffc8281 Use snapshot's .d file as source inputs in Gradle build. (#8756)
* 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 #8315
Fixes #8687
Fixes #8607
2017-03-14 12:49:30 +01:00
Jakob Andersen 2a05cfdf07 Remove superfluous (and wrong) target file check (#8367) 2017-02-23 16:27:30 +01:00
Jakob Andersen 6d66be17b9 Add support for target file in Gradle builds. (#8364)
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.
2017-02-23 15:09:05 +01:00
Jakob Andersen 13d7770cf9 Fix local engine support for Gradle builds. (#8362)
Fixes #6761.
2017-02-23 14:56:19 +01:00
Michael Goderbauer e9af570f1f Enable Gradle Workflow on Windows (#8201)
* Enable Gradle Workflow on Windows

With this the app created by `flutter create` now compiles on Windows.

* Move OS check to gradle file
2017-02-16 14:17:09 -08:00
Jakob Andersen 77e53016f2 Don't include Roboto fonts in Gradle builds. (#8169)
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
2017-02-15 09:27:05 +00:00
Jakob Andersen b246c5e7e9 Make new project template gradle-based for Android. (#7902)
* 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.
2017-02-10 09:37:38 +01:00