Commit Graph

69 Commits

Author SHA1 Message Date
Brian Wilkerson b936ffb329 Move several libraries out of the public API
Change-Id: I8259de00134310f25b1c6168940aea5190488999
Reviewed-on: https://dart-review.googlesource.com/51443
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-17 17:35:27 +00:00
Brian Wilkerson 71c782a104 One more change to get the analyzer_cli tests to all pass under preview-dart-2
Change-Id: I5913e5db484d6c285d4efd503200728c1166b787
Reviewed-on: https://dart-review.googlesource.com/48083
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-23 16:13:31 +00:00
Brian Wilkerson bd6f28f4c7 Make analyzer_cli closer to Dart 2 clean
Change-Id: I2f9b9e5bf87b65e871699c16633b1bfcf7605de5
Reviewed-on: https://dart-review.googlesource.com/48061
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-23 13:14:07 +00:00
Brian Wilkerson 26c06cdd82 Clean up Dart 2 type issues related to YAML support
Change-Id: Ic29054afca9773286aa899eecede287f7ecbca9a
Reviewed-on: https://dart-review.googlesource.com/47680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-22 17:06:40 +00:00
Brian Wilkerson 7a607ab239 Convert analyzer_cli tests to pass under preview-dart-2
Change-Id: I763ddcb880db9d7afb633d145c3de70dfb96f7b9
Reviewed-on: https://dart-review.googlesource.com/46567
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-15 16:46:54 +00:00
Brian Wilkerson ea94e65b43 Make preview-dart-2 imply strong-mode
Change-Id: Ifa230f9e64a538e222557ea471dc728ad3dd01d7
Reviewed-on: https://dart-review.googlesource.com/46300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-03-13 17:15:39 +00:00
Mike Fairhurst 748cfdff7e Refactor to efficiently find analysis roots correctly fix #31343 & #31344.
Move logic out into a ContextCache since we're not interested in caching
at least two if not three things (the options, the options path, and
optionally the builder).

Move some convenience methods around accessing contexts into a mixin.

Regarding some semantic decisions for finding analysis roots:
* treat the analysis_options.yaml file as the analysis root if it exists
* if it doesn't exist, assume the directory passed in is the root
* if custom options are provided, assume they "overwrite" the others
  _in-place_.

Tests to confirm this logic via excludes configurations with & without
the yaml file specified, passing in the root in some cases and
subdirectories in others.

Also change to use PathFinder for handling wildcards in excludes.

Bug: 31343,31344
Change-Id: I400fe30a1ec379f9040f812fc0bd9481d42a13cf
Reviewed-on: https://dart-review.googlesource.com/41570
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-05 23:51:00 +00:00
Mike Fairhurst 13ccc0d49e Reland https://dart-review.googlesource.com/c/sdk/+/42540
In CLI no batch, support analyzing multiple files in multiple contexts

Support `dartanalyzer pkg/a/foo pkg/b/foo` and use a different context
for each.

Requires knowing the source being analyzed while creating a context,
which gets a bit hacky with build mode, but seems to work as is.
Suggestions on a cleaner integration there are welcome!

Change-Id: I2648fdb80c0a36a05580ef7267350ffb847c43e9
Reviewed-on: https://dart-review.googlesource.com/42582
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-22 17:29:06 +00:00
Kevin Millikin be30b62e3d Remove the Kernel type inference listener
We have decided to move to a different API for Fasta/Analyzer
integration, one that doesn't involve compiling to Kernel or observing
type inference.  The listener API will become broken, so let's just
remove it before that happens.

We lose the ability to trace type inference so let's restore that
ability next.  The analyzer's resolution storer is not used, but that
code has been left.  The resolution applier will no longer work
without the resolution storer, so those tests have been disabled.

Change-Id: If9ac5aba2d5de7788d8a65f7fa8410599e636d21
Reviewed-on: https://dart-review.googlesource.com/42400
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-02-21 16:28:07 +00:00
Mike Fairhurst 4d88a243bd Revert "In CLI no batch, support analyzing multiple files in multiple contexts"
This reverts commit 126bfebb4e.

Reason for revert: Fails on windows due to forward slash paths, and seems to have one or two other secondary issues.

Original change's description:
> In CLI no batch, support analyzing multiple files in multiple contexts
> 
> Support `dartanalyzer pkg/a/foo pkg/b/foo` and use a different context
> for each.
> 
> Requires knowing the source being analyzed while creating a context,
> which gets a bit hacky with build mode, but seems to work as is.
> Suggestions on a cleaner integration there are welcome!
> 
> Change-Id: Ia4e63fe01342f2299c96ca8d34ca983a9280a911
> Reviewed-on: https://dart-review.googlesource.com/41900
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com,mfairhurst@google.com

