Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 439605d

Browse files
authored
Merge pull request #10 from tnorbye/studio3-packaging
Add sample for Android Studio 3.x
2 parents 1355b0c + e01536a commit 439605d

File tree

27 files changed

+612
-22
lines changed

27 files changed

+612
-22
lines changed

‎README.md‎

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Custom Lint Rules
2-
============
2+
=================
33

44
The [Android `lint` tool](http://developer.android.com/tools/help/lint.html) is a static code
55
analysis tool that checks your Android project source files for potential bugs and optimization
@@ -31,31 +31,15 @@ git clone https://github.com/googlesamples/android-custom-lint-rules.git
3131
cd android-custom-lint-rules
3232
```
3333

34-
##### Build the validator
34+
##### Build the code
3535

36-
`./gradlew build`
37-
38-
##### Copy to the lint directory
39-
40-
`cp ./build/libs/android-custom-lint-rules.jar ~/.android/lint/`
41-
42-
##### Verify whether the issues are registered with lint
43-
44-
`lint --show MainActivityDetector`
45-
46-
##### Run lint
47-
48-
`./gradlew lint`
49-
50-
> Note: If you can't run `lint` directly, you may want to include android tools `PATH` in your
51-
`~/.bash_profile`.
52-
> (i.e. `PATH=$PATH:~/Library/Android/sdk/tools`)
53-
>
54-
> Then run `source ~/.bash_profile`.
36+
For Android Studio 3.x and above, use the sample in `android-studio-3`.
37+
If you are targeting Android Studio 2.x and older, use the sample in `android-studio-2`.
5538

5639
Support
5740
-------
5841

42+
- The "lint-dev" Google group: https://groups.google.com/forum/#!forum/lint-dev
5943
- Google+ Community: https://plus.google.com/communities/105153134372062985968
6044
- Stack Overflow: http://stackoverflow.com/questions/tagged/android
6145

‎android-studio-2/README.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
See README.md in the parent directory for general information.
2+
3+
Getting Started
4+
---------------
5+
6+
##### Fetch code
7+
8+
```
9+
git clone https://github.com/googlesamples/android-custom-lint-rules.git
10+
cd android-custom-lint-rules
11+
```
12+
13+
##### Build the validator
14+
15+
`./gradlew build`
16+
17+
##### Copy to the lint directory
18+
19+
`cp ./build/libs/android-custom-lint-rules.jar ~/.android/lint/`
20+
21+
##### Verify whether the issues are registered with lint
22+
23+
`lint --show MainActivityDetector`
24+
25+
##### Run lint
26+
27+
`./gradlew lint`
28+
29+
> Note: If you can't run `lint` directly, you may want to include android tools `PATH` in your
30+
`~/.bash_profile`.
31+
> (i.e. `PATH=$PATH:~/Library/Android/sdk/tools`)
32+
>
33+
> Then run `source ~/.bash_profile`.

‎build.gradle‎ renamed to ‎android-studio-2/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies {
3636

3737
jar {
3838
manifest {
39-
attributes("Lint-Registry-v2": "com.example.google.lint.MyIssueRegistry")
39+
attributes("Lint-Registry": "com.example.google.lint.MyIssueRegistry")
4040
}
4141
}
4242

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /