| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the user enters an activity title like "Android's Tools" in the new
template wizard, an invalid strings.xml file is generated, since the
apostrophe is not properly escaped.
To fix this, there's a new string conversion method in the template
engine, "escapeXmlString", which will perform all the necessary
conversions.
It also adds two other XML escaping functions: one to escape text to
be suitable for XML attribute values, and one to be suitable for XML
text values.
Finally, when verifying this, I discovered that if I inserted
ampersands in the MasterDetail template, I ended up with errors in
various places there a filename was derived from the input string. To
help make this work better, there's also a new "extractLetters" method
which pulls all the characters out of a string (effectively stripping
whitespace and punctuation).
In addition to the above 4 new string conversion methods, the
templates have been updated to use them, and the template format
documentation updated.
Change-Id: I4d4e854ab78d63bc86b8eb0fb9d92246534615e7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset moves most constants into the SdkConstants
class, and gets rid of AndroidConstants and LintConstants.
It also migrates all non-ADT specific constants from
AdtConstants into SdkConstants. It furthermore moves various
other constants (such as those in XmlUtils and ValuesDescriptors)
into the constants class. It also fixes the modifier order
to be the canonical modifier order (JLS 8.x).
Finally, it removes redundancy and combines various constant
aliases such that we don't have both NAME_ATTR and ATTR_NAME
pointing to "name", etc.
Change-Id: Ifd1755016f62ce2dd80e5c76130d6de4b0e32161
|
|
|
|
| |
Change-Id: Ia51e3e2280c3d360496550df50a540571b9b7582
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset adds a new typo detector. There
are also some lint infrastructure fixes to better
handle positions within text nodes, and to allow
Eclipse lint quickfixes to supply multiple fixes
for a single issue (such as multiple misspelling
alternative replacements.)
Change-Id: Ie26f0bafc571e02ae09ff27a7f4b221fe0c2ea5b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ManifestMerger library needs to look up the prefix to use for the
Android namespace, and the Document.lookupPrefix method is not
implemented by the Eclipse DOM implementation (which throws an
exception). However, we have an implementation of this in the ADT
plugin.
This changeset creates a new XmlUtils class in the common/ library
(which is accessible by both ADT and the manifest merger, and the
anttasks where the manifest merger is used), and moves the namespace
prefix lookup code in there. It also moves the XML escape methods
into that class. It also adds a new method to the ManifestMerger for
merging directly from documents (rather than files), and makes sure
that all the merging code goes via the prefix utility method rather
than calling the document.lookupPrefix method.
Finally, it moves the various string constants associated with XML
namespaces into the single XmlUtils class, since these were spread
across several different classes before (and many of them are needed
in the XmlUtils class).
The vast majority of the diffs in this changeset are related to simple
import statement changes to reflect the new locations of these
constants.
Change-Id: Ib8f3d0e5c89e47e61ea509a23925af7b6580abee
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Lint API specifies that columns should be 0-based (like line
numbers), but in a number of places this was not the case; it was
1-based instead (both in the detector code and in the output code,
which is why things looked okay). This changeset cleans this up such
that the columns are properly 0-based (and adds unit tests for it).
The Location API has a mechanism to search in the source code for
tokens, which is useful for bytecode detectors where we only have line
numbers. This changeset adds tokens to the API detectors such that it
identifies the corresponding method, class or field reference in the
source, not just the corresponding line. It also improves the pattern
search to also look backwards a few lines, since some bytecode
references appear a few lines later than the source code reference (at
the nearest executable code; this is the case for parameter local
variables for example).
Change-Id: I3adac20d5f0075e0a919be15dfb68658d5b7bb11
|
|
|
|
| |
Change-Id: I37a4f3a9d9d8fd7870f08e56a595b52d7ff89add
|
|
|
|
| |
Change-Id: I189118b8612661e3c9aef4aaca0feeb7ac522f5b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The XML DOM parser used by the lint CLI driver (which tracks
positions) is needed outside of lint, so pull it out of the lint/cli
project, and refactor it such that it does not directly reference the
lint Position APIs (but can utilize them when subclassed in lint).
In addition, handle non-UTF-8 file encodings. XML files can be encoded
in other character sets, and can specify this via the encoding
attribute in the XML prologue. Until now, the CLI lint runner would
just read the XML file contents in using the default encoding and
parse this. Now there's a new utility method which takes a byte[] and
infers the desired encoding and uses that to convert the byte[] into a
string using the correct encoding. (We can't just pass an InputStream
and let the SAX parser handle this on its own because the XML parser
needs to access the character stream in order to assign correct node
offsets.) This code now also handles the byte order mark more
cleanly.
There are some new unit tests too to check the new encoding, BOM and
offset handling.
Change-Id: Ib0badbbe72172e3408c6d5af2413be51280a7724
|
|
Change-Id: I3a151d2fadd1c1e34177cb729fe5545fa754849a
|