Change-Id: I0e90d8d4e2256b7087daeeb934ed14da57fd20df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/42540
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-20 23:08:41 +00:00
Mike Fairhurst 126bfebb4e In CLI no batch, support analyzing multiple files in multiple contexts
Support `dartanalyzer pkg/a/foo pkg/b/foo` and use a different context
for each.

Requires knowing the source being analyzed while creating a context,
which gets a bit hacky with build mode, but seems to work as is.
Suggestions on a cleaner integration there are welcome!

Change-Id: Ia4e63fe01342f2299c96ca8d34ca983a9280a911
Reviewed-on: https://dart-review.googlesource.com/41900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 22:37:45 +00:00
Brian Wilkerson f5942a5ce0 Add support for analyzing analysis options and pubspec files
Change-Id: I2aa05e5822b2993d0f1e903396c816b52e2292b4
Reviewed-on: https://dart-review.googlesource.com/41566
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-14 22:50:05 +00:00
Konstantin Shcheglov 95c2bb7c2c Fix parts analysis in build mode without building summaries.
R=brianwilkerson@google.com

Change-Id: I67e33b0d5d403402ce7954106081e57fee3ef9ce
Reviewed-on: https://dart-review.googlesource.com/38781
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-05 18:50:26 +00:00
Jaime Wren cd878bc433 Create the new flag --use-cfe in the analyzer, analysis server and analyzer_cli and migrate the old behavior of --preview-dart-2 to --use-cfe. The --preview-dart-2 flag is now a no-op, with functionality coming soon.
See https://github.com/dart-lang/sdk/issues/31640

Change-Id: I2db2e7ef6a324cbd5d369b807e331495fed167df
Reviewed-on: https://dart-review.googlesource.com/33121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-01-08 22:37:05 +00:00
Devon Carew 3bca5b6a1d Duplicate some analyzer cli tests to also run in --preview-dart-2.
Bug:
Change-Id: Ic2b96434e58a7d3eff3ff9aef1bcb540d8f4f0ce
Reviewed-on: https://dart-review.googlesource.com/29623
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-14 22:18:35 +00:00
Devon Carew 6346b18028 Restore a strong mode analyzer cli test.
Bug:
Change-Id: If9b459d99a3120071ba8f3a7bd9aa1d2e776bbd6
Reviewed-on: https://dart-review.googlesource.com/29443
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-13 22:26:56 +00:00
Konstantin Shcheglov e67cd0daab The very first CL for end-to-end integration of FrontEnd resolution into Analysis Server.
At this point KernelDriver is used only by Analyzer, so I don't include
anyone from the FrontEnd team. We will merge to get the same performance
benefits of the latest IKG approach, but later.

Only just enought integration is done - we can store and apply
types in the local variable declaration.

Everything is in disarray, I will follow up with improvements.


R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ie3434e26233b84fb019c50a7cc834a08d0dadbed
Reviewed-on: https://dart-review.googlesource.com/22202
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-11-20 22:42:09 +00:00
Sigmund Cherem 436ed70100 Add preview-dart-2 flag to analyzer cli and plumb it through test.py.
This allows us to collect stats about language-style tests as follows:

 ./tools/test.py -m release -c dart2analyzer -r none --preview-dart-2 --report \
      language language_2 corelib corelib_2

As of this morning, the command above has 87% of the tests passing.

Change-Id: I0f84211d5f33659d5923601267367be90c578107
Reviewed-on: https://dart-review.googlesource.com/3381
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-09-07 20:13:40 +00:00
Konstantin Shcheglov 824a62ba3c More tests for build mode.
R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2971373002 .
2017-07-07 14:33:09 -07:00
Konstantin Shcheglov 671bedc8f6 Fix strong_mode_test after moving driver_test fields into class.
TBR

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2971343002 .
2017-07-07 10:01:47 -07:00
Konstantin Shcheglov 73ec7f0a79 Convert driver_test.dart to reflective tests.
It was hard to keep track of defined tests, and to run individual tests.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2976493002 .
2017-07-07 09:38:49 -07:00
Konstantin Shcheglov 0699a72344 Additional tests for build mode.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2968303002 .
2017-07-06 15:02:28 -07:00
Konstantin Shcheglov 956b9ce96b Split driver_test main() into 4 tests methods.
This is not how I would ideally prefer to write tests, but a bit better.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2967413002 .
2017-07-06 14:12:45 -07:00
Devon Carew d4abd49df7 Add analytics to analyzer-cli and analysis server.
BUG=
R=brianwilkerson@google.com, scheglov@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2963323002 .
2017-07-05 23:29:46 -07:00
Brian Wilkerson 62d0376231 Run the sorter to reduce code churn
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933753002 .
2017-06-12 07:37:14 -07:00
Devon Carew 5d0056df88 Make the exit code for dartanalyzer more deterministic.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2857203002 .
2017-05-03 11:38:35 -07:00
danrubel 9649ca1a94 fix driver test
Review-Url: https://codereview.chromium.org/2855513002 .
2017-04-30 23:35:59 -04:00
Devon Carew 66ac96c4a6 Use the dart:io Platform.resolvedExecutable API to locate the Dart SDK.
BUG=
R=brianwilkerson@google.com, danrubel@google.com, pquitslund@google.com

