Skip to content

Release 1.1.2 #154

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

Merged
merged 20 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c7ccb17
Bump dev version
blootsvoets Sep 28, 2023
06de816
Add List<Flow<T>>.combine function
blootsvoets Oct 11, 2023
6c39236
Use proper interrupt support on IO
blootsvoets Oct 11, 2023
b3f6196
Bump org.jlleitschuh.gradle:ktlint-gradle from 11.6.0 to 12.0.3
dependabot[bot] Dec 12, 2023
802e201
Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.9.10 to 1.9.21
dependabot[bot] Nov 24, 2023
03d5a83
Bump org.jetbrains.dokka:dokka-gradle-plugin from 1.9.0 to 1.9.10
dependabot[bot] Oct 17, 2023
4c327a3
Bump org.jetbrains.dokka from 1.9.0 to 1.9.10
dependabot[bot] Oct 17, 2023
0adc9b3
Bump jvm from 1.9.0 to 1.9.21
dependabot[bot] Nov 24, 2023
a5eaab6
Bump com.github.ben-manes:gradle-versions-plugin from 0.48.0 to 0.50.0
dependabot[bot] Nov 20, 2023
07692c8
Merge pull request #147 from RADAR-base/dependabot-security-updates
Bdegraaf1234 Mar 7, 2024
339bebc
Fixed snyk test
blootsvoets Jul 3, 2023
67df87f
applied changes from joris' old branch
Bdegraaf1234 Mar 7, 2024
c21f0b0
manually match radar-commons-gradle to Versions.kt
Bdegraaf1234 Mar 7, 2024
57888ee
explicitly assign all dependency versions
Bdegraaf1234 Mar 7, 2024
1a12fe9
Merge pull request #148 from RADAR-base/snyk-security-updates
Bdegraaf1234 Mar 8, 2024
42dfa7d
bump version in README.md and Versions.kt
Bdegraaf1234 Mar 8, 2024
f7ff386
Replace Joris as publisher
Bdegraaf1234 Mar 8, 2024
dae7713
bump commonsCompress version to 1.26.0
Bdegraaf1234 Mar 8, 2024
3fd40eb
bump plugin version
Bdegraaf1234 Mar 8, 2024
4b7ef26
remove joris from CODEOWNERS
Bdegraaf1234 Mar 8, 2024
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
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{kt,kts}]
ktlint_standard_no-wildcard-imports = disabled

[*.md]
trim_trailing_whitespace = false

