Skip to content

Commit

Permalink
Added dependency descriptions to the README and a note in each build.…
Browse files Browse the repository at this point in the history
…gradle to reference the README.
  • Loading branch information
btrautmann committed Mar 22, 2019
1 parent 439605d commit af20a35
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Expand Up @@ -36,6 +36,32 @@ cd android-custom-lint-rules
For Android Studio 3.x and above, use the sample in `android-studio-3`.
If you are targeting Android Studio 2.x and older, use the sample in `android-studio-2`.

##### Lint Dependencies

When building your own rules, you will likely want to know which dependencies you should bring into your own project.
The below descriptions of the dependencies included within this project serve to help you make that decision:

Source Dependencies

- **com.android.tools.lint:lint-api**: The most important one; it contains things like `LintClient`, the `Detector`
base class, the `Issue` class, and everything else that Lint checks rely on in the Lint framework.
- **com.android.tools.lint:lint-checks**: Contains the built-in checks that are developed internally. Also contains
utilities that are sometimes useful for other lint checks, such as the `VersionChecks` class (which figures out whether
a given UAST element is known to only be called at a given API level, either by surrounding `if >= SDK-version` checks or
`if < SDK-version` early returns in the method).

Test Dependencies

- **com.android.tools.lint:lint-tests**: Contains useful utilities for writing unit tests for Lint checks,
including the `LintDetectorTest` base class.
- **com.android.tools:testutils**: It's unlikely that you need to depend on this directly. The test infrastructure
depends on it indirectly though (the methods we use there were mostly for the older lint test infrastructure,
not the newer one).
- **com.android.tools.lint:lint**: Lint checks don't need to depend on this. It's a separate artifact used by tools
that want to integrate lint with the command line, such as the Gradle integration of lint. This is where things like
terminal output, HTML reporting, command line parsing etc is handled.


Support
-------

Expand Down
1 change: 1 addition & 0 deletions android-studio-2/build.gradle
Expand Up @@ -26,6 +26,7 @@ ext {
}

dependencies {
// For a description of the below dependencies, see the main project README
compile "com.android.tools.lint:lint-api:$lintVersion"
compile "com.android.tools.lint:lint-checks:$lintVersion"
testCompile "junit:junit:4.11"
Expand Down
1 change: 1 addition & 0 deletions android-studio-3/checks/build.gradle
@@ -1,6 +1,7 @@
apply plugin: 'java-library'

dependencies {
// For a description of the below dependencies, see the main project README
compileOnly "com.android.tools.lint:lint-api:$lintVersion"
compileOnly "com.android.tools.lint:lint-checks:$lintVersion"
testCompile "junit:junit:4.12"
Expand Down

0 comments on commit af20a35

Please sign in to comment.