Review-Url: https://codereview.chromium.org/2844883005 .
2017-04-27 09:29:08 -07:00
pq 1d4d0d769f CLI support for enableAssertInitializers.
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2809793004 .
2017-04-12 10:38:30 -07:00
Jacob MacDonald 3e623d7df1 Add --build-summary-only-unlinked flag, which makes the output summary be an unlinked summary instead of a linked one.
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2796953002 .
2017-04-04 12:22:20 -07:00
Devon Carew b51d1fd8e3 Use ansi color in the dartanalyzer cli output.
BUG=
R=brianwilkerson@google.com, danrubel@google.com

Review-Url: https://codereview.chromium.org/2775633002 .
2017-03-25 15:02:47 -07:00
danrubel b401f7272f cleanup bazel workspace relative path test
Review-Url: https://codereview.chromium.org/2712333002 .
2017-02-26 13:19:25 -08:00
danrubel 4c771a52d3 fix failing bazel workspace relative path test
Review-Url: https://codereview.chromium.org/2721483002 .
2017-02-26 12:44:28 -08:00
danrubel 130f43fe7b fix failing bazel workspace relative path test
Review-Url: https://codereview.chromium.org/2720593002 .
2017-02-26 11:14:14 -08:00
danrubel 994a3a2b20 Revert "debug failing test"
This reverts commit c78ea8c231.

Review-Url: https://codereview.chromium.org/2721473002 .
2017-02-26 11:08:19 -08:00
danrubel c78ea8c231 debug failing test
Review-Url: https://codereview.chromium.org/2721453002 .
2017-02-26 09:47:58 -08:00
danrubel c04f6a2ab1 fix dartanalyzer find options in bazel workspace
- add dartanalyzer test for bazel workspace
- ensure call to getAnalysisOptions passes an absolute path
- update BasicWorkspace to have an absolute normalized path similar to BazelWorkspace

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2719703005 .
2017-02-26 08:52:55 -08:00
Brian Wilkerson be65669b34 Fix tests that are failing on windows
Review-Url: https://codereview.chromium.org/2713913003 .
2017-02-24 08:18:54 -08:00
Devon Carew 46cacfeae9 Some improvements to the command-line analyzer's output.
BUG=
R=brianwilkerson@google.com, danrubel@google.com

Review-Url: https://codereview.chromium.org/2704103002 .
2017-02-22 12:35:09 -08:00
Devon Carew 6e9adf2624 Remove older deprecated flags; more cleanup to the cli help args.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2692203010 .
2017-02-17 13:30:37 -08:00
danrubel 167107e94c fix dartanalyzer sdk setup
Separate analysis options initialization from context setup
so that analysis options can be used to correctly setup the SDK
in strong mode.

Fix https://github.com/dart-lang/sdk/issues/28507

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2678633002 .
2017-02-04 12:08:53 -05:00
Konstantin Shcheglov 15cf5cb017 Run analyzer_cli asynchronously.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2658863002 .
2017-01-26 09:42:51 -08:00
Brian Wilkerson 0ea654a068 Remove the AnalysisOptionsProcessor
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2559523005 .
2016-12-07 10:51:33 -08:00
Dan Rubel aff6b796f3 update analyzer cli to support include directive in analysis options file
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2541933002 .
2016-11-30 15:16:55 -05:00
Brian Wilkerson e63105555b Remove uses of configuration data
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2522543007 .
2016-11-22 11:26:08 -08:00
Brian Wilkerson 3121296942 (TBR) Fix failing tests
Review URL: https://codereview.chromium.org/2426703002 .
2016-10-17 11:55:31 -07:00
Konstantin Shcheglov ec282eb726 Switch analyzer_cli to 'package:test'.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2395183002 .
2016-10-06 10:02:39 -07:00
Konstantin Shcheglov 5703f5adb1 Replace using reprecated 'package:analyzer/src/generated/error.dart'.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2364643002 .
2016-09-22 10:10:53 -07:00
Brian Wilkerson f8d7925ff2 Mark analyzer_cli as strong-mode clean
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2196393003 .
2016-08-01 12:44:59 -07:00
Brian Wilkerson 44836f8538 Support the name analysis_options.yaml for analysis options files
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1975963002 .
2016-05-13 07:33:06 -07:00