aboutsummaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Update known version names constantsTor Norbye2012-11-051-1/+1
| | | | Change-Id: Ib6b09a1ff85c45b4fc6c407e3404a8a58c6f84ea
* Update compiler flags.Tor Norbye2012-10-261-2/+2
| | | | | | | | | | Turns off the ability to use @SuppressWarnings with optional errors is available, but off by default (see Eclipse issue 392875). This turns that off, makes missing enums in switch statements a warning, and synchronizes the settings file to all projects (except tests.) Change-Id: Iad7060523b6ee2cbbca97e0a6ffedb264b185222
* Update maven artifacts and add lint.Xavier Ducrohet2012-10-191-0/+1
| | | | | | | | | Updated the groupId of most artifacts to be more reflective of their sub-projects status in the SDK tools. Added lint artifacts. Change-Id: I900a165647a9b7d3c55b473f63c4ca4469762d7b
* Check for missing layout_width and layout_height attributesTor Norbye2012-10-161-1/+1
| | | | | | | | Also looks at style declarations and attributes on include tags to allow elements to either pick up sizes from styles or from the including context. Change-Id: I91a944805d8a906ff63b5a22f2faa876e7292c19
* Look for missing android namespace prefix in manifest filesTor Norbye2012-10-151-0/+1
| | | | | | | | Extend the missing prefix checker such that it doesn't only look at layout files, but also complains in manifest files, menu files, drawable files, etc. Change-Id: Ifbd7635e3b73d662aa6c7a4e03e4c2894c6fe204
* Misc improvements to the multi-configuration editingTor Norbye2012-10-152-1/+119
| | | | | | | | | | | | | * Fix bug in switching to preview configurations * Don't draw drop shadows for thumbnails in Dialog themes * Move the preview title labels to sit above each preview thumbnail * Make error thumbnails include rendering error messages (and wrap if necessary), plus tweak appearance * Make switch animation show rectangles animating in both directions Change-Id: I0995617fa277b48419a88c5203abf5b1d49af711
* Lint detector for missing menu titlesTor Norbye2012-10-151-0/+2
| | | | | | | As requested in 38022: Lint should warn when menus don't have a title Change-Id: I34688d7733d98ba9fa8cc10202a5470040962117
* 37329: lint checks for conflicting permission definitionTor Norbye2012-10-151-0/+1
| | | | Change-Id: I3b131872cc9938ceb5df271ab10ec60644d44b26
* Check notification and action bar iconsTor Norbye2012-10-051-0/+4
| | | | | | | These icons should not use color (and in the case of notification icons, be white). Change-Id: I32b9422735830a01bb069b90a5ad5a76d7aeb5de
* Fix misc lint bugsTor Norbye2012-10-041-0/+1
| | | | | | | I ran lint over some large projects and manually verified the report; this uncovered a couple of false positives. Change-Id: I006d64a03119c6badc40e33df9ab4079e07dc7c5
* Fix javadoc here and there.Xavier Ducrohet2012-10-022-3/+3
| | | | Change-Id: If02d0b97c294d9821a1c914547782a08b1d256fb
* Update the gradle build files.Xavier Ducrohet2012-10-021-3/+52
| | | | | | | add javadoc and source artifacts as well as POM information to upload to Maven Central. Change-Id: I51701f5a5db5b2ae41ecede115e2b36adf1fa05e
* Fix issue with generation of R classes for libraries.Xavier Ducrohet2012-09-271-0/+2
| | | | | | | | | | | When a clean action happen, the order of compilation of the project isn't dictated by the dependencies between the project. It is therefore important to detect changed in R.txt for each library and recompile the project when that happens. Also fixed a potential NPE when building libraries! Change-Id: I6a87e9c3a4984e5aa6401270cf83eaea74044c9f
* Cache applicable issue lists per scope setTor Norbye2012-09-271-0/+1
| | | | | | | | | | Keep sets of applicable issues for each scope set. This should make incremental lint slightly more efficient. Also add a check that icon file extensions match the actual file format. Change-Id: I4a7f5e19b91aa3613480aa831ec42065528f02d3
* Ensure that themes are always style-prefixedTor Norbye2012-09-251-1/+1
| | | | | | Plus a few other minor tweaks/bug fixes Change-Id: Ic02db9123674ebfbc8977a94d1da4826ec13fb9b
* traceview: Fix check for upper case characters.Siva Velusamy2012-09-241-0/+11
| | | | | | Fixes http://code.google.com/p/android/issues/detail?id=37779 Change-Id: I8c1671d24caed3156b98dcb36d345c0eb1f573d7
* Merge "Add allowBackup lint security check"Tor Norbye2012-09-211-0/+1
|\
| * Add allowBackup lint security checkTor Norbye2012-09-211-0/+1
| | | | | | | | Change-Id: I3b79bef6981d880fe6a545429754e03bd384645c
* | Merge "Move some utility functions from AdtUtils to common"Siva Velusamy2012-09-212-0/+220
|\ \
| * | Move some utility functions from AdtUtils to commonSiva Velusamy2012-09-202-0/+220
| |/ | | | | | | Change-Id: Ia6f5c55e07c7f60712472c8e850b7c4595c46671
* | Merge "Validate user edits in XML files"Tor Norbye2012-09-201-0/+3
|\ \
| * | Validate user edits in XML filesTor Norbye2012-09-201-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Around ADT 15 or so we introduced a bunch of optimizations to run AAPT much less frequently, since with large projects it can take a long time, and end up blocking the UI if you try to save twice. Unfortunately, one side effect of this change is that if you edit only the *value* of an attribute, we will not re-run aapt, which means that if you set the value to a bogus value, you will get no error message until the next time AAPT runs (usually when you try to run). This changeset fixes this. We already have the attribute metadata which aapt uses, so now, when an XML file is changed and saved, we process it with an XML pull parser, and validate all the Android namespace attributes. If any are found to not be correct, then we request a full AAPT process, which will then display errors as appropriate. Change-Id: I374c19648e29c27c6d82616b3ee602cb2343cd3a
* | Merge "37497: Templates should escape string literals in resource files"Tor Norbye2012-09-202-1/+25
|\ \ | |/ |/|
| * 37497: Templates should escape string literals in resource filesTor Norbye2012-09-182-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Generate smaller R classes for libraries.Xavier Ducrohet2012-09-182-0/+6
|/ | | | | | | | | | | | | | | | Using the new --output-text-symbols from aapt the build system now generates the R class for libraries manually based on the symbols exported by the libraries and the final values computed by aapt when using all the resource folders. Because only R.java is concerned, the Manifest class is now included in the library jar file. Also added a new test apps that uses instrumentation to verify the build system. Change-Id: Ic436ea8eb070844e9db8b3b2620fbf665839d40b
* Improvements to stacktrace handler for constructorsTor Norbye2012-09-181-0/+1
| | | | | | | | | | | | | | | | | This changeset improves the SourceRevealer for certain types of stacktraces: (1) Constructors. If your class initializes fields using code, these are logically grouped into the constructor, but the linenumbers do not fit the constructor source range. Before this CL, this would cause the revealer to show the constructor method rather than the field initialization line. (2) Class initializers. If you clicked on a class initializer method, the IDE would throw an NPE. There's now some special handling to deal with these. Change-Id: Ibb3b7dcf13a69018f75fd12648d1f6b5c45625cc
* Add labelFor lint checkTor Norbye2012-09-171-0/+3
| | | | Change-Id: If2b905197d5d81c6f98315a0d48ff37091e8282b
* Support separate layout editors for a single layout resourceTor Norbye2012-09-171-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset changes the "reuse" behavior of the layout editor to no longer reuse the same layout editor when you are switching between alternate layout files for the same layout resource, such as layout/foo.xml and layout-land/foo.xml. This lets you more quickly switch back and forth and inspect differences between the layouts, etc. There is also an option in the Android > Editors panel to turn on single editor sharing again. The biggest part of the changeset, by far, is a cleanup of the ConfigurationComposite class and associated code. This was necessary not just to support the above feature (where we need to "back out" UI changes when you've made a configuration edit which results in a different file getting opened), but it's also an important preparation for multi configuration editing, where we need to be able to switch configuration settings in and out of a single configuration editor, etc. The configuration data itself is now in a separate Configuration class; the UI is in ConfigurationChooser, and the configuration matching code is in ConfigurationMatcher. There's also a new Locale class to track language/region pairs instead of using 2-element ResourceQualifier arrays. The various menu listeners are also in separate UI classes now. While there are new classes, most of the configuration matching algorithm is unchanged, just moved to a new class and the UI syncing and configuration data lookup replaced. Bitmasks are used to handle configuration changes, such that updating multiple related attributes (e.g. a rendering target change also causes a theme change if say Holo isn't available) can now be processed just once with a single change call. (Various other cleanup too.) Change-Id: I04ac969f46824321be3db0c487ef077c03cc6012
* Merge "Add guava to common and sdklib."Xavier Ducrohet2012-09-133-1/+3
|\
| * Add guava to common and sdklib.Xavier Ducrohet2012-09-133-1/+3
| | | | | | | | Change-Id: Ic465232c7df736d2823b391c1f973c6ae5d81833
* | Constants refactoring.Tor Norbye2012-09-134-221/+758
|/ | | | | | | | | | | | | | | | 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
* NPW Sample Wizard: list extras with a "sample" directory.Raphael Moll2012-09-111-0/+9
| | | | | | | | Some extras have just a single "sample" directory instead of having a samples/<sample_name> directory. Support this and list them as valid samples. Change-Id: I25bc59db0b9853d98385cca98f70bf261558fd8b
* Make some libraries be buildable with Gradle.Xavier Ducrohet2012-09-062-0/+30
| | | | | | They all output into out/host/repo Change-Id: I78a1a976f0a99860a66248492da7fd9c6593b1c2
* Update Guava from 10.0.1 to 13.0.1Tor Norbye2012-08-291-1/+1
| | | | Change-Id: Ia51e3e2280c3d360496550df50a540571b9b7582
* Fix nullability annotationsTor Norbye2012-08-212-4/+6
| | | | | | | | | | | Eclipse 3.8/4.2 requires that any method which overrides another method with a @NonNull parameter (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=381443). This changeset adds @NonNull on various overriding methods in newly added code such that Eclispe 4.2 doesn't show errors. Change-Id: Ice4a4b4dc31ba68c4e0911bb37c15da090076a0d
* Merge "Create new logging class in the common library."Xavier Ducrohet2012-08-154-1/+309
|\
| * Create new logging class in the common library.Xavier Ducrohet2012-08-154-1/+309
| | | | | | | | | | | | | | | | | | The goal is to later migrate all existing code to this new logger and get rid of all our duplicates. Also did a misc fix in AndroidLocation. Change-Id: Ia33a782b57c91b4e3d5fd2c0660e040be11b9cbb
* | Add Ant support for UI automation test.Xavier Ducrohet2012-08-151-2/+2
|/ | | | | | | Also fix a bug in a custom ant task where minSdkVersion and targetApi were swapped. Change-Id: Id9bac802377a04270e76def42eaf6a8fb4b3f874
* More refactoring.Xavier Ducrohet2012-08-134-0/+1096
| | | | | | | Move stuff out of sdklib into common and ide_common. Remove androidprefs and move the one class into common. Change-Id: I71d126a13cf2ba413692e29616f4968a37d7b33a
* Refactor common.jarXavier Ducrohet2012-08-0722-1633/+11
| | | | | | | | | | | | | | | 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
* Tweaks to the lint CLI offsetsTor Norbye2012-07-231-1/+2
| | | | Change-Id: I20592372d41235b36227a0d36014d77c23c7fc58
* Add XXHigh density (added in JB)Xavier Ducrohet2012-07-101-0/+1
| | | | Change-Id: I09f308a3187d93abfda23c63ed72ba906b65ebc9
* Add typo detectorTor Norbye2012-06-222-14/+64
| | | | | | | | | | | 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
* Fix warningsTor Norbye2012-06-011-0/+5
| | | | | | | | | | | | | | | | | First, update our various project-specific Eclipse compiler settings configuration files to include the new Eclipse 4 flags. Second, turn off the "Unchecked conversion from non-annotated type to @NonNull" warnings; there are hundreds or thousands of these, and there isn't much we can do about them when they're coming from platform and library APIs. Third, make the lint projects warning-clean again by addressing various warnings Eclipse found (such as some unclosed resources and some null handling issues; yesterday's null annotation fixes only addressed errors, not warnings.) Change-Id: If75f7401a1cbeef1bf58b47ccaa9ad17bede7f91
* Fix nullness annotationsTor Norbye2012-05-304-4/+4
| | | | | | | | | | | | | | | | | | | Eclipse 4.2 includes analysis support for @Nullable and @NonNull annotations. However, it requires these annotations to be *repeated* on every single method implementing or overriding a superclass or interface method (!). This changeset basically applies the quickfixes to inline these annotations. It also changes the retention of our nullness annotations from source to class, since without this Eclipse believes that a @NonNull annotation downstream is a redefinition of a @Nullable annotation. Finally, the null analysis revealed a dozen or so places where the nullness annotation was either wrong, or some null checking on parameters or return values needed to be done. Change-Id: I43b4e56e2d025a8a4c92a8873f55c13cdbc4c1cb
* Move XML code to the common libraryTor Norbye2012-05-203-0/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Ensure that exception during build put a marker on something.Xavier Ducrohet2012-03-272-5/+27
| | | | | | | | Failure to read the manifest (sometimes due to out of sync resources) could fail to put a marker on the file or project, making the build fail with no feedback. Change-Id: Ib75e0b72e202e14de556ba30f23a6879e3dfc2c8
* Add info about when qualifiers were added to the platform.Xavier Ducrohet2012-03-161-7/+13
| | | | | | | | This is a first step where we setup the info. Next step is to actually use the info when calling ResourceRepository.getConfiguredResources Change-Id: I03c20ad0ec7a53ec8219316cc4af7a59155ef34a
* Add support for suppressing lint via XML attributesTor Norbye2012-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This changeset adds support for suppressing in XML files: (1) Lint will ignore errors found in attributes and elements if the element (or any surrounding parent elements) specifies a tools:ignore="id-list" attribute where the id-list matches the id of the reported issue (or "all"). The "tools" prefix can be any prefix bound to the namespace "http://schemas.android.com/tools" (2) There's a new quickfix shown for XML lint warnings which offers to add a lint suppress attribute for a given lint warning (setting the id to the id of the warning, and adding the tools namespace binding if necessary). (3) The XML formatter now handles namespaces a bit better: after the preferred attributes (id, name, style, layout params, etc) have been handled, attributes are sorted by namespace prefix before they are sorted by local name -- which effectively will sort any new tools:ignore attributes to the end. Change-Id: Id7474cde5665d9bd29bdd4e0d0cc89ed4d422aea
* Fix lint column offset handling, and add columns to API checkTor Norbye2012-01-302-5/+54
| | | | | | | | | | | | | | | | | | | | 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