Skip to content

Commit efffc96

Browse files
committed
Updated readme, added a single test.
1 parent 675c68e commit efffc96

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ buildscript {
22
ext {
33
versions = [:]
44
versions.guava = '13.0.1'
5+
versions.junit = '4.12'
56
versions.kotlin = '1.3.21'
67
versions.lint = '22.2.0'
78
versions.simplexml = '2.7.1'

readme.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ This plugin started out as a copy of https://github.com/ofields/sonar-android wi
1919
* copy the jar (in the new generated `build/libs` folder) to the `<path_to_your_sonar_install>/extensions/plugins` folder in your SonarQube installation
2020
* restart sonar
2121

22+
## Upgrade Android Lint
23+
1. Change `versions.lint` in `build.gradle`
24+
2. Ensure `lint-rules-gen` compiles, `gradlew :lint-rules-gen:build`
25+
3. Run `lint-rules-gen` - `gradlew clean build` TODO can we also execute the built artifact from Gradle?
26+
4. Copy the generated XML to the correct location (from the root directory)
27+
- `cp lint-rules-gen/out/org/sonar/plugins/android/lint/android_lint_sonar_way.xml sonar-android-plugin/src/main/resources/org/sonar/plugins/android/lint/android_lint_sonar_way.xml`
28+
- `cp lint-rules-gen/out/org/sonar/plugins/android/lint/rules.xml sonar-android-plugin/src/main/resources/org/sonar/plugins/android/lint/rules.xml`
29+
5. go to `its/plugin/projects/SonarAndroidSample` and run `gradlew lint`
30+
6. Run the tests from the base directory `gradlew clean build`, fix as necessary.
31+
7. Add missing rules to: `sonar-android-plugin/src/main/resources/org/sonar/plugins/android/lint/java-model.xml`
32+
2233
## Running analysis:
2334
*TODO - I think this profile is automatically included if lint report path property is specified*
2435
1. On a Maven project
@@ -35,4 +46,6 @@ This plugin started out as a copy of https://github.com/ofields/sonar-android wi
3546
3. Clean up code
3647
4. Check compatibility with newer versions of SonarQube
3748
5. Check if we can detach from the SonarJava plugin to become standalone
38-
6. Create a sample project
49+
6. Create a sample project
50+
7. Integrate with a build server and SonarCloud
51+
8. Include the `lint-rules-gen` module

sonar-android-plugin/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ dependencies {
1616
implementation("org.codehaus.sonar-plugins.java:sonar-java-plugin:$versions.sonarJava") { transitive = false }
1717
implementation("org.codehaus.staxmate:staxmate:$versions.staxmate") { transitive = false }
1818
implementation "org.slf4j:slf4j-api:$versions.slf4j"
19+
20+
testImplementation "junit:junit:$versions.junit"
1921
}
2022

2123
compileKotlin {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package no.thorbear.sonar.plugins.android
2+
3+
import org.junit.Assert.assertEquals
4+
import org.junit.Test
5+
6+
class AndroidPluginTest {
7+
8+
@Test
9+
fun getExtensions() {
10+
assertEquals(5, AndroidPlugin().extensions.size)
11+
}
12+
}

0 commit comments

Comments
 (0)