Skip to content

Adding dependency descriptions #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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