Commit graph

300 commits

Author SHA1 Message Date
Paul Berry c39a890dd1 Respect machineFormat in package-mode.
Ensures that stats printing in package-mode respects the `machineFormat`
flag.  (That is, only displays stats if not in machine mode.)

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1820233003 .
2016-03-22 13:23:06 -07:00
Brian Slesinsky 9e21594c2a add --x-package-warnings-prefix option to dartanalyzer
This is similar to --package-warnings, except that diagnostics will
only be reported for Dart packages matching the given prefix.

Also added the number of source files analyzed and the number of
errors generated to performance report.

Cleanup: simplified code for triggering diet parsing.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1806263004 .
2016-03-21 11:37:49 -07:00
pq b6a1d75444 Analyzer directory recursing (tk 2) (#25129).
Take 2 with a fix that addresses a regression in batch-mode.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1810103003 .
2016-03-18 09:19:35 -07:00
Brian Slesinsky 802cf80812 Suppress warnings in analyzer_cli test data
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1806423002 .
2016-03-17 13:01:12 -07:00
pq 3b520bc114 Revert "Directory support for the analyzer CLI (#25129)."
This reverts commit 0bd85a2435.

BUG=

Review URL: https://codereview.chromium.org/1811753002 .
2016-03-16 14:51:17 -07:00
pq 0bd85a2435 Directory support for the analyzer CLI (#25129).
Adds smarts to recurse through directories to assemble a list of dart files to analyze.

Addresses: https://github.com/dart-lang/sdk/issues/25129

Do note that all of these files are sharing the same analysis context (and options).  Once the the ContextManager re-work is complete this can get smarter (see: https://github.com/dart-lang/sdk/issues/24133).

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

Review URL: https://codereview.chromium.org/1805533005 .
2016-03-16 13:56:13 -07:00
pq fb3eae598a CLI support for enableConditionalDirectives.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1778683004 .
2016-03-09 10:04:41 -08:00
Paul Berry c497c026fe Fix summary generation in "package-summary-only" mode.
If we aren't doing full analysis, then we can't use
`context.librarySources` to find out the set of library sources (because
it doesn't include sources that haven't been examined yet).  Instead, we
have to query each source to find out its type.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1770323003 .
2016-03-08 12:14:11 -08:00
Paul Berry 1f8ea5448e Add an analyzer_cli option to disable analysis (for faster summary generation)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1772923002 .
2016-03-08 09:25:20 -08:00
Paul Berry 8219e27009 Fix path handling when creating summaries.
The path passed to "--packageMode" must be converted to an absolute path
because it is used to normalize file paths (which are automatically
converted to absolute paths by the PhysicalResourceProvider.

We should not call `resourceProvider.pathContext.absolute()`.  This
seems (by its name) like it would convert its argument to an absolute
path.  But in fact it simply prepends the path with
`resourceProvider.pathContext.current`, which is `.`, and this causes
Source objects to be created referring to non-canonical paths.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1762363002 .
2016-03-04 14:15:48 -08:00
Paul Berry c6314577ff Move package summary reading code into analyzer.
This will allow it to be re-used by DDC.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1739923002 .
2016-02-25 13:13:52 -08:00
Paul Berry 8dc6261f10 Find SDK properly when analyzing files in package mode.
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1737773002 .
2016-02-25 10:32:45 -08:00
Konstantin Shcheglov 3b97d01634 Fix for using the strong mode SDK summary.
I think the fix does the change needed to configure SDK for using
the strong mode summary, but I was not able to verify this fully
because of the exception with LibraryElementHandle.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1734773003 .
2016-02-24 14:50:22 -08:00
Konstantin Shcheglov 8e9aac65ab Extract PackageBundleAssembler and use for SDK and package summary generation.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1722413002 .
2016-02-24 08:26:05 -08:00
Konstantin Shcheglov 918582490e Fix the 'Unused import' hint when using package summaries.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1722383002 .
2016-02-24 08:16:37 -08:00
Paul Berry 44f507bd05 Add file hashes to SdkBundle; rename to PackageBundle.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1725913002 .
2016-02-23 10:56:26 -08:00
Konstantin Shcheglov 36535e81c0 Use the 'analysisOption.strongMode' option in package analyzer.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1722343002 .
2016-02-23 10:52:02 -08:00
Konstantin Shcheglov 686b30e4cb Initial hermetic package analyzer.
When --package-mode is specified, this turns ON the single package
analysis mode. My initial idea was to accept a single path - the root
folder of the package and analyze the package completely as Dart
Analysis Server does. But later I decided to accept a list of files
to analyze, at least for now.

We still need the --package-mode-path option with the path to the root
folder of the package because we need to know which libraries are in
the 'lib' folder and write these libraries into the output summary.

The option --package-name is used to write the same URIs into
summary as the clients are going to use to refer the package
libraries, and also as the package references itself.

Multiple --package-summary-input=pkg,summary options can be specified,
one for each package. Every referenced package (except itself) must
be listed.

If --package-summary-output is specified, the output summary of
the package is written to the specified file. It is up to the client
to specify the correct X.spec.sum or X.strong.sum names.

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

Review URL: https://codereview.chromium.org/1720963003 .
2016-02-22 17:19:27 -08:00
Konstantin Shcheglov 09672f09c6 CLI. Always fully parse given target files.
It seems that we have a bug - when we analyze a SDK library during
running shared tests, we still parse it dietly so we don't actually
validate that bodies are warning-free.

And when we attempt to use SDK summary, we again parse a library
dietly, but then attempt to apply the full summary using
DeclarationResolver, which fails because we fail to bind some elements
to not parsed nodes.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1689263004 .
2016-02-12 07:02:43 -08:00
pq 37767eff86 Hooks for injecting embedder resolver providers.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1666573006 .
2016-02-04 11:03:43 -08:00
Brian Wilkerson 5b95009a6b Move ResolverProvider to analyzer so that it can be shared
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1658663002 .
2016-02-01 08:12:29 -08:00
Brian Wilkerson 3fa4b0fadb Add hook to command-line analyzer similar to server
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1646413003 .
2016-01-29 13:31:25 -08:00
pq 9b1fa223a8 Embedded libs key rename to defuse server landmine.
1.13 stable builds of the SDK contain a version of server that fails catastrophically when analyzing source that imports packages that define embedded libraries. Since we can't pragmatically require more recent SDKs for flutter development we have been prevented from landing embedded libs in the flutter engine.  By renaming the key we use to identify contributed libraries, this change avoids the issue.  Old versions of server will simply ignore the new key and new ones will process it properly.  Win-win!

BUG=
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1643023002 .
2016-01-29 09:52:04 -08:00
Brian Wilkerson 348b79b8ec Set the SDK analysis options in analyzer_cli
R=jmesserly@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1644093002 .
2016-01-29 07:42:31 -08:00
pq 3d3c9c5af4 CLI support for embedders (#25380).
Background here: https://github.com/dart-lang/sdk/issues/25380

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1631763007 .
2016-01-26 11:33:14 -08:00
pq 1dcec8c35f Bootloader cleanup.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1570603004 .
2016-01-11 14:13:44 -08:00
Brian Slesinsky adacaefeda add tasks to perf report
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1539783002 .
2016-01-05 17:41:53 -08:00
Brian Slesinsky ba1b82b240 Add --x-perf-report flag to the dartanalyzer command
Also added a couple of performance tags to catch time spent in the driver.

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

Review URL: https://codereview.chromium.org/1524413002 .
2015-12-17 11:40:15 -08:00
pq 8887cd69f0 Fix analyzer_cli error overrides (#24452).
Brings `analyzer_cli` inline with server wrt processing errors configured in `.analysis_options`.

Note some added complexity due to interactions with flags that globally escalate warnings/hints to errors.

https://github.com/dart-lang/sdk/issues/24452

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1529243002 .
2015-12-16 12:44:38 -08:00
Brian Slesinsky 4fad247dc6 remove obsolete cache size parameter
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1530103002 .
2015-12-16 12:35:20 -08:00
Brian Wilkerson 56fe38f0ab Clean up imports in analysis_server and analyzer_cli (and one missed in analyzer)
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1527793003 .
2015-12-14 19:31:46 -08:00
pq e4e61ee462 Disable temp-dir hosted tests pending fixes.
Background here: https://github.com/dart-lang/sdk/issues/25258

BUG=

Review URL: https://codereview.chromium.org/1526533003 .
2015-12-14 15:04:43 -08:00
pq fd0f649327 Driver failure mode fixes (and test cleanup).
* `printAndFail(msg)` doesn't exit in testing (so we need to return null).

R=keertip@google.com

Review URL: https://codereview.chromium.org/1530453002 .
2015-12-14 13:58:05 -08:00
pq 5a57d6e8dc CLI driver test re-enablement (#25001).
Another stab.  The rub, I *think*, to our failures are unexpected calls to `exit()` on the bots (that are not reproducing locally).  These fixes should address that (and fix error stream handling along the way).

* fixes test setup and teardown to ensure exit handling is properly managed.
* fixes driver source to use the `exitHandler` and `errorSink` consistently

BUG=
R=keertip@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1525623003 .
2015-12-14 13:08:47 -08:00
pq 1c3df7f4ec Revert "Make analyzer_cli tests bot-friendly (#25001)."
This reverts commit e67affe6b6.

R=keertip@google.com

Review URL: https://codereview.chromium.org/1524493002 .
2015-12-11 14:57:01 -08:00
pq e67affe6b6 Make analyzer_cli tests bot-friendly (#25001).
* re-enables a host of tests that were breaking on the bots due to path issues

Bug: https://github.com/dart-lang/sdk/issues/25001

R=keertip@google.com

Review URL: https://codereview.chromium.org/1516353003 .
2015-12-11 14:13:30 -08:00
pq 63f24be16c Update server/cli linter pubspec deps.
* bumps lower-bound to grab a `0.27.0`-compatible linter.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1520973002 .
2015-12-11 10:51:50 -08:00
pq 56650e6bfe More mock cleanup.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1520673002 .
2015-12-10 14:37:22 -08:00
pq ad7c566e04 Driver test fixes.
* Updates to use new CONFIGURED_ERROR_PROCESSORS (rather than defunct CONFIGURED_ERROR_FILTERS).

BUG=
R=keertip@google.com

Review URL: https://codereview.chromium.org/1520663002 .
2015-12-10 14:22:16 -08:00
pq 166de569a1 CLI doc update to remove contributor bits.
In the absence of a `CONTRIBUTOR.md` doc (or similar) for the SDK, remove contributor bits.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1511663002 .
2015-12-08 12:40:34 -08:00
Brian Wilkerson ea3ba0e31f Remove deprecated code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1502213002 .
2015-12-07 10:24:36 -08:00
Brian Wilkerson 600fc17de1 Clean-up the registration of plugins
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1487953002 .
2015-12-02 13:25:28 -08:00
Brian Wilkerson 4ae8540383 Revert "Clean-up the registration of plugins"
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1465983004 .
2015-11-20 14:04:53 -08:00
pq 8d613feaf9 Migrate mockito mocks to typed_mock (#24994).
BUG=24994
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1462393002 .
2015-11-20 13:57:56 -08:00
Brian Wilkerson 1367d2d47d Clean-up the registration of plugins
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1460123002 .
2015-11-20 08:14:14 -08:00
pq 7c15fa857c More bot-unfriendly test fixing [TBR].
Remove tests pending update.

Background: https://github.com/dart-lang/sdk/issues/25001

BUG=25001

Review URL: https://codereview.chromium.org/1463133002 .
2015-11-19 16:52:14 -08:00
pq c58e064b67 Remove bot-unfriendly tests (#25001).
Remove tests pending update.

Background: https://github.com/dart-lang/sdk/issues/25001

BUG=25001

Review URL: https://codereview.chromium.org/1459083005 .
2015-11-19 16:15:18 -08:00
pq 9ae1265ff5 analyzer_cli move to SDK.
Tracking bug: https://github.com/dart-lang/sdk/issues/24731

Note, dartium build changes are in a separate CL: https://codereview.chromium.org/1453413006/

Some tests had to be disabled for want of mockito in the SDK; tracking their reimplementation is here: https://github.com/dart-lang/sdk/issues/24994

BUG=24731
R=whesse@google.com

Review URL: https://codereview.chromium.org/1459683003 .
2015-11-19 14:52:54 -08:00
pq 5cc9a288bb Revert "Move analyzer_cli into the SDK."
This reverts commit a573ed31f1.

BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org/1462143002 .
2015-11-19 11:28:52 -08:00
pq a573ed31f1 Move analyzer_cli into the SDK.
Build changes to follow.

Tracking bug: https://github.com/dart-lang/sdk/issues/24731

BUG=24731
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1464553003 .
2015-11-19 11:11:17 -08:00