Skip to content

Commit

Permalink
Merge pull request #135 from RADAR-base/release-1.1.1
Browse files Browse the repository at this point in the history
Release 1.1.1
  • Loading branch information
blootsvoets authored Sep 27, 2023
2 parents 339d67f + 2df6b7c commit 049bfc2
Show file tree
Hide file tree
Showing 60 changed files with 882 additions and 961 deletions.
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ 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
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.0")
implementation("org.radarbase:radar-commons:1.1.1")
}
```

Expand Down Expand Up @@ -62,7 +62,7 @@ repositories {
}
dependencies {
implementation("org.radarbase:radar-commons-server:1.1.0")
implementation("org.radarbase:radar-commons-server:1.1.1")
}
```

Expand All @@ -75,7 +75,7 @@ repositories {
}
dependencies {
testImplementation("org.radarbase:radar-commons-testing:1.1.0")
testImplementation("org.radarbase:radar-commons-testing:1.1.1")
}
```

Expand All @@ -102,7 +102,7 @@ configurations.all {
}
dependencies {
implementation("org.radarbase:radar-commons:1.1.1-SNAPSHOT")
implementation("org.radarbase:radar-commons:1.1.2-SNAPSHOT")
}
```

Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.radarbase.gradle.plugin.radarPublishing
*/
plugins {
kotlin("plugin.serialization") version Versions.Plugins.kotlinSerialization apply false
kotlin("plugin.allopen") version Versions.Plugins.kotlinAllOpen apply false
id("com.github.davidmc24.gradle.plugin.avro") version Versions.Plugins.avro apply false
id("org.radarbase.radar-root-project")
id("org.radarbase.radar-dependency-management")
Expand Down
8 changes: 6 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
@Suppress("ConstPropertyName", "MemberVisibilityCanBePrivate")
object Versions {
const val project = "1.1.0"
const val project = "1.1.1"

object Plugins {
const val kotlin = "1.9.10"
const val kotlinSerialization = kotlin
const val kotlinAllOpen = kotlin
const val avro = "1.8.0"
const val gradle = "8.3"
}
Expand All @@ -12,7 +14,7 @@ object Versions {
const val slf4j = "2.0.9"
const val confluent = "7.5.0"
const val kafka = "7.5.0-ce"
const val avro = "1.11.2"
const val avro = "1.11.3"
const val jackson = "2.15.2"
const val okhttp = "4.11.0"
const val junit = "5.10.0"
Expand All @@ -23,4 +25,6 @@ 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 snappy = "1.1.10.5"
}
86 changes: 0 additions & 86 deletions gradle/publishing.gradle

This file was deleted.

8 changes: 4 additions & 4 deletions radar-commons-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
signing
}

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

Expand All @@ -23,11 +23,11 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
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.47.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.5.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")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ import org.gradle.api.tasks.bundling.Tar
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.kotlin.dsl.*
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getValue
import org.gradle.kotlin.dsl.hasPlugin
import org.gradle.kotlin.dsl.maven
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.repositories
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand Down Expand Up @@ -109,6 +120,10 @@ class RadarKotlinPlugin : Plugin<Project> {
useJUnitPlatform()
}

tasks.withType<Tar> {
compression = Compression.GZIP
archiveExtension.set("tar.gz")
}

tasks.register("downloadDependencies") {
doFirst {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ import org.gradle.api.publish.maven.MavenPomDeveloperSpec
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.bundling.Compression
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.bundling.Tar
import org.gradle.kotlin.dsl.*
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.attributes
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getByName
import org.gradle.kotlin.dsl.getValue
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.registering
import org.gradle.kotlin.dsl.the
import org.gradle.kotlin.dsl.withType
import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningExtension
import org.gradle.plugins.signing.SigningPlugin
Expand Down Expand Up @@ -52,11 +61,6 @@ class RadarPublishingPlugin : Plugin<Project> {
dependsOn(dokkaJavadoc)
}

tasks.withType<Tar> {
compression = Compression.GZIP
archiveExtension.set("tar.gz")
}

tasks.withType<Jar> {
manifest {
attributes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import kotlinx.coroutines.sync.Semaphore
import java.util.concurrent.atomic.AtomicReference
import kotlin.coroutines.coroutineContext
import kotlin.time.Duration
import kotlin.time.ExperimentalTime
import kotlin.time.TimeMark
import kotlin.time.TimeSource

Expand Down Expand Up @@ -207,17 +206,11 @@ open class CachedValue<T>(
cache.set(null)
}

sealed class CacheContents<T>
@ExperimentalTime
constructor(time: TimeMark?) {

@OptIn(ExperimentalTime::class)
sealed class CacheContents<T>(time: TimeMark?) {
constructor() : this(null)

@ExperimentalTime
protected val time: TimeMark = time ?: TimeSource.Monotonic.markNow()

@OptIn(ExperimentalTime::class)
open fun isExpired(age: Duration): Boolean = (time + age).hasPassedNow()

abstract fun getOrThrow(): T
Expand All @@ -229,27 +222,25 @@ open class CachedValue<T>(
internal constructor(
val exception: Throwable,
) : CacheContents<T>() {
override fun isExpired(age: Duration): Boolean = exception is CancellationException || super.isExpired(age)
override fun isExpired(age: Duration): Boolean = exception is CancellationException ||
super.isExpired(age)

override fun getOrThrow(): T = throw exception

@Suppress("UNCHECKED_CAST")
override suspend fun <R> map(transform: suspend (T) -> R): CacheContents<R> = this as CacheError<R>
}

@OptIn(ExperimentalTime::class)
class CacheValue<T>
@ExperimentalTime
internal constructor(
val value: T,
time: TimeMark?,
) : CacheContents<T>(time) {

@OptIn(ExperimentalTime::class)
constructor(value: T) : this(value, null)

override fun getOrThrow(): T = value

@OptIn(ExperimentalTime::class)
override suspend fun <R> map(transform: suspend (T) -> R): CacheContents<R> = try {
CacheValue(transform(value), time = time)
} catch (ex: Throwable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

package org.radarbase.kotlin.coroutines

import kotlinx.coroutines.*
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.consume
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.radarbase.ktor.auth

import io.ktor.client.request.*
import io.ktor.http.*
import io.ktor.client.request.HttpRequestBuilder
import io.ktor.http.HttpHeaders

fun HttpRequestBuilder.bearer(token: String) {
headers[HttpHeaders.Authorization] = "Bearer $token"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
package org.radarbase.ktor.auth

import io.ktor.client.*
import io.ktor.client.call.*
import io.ktor.client.plugins.auth.*
import io.ktor.client.plugins.auth.providers.*
import io.ktor.client.request.*
import io.ktor.client.request.forms.*
import io.ktor.client.statement.*
import io.ktor.http.*
import io.ktor.http.auth.*
import io.ktor.util.*
import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.plugins.auth.Auth
import io.ktor.client.plugins.auth.AuthProvider
import io.ktor.client.plugins.auth.providers.BearerAuthConfig
import io.ktor.client.plugins.auth.providers.BearerAuthProvider
import io.ktor.client.request.HttpRequestBuilder
import io.ktor.client.request.accept
import io.ktor.client.request.forms.submitForm
import io.ktor.client.request.headers
import io.ktor.client.statement.HttpResponse
import io.ktor.client.statement.bodyAsText
import io.ktor.http.ContentType
import io.ktor.http.HttpHeaders
import io.ktor.http.HttpStatusCode
import io.ktor.http.Parameters
import io.ktor.http.auth.AuthScheme
import io.ktor.http.auth.HttpAuthHeader
import io.ktor.http.isSuccess
import io.ktor.util.KtorDsl
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import org.slf4j.LoggerFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.*
import org.hamcrest.Matchers.equalTo
import org.hamcrest.Matchers.`is`
import org.hamcrest.Matchers.lessThan
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
Expand Down
Loading

0 comments on commit 049bfc2

Please sign in to comment.