Commit graph

338 commits

Author SHA1 Message Date
Paul Berry 2839653161 Fix generation of analysis results in analyzer_cli "build mode".
This was inadvertently broken in 1b10de1a86.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2350963005 .
2016-09-20 10:07:11 -07:00
Konstantin Shcheglov 979a9bd6da Remove incremental session from analyzer_cli.
This should have been done together with 1310dc801a.

TBR

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2348283004 .
2016-09-19 15:06:03 -07:00
Konstantin Shcheglov 1387e8ec5c Remove fallback mode and corresponding cli flag.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2356523002 .
2016-09-19 14:02:14 -07:00
Konstantin Shcheglov 1b10de1a86 Generate only AST based summaries in build mode.
Should we also remove fallback mode?

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2355613003 .
2016-09-19 13:47:38 -07:00
Paul Berry f7a12f9c83 Allow input summaries to be specified when running analyzer_cli in non-build mode.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2347133004 .
2016-09-19 12:39:24 -07:00
Konstantin Shcheglov f5a616834e Use configurations and declared variables to select import/export URIs during prelinking.
R=paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/27045

Review URL: https://codereview.chromium.org/2353433002 .
2016-09-18 14:04:01 -07:00
Sigmund Cherem b9a5c77321 Fixs in perf.dart: strong-clean, avoid deprecated apis, minor output tweaks
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org/2349683003 .
2016-09-16 09:57:03 -07:00
Sigmund Cherem 4af56d5647 entrypoint to measure performance of the analyzer frontend
R=paulberry@google.com

Review URL: https://codereview.chromium.org/2339803004 .
2016-09-15 15:43:09 -07:00
Brian Wilkerson a5ee525e14 Add support for accessing field formal parameters in the initializer list of constructors
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2335693002 .
2016-09-12 09:48:34 -07:00
Brian Wilkerson fa1b80fd82 Remove references to deprecated code
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2331743002 .
2016-09-10 11:28:43 -07:00
Brian Wilkerson 6c448b6938 Move exception support to its own library
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2328043002 .
2016-09-10 11:04:19 -07:00
Brian Wilkerson 5bd4de469e Clean up warnings and hints
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2324463006 .
2016-09-09 09:09:59 -07:00
Brian Wilkerson fe02411930 Remove several references to JavaFile
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2323173002 .
2016-09-09 07:45:40 -07:00
Paul Berry 94309733cd Revert "Remove unnecessary hide clauses"
The `Resource` class wasn't removed from the SDK until version
1.20.0-dev.0.0, which was only recently published.  Reverting this
change to allow people using older SDK releases a little more time to
upgrade.

This reverts commit 2cdafd82c2.

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

Review URL: https://codereview.chromium.org/2299243002 .
2016-09-01 16:08:43 -07:00
Brian Wilkerson 2cdafd82c2 Remove unnecessary hide clauses
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2305453002 .
2016-08-31 16:44:52 -07:00
Konstantin Shcheglov ac81124b8c Revert "Use dependency_overrides / analyzer in analysis_server."
This reverts commit 72f5463631.

