| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Move folders around to match default gradle/maven
folder structure.
The custom structure confused some IDEs when importing
the project as a Gradle project.
Change-Id: I5c059cc6fdf0ac2444b03d435f83f853363cfa32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset changes the default targetSdkVersion written into new
projects from being hardcoded to "15" to being the same level as the
build target's API level.
It also adds a new lint check which looks at the targetSdkVersion and
complains if it's not the same as the highest known version (currently
16). The issue explanation points to the javadocs for the
android.os.Build.VERSION_CODES class for details on how to upgrade the
app.
Change-Id: I00c2bd7cd8fa239b9fd1de9b2d35ff9faf87d25f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move resources and com.android.util.Pair into layoutlib_api
where they belong since layoutlib depends on them and we need
to control the API.
Made a copy of Pair to stay in common.jar but moved it to
com.android.utils.Pair (the one in com.android.util.Pair is
marked as deprecated to prevent usage where applicable).
Also moved XmlUtil and PositionXmlParser to com.android.utils
to match Pair.
Change-Id: I21d7057d3f2ce604f86a3bb1fa3c130948c93b89
|
|
|
|
|
|
|
|
|
|
| |
The Makefiles for the lint, lint_api and lint_check libraries were
*statically* linking in the Guava and ASM libraries. This made them
much larger than necessary (~1.6M instead of ~100K), and for no good
reason since the classes were already on the classpath, and of course
this duplicates them repeatedly.
Change-Id: Iec3ed623429ab8b7b8ba78f5d7a069853ae665c3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset adds Java AST support to Lint. There are new interfaces
for Java parser and specialized Java detectors. Java detectors can
either visit a full parse tree, or they can register interest in
specific methods, or Android resource references, or specific AST node
types -- or a combination of these. They will then be invoked during
an AST visit with the relevant info.
This changeset also rewrites the existing detectors that were using
String-based pattern checking on Java files to using real AST
traversal instead (and it removes the custom Eclipse-specific unused
resource detector since the plain one now does the same AST-based
analysis that the Eclipse one did.)
Change-Id: I4d85f8b785bf41a88dbb29e7017b9c0f588880bc
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset adds the Guava library to ADT and lint. (It is also a
prerequisite for the Lombok AST library which is added by a later CL.)
This changeset also uses the library in a few simple ways: It replaces
some custom I/O and collections code with calls into the equivalent
Guava methods, and it also adds the @Beta annotation on the various
"API" classes which are not yet stable.
Change-Id: I2f50febfa075c32818404e888578a2e1e447d408
|
|
|
|
| |
Change-Id: Ifcc1d88dabb07dc05b2e5c934743ad52f9b6dc1d
|
|
This changeset adds a static analyzer, "lint", which looks for various
potential bugs in Android projects. It has 3 parts:
(1) A library which performs the actual static checks.
This library is standalone: it does not depend on Eclipse.
(Technically the library has two halves: an API half, for use
by third party developers to write additional detectors, and
an actual implementation of a bunch of built-in checks.)
(2) A command line driver, "lint", which runs the static checks and
emits any warnings to standard out. This can be thought of as
a replacement for the layoutopt tool.
(3) Eclipse integration. Lint errors are added to the Problems view as
well as shown as editor annotations. There's an options panel for
controlling which detectors are enabled. There's also a quickfix
for disabling errors directly within the editor and a marker
resolution for disabling them via the Problems view.
The static checks are run on an XML file right after it has been
saved. (This is optional via a toggle on the same preference page
as the detector list.)
The static checks are also run when you export an APK, and if any
fatal errors are found the export is abandoned. (This is also
optional via an option).
Finally you can run a full lint through the Android Tools menu,
and there's also an action to clear all the lint markers there.
There's also a new indicator on the layout editor which shows
whether there are lint errors on the associated file, and when
clicked brings up a dialog listing the specific errors.
This changeset also includes a number of checks:
* An accessibility detector which warns about images missing
contentDescriptions
* A drawable selector detector which warns about state lists where not
all states are reachable (e.g. it is not the case that only the last
item in the list omits a state qualifier)
* A detector finding duplicate ids, not just in the current layout but
across included layouts (transitively) as well
* All the layoutopt ones ported to Java + DOM
* Unit tests for the above.
The focus here is on getting the infrastructure in place, and it
currently focuses on XML resource files and analyzing them
efficiently. See the comment in XmlVisitor for details on that.
Change-Id: Ic5f5f37d92bfb96ff901b959aaac24db33552ff7
|