Skip to content
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

Add kotlin dsl support #184

Merged
merged 6 commits into from
Nov 6, 2019
Merged

Conversation

devtribe
Copy link
Contributor

This fixes issue #163

@Reamer Reamer self-assigned this Oct 25, 2019
@Reamer Reamer self-requested a review October 25, 2019 13:24
Copy link
Member

@Reamer Reamer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get the example working with

14:07 $ git diff
diff --git a/examples/single-module-kotlin-dsl-gradle/build.gradle.kts b/examples/single-module-kotlin-dsl-gradle/build.gradle.kts
index 194a3e5..78e105a 100644
--- a/examples/single-module-kotlin-dsl-gradle/build.gradle.kts
+++ b/examples/single-module-kotlin-dsl-gradle/build.gradle.kts
@@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
 plugins {
     application
     kotlin("jvm") version "1.3.50"
-    id("org.sonarqube") version "2.6.2"
+    id("org.sonarqube") version "2.8"
     id("org.owasp.dependencycheck") version "5.2.2"
 }
 
@@ -31,9 +31,9 @@ dependencyCheck {
 
 sonarqube {
     properties {
-        property("sonar.dependencyCheck.reportPath", "build/reports/dependency-check-report.xml")
+        property("sonar.dependencyCheck.xmlReportPath", "build/reports/dependency-check-report.xml")
         property("sonar.dependencyCheck.htmlReportPath", "build/reports/dependency-check-report.html")
-        property("sonar.sources", "${properties["sonar.sources"].toString()},build.gradle.kts")
+        property("sonar.sources", "src,build.gradle.kts")
     }
 }

Can you run the example project without errors?

Without I get this error:

14:23 $ gradle sonarqube 

> Task :sonarqube FAILED
Invalid value of sonar.sources for single-module-kotlin-dsl-gradle

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sonarqube'.
> The folder '[/home/philipp/git/dependency-check-sonar-plugin/examples/single-module-kotlin-dsl-gradle/src/main/kotlin]' does not exist for 'single-module-kotlin-dsl-gradle' (base directory = /home/philipp/git/dependency-check-sonar-plugin/examples/single-module-kotlin-dsl-gradle)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
2 actionable tasks: 1 executed, 1 up-to-date

@devtribe
Copy link
Contributor Author

devtribe commented Nov 6, 2019

You're absolutely correct about your changes. Sorry for that, i just build it and don't check if the sonarqube tasks works. Thanks for your open Eye!

@devtribe devtribe requested a review from Reamer November 6, 2019 08:59
@Reamer Reamer merged commit e8399a7 into dependency-check:master Nov 6, 2019
@devtribe devtribe deleted the kotlin-dsl-support branch November 6, 2019 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants