Skip to content

Commit

Permalink
Fixed #200, #202, prepared new release
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilles Grousset committed Feb 28, 2019
1 parent f148bbb commit 42831ea
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# _SonarQube Plugin for Swift_ Changelog

## v0.4.4
- Fixed [java.lang.IllegalArgumentException: Component can't be null](https://github.com/Backelite/sonar-swift/issues/202)
- Fixed [NPE on CoberturaReportParser line 98](https://github.com/Backelite/sonar-swift/issues/200)

## v0.4.3
- Added support for SonarQube 7.3

Expand Down
2 changes: 1 addition & 1 deletion commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<artifactId>backelite-swift</artifactId>
<groupId>com.backelite.sonarqube</groupId>
<version>0.4.3</version>
<version>0.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions objclang/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<artifactId>backelite-swift</artifactId>
<groupId>com.backelite.sonarqube</groupId>
<version>0.4.3</version>
<version>0.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -37,7 +37,7 @@
<dependency>
<groupId>com.backelite.sonarqube</groupId>
<artifactId>commons</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,24 @@ private void collectFileViolations(String filePath, NodeList nodeList) {
FilePredicate fp = context.fileSystem().predicates().hasAbsolutePath(file.getAbsolutePath());
if(!context.fileSystem().hasFiles(fp)){
LOGGER.warn("file not included in sonar {}", filePath);
}
InputFile inputFile = context.fileSystem().inputFile(fp);
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
NewIssueLocation dil = new DefaultIssueLocation()
.on(inputFile)
.at(inputFile.selectLine(Integer.valueOf(element.getAttribute(LINE))))
.message(element.getTextContent());
context.newIssue()
.forRule(RuleKey.of(OCLintRulesDefinition.REPOSITORY_KEY, element.getAttribute(RULE)))
.at(dil)
.save();
} else {
InputFile inputFile = context.fileSystem().inputFile(fp);
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
NewIssueLocation dil = new DefaultIssueLocation()
.on(inputFile)
.at(inputFile.selectLine(Integer.valueOf(element.getAttribute(LINE))))
.message(element.getTextContent());
context.newIssue()
.forRule(RuleKey.of(OCLintRulesDefinition.REPOSITORY_KEY, element.getAttribute(RULE)))
.at(dil)
.save();
}
}
}


}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<groupId>com.backelite.sonarqube</groupId>
<artifactId>backelite-swift</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>

<packaging>pom</packaging>

Expand Down
8 changes: 4 additions & 4 deletions sonar-swift-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<parent>
<groupId>com.backelite.sonarqube</groupId>
<artifactId>backelite-swift</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>
</parent>

<groupId>com.backelite.sonarqube</groupId>
<artifactId>backelite-sonar-swift-plugin</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>

<packaging>sonar-plugin</packaging>

Expand All @@ -40,12 +40,12 @@
<dependency>
<groupId>com.backelite.sonarqube</groupId>
<artifactId>swift-lang</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>
</dependency>
<dependency>
<groupId>com.backelite.sonarqube</groupId>
<artifactId>objc-lang</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ private void collectClassMeasures(NodeList nodeList) {

private void collectFileData(String filePath, NodeList nodeList) {
InputFile resource = getFile(filePath);
LOGGER.info("Collect file data: {}",resource.toString());
if (resource != null) {
LOGGER.info("Collect file data: {}",resource.toString());
boolean lineAdded = false;
NewCoverage coverage = context.newCoverage();
coverage.onFile(resource);
Expand Down
4 changes: 2 additions & 2 deletions swiftlang/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<artifactId>backelite-swift</artifactId>
<groupId>com.backelite.sonarqube</groupId>
<version>0.4.3</version>
<version>0.4.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -36,7 +36,7 @@
<dependency>
<groupId>com.backelite.sonarqube</groupId>
<artifactId>commons</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 42831ea

Please sign in to comment.