-
-
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.
Merge pull request #25 from asarkar/3.0.x
closes #22; support for output to CSV file
- Loading branch information
Showing
17 changed files
with
715 additions
and
492 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "Close stale issues and PRs" | ||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v3 | ||
with: | ||
stale-issue-message: "This issue is stale and will be closed in 5 days." | ||
stale-pr-message: "This PR is stale and will be closed in 5 days." | ||
days-before-stale: 30 | ||
days-before-close: 5 | ||
any-of-labels: "waiting-feedback" | ||
exempt-all-milestones: true | ||
debug-only: false | ||
enable-statistics: true |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
30 changes: 7 additions & 23 deletions
30
.../asarkar/gradle/BuildTimeTrackerPlugin.kt → ...uildtimetracker/BuildTimeTrackerPlugin.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
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 | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/asarkar/gradle/buildtimetracker/Constants.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,14 @@ | ||
package com.asarkar.gradle.buildtimetracker | ||
|
||
object Constants { | ||
const val PLUGIN_EXTENSION_NAME = "buildTimeTracker" | ||
const val EXTRA_EXTENSION_NAME = "extra" | ||
const val LOGGER_KEY = "logger" | ||
val DEFAULT_BAR_POSITION = BarPosition.TRAILING | ||
const val DEFAULT_SORT = false | ||
val DEFAULT_OUTPUT = Output.CONSOLE | ||
const val DEFAULT_MAX_WIDTH = 80 | ||
const val DEFAULT_MIN_TASK_DURATION = 1L | ||
const val DEFAULT_SHOW_BARS = true | ||
const val CSV_FILENAME = "build.csv" | ||
} |
Oops, something went wrong.