[*.{json,yaml,yml}]
indent_style = space
indent_size = 2
3 changes: 1 addition & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# These owners will be the default owners for everything in the repo.
# Unless a later match takes precedence, they will be requested for review when someone
# opens a pull request.
* @blootsvoets
testing/* @nivemaham @fnobilia
* @bdegraaf1234
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
}

dependencies {
implementation("org.radarbase:radar-commons:1.1.1")
implementation("org.radarbase:radar-commons:1.1.2")
}
```

Expand Down Expand Up @@ -62,7 +62,7 @@ repositories {
}

dependencies {
implementation("org.radarbase:radar-commons-server:1.1.1")
implementation("org.radarbase:radar-commons-server:1.1.2")
}
```

Expand All @@ -75,7 +75,7 @@ repositories {
}

dependencies {
testImplementation("org.radarbase:radar-commons-testing:1.1.1")
testImplementation("org.radarbase:radar-commons-testing:1.1.2")
}
```

Expand All @@ -102,7 +102,7 @@ configurations.all {
}

dependencies {
implementation("org.radarbase:radar-commons:1.1.2-SNAPSHOT")
implementation("org.radarbase:radar-commons:1.1.3-SNAPSHOT")
}
```

Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ subprojects {
githubUrl.set("https://github.com/$githubRepoName")
developers {
developer {
id.set("blootsvoets")
name.set("Joris Borgdorff")
email.set("joris@thehyve.nl")
id.set("bdegraaf1234")
name.set("Bastiaan de Graaf")
email.set("bastiaan@thehyve.nl")
organization.set("The Hyve")
}
developer {
Expand Down
1 change: 0 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ repositories {
mavenCentral()
}


tasks.withType<JavaCompile> {
sourceCompatibility = "17"
targetCompatibility = "17"
Expand Down
14 changes: 10 additions & 4 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
@Suppress("ConstPropertyName", "MemberVisibilityCanBePrivate")
object Versions {
const val project = "1.1.1"
const val project = "1.1.2"

object Plugins {
const val kotlin = "1.9.10"
const val licenseReport = "2.5"
const val kotlin = "1.9.21"
const val dokka = "1.9.10"
const val kotlinSerialization = kotlin
const val kotlinAllOpen = kotlin
const val avro = "1.8.0"
const val gradle = "8.3"
const val publishPlugin = "2.0.0-rc-1"
}

const val java = 11
const val java = 17
const val slf4j = "2.0.9"
const val confluent = "7.5.0"
const val kafka = "7.5.0-ce"
Expand All @@ -25,6 +28,9 @@ object Versions {
const val opencsv = "5.8"
const val ktor = "2.3.4"
const val coroutines = "1.7.3"
const val commonsCompress = "1.24.0"
const val commonsCompress = "1.26.0"
const val snappy = "1.1.10.5"
const val guava = "32.1.1-jre"
const val gradleVersionsPlugin = "0.50.0"
const val ktlint = "12.0.3"
}
70 changes: 56 additions & 14 deletions radar-commons-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`kotlin-dsl`
`java-gradle-plugin`
kotlin("jvm") version "1.9.0"
// Match to the versions in the bottom of this file
kotlin("jvm") version "1.9.21"
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1"
id("org.jetbrains.dokka") version "1.9.0"
id("org.jetbrains.dokka") version "1.9.10"
signing
}

version = "1.1.1"
version = "1.1.2"
group = "org.radarbase"
description = "RADAR-base common Gradle plugin setup"

Expand All @@ -23,12 +24,12 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.9.0")
implementation("com.github.ben-manes:gradle-versions-plugin:0.48.0")
implementation("io.github.gradle-nexus:publish-plugin:2.0.0-rc-1")
implementation("org.jlleitschuh.gradle:ktlint-gradle:11.6.0")
implementation("com.github.jk1.dependency-license-report:com.github.jk1.dependency-license-report.gradle.plugin:2.5")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Plugins.kotlin}")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${Versions.Plugins.dokka}")
implementation("com.github.ben-manes:gradle-versions-plugin:${Versions.gradleVersionsPlugin}")
implementation("io.github.gradle-nexus:publish-plugin:${Versions.Plugins.publishPlugin}")
implementation("org.jlleitschuh.gradle:ktlint-gradle:${Versions.ktlint}")
implementation("com.github.jk1.dependency-license-report:com.github.jk1.dependency-license-report.gradle.plugin:${Versions.Plugins.licenseReport}")
}

gradlePlugin {
Expand All @@ -53,11 +54,12 @@ gradlePlugin {
}

tasks.withType<JavaCompile> {
options.release.set(11)
options.release.set(Versions.java)
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
jvmTarget.set(JvmTarget.JVM_17)
languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9)
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9)
}
Expand Down Expand Up @@ -102,9 +104,9 @@ tasks.withType<GenerateMavenPom> {
}
developers {
developer {
id.set("blootsvoets")
name.set("Joris Borgdorff")
email.set("joris@thehyve.nl")
id.set("bdegraaf1234")
name.set("Bastiaan de Graaf")
email.set("bastiaan@thehyve.nl")
organization.set("The Hyve")
}
}
Expand Down Expand Up @@ -169,3 +171,43 @@ tasks.withType<Sign> {
tasks.withType<PublishToMavenRepository> {
dependsOn(tasks.withType<Sign>())
}

// Because this project is where all the required plugins get built, we need to add the dependencies separately here.
// They should be copied from the Versions.kt file directly to maintain consistency.
@Suppress("ConstPropertyName", "MemberVisibilityCanBePrivate")
object Versions {
const val project = "1.1.2"

object Plugins {
const val licenseReport = "2.5"
const val kotlin = "1.9.21"
const val dokka = "1.9.10"
const val kotlinSerialization = kotlin
const val kotlinAllOpen = kotlin
const val avro = "1.8.0"
const val gradle = "8.3"
const val publishPlugin = "2.0.0-rc-1"
}

const val java = 17
const val slf4j = "2.0.9"
const val confluent = "7.5.0"
const val kafka = "7.5.0-ce"
const val avro = "1.11.3"
const val jackson = "2.15.2"
const val okhttp = "4.11.0"
const val junit = "5.10.0"
const val mockito = "5.5.0"
const val mockitoKotlin = "5.1.0"
const val hamcrest = "2.2"
const val radarSchemas = "0.8.4"
const val opencsv = "5.8"
const val ktor = "2.3.4"
const val coroutines = "1.7.3"
const val commonsCompress = "1.26.0"
const val snappy = "1.1.10.5"
const val guava = "32.1.1-jre"
const val gradleVersionsPlugin = "0.50.0"
const val ktlint = "12.0.3"
}

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface RadarDependencyManagementExtension {
class RadarDependencyManagementPlugin : Plugin<Project> {
override fun apply(project: Project): Unit = with(project) {
val extension = extensions.create<RadarDependencyManagementExtension>("radarDependencies").apply {
regex.convention("(^[0-9,.v-]+(-r)?|RELEASE|FINAL|GA|-CE)$")
regex.convention("(^[0-9,.v-]+(-r)?|RELEASE|FINAL|GA|-CE|-JRE|-ANDROID)$")
rejectMajorVersionUpdates.convention(false)
}

Expand Down
2 changes: 1 addition & 1 deletion radar-commons-kotlin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ First of all, it contains a cache implementation to use with coroutines, with su
import java.io.IOException

val dirCache = CachedMap<String, FileInfo> {
withContext(Dispatchers.IO) {
runInterruptible(Dispatchers.IO) {
client.fetchDirectoryMap()
}
}
Expand Down
8 changes: 4 additions & 4 deletions radar-commons-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ description = "Library for Kotlin utility classes and functions"

dependencies {
api(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:${Versions.coroutines}"))
api("org.jetbrains.kotlinx:kotlinx-coroutines-core")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}")

api(platform("io.ktor:ktor-bom:${Versions.ktor}"))
api("io.ktor:ktor-client-auth")
implementation("io.ktor:ktor-client-content-negotiation")
implementation("io.ktor:ktor-serialization-kotlinx-json")
api("io.ktor:ktor-client-auth:${Versions.ktor}")
implementation("io.ktor:ktor-client-content-negotiation:${Versions.ktor}")
implementation("io.ktor:ktor-serialization-kotlinx-json:${Versions.ktor}")

testImplementation("org.hamcrest:hamcrest:${Versions.hamcrest}")
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.consume
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.runInterruptible
import kotlinx.coroutines.sync.Semaphore
import kotlinx.coroutines.withContext
import java.util.concurrent.Future
import java.util.concurrent.TimeUnit
import kotlin.coroutines.CoroutineContext
Expand Down Expand Up @@ -49,15 +49,13 @@ suspend fun <T> Future<T>.suspendGet(
}
}
try {
withContext(Dispatchers.IO) {
runInterruptible(Dispatchers.IO) {
if (duration != null) {
get(duration.inWholeMilliseconds, TimeUnit.MILLISECONDS)
} else {
get()
}
}
} catch (ex: InterruptedException) {
throw CancellationException("Future was interrupted", ex)
} finally {
channel.send(Unit)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package org.radarbase.kotlin.coroutines.flow

import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.zip

/**
* Convert a list of flows to one flow with a list of values. The list contains the latest value of
* each respective flow, in the same order as the original flows.
* each respective flow, in the same order as the original flows. One value is produced when all
* flows produce a new value.
*/
fun <T> List<Flow<T>>.zipAll(): Flow<List<T>> = when (val numberOfFlows = size) {
0 -> flowOf(listOf())
Expand All @@ -23,3 +25,12 @@ fun <T> List<Flow<T>>.zipAll(): Flow<List<T>> = when (val numberOfFlows = size)
fun <T> zipAll(
vararg flows: Flow<T>,
): Flow<List<T>> = flows.toList().zipAll()

/**
* Combine the latest values of the flows in a list to a single list.
*/
inline fun <reified T> List<Flow<T>>.combine(): Flow<List<T>> = when (size) {
0 -> flowOf(emptyList())
1 -> get(0).map { listOf(it) }
else -> combine(this) { it.toList() }
}
13 changes: 9 additions & 4 deletions radar-commons-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,23 @@ dependencies {

// For POJO classes and ConfigLoader
implementation(platform("com.fasterxml.jackson:jackson-bom:${Versions.jackson}"))
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
implementation("com.fasterxml.jackson.core:jackson-databind")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${Versions.jackson}")
implementation("com.fasterxml.jackson.core:jackson-databind:${Versions.jackson}")

api("org.apache.avro:avro:${Versions.avro}")
api("org.apache.avro:avro:${Versions.avro}") {
implementation("org.apache.commons:commons-compress:${Versions.commonsCompress}")
}

implementation("org.apache.kafka:kafka-clients:${Versions.kafka}") {
implementation("org.xerial.snappy:snappy-java:${Versions.snappy}")
}

testImplementation("org.mockito:mockito-core:${Versions.mockito}")
// Direct producer uses KafkaAvroSerializer if initialized
testImplementation("io.confluent:kafka-avro-serializer:${Versions.confluent}")

implementation("io.confluent:kafka-avro-serializer:${Versions.confluent}") {
runtimeOnly("com.google.guava:guava:${Versions.guava}")
}
testImplementation("org.radarbase:radar-schemas-commons:${Versions.radarSchemas}")
}

Expand Down
14 changes: 10 additions & 4 deletions radar-commons-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,26 @@ dependencies {
api(project(":radar-commons-server"))
api(project(":radar-commons-kotlin"))

api("org.apache.avro:avro:${Versions.avro}")
api("org.radarbase:radar-schemas-commons:${Versions.radarSchemas}")

implementation("com.opencsv:opencsv:${Versions.opencsv}")
implementation(platform("com.fasterxml.jackson:jackson-bom:${Versions.jackson}"))
implementation("com.fasterxml.jackson.core:jackson-databind")
implementation("com.fasterxml.jackson.core:jackson-databind:${Versions.jackson}")

implementation("org.apache.kafka:kafka-clients:${Versions.kafka}") {
implementation("org.xerial.snappy:snappy-java:${Versions.snappy}")
}
implementation("io.confluent:kafka-avro-serializer:${Versions.confluent}")

implementation("io.confluent:kafka-avro-serializer:${Versions.confluent}") {
runtimeOnly("com.google.guava:guava:${Versions.guava}")
}

api("org.apache.avro:avro:${Versions.avro}") {
implementation("org.apache.commons:commons-compress:${Versions.commonsCompress}")
}

implementation(platform("io.ktor:ktor-bom:${Versions.ktor}"))
implementation("io.ktor:ktor-serialization-kotlinx-json")
implementation("io.ktor:ktor-serialization-kotlinx-json:${Versions.ktor}")

applicationRuntimeOnly("org.slf4j:slf4j-simple:${Versions.slf4j}")

Expand Down
Loading