Commit graph

69 commits

Author SHA1 Message Date
Alexandre Ardhuin 387f885481
Add missing trailing commas (#28673)
* add trailing commas on list/map/parameters

* add trailing commas on Invocation with nb of arg>1

* add commas for widget containing widgets

* add trailing commas if instantiation contains trailing comma

* revert bad change
2019-03-01 08:17:55 +01:00
KyleWong d7b0aab634 Add tests for pr:27687 (#27944) 2019-02-25 18:34:03 -08:00
Dan Field 15f2119f2c
Reland "Allow for gradle downloading missing SDK assets" (#28097) (#28355)
* Allow for gradle downloading missing SDK assets if SDK licenses are present.

*  Improvements for windows testing
2019-02-23 09:56:57 -08:00
Dan Field 74a9086037
Revert "Allow for gradle downloading missing SDK assets (#28097)" (#28295)
This reverts commit 6f5e88a59f.
2019-02-21 16:53:45 -08:00
Dan Field 6f5e88a59f
Allow for gradle downloading missing SDK assets (#28097)
* Allow for gradle downloading missing SDK assets if SDK licenses are present.

* Fix license path for missing sdkmanager

* Cirrus re-run...

* Fix condition check

* rename props, add docs, rename method

* fix tests after param changes

* Fix weird path for flutter run and add tests

* remove print, fix tests
2019-02-21 15:57:20 -08:00
KyleWong 4b4a9400b7 Refactor build-number/build-name logic. (#27743)
This PR aims at several things:

1. Use pub_semver to check a version in pubspec.yaml meets the requirements specified in https://semver.org/.
2. Don't limit build-number/build-name as a fixed format. Instead, validate it according to the target(ios/android).
3. Make sure that build-number/build-name are always validated no matter it's specified by the `flutter command` or version in pubspec.yaml.

Fixes #27589
2019-02-13 07:48:03 -08:00
Michael Klimushyn 4a9e5bc11b
Warn when gradle builds fail because of AndroidX (#27566)
Try to detect Gradle error messages that hint at AndroidX problems, and
warn in the logs about the potential problem and point to documentation
on how to fix the issue.

Unfortunately the Gradle errors based on this root issue are varied and
project dependent. It's probably better to still leave the message
intact in case the problem is unrelated.

Also filters out the plugin warning message pending in
flutter/plugins#1138. It's still valuable to add that for people on
previous versions of Flutter, but this link should override that message
for anyone on an up to date version of Flutter.

#27106
2019-02-07 17:23:35 -08:00
Dan Field 19b8d2e0a9
Detect Android SDK 28/28.0.3 (#26942)
* Detect Android SDK 28/28.0.3

* revert minimumAndroidSdkVersion const change
2019-01-23 15:56:48 -08:00
Vyacheslav Egorov 8f65ee9f53
Fix --build-shared-library on newer NDKs (#26642)
Newer NDKs switched to clang which by default uses system linker, instead
we need to force it to use appropriate toolchain linker by passing
-fuse-ld= command line flag.

Fixes #23458
2019-01-16 21:30:37 +01:00
Pranay Airan 368cd7da8b
Adding support for android app bundle - Issue #17829 (#24440)
* adding support for android app bundle.

* removing the debug statement.

* fixing formatting and code review changes.

* Revert "fixing formatting and code review changes."

This reverts commit 2041d459f3.

* Fixing code formatting issues.

* updating review comments fixing comments and spacing.

* changing and to & to rerun the CI and tests.

* updating the comment to re-run the test

updating the comment to re-run the test

* fixing the formatting.

* updating comments to re-trigger build

updating comments to re-trigger build
2018-12-20 22:18:53 -08:00
Stanislav Baranov 693fb6560e
Fix flutter tool to actually honor --build-number/--build-name flags. (#25520) 2018-12-18 12:54:26 -08:00
Stanislav Baranov f6c1476fbb
Fix gradle local.properties tests that were never excersized. (#25484)
These tests were actually failing, but were silently ignored due overly broad exception catching logic.
2018-12-18 10:39:27 -08:00
jslavitz 34fa90b062
Improves SDK Search Error Messages (#23884)
* Improves error message and adds test.
2018-11-06 15:13:35 -08:00
Ian Hickson 4a094de290
[H] Cleanup (#23632)
* Avoid abbreviations

* Sample code for AppBar.leading

* Add a test for OverflowBox/FractionallySizedBox

* Minor wording improvements in the text.

The words "note that" here don't really contribute to the flow.
2018-10-29 19:44:00 -07:00
Greg Spencer 081d2a7a86
Re-land text wrapping/color PR (#22831)
This attempts to re-land #22656.

There are two changes from the original:

I turned off wrapping completely when not sending output to a terminal. Previously I had defaulted to wrapping at and arbitrary 100 chars in that case, just to keep long messages from being too long, but that turns out the be a bad idea because there are tests that are relying on the specific form of the output. It's also pretty arbitrary, and mostly people sending output to a non-terminal will want unwrapped text.

I found a better way to terminate ANSI color/bold sequences, so that they can be embedded within each other without needed quite as complex a dance with removing redundant sequences.

As part of these changes, I removed the Logger.supportsColor setter so that the one source of truth for color support is in AnsiTerminal.supportsColor.

*     Turn on line wrapping again in usage and status messages, adds ANSI color to doctor and analysis messages. (#22656)

    This turns on text wrapping for usage messages and status messages. When on a terminal, wraps to the width of the terminal. When writing to a non-terminal, wrap lines at a default column width (currently defined to be 100 chars). If --no-wrap is specified, then no wrapping occurs. If --wrap-column is specified, wraps to that column (if --wrap is on).

    Adds ANSI color to the doctor and analysis output on terminals. This is in this PR with the wrapping, since wrapping needs to know how to count visible characters in the presence of ANSI sequences. (This is just one more step towards re-implementing all of Curses for Flutter. :-)) Will not print ANSI sequences when sent to a non-terminal, or of --no-color is specified.

    Fixes ANSI color and bold sequences so that they can be combined (bold, colored text), and a small bug in indentation calculation for wrapping.

    Since wrapping is now turned on, also removed many redundant '\n's in the code.
2018-10-10 18:17:56 -07:00
Jorge Coca 422e56c29c Added support for Gradle productFlavors that are not only lowercase (#22767)
Fixes https://github.com/flutter/flutter/issues/19507
2018-10-09 20:04:29 -07:00
Greg Spencer 2d81adf74c
Revert "Turn on line wrapping in usage and status messages, adds ANSI color to doctor and analysis messages. (#22656)" (#22759)
This reverts commit e438632165
because it breaks 160 benchmarks, and several devicelab tests,
due to changing the format of the output.
2018-10-05 22:29:37 -07:00
Greg Spencer e438632165
Turn on line wrapping in usage and status messages, adds ANSI color to doctor and analysis messages. (#22656)
This turns on text wrapping for usage messages and status messages. When on a terminal, wraps to the width of the terminal. When writing to a non-terminal, wrap lines at a default column width (currently defined to be 100 chars). If --no-wrap is specified, then no wrapping occurs. If --wrap-column is specified, wraps to that column (if --wrap is on).

Adds ANSI color to the doctor and analysis output on terminals. This is in this PR with the wrapping, since wrapping needs to know how to count visible characters in the presence of ANSI sequences. (This is just one more step towards re-implementing all of Curses for Flutter. :-)) Will not print ANSI sequences when sent to a non-terminal, or of --no-color is specified.

Fixes ANSI color and bold sequences so that they can be combined (bold, colored text), and a small bug in indentation calculation for wrapping.

Since wrapping is now turned on, also removed many redundant '\n's in the code.
2018-10-05 20:00:11 -07:00
tonyzhao1 b04447d51c Split Android license checks into their own subvalidator (#22446) 2018-10-05 08:45:16 -07:00
Greg Spencer 40a7a9cfc3
Fixes a common crash in getAdbDevices when adb executable isn't found. (#22676)
Apparently, this accounts for 13% of our crashes in Beta.
2018-10-04 15:57:15 -07:00
Jason Simmons e031613a2a
Use "gradle tasks --all" to query build variants (#21761)
Previously flutter_tools had used "gradle properties" to find the build types
and flavors supported by the Gradle project.  Tasks should work more reliably
across different versions of the Android Gradle plugin.

Fixes https://github.com/flutter/flutter/issues/20781
2018-10-04 10:06:31 -07:00
Alexandre Ardhuin f62afdcf57
add missing type parameter on methods (#22096) 2018-10-01 21:29:08 +02:00
Joao da Silva 66e5422375 Check for AndroidStudio plugins in the right .dot dir. (#20619)
This fixes issues 11940 and 18155.
2018-09-12 08:15:30 -07:00
Alexandre Ardhuin d927c93310
Unnecessary new (#20138)
* enable lint unnecessary_new

* fix tests

* fix tests

* fix tests
2018-09-12 08:29:29 +02:00
tonyzhao1 58d98ce31e Create categories for doctor validators (#20758)
* First step in Flutter Doctor refactor. Assigns categories to all validators.

* Revert "Roll engine e54bc4ea1832..a84b210b3d26 (6 commits) (#20453)"

This reverts commit 05c2880a17.

* Split iOS and Android workflows into workflow and validator classes.

* Change ValidatorCategory to handle standalone validators that share a
category (e.g. IntelliJ).

Also make Android Studio and Android toolchain use separate categories.

At this stage, flutter doctor output matches what it was previously.
(The summary() method itself has not yet been changed )

* Change doctor summary code to support validator categories.

Output is still unchanged.

* Handle small formatting issues.

* Flip Flutter category's isGroup field to false until it's actually
needed.

* Revert auto-generated formatting changes to keep those lines from
muddying the pull.

* Small fixes pointed out by analyzer.

* Properly fix analyzer issues around const constructors.

* Small changes to address comments.

* Add tests to verify grouped validator behavior and validationtype
merging.

* Update doctor.dart

* Add comments for clarification.
2018-09-04 19:36:47 -07:00
Danny Tuppeny a74f591d0c
Change asset_bundle_package_font_test to memory file system (#21114)
* Change assert_bundle_package_font_test to memory file system

This is to work towards being able to run the tests without `-j1` (#21113). These tests were using the real filesystem and setting/relying on fs.currentDirectory. There was a comment about this being because the memory provider didnt' support POSIX and Windows, however that seems to have changed since (and many other asset tests already do something similar to this).

* Trim trailing whitespace

* Add a workaround for Windows path slash directions

Strictly this is correct, but the real FS can tolerate either path. The in-memory file system is more strict (see https://github.com/google/file.dart/issues/112).

* Extract a helper for writing schema files in tests

* Missed file when saving!

* Remove redundant comment

* Rename writeBasicSchema -> writeEmptySchema

* Use the file we already have to write contents

* Make comments more descriptive

* Remove another dupe of writeSchema to use the shared one

* Rename schema -> pubspec_schema

* Trim whitespace
2018-09-04 17:12:24 +01: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
Mikkel Nygaard Ravn d4e5e1e11e
Materialize Flutter module, Android (#20520) 2018-08-16 13:21:55 +02: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
Mikkel Nygaard Ravn b280074815
Move async from member access to construction (#20035) 2018-08-02 14:12:25 +02:00
Alexandre Ardhuin eda03e2586
re-re-enable lint unnecessary_const (#20103) 2018-08-02 12:02:32 +02:00
Todd Volkert 00aac68e2d
Revert flutter/flutter#19592 (#19861)
It was causing problems rolling Flutter into Fuchsia
2018-07-27 08:44:39 -07:00
Alexandre Ardhuin 27018359d2
re-enable lint unnecessary_const (#19592)
* re-enable lint unnecessary_const

* remove trailling whitespaces

* remove unnecessary const (after merge)
2018-07-23 08:31:48 +02:00
Sigurd Meldgaard 2d3a5c744d
Revert "Revert "Use FlutterProject to locate files (#18913)" (#19409)" (#19456)
With a fix of a path being printed relative instead of absolute.
2018-07-20 08:00:30 +02:00
Ian Hickson f630f90d6d
Revert "enable lint unnecessary_const (#19342)" (#19423)
This reverts commit cc1cf13eec.
2018-07-16 13:30:27 -07:00
Alexandre Ardhuin cc1cf13eec
enable lint unnecessary_const (#19342) 2018-07-16 21:43:48 +02:00
Sigurd Meldgaard 6a8f904104
Revert "Use FlutterProject to locate files (#18913)" (#19409)
This reverts commit 57d78cc739.
2018-07-16 16:21:20 +02:00
Sigurd Meldgaard 57d78cc739
Use FlutterProject to locate files (#18913) 2018-07-16 09:39:37 +02:00
Ralph Bergmann 779eea681f make tests in xcodeproj_test.dart and gradle_test.dart hermetic (#18093) (#18548) 2018-07-09 10:36:17 -07:00
Sam Rawlins 9f8a70be4c Bump mockito to 3.0.0-beta (#18462)
* Bump mockito to 3.0.0-beta

* Few fixes

* fix test

* Bump image

* Fix

* New packages update

* With matcher pinned

* No more typed
2018-06-21 16:23:47 -07:00
Keerti Parthasarathy da7670c2ee
Fixes for test failures in Dart 2 mode (#18122) 2018-06-05 12:38:30 -07:00
Ian Hickson e3427550e9
Be less verbose in the logs. (#17401)
Now that we have thousands of tests, it doesn't make sense to display a separate line for each test. The result is just megabytes of logs that you have to scrub through to find error messages.
2018-06-04 15:22:19 -07:00
Sam Rawlins fba81d0f1d Use anyNamed when mocking named arguments (#17996) 2018-05-31 08:24:26 -07:00
Ralph Bergmann c65e9d19a4 add version to pubspec.yaml (#16857)
Uses the `version` property from the `pubspec.yaml` file to set the corresponding fields in the `local.properties` file respectively in the `Generated.xcconfig` file.

The `--build-name` and `--build-number` options have changed. Now they trump the `version` property from the `pubspec.yaml` file.

If the `version` property is not set and the  `--build-name` and `--build-number` options are not provided, the build command will not change the `local.properties` / `Generated.xcconfig` file.
2018-05-30 07:51:25 -07:00
liyuqian ae8586cfa1
Show help info instead of crashing if Android SDK is not found (#17610)
Fixes #16832
2018-05-15 14:42:12 -07:00
Vyacheslav Egorov 4931b46772
Make --build-shared-library more robust. (#17420)
* Search for a suitable ARM sysroot instead of hardcoding it;
* Add facility to explain why NDK was not found;
2018-05-14 16:36:54 +02:00
Danny Tuppeny 799678f0a7 Add some tests around device+ini parsing 2018-05-09 16:03:59 +01:00
Todd Volkert d9a3ced9db
Check whether we can run sdkmanager in AndroidWorkflow.licensesAccepted (#16343)
Fixes https://github.com/flutter/flutter/issues/16332
2018-04-09 08:57:11 -07:00
Alexandre Ardhuin 217b2bdaa1
add new lints of linter-0.1.44 and enable unnecessary_parenthesis (#15585) 2018-03-21 07:10:14 +01:00
Jonah Williams 4ace88bfc0
fix spacing issue and add test for supportsHardwareRendering (#15305)
* fix spacing issue and add test for supportsHardwareRendering

* remove extra async tag

* move spacing to prev line
2018-03-09 09:30:13 -08:00