Yes, we do have bot failures :-(

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

Review URL: https://codereview.chromium.org/2298423002 .
2016-08-31 15:01:10 -07:00
Konstantin Shcheglov 72f5463631 Use dependency_overrides / analyzer in analysis_server.
RFC

We always do this locally, but until analysis_server is published,
we could just keep this change in repo.

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

Review URL: https://codereview.chromium.org/2298973002 .
2016-08-31 14:44:09 -07:00
Brian Wilkerson 1a9cafd85c Replace uses of FileBasedSource in cli
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2257023002 .
2016-08-18 06:11:28 -07:00
Brian Wilkerson c41427383b Deprecate DirectoryBasedDartSdk and transition existing uses to the new API
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2242853002 .
2016-08-12 09:18:12 -07:00
Paul Berry 902ce5e739 Record information about a summary's dependencies in the summary itself.
The idea is that we can use this information to help discover related
summary files, and determine when summaries need to be re-linked.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2226093002 .
2016-08-09 09:31:04 -07:00
Konstantin Shcheglov 43fef756ae Provide LINE_INFO from ResynthesizerResultProvider.
Also, to guarantee that LINE_INFO is computed, we need to replace
context.getLineInfo() with context.computeLineInfo() in the server.
This should be equivalently fast in both summary (from provider) and
non-summary cases (the source should have been scanned and parsed in
order to resolve references to its elements).

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2225893003 .
2016-08-09 09:12:24 -07:00
Konstantin Shcheglov b3588f44fe Add line starts into unlinked units.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2223113002 .
2016-08-08 11:40:05 -07:00
Brian Wilkerson b47d35d706 Clean up use of resource provider in cli
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2212813003 .
2016-08-04 12:31:10 -07:00
Brian Wilkerson 5b26441dbf Convert server and cli and deprecate the old implementation
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2214613003 .
2016-08-04 11:28:16 -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
Kevin Moore 17a2ddfd42 Update dependency on pkg/package_compiler
For analysis_server, analyzer, analyzer_cli, compiler packages

Progress on https://github.com/dart-lang/sdk/issues/26711

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2172683002 .
2016-07-27 08:42:05 -07:00
John Messerly 4b3c06f3c5 add no-implicit-casts and no-implicit-dynamic options
* adds these to dartanalyzer command line
* adds them to .analysis_options

R=leafp@google.com

Review URL: https://codereview.chromium.org/2144383002 .
2016-07-15 16:08:20 -07:00
Brian Wilkerson f14772d8c9 Fix NPE when a resolver provider is given
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2136083003 .
2016-07-11 13:06:00 -07:00
Paul Berry a35c9415f5 Add option "--build-summary-output-semantic" to analyzer_cli.
This option has the same functionality as the flag
"--build-summary-exclude-informative", except it is an option rather
than a flag.  This makes it possible to get both a "full" summary and a
"semantic" summary by specifying both "--build-summary-output" and
"--build-summary-output-semantic".

The flag "--build-summary-exclude-informative" is kept around to ease in
transitioning tools, but it is deprecated.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2104003004 .
2016-06-29 10:25:50 -07:00
pq 1ec13d1548 Fix pipe escaping.
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2109783003 .
2016-06-28 15:17:46 -07:00
John Messerly 1b9bf0769d fix #26122, classify strong mode errors correctly
StaticTypeWarningCode was being handled, but many warnings with StaticWarningCode also need to be treated as errors.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2108823002 .
2016-06-28 14:35:44 -07:00
Brian Wilkerson 5c97a88ddd Remove embedder locator from analysis context
R=pquitslund@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/2078993002 .
2016-06-17 09:42:27 -07:00
Brian Wilkerson 2b522d50d0 Deprecate EmbedderUriResolver
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2076743002 .
2016-06-17 07:44:02 -07:00
Jaime Wren 7f244c8d39 Deprecate FileUriResolver and RelativeFileUriResolver in source_io.dart, replace the usages with ResourceUriResolver(PhysicalResourceProvider.INSTANCE).
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2060263006 .
2016-06-16 11:14:03 -07:00
Brian Wilkerson 34a71429d9 Remove hook for setting a provider for an EmbedderUriResolver
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2075663002 .
2016-06-16 10:28:40 -07:00
Brian Wilkerson dc7fb35bd4 Refactor common portions of the two SDK implementations into a base class
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2069483002 .
2016-06-16 08:57:32 -07:00
Konstantin Shcheglov e2cb8df046 Compact incremental cache when we're done using it.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2064613004 .
2016-06-13 13:25:03 -07:00
Konstantin Shcheglov 6d49c787dc Stop tracking cache dependencies in analyzer_cli.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2058253002 .
2016-06-10 14:29:34 -07:00
Konstantin Shcheglov 6682e74526 Use package_config 0.1.5 in analyzer_cli to get performance improvements.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2055363002 .
2016-06-10 13:30:05 -07:00
Konstantin Shcheglov 676a9f7d60 Compute IGNORE_INFO and filter DART_ERRORS.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2048713002 .
2016-06-07 09:56:14 -07:00
Konstantin Shcheglov 1074d44c65 Serve DART_ERRORS from incremental cache.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2045793003 .
2016-06-06 20:25:33 -07:00
Konstantin Shcheglov a42317f2de Serve INCLUDED_PARTS from incremental cache.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2044513003 .
2016-06-06 16:00:37 -07:00
Konstantin Shcheglov e87a9c955c Start adding experimental incremental analysis mode into CLI analyzer.
At the moment it is not very useful, because it does not use or store
errors from incremental cache yet. But I hope to implement this soon.

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

Review URL: https://codereview.chromium.org/2039773004 .
2016-06-06 11:35:55 -07:00
pq fba5cbc425 Analyzer 0.27.4-alpha.9 (API fixes) (#26562).
Restores `EmbedderUriResolver` API.

Addresses breakages in `dartdoc` and any other downstream dependencies.

See: https://github.com/dart-lang/sdk/issues/26562.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2021453003 .
2016-05-29 06:57:42 -07:00
pq 53fe39137f Embedder support refactoring (phase 1).
A bunch of changes to pave the way for emebdder SDK summary creation.

* Moves _embedder.yaml processing into the embedder SDK (out of the resolver).
* Changes EmbedderUriResolver to compose rather than extend a DartUriResolver.
* Fixes the wierd handling (dropping to add back) of `dart:` URIs.
* Fixes the incorrect overriding docs for `SDKLibraryImpl.shortName`.
* Updates embedder test to include a definition of `dart:core` in anticipation of adding some embedder SDK tests.

Some API work TODO in a follow-up CL (notably the way we check for the presence of embedders by querying the resolver is odd).

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2009303002 .
2016-05-25 10:52:53 -07:00
pq ff857f1b71 CLI cleanup.
A little linting.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1986943002 .
2016-05-18 10:30:09 -07:00
pq 43bbf11dd8 SDK ext test fix (add missing packages file).
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1988603003 .
2016-05-17 13:49:04 -07:00
pq fb99a26b21 Test exit code handling fix [TBR].
TBR in a quest for build greenness...

BUG=

Review URL: https://codereview.chromium.org/1984323004 .
2016-05-17 12:37:39 -07:00
Konstantin Shcheglov 34d5d4f55c When in strong mode, analyze with dart2js paths.
This would correspond to the code in build_sdk_summaries.dart, which
creates strong mode summaries.

R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/26466

Review URL: https://codereview.chromium.org/1988853002 .
2016-05-17 12:20:39 -07:00
pq 31a03ec31b Skip SDK summaries in the presence of SDK extenders (#26448).
Works around crash provoked by mojo: https://github.com/dart-lang/sdk/issues/26448.

The rub is that using SDK summaries in the presence of SDK extenders (and embedders) is unsafe.

Greater context: https://github.com/dart-lang/sdk/issues/26467.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1990463002 .
2016-05-17 11:10:43 -07:00
Konstantin Shcheglov 048d396f1b Fix for analyzer-cli and the new SummaryBasedDartSdk 'strongMode' parameter.
I broke the build :-(

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1979193010 .
2016-05-16 15:03:35 -07:00
pq 7937623063 Don't use SDK summaries with embedders (#26448).
Addresses the issue seen in https://github.com/dart-lang/sdk/issues/26448.

Ultimately we want a better story for summaries in the presence of embedded SDKs; in the short-term this simply disables them.

The trick (and reason for all of the changes here) is that there is *a lot* of temporal coupling in the initiailization of contexts, sdks, resolvers, etc.  With this change, embedder processing is pulled out to where it can be done before the SDK is configured.  Hopefully this even makes this a bit more clear as resolver setup is less complex.

Open question: I think the logic that calls `pub list-dirs` is dead and can safely be removed.  Comments there welcome.

Thanks!

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

Review URL: https://codereview.chromium.org/1984733003 .
2016-05-16 14:13:40 -07:00
Konstantin Shcheglov a4862dd22a Add '--dart-sdk-summary' option to analyzer-cli and use SummaryBasedDartSdk.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1974323003 .
2016-05-13 12:56:09 -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
Jacob MacDonald 6b7139d896 Dont search for the sdk on startup in worker mode
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1974993002 .
2016-05-12 15:07:01 -07:00
pq 40b03d2261 Server and CLI pubspec updates [TBR].
Should address version constraint issues introduced by dep on new plugin API.

BUG=

Review URL: https://codereview.chromium.org/1972193002 .
2016-05-12 06:21:46 -07:00
Brian Wilkerson d87f9c09de Update to use the latest version of the plugin package
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1965083002 .
2016-05-11 09:54:29 -07:00
Paul Berry 92f5fc8836 Handle missing sources properly when building AST-based summaries.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1966443002 .
2016-05-10 14:15:14 -07:00
pq 7913968725 Fix CLI SDK option config timing (#26129).
Fixes: https://github.com/dart-lang/sdk/issues/26129

The issue was that we were creating the SDK and populating its options (notably `strong-mode`) *before* options processors were called.  The result was that client code analysis contexts and SDK contexts were getting configured differently causing confusion when client code was getting analyzed with a non-strong-mode SDK.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1962403002 .
2016-05-10 13:35:40 -07:00
Konstantin Shcheglov e7b51f7bd1 Issue 26426. Don't use SDK summarie when analyzing SDK itself.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/26426

Review URL: https://codereview.chromium.org/1963023002 .
2016-05-10 09:54:24 -07:00
Paul Berry baa7dac310 Allow zero analyzer args in build mode.
This simplifies the integration with build systems such as Bazel, in
which it is sometimes convenient to have a build unit which depends on
other build units but doesn't introduce any additional source files of
its own.

R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1960263003 .
2016-05-09 12:39:06 -07:00
Konstantin Shcheglov d7f14a639d Turn on using SDK summaries in the command line analyzer.
We pass all of the shared tests now.
We used to pass too, but there was a couple small regressions.
The regressions have been fixed, so if you don't see a reason not to
turn using summaries on, I think we could do this.

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

Review URL: https://codereview.chromium.org/1945013002 .
2016-05-03 15:15:52 -07:00
Paul Berry a8e665eaf5 Don't compute hashes in "--build-summary-exclude-informative" mode.
The hashes were being thrown away anyway; computing them just wastes
time.

Cuts the runtime of generating an AST-based summary of the analyzer
package (with a warm VM) by about 19%.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1910553002 .
2016-04-20 11:04:58 -07:00
Paul Berry 2d1dbd4d5b Sort build_mode.dart.
No functional change; just code motion.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1903053003 .
2016-04-20 10:55:24 -07:00
Paul Berry 48c8d84357 Clear analyzer caches after each persistent worker build step.
Without this, a persistent worker that runs too long will eventually
overflow memory.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1897973005 .
2016-04-19 13:41:53 -07:00
Brian Wilkerson 21a1b757c1 Clean up hints after a new hint was introduced
R=jwren@google.com

Review URL: https://codereview.chromium.org/1890973002 .
2016-04-14 13:15:34 -07:00
Brian Wilkerson 3084ceae83 Clean up flags for conditional directives
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1892523002 .
2016-04-14 11:47:28 -07:00
Jacob MacDonald d4197b759d close the input stream in build_mode tests so they dont hang
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1892483003 .
2016-04-14 10:54:18 -07:00
Jacob MacDonald d2e2241fc1 update to use bazel_worker package
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1885073002 .
2016-04-14 07:46:33 -07:00
Jacob MacDonald 09c6fcebc0 Use the provided dart sdk path in worker mode
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1882373003 .
2016-04-14 07:24:53 -07:00
Paul Berry 2a5db6841b Turn off summaries in context when building summary from AST.
When building summaries from ASTs, we only use the context to read
source files; we don't need it to provide an element model.  Therefore,
we can save some time by turning off the context's use of summaries,
because this prevents it from trying to eagerly deserialize the
summaries of dart:async and dart:core.

Saves a significant amount of time when building a summary of a small
package using ASTs.  For example, saves ~37% of time when building a
strong mode summary of the "yaml" package.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1882263002 .
2016-04-14 05:59:01 -07:00
Konstantin Shcheglov bc54ea8c23 Disable computing errors for .pub-cache sources.
R=brianwilkerson@google.com, pquitslund@google.com
BUG=

Review URL: https://codereview.chromium.org/1888583002 .
2016-04-13 17:01:38 -07:00
Paul Berry 3b65dacd6c Modify build mode to use the linker when building summaries from ASTs.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1877133002 .
2016-04-11 17:04:10 -07:00
pq 082edc9fa3 Suppress TODOs (#26215).
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1870123002 .
2016-04-08 08:54:59 -07:00
Jacob MacDonald 63efb288a7 allow --dart-sdk with --persisent_worker
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1859363003 .
2016-04-07 07:08:48 -07:00
Jacob MacDonald 92419d092b Update worker mode to use the bazel protos directly instead of json
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1868663002 .
2016-04-06 13:49:32 -07:00
Brian Wilkerson f819f9fb07 Add hooks for changing priorities of warnings to errors in strong mode
R=leafp@google.com

Review URL: https://codereview.chromium.org/1861363002 .
2016-04-06 13:06:29 -07:00
P.Y. Laligand f2a8ee1ebc Added option to dartanalyzer to treat lints as errors.
Fixes #25977
2016-03-31 11:24:51 -07:00
Konstantin Shcheglov 6347b4cca7 Support --persistent_worker flag in --build-mode.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1848543002 .
2016-03-30 12:31:09 -07:00
Konstantin Shcheglov 2895d7501e Fix for analyzer_cli/test/package_prefix_test on Windows.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1844613002 .
2016-03-29 12:18:50 -07:00
Konstantin Shcheglov daab52a191 Add the '--build-summary-only-ast' flag for generating summaries using only ASTs.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1838883002 .
2016-03-28 13:36:12 -07:00
Paul Berry ea189bd6dc Add a fallback mode for building summaries.
When summaries are built in fallback mode, the only information stored
in the package bundle is (a) which libraries appear in the bundle, and
(b) where the source files can be found on disk.  This is enough
information so that DDC will still be able to tell how libraries are
grouped into build units, but otherwise summary functionality is
disabled.

This is intended to be availadle as a temporary workaround so that if
a bug is found in the summary infrastructure, it won't prevent DDC
compilation from working (it will just make it slower).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1826353002 .
2016-03-24 13:47:37 -07:00
Konstantin Shcheglov 58bde1b3b4 Add the --build-summary-exclude-informative flag.
It (in combination with --build-summary-only-diet) makes the
package:path summary is almost 3 times smaller, partially because of
skipping bodies, patially because of excluding documentation comments,
and partially because of making 'codeRange' fields informative.

We also remove MD5 hashes.

As I can see after changes in method bodies we generate the exactly
same file (or at least 'cmp -l' thinks so). Adding a new field results
in a file of different length.

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

Review URL: https://codereview.chromium.org/1828973002 .
2016-03-24 08:20:56 -07:00
Konstantin Shcheglov d067c70ce9 Add --build-summary-only-diet option.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1830733004 .
2016-03-23 20:37:26 -07:00
Konstantin Shcheglov f00f0168b6 Fix for build mode SDK options.
R=skybrian@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1830773004 .
2016-03-23 18:36:05 -07:00
Konstantin Shcheglov ef04426f17 Fix for analyze-cli and Dart SDK options.
Fix for one more problem with my analysisOptions change.
We should set it early and don't attempt to change it later.

Not sure how well it will work with Flutter and other non-standard SDKs.

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

Review URL: https://codereview.chromium.org/1828903002 .
2016-03-23 14:53:07 -07:00
Paul Berry 014cfddea0 Clean up analyzer_cli build mode tests.
- Properly convert relative to absolute paths when the command-line
  arguments are of the form "$uri|$path".

- Test the behavior of "--build-suppress-exit-code".

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1825283006 .
2016-03-22 21:25:24 -07:00
Paul Berry c7e1de177a Change analyzer_cli's "package mode" into a "build mode".
Build mode differs from package mode in the following ways:

- The analyzer no longer guesses the relationship between paths and
  URIs based on directory structure.  Instead, each input file is
  specified in the form "$uri|$path".

- The analyzer does not read any files from disk that are not
  specified on the command line.

- There are no restrictions on the relationship between summaries and
  packages.  In particular: (a) multiple input summaries may summarize
  parts of the same package, and (b) part of a package may be
  specified with an input summary while an output summary is being
  generated for other parts of the same package.

- Output may be redirected to a file.

- The analyzer may be told to exit with success even in the event that
  an error is found during analysis.

This should ease the integration with Bazel, and provide a starting
point for integrating with other build systems.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1830463002 .
2016-03-22 20:38:30 -07:00
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