-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve relative csvFilePath relative to project
- Loading branch information
Abhijit Sarkar
authored and
Abhijit Sarkar
committed
May 16, 2021
1 parent
b2c202a
commit 90d68d9
Showing
9 changed files
with
203 additions
and
163 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
36 changes: 36 additions & 0 deletions
36
src/main/kotlin/com/asarkar/gradle/buildtimetracker/BuildTimeTrackerPluginExtension.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,36 @@ | ||
package com.asarkar.gradle.buildtimetracker | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.file.DirectoryProperty | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.reporting.ReportingExtension | ||
import java.time.Duration | ||
|
||
enum class BarPosition { | ||
LEADING, TRAILING | ||
} | ||
|
||
enum class Output { | ||
CONSOLE, CSV | ||
} | ||
|
||
open class BuildTimeTrackerPluginExtension(private val project: Project) { | ||
val barPosition: Property<BarPosition> = project.objects.property(BarPosition::class.java) | ||
.convention(Constants.DEFAULT_BAR_POSITION) | ||
val sort: Property<Boolean> = project.objects.property(Boolean::class.java) | ||
.convention(Constants.DEFAULT_SORT) | ||
val output: Property<Output> = project.objects.property(Output::class.java) | ||
.convention(Constants.DEFAULT_OUTPUT) | ||
val maxWidth: Property<Int> = project.objects.property(Int::class.java) | ||
.convention(Constants.DEFAULT_MAX_WIDTH) | ||
val minTaskDuration: Property<Duration> = project.objects.property(Duration::class.java) | ||
.convention(Duration.ofSeconds(Constants.DEFAULT_MIN_TASK_DURATION)) | ||
val showBars: Property<Boolean> = project.objects.property(Boolean::class.java) | ||
.convention(Constants.DEFAULT_SHOW_BARS) | ||
val reportsDir: DirectoryProperty = project.objects.directoryProperty() | ||
.convention(baseReportsDir.map { it.dir(Constants.PLUGIN_EXTENSION_NAME) }) | ||
|
||
private val baseReportsDir: DirectoryProperty | ||
get() = project.extensions.getByType(ReportingExtension::class.java) | ||
.baseDirectory | ||
} |
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
Oops, something went wrong.