Skip to content

Commit 7f3cb73

Browse files
authored
Merge pull request #163 from insideapp-oss/feature/sonarcloud
SonarCloud integration
2 parents b860ffd + f63f447 commit 7f3cb73

File tree

5 files changed

+77
-45
lines changed

5 files changed

+77
-45
lines changed

.github/workflows/maven.yml

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,53 @@
11
name: CI
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
- develop
8-
pull_request:
9-
branches:
10-
- master
11-
- develop
3+
on: [push]
124

135
jobs:
146
build:
157
runs-on: ubuntu-latest
168
steps:
17-
- uses: actions/[email protected]
9+
10+
- name: Checkout
11+
uses: actions/[email protected]
12+
with:
13+
fetch-depth: 0
14+
1815
- name: Set up JDK 1.11
1916
uses: actions/[email protected]
2017
with:
2118
distribution: 'adopt'
2219
java-version: '11'
2320
check-latest: true
2421
cache: 'maven'
25-
- name: Build with Maven
22+
23+
- name: License Header Check
24+
run: mvn license:check
25+
26+
- name: Build
2627
run: mvn -B package --file pom.xml
27-
- name: Upload coverage to Codecov
28-
uses: codecov/[email protected]
29-
with:
30-
token: ${{ secrets.CODECOV_TOKEN }} #required
31-
- id: get-version
32-
name: Get maven project version
33-
uses: jactions/[email protected]
34-
- name: Upload plugin artifact
35-
uses: actions/[email protected]
28+
29+
- name: Analyze
30+
env:
31+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
35+
-Dsonar.login=$SONAR_TOKEN \
36+
-Dsonar.host.url=https://sonarcloud.io \
37+
-Dsonar.organization=insideapp-oss \
38+
-Dsonar.projectKey=insideapp-oss_sonar-flutter
39+
40+
- name: Read version
41+
run: echo "version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
42+
43+
- name: Upload snapshot release
44+
if: github.ref == 'refs/heads/develop'
45+
uses: svenstaro/upload-release-action@v2
3646
with:
37-
name: plugin
38-
path: sonar-flutter-plugin/target/sonar-flutter-plugin-${{ steps.get-version.outputs.version }}.jar
47+
repo_token: ${{ secrets.GITHUB_TOKEN }}
48+
file: ${{github.workspace}}/sonar-flutter-plugin/target/*.jar
49+
tag: ${{env.version}}
50+
overwrite: true
51+
body: "Snapshot release"
52+
file_glob: true
53+
prerelease: true

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
![CI](https://github.com/insideapp-oss/sonar-flutter/workflows/CI/badge.svg)
2-
![Coverage](https://codecov.io/gh/insideapp-oss/sonar-flutter/branch/master/graph/badge.svg)
2+
3+
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=insideapp-oss_sonar-flutter&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=insideapp-oss_sonar-flutter)
4+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=insideapp-oss_sonar-flutter&metric=coverage)](https://sonarcloud.io/summary/new_code?id=insideapp-oss_sonar-flutter)
5+
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=insideapp-oss_sonar-flutter&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=insideapp-oss_sonar-flutter)
6+
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=insideapp-oss_sonar-flutter&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=insideapp-oss_sonar-flutter)
7+
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=insideapp-oss_sonar-flutter&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=insideapp-oss_sonar-flutter)
8+
39

410
# SonarQube plugin for Flutter / Dart
511

@@ -11,14 +17,14 @@ A plugin to enable analysis of Dart and Flutter projects into SonarQube.
1117

1218
## Features
1319

14-
| Feature | Supported |
15-
|------------|------------------------|
16-
| Size | YES |
17-
| Issues | YES ([dartanalyzer](https://dart.dev/tools/dartanalyzer) rules)|
18-
| Tests | YES |
19-
| Coverage | YES |
20-
| Complexity | YES |
21-
| Syntax | YES |
20+
| Feature | Supported |
21+
|------------|-----------------------------------------------------------------|
22+
| Size | YES |
23+
| Issues | YES ([dartanalyzer](https://dart.dev/tools/dartanalyzer) rules) |
24+
| Tests | YES |
25+
| Coverage | YES |
26+
| Complexity | YES |
27+
| Syntax | YES |
2228

2329
The plugin is compatible with sonarQube 6.7+.
2430

dart-lang/src/main/js/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

pom.xml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
5-
<parent>
6-
<groupId>org.sonarsource.parent</groupId>
7-
<artifactId>parent</artifactId>
8-
<version>59.0.29</version>
9-
</parent>
104

115
<groupId>fr.insideapp.sonarqube</groupId>
126
<artifactId>sonar-flutter</artifactId>
@@ -49,24 +43,27 @@
4943
<developerConnection>scm:git:[email protected]:insideapp-oss/sonar-flutter.git</developerConnection>
5044
<url>https://github.com/insideapp-oss/sonar-flutter</url>
5145
<tag>HEAD</tag>
52-
</scm>
46+
</scm>
5347

5448
<properties>
5549
<license.owner>inside|app</license.owner>
5650
<license.title>SonarQube Flutter Plugin</license.title>
5751
<license.mailto>[email protected]</license.mailto>
5852

5953
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
54+
<jdk.min.version>1.9</jdk.min.version>
55+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
56+
57+
<sonar.version>6.7</sonar.version>
58+
<sonar-orchestrator.version>3.22.0.1791</sonar-orchestrator.version>
59+
<sonarlint.version>4.0.0.2052</sonarlint.version>
6060

6161
<assertj.version>3.5.2</assertj.version>
6262
<guava.version>17.0</guava.version>
6363
<junit.version>4.10</junit.version>
6464
<logback.version>1.0.13</logback.version>
6565
<mockito.version>1.9.0</mockito.version>
6666
<slf4j.version>1.7.21</slf4j.version>
67-
<sonar.version>6.7</sonar.version>
68-
<sonar-orchestrator.version>3.22.0.1791</sonar-orchestrator.version>
69-
<sonarlint.version>4.0.0.2052</sonarlint.version>
7067
<sslr.version>1.23</sslr.version>
7168
<sslr-squid-bridge.version>2.7.1.392</sslr-squid-bridge.version>
7269
<ant.version>1.6</ant.version>
@@ -75,6 +72,9 @@
7572
<jproc.version>2.2.3</jproc.version>
7673
<apache-commons.version>2.6</apache-commons.version>
7774

75+
<sonar.sources>src/main/java,src/main/js</sonar.sources>
76+
<sonar.exclusions>file:**/src/main/java/**/generated/**/*.java</sonar.exclusions>
77+
7878
</properties>
7979

8080
<dependencies>
@@ -196,17 +196,20 @@
196196
<plugin>
197197
<groupId>org.apache.maven.plugins</groupId>
198198
<artifactId>maven-compiler-plugin</artifactId>
199-
<version>3.6.2</version>
199+
<version>3.8.1</version>
200200
<configuration>
201-
<source>1.8</source>
202-
<target>1.8</target>
201+
<source>${jdk.min.version}</source>
202+
<target>${jdk.min.version}</target>
203+
<compilerArgs>
204+
<arg>-Xlint</arg>
205+
</compilerArgs>
203206
</configuration>
204207
</plugin>
205208

206209
<plugin>
207210
<groupId>org.jacoco</groupId>
208211
<artifactId>jacoco-maven-plugin</artifactId>
209-
<version>0.8.2</version>
212+
<version>0.8.5</version>
210213
<configuration>
211214
<excludes>
212215
<exclude>**/generated/**</exclude>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

0 commit comments

Comments
 (0)