This repository has been archived by the owner on Feb 2, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add report support for KotlinCompile tasks (#34)
* Add report support for KotlinCompile tasks * Update README.md Co-authored-by: M Schalk <[email protected]>
- Loading branch information
Showing
12 changed files
with
88 additions
and
75 deletions.
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
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
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
11 changes: 0 additions & 11 deletions
11
src/main/kotlin/io/github/detekt/gradle/extensions/CustomDetektReport.kt
This file was deleted.
Oops, something went wrong.
19 changes: 8 additions & 11 deletions
19
src/main/kotlin/io/github/detekt/gradle/extensions/DetektReport.kt
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
package io.github.detekt.gradle.extensions | ||
|
||
import java.io.File | ||
|
||
class DetektReport(val type: DetektReportType) { | ||
|
||
var enabled: Boolean? = null | ||
|
||
var destination: File? = null | ||
|
||
override fun toString(): String { | ||
return "DetektReport(type='$type', enabled=$enabled, destination=$destination)" | ||
} | ||
import org.gradle.api.file.RegularFileProperty | ||
import org.gradle.api.model.ObjectFactory | ||
import org.gradle.api.provider.Property | ||
import javax.inject.Inject | ||
|
||
open class DetektReport @Inject constructor(val name: String, objects: ObjectFactory) { | ||
val enabled: Property<Boolean> = objects.property(Boolean::class.java) | ||
val destination: RegularFileProperty = objects.fileProperty() | ||
} |
12 changes: 0 additions & 12 deletions
12
src/main/kotlin/io/github/detekt/gradle/extensions/DetektReportType.kt
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
src/main/kotlin/io/github/detekt/gradle/extensions/DetektReports.kt
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/io/github/detekt/gradle/extensions/KotlinCompileTaskDetektExtension.kt
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,17 @@ | ||
package io.github.detekt.gradle.extensions | ||
|
||
import org.gradle.api.Project | ||
|
||
open class KotlinCompileTaskDetektExtension(project: Project) { | ||
val reports = project.container(DetektReport::class.java) | ||
|
||
init { | ||
reports.create("xml") | ||
reports.create("txt") | ||
reports.create("html") | ||
} | ||
|
||
fun getXml() = reports.getByName("xml") | ||
fun getHtml() = reports.getByName("html") | ||
fun getTxt() = reports.getByName("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