summaryrefslogtreecommitdiff
path: root/android-lint/src
AgeCommit message (Collapse)Author
2022-03-07222095229: Move VersionChecks into API package to open up visibilityTor Norbye
(Tracks changes in the lint module.) Fixes: 222095229 Test: Existing unit tests Change-Id: Iad9121a81658ba0a7250f75a001f68810aeba27b
2022-03-02Add desugaredMethodsFiles to LazyLintModelVariant and IdeVariantScott Pollom
Bug: 215256062 Test: existing Change-Id: Ia6eeb8c7f38d4b5f8c1d53b351403f7c17dfeea5
2022-02-12210520416: Register new lint check as inspectionTor Norbye
This CL registers the new redundant Kotlin nullness annotation lint check as an IDE inspection. Test: This is automatically generated code from LintInspectionRegistrationTest (the inspection is tested as part of lint) Fixes: 210520416 Change-Id: Ia84b0b5e42a127bced8704a96b35ead4b38708a0
2022-02-09Remove UnpackedNativeCodeDetectorScott Pollom
This lint check is obsolete because (1) native lib packaging should now be specified via AGP's DSL, and (2) AGP will inject the recommended value for android:extractNativeLibs into the merged manifest if not specified in the DSL. Bug: 216662628 Test: existing Change-Id: I74d4f71193b5006b29c35e5baa46e463da692dd3
2022-02-01Make IdeModuleDependency helper methods extensionsYuriy Solodkyy
This is (1) to make it clear which properties belong to models and which are just convenient helpers and (2) to make IDE models compatible with reflection based model dumper so that they can be changed without rewriting dumpers. Bug: n/a Test: n/a Change-Id: I042dfb009af913605dfbd0bc3987c346460cf8b3
2022-02-01Move check `requiresAndroidModel` util to ProjectSystemUtilKun Shen
Bug: wip Test: updated Change-Id: If386650546a0fdb7915afd0a5704eb930d8e5c54
2022-01-28Clean up IDE library modelsYuriy Solodkyy
Bug: n/a Test: n/a Change-Id: Iaa40935ccd8108883962d27750cdec8f8c3fb043
2022-01-27Fix lint which was broken as a result of MPSSBradley Smith
Module per source set caused lint to get duplicate paths while building a map of directory to LintProject, this failed an assertion and caused lint to crash. Instead of obtaining the dir for java modules from the linked project path, get them from the first content root. This guarantees that they will be unique. Modules do not really have an associated directory anymore and are a collection of content roots. A long term fix would be to address this and stop using a map from directories to LintProjects. This change does not attempt to address the underlying issue but instead just ensures the lint is usable and doesn't crash on java modules. Bug: 216291399 Test: test added in I588cf0ceda5 Change-Id: I3d51cbd9d8676386d45ccfb71bd37a322b353ce9
2022-01-21Register the new id is 0 lint check as an inspectionTor Norbye
Test: In lint (this is just machine generated registration code) Bug: Not filed Change-Id: If5f63bc1e901f5da695db09a5d169c39b21e1720
2022-01-21Add @ReturnThis, @OpenForTesting, @EmptySuper and @DeprecatedSinceApiTor Norbye
Register new lint checks as inspections. Test: Automatically generated inspections registration code; lint checks are tested in lint Fixes: 140249763 Fixes: 141539024 Fixes: 37116481 Change-Id: I0113569420c5c8f83c1de3e75cb0894d31427a80
2022-01-19Rework IdeBaseArtifact propertiesKarima Ichou
classFolders and additionalClassesfolders are 2 prroperties mutually used in the IDE and this change merges them into 2 properties to correspond more to V2 design. ClassFolder property showed a problematic usage: it is used to set the compiler output path which is used by Platform and us. the next steps would be to clean our internal usage of the compiler output property : b/214217361, b/214032039. The usage by Intellij which might affects us is related to unit tests code coverage: This can be also deleted once we have support for Jacoco runner. Bug: 201055230 Test: existing Change-Id: Icdf3d09c6aa78481e7c911e715cdb8559d5f114a
2022-01-12[Gradle] Add separate language filetype for Gradle script files IDEA-276227Vladislav.Soroka
(cherry picked from commit 0fc15178cb6ea77bf6b54cf43d9ac4c9c4c48bc5) Change-Id: I0fc15178cb6ea77bf6b54cf43d9ac4c9c4c48bc5
2022-01-07Split library interfaces into dependency and library onesYuriy Solodkyy
This is a first step towards exposing the hierarchy of transitive dependencies to consumers. Bug: n/a Test: n/a Change-Id: I6fe3471e8cd8eff34f015ade9008386790127bff
2021-12-24Remove AndroidModuleModel.getAndroidProject()Yuriy Solodkyy
(1) Replace several usages in android.core with suitable alternatives; (2) Use `GradleAndroidModel` directly everywhere in Gradle specific code; (3) Replace some mocking with @VisibleForTesting methods. Bug: 147586218 Test: n/a Change-Id: Iff7f595f630244b6f0a6e0518f1264fa61cdf646
2021-12-23211770054: Preserve quickfix order in the IDETor Norbye
When there are multiple quickfixes registered, IntelliJ will show them in *alphabetical* order, not the logical order they were registered in. This CL attempts to work around that by using inspection priorities. IntelliJ only has a concept of top/high/normal/low priorities, not a general rank, so we cannot guarantee the order, but for short lists of 2-4 items it should be fine, and that's nearly always the case. (Most of this fix updates various existing quickfixes to extend DefaultLintQuickFix instead of implementing the LintQuickFix interface directly which involves passing the display name to the super constructor; then we add a priority property on DefaultLintQuickFix which is used to remember the priority sorting for when we construct IntentionActions from these.) Test: AndroidLintInspectionBaseTest#testSortingPriority Fixes: 211770054 Change-Id: I59d8990d1e1be903148711525fd79c6a9900d77f
2021-12-23Use "implementation" instead of translating from "compile"Yuriy Solodkyy
as all supported version of the Android Gradle plugin now understand `implementation` configuration name. Move `getAndroidGradleModelVersionInUse` to `project-system-gradle`. Bug: n/a Test: n/a Change-Id: I09a1f4640eb9157b1fabf7a663d6a487b129ccb2
2021-12-16178373617: Register a lint check for incorrect wearableConfigurationAction ↵Oleg Baskakov
values Bug: not filed Test: checked automatically by lint Change-Id: Ice0e4dfa25e05df2f9b539aeee16a75861b886fa
2021-12-15Remove unused methods from AndroidModuleModelYuriy Solodkyy
Bug: 147586218 Test: n/a Change-Id: I94b87182f3e12fe277a4e244bf6dcc9d4cfa8387
2021-12-14add a missing dot in the lint check registration codeOleg Baskakov
Bug: follow up on 199059158 Test: ci build pipeline Change-Id: Id81c81aea530215878cdb255e1dff37489bfc638
2021-12-14Register the watch face action duplicate check as inspectionOleg Baskakov
Test: In lint (this is just machine generated registration code) Bug: Not filed Change-Id: I21c99cc2313ffd4e46469f487ec8c6a577a29f5a
2021-12-13Register lint check for trivial format stringsKevin Jeon
This change registers the corresponding lint check in tools/base. Test: presubmit Bug: 202993567 Change-Id: I9c43caed0c58a2b6c0dd6fd59fead344866f2677
2021-12-01Move package `com.android.tools.idea.progress`Kun Shen
... from `intellij.android.core` module to `intellij.android.common` module. Bug: 208494592 Test: n/a Change-Id: Ifa9bb80271f4dcb965641db36a1e82bf9b15d647
2021-11-30Begin moving AndroidModuleModel to project-system-gradle (Step 1)Yuriy Solodkyy
Step 1: - Move `AndroidModuleModel` implementation to a new class named `GradleAndroidModule` and update all references in `project-system-gradle` module to use the implementation class directly. - Convert `AndroidModuleModel` to an interface and leave there methods which are used in `android.core` and other modules which are not part of the Gradle project system (with some exceptions which we will need to address later). Bug: 147586218 Test: n/a Change-Id: Ie37e4ab73ba9b249320b440289d3197d3929d727
2021-11-29Ensure additional folders are sorted to maintain order...Bradley Smith
between running via the ide and bazel. Bug: N/A Test: N/A Change-Id: Ie1b2d14bf9fde79e531a8a9deed50c26debf20ac
2021-11-24fix a missing dot in the classname ↵Oleg Baskakov
inspectionsAndroidLintWearableConfigurationActionInspection Test: build pipeline Bug: not filed Change-Id: I486ebf00a150217d742538bb206e213ef4cfe723
2021-11-23Register new watch face configuration check as inspectionOleg Baskakov
Test: In lint (this is just machine generated registration code) Bug: Not filed Change-Id: Ia1393da9c7249a6e19767b0882449c5df11ef198
2021-11-23Rename modelVersion to agpVersionYuriy Solodkyy
since it represent the version of the Android Gradle plugin rather than the version of any model. Also, make it not nullable as it is reported since first versions of the AGP. Bug: n/a Test: n/a Change-Id: I18563c9b382023a7dfa07dbbbf60b658e2aab1ae
2021-11-22Move GradleDependencyManager to Gradle project systemYuriy Solodkyy
Bug: 147586218 Test: n/a Change-Id: I47bfc682c7760fc009d1412b18a5883eb7130db0
2021-11-19Add an identifier property to lint model dependenciesAmr Afifiy
Currently, the artifact address value is being used as a unique identifier, which is not correct in the case of testFixtures dependency as the testFixtures and the main artifacts will have the same maven coordinates. This change adds an identifier property that properly uniquely identifies the dependency. For libraries, we get the unique identifier from the IdeArtifactLibrary name, which is generated uniquely for each library. And for modules, the identifier is the combination of the sourceset and the project path. Test: lint model snapshot tests Bug: 139438142 Change-Id: Ice53b844fecb81f34a2c305d470385c7431665b9
2021-11-19Add dsl to exclude testFixtures sources from lint analysisAmr Afifiy
Bug: 139438142 Test: Model snapshot tests Change-Id: Idecf520a0c4ff96a71c8b91ddca08d512059d4c9
2021-11-19Move code aroundKun Shen
Here we move the util to the feature specific package. This is to prepare for the following extraction work. Bug: 206859899 Test: n/a Change-Id: I793b6f4057c47c81948c0ac9336f1c837a9c416a
2021-11-15[Lint] Update the metadata for ExportedFlagDetectorSam Wang
Bug: N/A Test: N/A Change-Id: I03f3b8f46ea19b9c80398ae1f1453d08ff4f0b37
2021-11-15Allow build system to customize lint jarsxinruiy
Prviously, we have to collect lint jars from lint client. It asks to create different lint model when different build system is used. With this cl, AndoridModel.getLintRuleJarsOverride is provided to allow build system to provide their own lint rule jars without implement lint model. Build-in detectors may not work in such case since we do not have build system specified lint model which is need by part of detectors. bug: b/203566707 Test: unit test added Change-Id: I399582211afc1ebc1b49a52c9da939777e5e8730
2021-11-11Use LintIdeSupport in UpgradeAppCompatV7FixYuriy Solodkyy
Bug: 147586218 Test: n/a Change-Id: Id8616ca4cfb7464b19aed32375078c5428113e01
2021-11-08Replace current SDK version in Lint model snapshotsYuriy Solodkyy
Bug: 203802678 Test: n/a Change-Id: I00a07f85e0b39d5c3e926d4585d63524c34ab604
2021-11-03Add a testFixturesSourceProviders to LintModelVariantAmr Afifiy
Bug: 139438142 Test: LintModelSnapshotComparisonTest Change-Id: I647a4d55cfccc6e93abe6096d5e066dd1d484293
2021-11-03Revert "Add a sourceset field to LintModelModuleLibrary"Amr Afifiy
This reverts commit 852d9a8f0e0bd197715c79349c2d007f0883012f. Reason for revert: Moving from using a sourceset field to rely on the artifact address to distinguish between different sourceset artifacts. There is no need currently for lint to know whether a library or a module is a testFixtures component of a library or a module. By moving to using the artifact address lint will deal with them as separate artifacts. Change-Id: Iebd9569b46deebed75a17c7d60d75721bb3bfb04
2021-11-02Add testFixturesArtifact to LintModelVariantAmr Afifiy
Bug: 139438142 Test: LintModelSnapshotComparisonTest Change-Id: I2ac1bc0c65a008e5032e6beccdaa7ab30dd3cec5
2021-10-28Add a sourceset field to LintModelModuleLibraryAmr Afifiy
Add a sourceset field to LintModelModuleLibrary to specify the sourceset of the dependency as now with testFixtures, tests and other modules could depend on the testFixtures sourceset of a module. This change integrates the sourceset as part of the lint module dependency identity. Bug: 139438142 Test: model snapshots Change-Id: Ic729f0e9676e2510bd70c4ec7ccd2bf990fe2b3f
2021-10-28Support for optional sourcesets in models.Xavier Ducrohet
AGP will now exclude sourcesets that aren't used by any variant or test components. This means some of the sourceset will be nullable. This change updates the snapshots and the model and consuming code to handle this. Fixes: 169403306 Test: N/A Change-Id: I033d6ae9b6f6e415d6649a28e2790a71cd1aa287
2021-10-25Replace current SDK version with a placeholderYuriy Solodkyy
in IDE model snapshots. Bug: 203803107 Test: n/a Change-Id: I3d5be37ff5fd7d0ccd479a8d10928af9293b4a1b
2021-10-21LintIdeSupport: use service instead of EPMatthew Gharrity
...and fix 'cyclic extension initialization' which was caused by querying the extension point in the static initializer of the extension base class. This is a recapitulation of commit e42c03d2 from JetBrains. Test: AndroidLintTest Change-Id: Iebb37a7f2718daee30e748d035f5a1e5b400863b
2021-10-19cleanup signatures and deprecate methods in `PopupHandler` 2Gregory.Shrago
(cherry picked from commit db3d694a16f5884fd8ecd89b007d6e4c6b25b375) Change-Id: Idb3d694a16f5884fd8ecd89b007d6e4c6b25b375
2021-10-19[platform] tidying up notifications APIRoman Shevchenko
(cherry picked from commit 7545bd83b798aebabef687a6be2fc763800d8d94) Change-Id: I7545bd83b798aebabef687a6be2fc763800d8d94
2021-10-18Split up EditorUtilKun Shen
... to `EditorUtil` and `ReformatUtil`. This is to get rid of the circular dependency between `android/src/com/android/tools/idea/util/` and "android/src/org/jetbrains/android/uipreview/", which is for the next step to extract "uipreview" and the related out of `intellij.android.core` module. Here, we make `EditorUtil` sit with `AndroidEditorSettings` inside `uipreview` package. And now `uipreview` package depends on `util` package. Bug: 202967571 Test: n/a Change-Id: I9684d8bdbadc7aa3062797a6dec70125754ecf4b
2021-10-18Add lint to detect if motion layout is missing an idIsaac Chai
Bug: 157735162 Test: Manual test + unit test Change-Id: Iaa9d048bad286ca0d9b6464ba6689c28c28e72b1
2021-10-15deprecate ServiceManager.getService(project)Vladimir Krivosheev
(cherry picked from commit 3c69555f6b5223a691986f02eacd1e94d9ee0125) Change-Id: I3c69555f6b5223a691986f02eacd1e94d9ee0125
2021-10-15Sort lint libraries in the snapshots.Karima Ichou
This is to prepare for enabling V2 sync. The order of the libraries isn't necessarily the same in V2 and this is due to a difference in setting the android/module libraries in V2. Bug: N/A Test: Updated Change-Id: Ieb5d8201ccf7aaff5e589360d93e8b2fb377e823
2021-10-12[MPSS] Only dump holder modules with facetsBradley Smith
This hugely reduces the spam in the snapshots when running in module per source set. Bug: N/A Test: N/A Change-Id: I02b38a9d13d4535e3a46185b9ea29085eb810a8c
2021-10-11Clean up codeKun Shen
Here, `WrongThreadInterproceduralAction` and `CallGraphAction` are moved to `intellij.android.lint` module. Bug: n/a Test: n/a Change-Id: If8f530de53d9a8fa48034da6eb429950fdce3180