-
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
Kotlin plugin #111
Changes from 8 commits
4e47bd4
4e4b620
347baae
e83afd1
f3e92cc
8395796
1a37684
d38bc21
06e8a73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
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.ReportScanningTool; | ||
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(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -737,7 +737,17 @@ public void shouldFindAllJavaIssues() { | |
shouldFindIssuesOfTool(2 + 1 + 1 + 2, new Java(), "javac.txt", "gradle.java.log", "ant-javac.txt", "hpi.txt"); | ||
} | ||
|
||
/** Runs the CssLint parser on an output file that contains 51 issues. */ | ||
/** | ||
* Runs the Kotlin parser on several output files that contain 4 issues. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. contains 1 issue There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where do I upload the logo and do we want only a logo or a log and text with it ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logos are in https://github.com/jenkinsci/warnings-ng-plugin/tree/master/src/main/webapp/icons. Please add a line that references the license somehow in the License.txt file. You can have a look at the https://github.com/jenkinsci/warnings-ng-plugin/blob/master/src/main/java/io/jenkins/plugins/analysis/warnings/AndroidLint.java to see how icons are used. If everything is working correctly you will see the result in https://github.com/jenkinsci/warnings-ng-plugin/blob/master/SUPPORTED-FORMATS.md (after running the |
||
*/ | ||
@Test | ||
public void shouldFindAllKotlinIssues() { | ||
shouldFindIssuesOfTool(1, new Kotlin(), "kotlin.txt"); | ||
} | ||
|
||
/** | ||
* Runs the CssLint parser on an output file that contains 51 issues. | ||
*/ | ||
@Test | ||
public void shouldFindAllCssLintIssues() { | ||
shouldFindIssuesOfTool(51, new CssLint(), "csslint.xml"); | ||
|
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) $ |
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