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

Refactor OptionalDouble and OptionalLong #13

Merged
merged 6 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package co.raccoons.local.gradle.jacoco

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.testing.Test
import org.gradle.testing.jacoco.tasks.JacocoReport

private const val JACOCO_PLUGIN_ID = "jacoco"
Expand All @@ -20,14 +21,18 @@ class JacocoConfiguration private constructor(private val reportFormats: List<Ja

private fun enableReports(project: Project) {
project.tasks
.withType(JacocoReport::class.java)
.configureEach { jacocoReport ->
jacocoReport.dependsOn("test")
.withType(JacocoReport::class.java) { jacocoReport ->
jacocoReport.dependsOn(project.tasks.withType(Test::class.java))

for (format in this.reportFormats) {
format.subscribeTo(jacocoReport.reports)
}
}

project.tasks
.withType(Test::class.java) { test ->
test.finalizedBy(project.tasks.withType(JacocoReport::class.java))
}
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ class MavenPublishConfiguration(private val publication: Publication) : Plugin<P
}
}
}
}
}
25 changes: 8 additions & 17 deletions buildSrc/src/main/kotlin/co/raccoons/local/gradle/test/TestNG.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,19 @@ class TestNG private constructor(private val dependencyScope: DependencyScope) :
}

companion object {
fun newBuilder(): TestNgBuilder {
class Builder : TestNgBuilder {

private val dependencyScope = DependencyScope()
fun newBuilder() = Builder()

override fun addDependency(dependency: Dependency): Builder {
this.dependencyScope.add(dependency)
return this
}
class Builder {

override fun build() = TestNG(this.dependencyScope)
}
return Builder()
}

interface TestNgBuilder {
private val dependencyScope = DependencyScope()

fun addDependency(dependency: Dependency): TestNgBuilder
fun addDependency(dependency: Dependency): Builder {
this.dependencyScope.add(dependency)
return this
}

fun build(): TestNG
fun build() = TestNG(this.dependencyScope)
}

}

}
5 changes: 5 additions & 0 deletions lib/src/main/java/co/raccoons/meeko/Optional.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

/*
* @summary Refactored java.util.Optional
* @author Oleksii Kucheruk
*/
package co.raccoons.meeko;

import java.util.NoSuchElementException;
Expand Down
Loading