Skip to content

Commit

Permalink
Fix #12: Compilation failure on Java 8
Browse files Browse the repository at this point in the history
Fixes #12: Compilation failure on Java 8
  • Loading branch information
asarkar authored Jul 31, 2020
2 parents 5e85374 + ef7bce8 commit 6d9fc09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
java-version: 8

- name: Build
run: ./gradlew build
run: ./gradlew clean build
continue-on-error: true

- name: Test report
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/org/asarkar/gradle/TimingRecorder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TimingRecorder(val ext: BuildTimeTrackerPluginExtension) : TaskExecutionLi
}

override fun afterExecute(task: Task, state: TaskState) {
val duration = Duration.between(taskStarted, Instant.now()).toSeconds()
val duration = Duration.between(taskStarted, Instant.now()).seconds
if (duration >= ext.minTaskDuration.seconds) {
taskDurations.add(task.path to duration)
}
Expand All @@ -36,11 +36,11 @@ class TimingRecorder(val ext: BuildTimeTrackerPluginExtension) : TaskExecutionLi
)
(extra[Constants.LOGGER_KEY] as Logger).lifecycle(
"All tasks completed within the minimum threshold: {}s, no build summary to show",
ext.minTaskDuration.toSeconds()
ext.minTaskDuration.seconds
)
return
}
val buildDuration = Duration.between(buildStarted, Instant.now()).toSeconds()
val buildDuration = Duration.between(buildStarted, Instant.now()).seconds
if (ext.sort) {
taskDurations.sortBy { -it.second }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BuildTimeTrackerPluginFunctionalTest {
""".trimIndent())
}

println(Files.readString(buildFile))
println(buildFile.toFile().readText())

val result = GradleRunner.create()
.withProjectDir(buildFile.parent.toFile())
Expand Down

0 comments on commit 6d9fc09

Please sign in to comment.