Commit graph

52 commits

Author SHA1 Message Date
Alexandre Ardhuin d927c93310
Unnecessary new (#20138)
* enable lint unnecessary_new

* fix tests

* fix tests

* fix tests
2018-09-12 08:29:29 +02:00
Chris Bracken 251e82d211
Migrate devfs tests to Dart 2 (#21285)
DevFS.update only runs in Dart 2 mode when the generator parameter is
supplied. In Dart 2 mode, both mainPath and pathToReload are required
parameters; this patch marks them as such.

generator is required for running in Dart 2. All call sites other than tests already explicitly set this value.

Note the statements on line 510 and line 516 for why mainPath and pathToReload are required.
2018-08-31 13:31:56 -07:00
Ian Hickson 8c79f40d71
Fixes resulting from audit of issues links (#20772)
* Fixes resulting from audit of issues links

I looked at every link to GitHub in our repo. For cases where we had a TODO that was waiting for a bug to be fixed, and the bug has now been fixed, I applied the pending change. For cases where the link was out of date, I updated the link.

* Update run_test.dart

skip this test again since it failed on linux and macos bots
2018-08-18 16:44:39 -07:00
Ian Hickson 3dec6a6930
Clean up usage of temporary directories (#20682)
All temporary directory start with `flutter_` and have their random component separated from the name by a period, as in `flutter_test_bundle.YFYQMY`.

I've tried to find some of the places where we didn't cleanly delete temporary directories, too. This greatly reduces, though it does not entirely eliminate, the directories we leave behind when running tests, especially `flutter_tools` tests.

While I was at it I standardized on `tempDir` as the variable name for temporary directories, since it was the most common, removing occurrences of `temp` and `tmp`, among others.

Also I factored out some common code that used to catch exceptions that happen on Windows, and made more places use that pattern.
2018-08-17 13:17:23 -07:00
Ian Hickson 686d8f8a22 Shim package:test to avoid matcher issues (#20602)
* Upgrade everything except matcher.
* Roll matcher (and test)
* Adjust tests that depend on flutter:test directly to depend on a shim
* Require use of package:test shim and remove other references to package:test
2018-08-14 20:33:58 -07:00
Leaf Petersen 32f94443cc
Remove uses of deprecated constants and change int.parse to int.tryParse (#19575)
* Remove uses of deprecated constants
* Change int.parse to int.tryParse where appropriate
2018-07-20 15:07:24 -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
Alexandre Ardhuin 09276bea25
enable lint prefer_equal_for_default_values (#18156) 2018-06-05 08:50:40 +02:00
Todd Volkert d820e5f3b1
Use deprecated io constants (#17278)
The new values are not ready for use yet inside Google
2018-05-03 22:27:29 -07:00
Yegor b2c98f9a4e
Roll engine to e976be13c51448f89107d082ec81e2b6731671fa (#17266)
* Roll engine to e976be13c51448f89107d082ec81e2b6731671fa

* move away from deprecated constants
2018-05-03 19:24:48 -07:00
Todd Volkert 8d11f5c763
Make AppContext immutable and race-free (#15984)
This updates AppContext per the recommendations in #15352

Fixes #15352
2018-03-28 10:58:28 -07:00
Jason Simmons 466d15433f
Use Dart 2 camel case constants (#15360) 2018-03-12 11:06:32 -07:00
Josh Soref c5a5945e92 Spelling (#15229)
* spelling: accommodate

* spelling: allotted

* spelling: anonymous

* spelling: artificial

* spelling: associated

* spelling: asset

* spelling: button

* spelling: canvas

* spelling: compatibility

* spelling: coverage

* spelling: condition

* spelling: decoration

* spelling: deferring

* spelling: diameter

* spelling: direction

* spelling: displacement

* spelling: dropdown

* spelling: needing

* spelling: environment

* spelling: exited

* spelling: expansion

* spelling: explore

* spelling: families

* spelling: horizontal

* spelling: increment

* spelling: indices

* spelling: internationalization

* spelling: labrador

* spelling: localizations

* spelling: midflight

* spelling: milliseconds

* spelling: minimum

* spelling: multiple

* spelling: multiplication

* spelling: navigator

* spelling: overridden

* spelling: package

* spelling: performance

* spelling: platform

* spelling: porsche

* spelling: position

* spelling: preceded

* spelling: precede

* spelling: precedence

* spelling: print

* spelling: property

* spelling: readily

* spelling: reproducibility

* spelling: rounded

* spelling: scroll

* spelling: separate

* spelling: separator

* spelling: services

* spelling: specific

* spelling: specify

* spelling: synchronously

* spelling: through

* spelling: timeout

* spelling: triangle

* spelling: trivial

* spelling: unusual

* spelling: then

* spelling: vertically

* spelling: visible

* spelling: visited

* spelling: voice
2018-03-06 21:36:03 -08:00
Alexandre Ardhuin c02b6a8bcf
some whitespace cleanup (#14443) 2018-02-02 23:27:29 +01:00
Alexandre Ardhuin 841d5d7bd5
prefer_const_declarations on local variables (#14358) 2018-02-01 07:51:26 +01:00
Todd Volkert 1859e82a3d
Extensibility improvements to flutter_tools (#14299)
* Make the current command injected into the AppContext, allowing
  other classes to inject the current command.
* Introduce `AssetBundleFactory`, an injected factory class for
  spawning instances of `AssetBundle`. This allows other run contexts
  to use custom asset bundling logic.
* Clean up RunCommand by removing a 'packages' argument that duplicated
  a global argument by the same name (and for the same purpose).
  Duplicate arguments are confusing and error-prone.
2018-01-29 09:40:28 -08:00
Zachary Anderson 4d490666b3 Clean up pre-existing DevFS during creation (#10843) 2017-06-22 09:48:31 -07:00
Chris Bracken d3fbf2ae6f Avoid duplicate exceptions on VM Service Mock failure (#10197)
On failure to configure a mock VM service, we get a useful exception in
setUpAll(). This change prevents an additional failure in tearDownAll()
that provides no additional useful diagnostic info.
2017-05-18 22:56:12 -07:00
Todd Volkert a253605c76 Fall back to IPv4 in devfs_test.dart (#10196)
Fixes the broken build in the Chromium bots
2017-05-18 22:41:41 -07:00
Todd Volkert e8ac331d87 Change devfs_test to use IPv6 (#10194) 2017-05-18 21:45:24 -07:00
Michael Goderbauer ad1c497c03 Do not lower-case paths during canonicalization. (#9571)
* Do not lower-case paths during canonicalization.

This breaks hot reload on some platfroms with case insensitive file systems.

* Add unit tests
2017-04-25 10:34:43 -07:00
John McCutchan 2c1bb355dd Do less file system crawling when we have the Dart dependency set (#9424)
- [x] Skip scanning the file system if we already have the Dart dependency set.

Fixes #9376

```
Performing hot reload...
Reloaded 1 of 418 libraries in 888ms.

Performing hot reload...
Reloaded 1 of 418 libraries in 871ms.

** UNTAR dragontail under project root **
Performing hot reload...
Reloaded 0 of 418 libraries in 443ms.

** UNTAR dragontail under lib/ **
Performing hot reload...
Reloaded 0 of 418 libraries in 385ms.
```
2017-04-17 11:20:04 -07:00
Todd Volkert ff61962144 Update devfs_test to use MemoryFileSystem (#8811) 2017-03-27 12:55:19 -07:00
John McCutchan 51ea62c143 Attempt to fix devfs test (#9007) 2017-03-24 12:32:45 -07:00
Dan Rubel 8742fb09fa Fix tests (#8736)
* do not forward status if stream is closed
* remove devfs test timeout
2017-03-13 13:47:29 -04:00
Michael Goderbauer 03d3186531 Transfer URIs instead of platform-dependent file paths (#8701) 2017-03-10 10:13:53 -08:00
Chris Bracken 33ef949efc Declare locals as final where not reassigned (#8576)
Fix a few regressions.
2017-03-03 18:40:19 -08:00
Michael Goderbauer e0c51480d2 canonicalize paths in devfs (#8565) 2017-03-03 18:21:01 -08:00
Chris Bracken 7a09316cd0 Declare locals final where not reassigned (flutter_tools) (#8570) 2017-03-03 17:50:46 -08:00
Alexandre Ardhuin 69b6bb87d1 prefer_is_empty and prefer_is_not_empty (#8474) 2017-03-01 22:17:30 -08:00
Michael Goderbauer 17057bb44b [devFS] Use URI to represent paths on device (#8446)
* [devFS] Use URI to represent paths on device

Previosuly, regular file paths in the format of the host platform were used to represent paths on device. That works when host and device share the same (POSIX) file path format. With a Windows host, this breaks. URIs are the solution as they are platform independent and the VM service on the device already interpreted the file paths as URIs anyways.

* review comments

* switch to file paths

* fix tests on Windows

* review comments
2017-03-01 10:11:56 -08:00
Michael Goderbauer d7d73a302f fix analyzer warning (#8484) 2017-02-28 19:45:22 -08:00
Michael Goderbauer 65835af4e6 Roll forward #8467 (#8477)
* Revert "Revert "Simplify path handling logic in dependency checker and devFS (#8414)" (#8467)"

This reverts commit 96ba7f76d2.

* Intentionally use a self-package URI in flutter_gallery

* tests to catch problems with self-package imports
2017-02-28 17:21:17 -08:00
Michael Goderbauer ac7954c11a Migrate from touch cmd to dart's built-in API (#8313)
This enables us to run more tests on Windows.
2017-02-21 15:11:37 -08:00
Alexandre Ardhuin 2888139c6b prefer const constructor (#8292) 2017-02-20 14:07:16 -08:00
Michael Goderbauer 5e54fd54d9 Ban package:path from Flutter Tools (#8119) 2017-02-13 17:45:50 -08:00
Michael Goderbauer 82f887de07 Fix Flutter Tools Tests to run on Windows (#7878) 2017-02-05 22:58:49 -08:00
Ian Hickson dc634e195e Introduce the concept of asynchronicity to the service extensions. (#7823)
This allows us, for example, to wait for the slow mode banner to have
been removed from the screen before triggering a screen shot.
2017-02-02 15:48:35 -08:00
Ian Hickson 63aa1397a3 Increase the strictness of our requiring explicit types (#7585)
...now that we have generic methods, their types need to be specified too.
2017-01-23 01:04:31 -08:00
Dan Rubel 0295def2a9 Refactor DevFS for kernel code (#7529)
Refactor DevFS so that it's easier to add new types of content such as kernel code
* add tests for DevFS package scanning
* add tests for DevFS over VMService protocol
* which covers _DevFSHttpWriter and ServiceProtocolDevFSOperations
* replace AssetBundleEntry and DevFSEntry with DevFSContent
* refactor to cleanup common code and replace some fields with locals
* rework .package file generation refactor away DevFSOperations.writeSource
* only update .package file if it has changed
* only write/delete/evict assets that have been changed/removed
2017-01-22 10:37:10 -05:00
Todd Volkert 8bb270342e Update flutter_tools to use package:file throughout (#7385)
This removes direct file access from within flutter_tools
in favor of using `package:file` via a `FileSystem` that's
accessed via the `ApplicationContext`.

This lays the groundwork for us to be able to easily swap
out the underlying file system when running Flutter tools,
which will be used to provide a record/replay file system,
analogous to what we have for process invocations.
2017-01-06 16:51:44 -08:00
John McCutchan 2546259a64 DependencyChecker with tests (#7268)
- [x] Introduce DependencyChecker which can determine if any dependencies have been modified.
- [x] Move the DartDependencyBuilder into a separate file.
- [x] Add unit tests for DartDependencyBuilder.
- [x] Add unit tets for DependencyChecker

Part of #7014
2016-12-15 15:05:15 -08:00
Luke Church 673745901f Use touch to avoid race condition in file modification test (#7117)
* Use touch to avoid race condition in file modification test

* Remove unused import
2016-12-05 14:40:45 +00:00
Luke Church a0c567f751 Add delay between writing file and modifying it (#6968)
* Add delay between writing file and modifying it

* Add type argument
2016-11-21 20:17:41 -08:00
Chris Bracken b5f763b45e Support a configurable build directory (#5601)
This change adds a top-level getBuildDirectory func and funcs for
android, aot, asset, ios build products.

Developers may now add a "build-dir" mapping to their
~/.flutter_settings (JSON format) config file. Output directory is
relative to the main flutter application directory.

This change also changes the default build directory for iOS builds to a
subdirectory of the configured build directory, 'build/ios' by default.
2016-08-25 16:38:19 -07:00
John McCutchan ec0f880032 Hot reload: Only sync Dart sources necessary for startup on first launch (#5333)
- [x] Update engine to bring in new snapshotter.
- [x] Use the new snapshotter to quickly determine the minimal set of files necessary to run.
- [x] On first DevFS sync, only sync files necessary to run the application.
- [x] Fix a DevFS unit test failure.
- [x] Include DevFS tests in all.dart.
2016-08-11 07:40:49 -07:00
Ian Hickson d7fb51a551 Hot reload UI polish (#5193)
* General improvoments to the loader app:
   * Show a message after 8 seconds if no connection comes in.
   * Show a progress bar as files are being uploaded.
   * Hide the spinner just before launching the application.

* General improvements to the "flutter run" UI:
   * Add "?" key as a silent alias for "h".
   * Make the help text bold so it doesn't get mixed with the logs.
   * Make "R" do a cold restart when hot reload is enabled.

* Supporting features and bug fixes:
   * Add support for string service extensions.

* Other bug fixes:
   * Expose debugDumpRenderTree() outside debug mode.
   * Logger.supportsColor was missing a getter.
   * Mention in the usage docs that --hot requires --resident.
   * Trivial style fixes.
2016-08-02 16:52:57 -07:00