Skip to content

Commit af20a35

Browse files
committed
Added dependency descriptions to the README and a note in each build.gradle to reference the README.
1 parent 439605d commit af20a35

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,32 @@ cd android-custom-lint-rules
3636
For Android Studio 3.x and above, use the sample in `android-studio-3`.
3737
If you are targeting Android Studio 2.x and older, use the sample in `android-studio-2`.
3838

39+
##### Lint Dependencies
40+
41+
When building your own rules, you will likely want to know which dependencies you should bring into your own project.
42+
The below descriptions of the dependencies included within this project serve to help you make that decision:
43+
44+
Source Dependencies
45+
46+
- **com.android.tools.lint:lint-api**: The most important one; it contains things like `LintClient`, the `Detector`
47+
base class, the `Issue` class, and everything else that Lint checks rely on in the Lint framework.
48+
- **com.android.tools.lint:lint-checks**: Contains the built-in checks that are developed internally. Also contains
49+
utilities that are sometimes useful for other lint checks, such as the `VersionChecks` class (which figures out whether
50+
a given UAST element is known to only be called at a given API level, either by surrounding `if >= SDK-version` checks or
51+
`if < SDK-version` early returns in the method).
52+
53+
Test Dependencies
54+
55+
- **com.android.tools.lint:lint-tests**: Contains useful utilities for writing unit tests for Lint checks,
56+
including the `LintDetectorTest` base class.
57+
- **com.android.tools:testutils**: It's unlikely that you need to depend on this directly. The test infrastructure
58+
depends on it indirectly though (the methods we use there were mostly for the older lint test infrastructure,
59+
not the newer one).
60+
- **com.android.tools.lint:lint**: Lint checks don't need to depend on this. It's a separate artifact used by tools
61+
that want to integrate lint with the command line, such as the Gradle integration of lint. This is where things like
62+
terminal output, HTML reporting, command line parsing etc is handled.
63+
64+
3965
Support
4066
-------
4167

android-studio-2/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ ext {
2626
}
2727

2828
dependencies {
29+
// For a description of the below dependencies, see the main project README
2930
compile "com.android.tools.lint:lint-api:$lintVersion"
3031
compile "com.android.tools.lint:lint-checks:$lintVersion"
3132
testCompile "junit:junit:4.11"

android-studio-3/checks/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
apply plugin: 'java-library'
22

33
dependencies {
4+
// For a description of the below dependencies, see the main project README
45
compileOnly "com.android.tools.lint:lint-api:$lintVersion"
56
compileOnly "com.android.tools.lint:lint-checks:$lintVersion"
67
testCompile "junit:junit:4.12"

0 commit comments

Comments
 (0)