File tree Expand file tree Collapse file tree 4 files changed +29
-1
lines changed
src/test/kotlin/no/thorbear/sonar/plugins/android Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff 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*
24351 . On a Maven project
@@ -35,4 +46,6 @@ This plugin started out as a copy of https://github.com/ofields/sonar-android wi
35463 . Clean up code
36474 . Check compatibility with newer versions of SonarQube
37485 . 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
Original file line number Diff line number Diff 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
2123compileKotlin {
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments