-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin plugin #111
Merged
Merged
Kotlin plugin #111
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4e47bd4
Added Kotlin.java to plugins
4e4b620
Checkstyle Changes
347baae
Added parser test
e83afd1
Added kotlin.txt and resolved codacy errors
f3e92cc
Added parser name in message.properties
8395796
Resolved codacy errors
1a37684
Changed file path for kotlin.txt
d38bc21
Fixed expected issues
06e8a73
Added license and icons
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/main/java/io/jenkins/plugins/analysis/warnings/Kotlin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package io.jenkins.plugins.analysis.warnings; | ||
|
||
import edu.hm.hafner.analysis.IssueParser; | ||
import edu.hm.hafner.analysis.parser.JavacParser; | ||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import hudson.Extension; | ||
import io.jenkins.plugins.analysis.core.model.IconLabelProvider; | ||
import io.jenkins.plugins.analysis.core.model.ReportScanningTool; | ||
import io.jenkins.plugins.analysis.core.model.StaticAnalysisLabelProvider; | ||
import org.jenkinsci.Symbol; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
/** | ||
* Provides a parser and customized messages for Kotlin errors and warnings. | ||
* | ||
* @author Sladyn Nunes | ||
*/ | ||
public class Kotlin extends ReportScanningTool { | ||
private static final long serialVersionUID = 2618843071479627178L; // To be added | ||
private static final String ID = "kotlin"; | ||
|
||
/** | ||
* Creates a new instance of {@link Kotlin}. | ||
*/ | ||
@DataBoundConstructor | ||
public Kotlin() { | ||
super(); | ||
// empty constructor required for stapler | ||
} | ||
|
||
@Override | ||
public IssueParser createParser() { | ||
return new JavacParser(); | ||
} | ||
|
||
/** | ||
* Descriptor for this static analysis tool. | ||
*/ | ||
@Symbol("kotlin") | ||
@Extension | ||
public static class Descriptor extends ReportScanningToolDescriptor { | ||
/** | ||
* Creates the descriptor instance. | ||
*/ | ||
public Descriptor() { | ||
super(ID); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getDisplayName() { | ||
return Messages.Warnings_Kotlin_ParserName(); | ||
} | ||
|
||
@Override | ||
public StaticAnalysisLabelProvider getLabelProvider() { | ||
return new IconLabelProvider(getId(), getDisplayName()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/test/resources/io/jenkins/plugins/analysis/warnings/kotlin.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[INFO] Scanning for projects... | ||
[INFO] | ||
[INFO] ----------< com.michaelrice.kotlin:hello-world-maven-example >---------- | ||
[INFO] Building hello-world-maven-example 1.0 | ||
[INFO] --------------------------------[ jar ]--------------------------------- | ||
[INFO] | ||
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hello-world-maven-example --- | ||
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! | ||
[INFO] skip non existing resourceDirectory /Users/hafner/Development/git/kotlin-maven-hello-world/src/main/resources | ||
[INFO] | ||
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hello-world-maven-example --- | ||
[INFO] Nothing to compile - all classes are up to date | ||
[INFO] | ||
[INFO] --- kotlin-maven-plugin:1.1.2:compile (compile) @ hello-world-maven-example --- | ||
[INFO] Kotlin Compiler version 1.1.2 | ||
[INFO] Compiling Kotlin sources from [/Users/hafner/Development/git/kotlin-maven-hello-world/src/main/kotlin] | ||
[INFO] Module name is hello-world-maven-example | ||
[WARNING] /Users/hafner/Development/git/kotlin-maven-hello-world/src/main/kotlin/hello.kt: (4, 11) Parameter 'args' is never used | ||
[INFO] | ||
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hello-world-maven-example --- | ||
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! | ||
[INFO] skip non existing resourceDirectory /Users/hafner/Development/git/kotlin-maven-hello-world/src/test/resources | ||
[INFO] | ||
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hello-world-maven-example --- | ||
[INFO] No sources to compile | ||
[INFO] | ||
[INFO] --- kotlin-maven-plugin:1.1.2:test-compile (test-compile) @ hello-world-maven-example --- | ||
[INFO] Kotlin Compiler version 1.1.2 | ||
[WARNING] No sources found skipping Kotlin compile | ||
[INFO] | ||
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ hello-world-maven-example --- | ||
[INFO] No tests to run. | ||
[INFO] | ||
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ hello-world-maven-example --- | ||
[INFO] Building jar: /Users/hafner/Development/git/kotlin-maven-hello-world/target/hello-world-maven-example-1.0.jar | ||
[INFO] | ||
[INFO] --- maven-assembly-plugin:2.6:single (make-assembly) @ hello-world-maven-example --- | ||
[INFO] Building jar: /Users/hafner/Development/git/kotlin-maven-hello-world/target/hello-world-maven-example-1.0-jar-with-dependencies.jar | ||
[INFO] ------------------------------------------------------------------------ | ||
[INFO] BUILD SUCCESS | ||
[INFO] ------------------------------------------------------------------------ | ||
[INFO] Total time: 3.100 s | ||
[INFO] Finished at: 2019-06-12T21:47:44+02:00 | ||
[INFO] ------------------------------------------------------------------------ | ||
~/D/g/kotlin-maven-hello-world (master|✚1) $ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an icon available that can be included in the warnings-plugin? (Check License).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we can use the android one, so NO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://kotlinlang.org/docs/reference/faq.html#where-can-i-get-an-hd-kotlin-logo