Skip to content

Commit

Permalink
Merge branch 'main' into openssl-1.1.1u
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethshackleton authored Jul 15, 2023
2 parents 2c262b4 + 135715a commit 890c2cf
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 52 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@ jobs:
path: |
**/build/reports/detekt
- name: 'Unit tests'
run: ./gradlew :selekt-android:testDebugUnitTest :selekt-java:test :koverMergedHtmlReport ${{ env.SCAN }}
run: ./gradlew :selekt-android:testDebugUnitTest :selekt-java:test :koverHtmlReport ${{ env.SCAN }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: 'Unit test and coverage reports'
path: |
build/reports/kover/merged/html
build/reports/kover/html
selekt-android/build/reports/tests/testDebugUnitTest
selekt-java/build/reports/tests/test
- name: 'Build Selekt'
run: |
./gradlew assembleRelease ${{ env.SCAN }}
- name: 'Verify coverage'
run:
./gradlew :koverMergedVerify
./gradlew :koverVerify
- name: 'Build others'
run: |
./gradlew assembleAndroidTest :AndroidCLI:assembleDebug :selekt-android-lint:assemble jmhClasses
Expand Down
50 changes: 21 additions & 29 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import java.net.URL
import java.time.Duration
import kotlinx.kover.api.VerificationValueType
import kotlinx.kover.gradle.plugin.dsl.AggregationType
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.gradle.DokkaTask
Expand Down Expand Up @@ -60,6 +60,9 @@ nexusPublishing {
}

dependencies {
kover(projects.selektAndroid)
kover(projects.selektApi)
kover(projects.selektJava)
ktlint("com.pinterest:ktlint:${Versions.KTLINT}")
}

Expand Down Expand Up @@ -200,41 +203,30 @@ allprojects {
}
}

koverMerged {
enable()
filters {
classes {
excludes.addAll(listOf(
"*.BuildConfig"
))
}
projects {
excludes.addAll(projects.run {
listOf(
androidCLI,
androidLibBenchmark,
openSSL,
selektAndroidLint,
selektAndroidSqlcipher,
selektric,
selektSqlite3
).map { it.name }
} + rootProject.name)
koverReport {
defaults {
filters {
excludes {
classes("*Test*")
packages(listOf(
"*.benchamrks",
"*_generated"
))
}
}
}
verify {
rule {
name = "Minimal coverage"
bound {
minValue = 97
valueType = VerificationValueType.COVERED_PERCENTAGE
verify {
rule("Minimal coverage") {
bound {
minValue = 97
aggregation = AggregationType.COVERED_PERCENTAGE
}
}
}
}
}

tasks.getByName("check") {
dependsOn("koverMergedVerify")
dependsOn("koverVerify")
}

idea.project.settings {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ enum class Versions(
KOTLIN("1.8.22", URL("https://github.com/JetBrains/kotlin")),
KOTLIN_TEST(KOTLIN.version, URL("https://github.com/JetBrains/kotlin")),
KOTLINX_COROUTINES("1.6.4", URL("https://github.com/Kotlin/kotlinx.coroutines")),
KOTLINX_KOVER("0.6.1", URL("https://github.com/Kotlin/kotlinx-kover")),
KOTLINX_KOVER("0.7.2", URL("https://github.com/Kotlin/kotlinx-kover")),
KTLINT("0.45.2", URL("https://github.com/pinterest/ktlint")),
KTLINT_GRADLE_PLUGIN("11.0.0", URL("https://github.com/JLLeitschuh/ktlint-gradle")),
MOCKITO("5.3.0", URL("https://github.com/mockito/mockito")),
Expand Down
1 change: 0 additions & 1 deletion selekt-android-sqlcipher/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ plugins {
id("com.android.library")
`maven-publish`
signing
id("org.jetbrains.kotlinx.kover")
}

repositories {
Expand Down
17 changes: 11 additions & 6 deletions selekt-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

import kotlinx.kover.api.KoverTaskExtension

plugins {
id("com.android.library")
id("kotlin-android")
Expand Down Expand Up @@ -76,10 +74,17 @@ dependencies {
testRuntimeOnly("org.robolectric:android-all:${Versions.ROBOLECTRIC_ANDROID_ALL}")
}

tasks.withType<Test>().configureEach {
if (!name.contains("debug", ignoreCase = true)) {
extensions.configure<KoverTaskExtension> {
isDisabled.set(true)
koverReport {
defaults {
mergeWith("debug")
}
androidReports("debug") {
filters {
excludes {
classes(
"*.BuildConfig"
)
}
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions selekt-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

@file:Suppress("UnstableApiUsage")

import kotlinx.kover.api.KoverTaskExtension
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial

Expand All @@ -27,10 +26,10 @@ repositories {
plugins {
kotlin("jvm")
kotlin("kapt")
id("org.jetbrains.kotlinx.kover")
id("org.jetbrains.dokka")
`maven-publish`
signing
id("org.jetbrains.kotlinx.kover")
id("bb-jmh")
}

Expand Down Expand Up @@ -81,9 +80,6 @@ tasks.register<Test>("integrationTest") {
outputs.cacheIf { false }
dependsOn("buildHostSQLite")
shouldRunAfter("test")
extensions.configure<KoverTaskExtension> {
isDisabled.set(true)
}
}

tasks.register<Task>("buildHostSQLite") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Bloomberg Finance L.P.
* Copyright 2023 Bloomberg Finance L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,8 +14,14 @@
* limitations under the License.
*/

package com.bloomberg.selekt.pools
package com.bloomberg.selekt.pools.benchamrks

import com.bloomberg.selekt.pools.CommonObjectPool
import com.bloomberg.selekt.pools.IObjectFactory
import com.bloomberg.selekt.pools.IObjectPool
import com.bloomberg.selekt.pools.IPooledObject
import com.bloomberg.selekt.pools.PoolConfiguration
import com.bloomberg.selekt.pools.SingleObjectPool
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.delay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.bloomberg.selekt.pools
package com.bloomberg.selekt.pools.benchamrks

import java.util.concurrent.Executors

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Bloomberg Finance L.P.
* Copyright 2023 Bloomberg Finance L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,9 @@
* limitations under the License.
*/

package com.bloomberg.selekt.pools
package com.bloomberg.selekt.pools.benchamrks

import com.bloomberg.selekt.pools.IPooledObject

class PooledObject(val key: String = Thread.currentThread().id.toString()) : IPooledObject<String> {
override val isPrimary = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Bloomberg Finance L.P.
* Copyright 2023 Bloomberg Finance L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,8 +14,12 @@
* limitations under the License.
*/

package com.bloomberg.selekt.pools
package com.bloomberg.selekt.pools.benchamrks

import com.bloomberg.selekt.pools.IObjectFactory
import com.bloomberg.selekt.pools.IObjectPool
import com.bloomberg.selekt.pools.PoolConfiguration
import com.bloomberg.selekt.pools.SingleObjectPool
import org.openjdk.jmh.annotations.Benchmark
import org.openjdk.jmh.annotations.BenchmarkMode
import org.openjdk.jmh.annotations.Level
Expand Down

0 comments on commit 890c2cf

Please sign in to comment.