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

Release 1.0.1 #123

Closed
wants to merge 6 commits into from
Closed
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
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ jobs:

# Compile code
- name: Compile code
run: ./gradlew assemble
run: ./gradlew assemble collectLicenses

# Upload it to GitHub
- name: Upload to GitHub
uses: AButler/upload-release-assets@v2.0
uses: AButler/upload-release-assets@v2.0.2
with:
files: 'radar-commons*/build/libs/*'
files: 'radar-commons*/build/libs/*;radar-commons*/build/reports/*.tar.gz'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install gpg secret key
Expand Down
10 changes: 10 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JAVA-ORGJETBRAINSKOTLIN-2393744:
- '*':
reason: Not using createTempDir in Kotlin
expires: 2024-12-02T10:06:59.964Z
created: 2023-07-03T10:06:59.968Z
patch: {}
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.0.0")
implementation("org.radarbase:radar-commons:1.0.1")
}
```

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

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

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

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

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

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

Expand Down
24 changes: 13 additions & 11 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
object Versions {
const val project = "1.0.0"
const val project = "1.0.1"

object Plugins {
const val kotlin = "1.8.21"
const val kotlin = "1.8.22"
const val kotlinSerialization = kotlin
const val avro = "1.7.0"
const val avro = "1.7.1"
}

const val java = 11
const val slf4j = "2.0.7"
const val confluent = "7.3.2"
const val kafka = "7.3.2-ce"
const val confluent = "7.4.0"
const val kafka = "7.4.0-ce"
const val snappy = "1.1.10.1"
const val guava = "32.1.1-jre"
const val avro = "1.11.1"
const val jackson = "2.15.0"
const val jackson = "2.15.2"
const val okhttp = "4.11.0"
const val junit = "5.9.3"
const val mockito = "5.3.1"
const val mockitoKotlin = "4.1.0"
const val mockito = "5.4.0"
const val mockitoKotlin = "5.0.0"
const val hamcrest = "2.2"
const val radarSchemas = "0.8.2"
const val radarSchemas = "0.8.4"
const val opencsv = "5.7.1"
const val ktor = "2.3.0"
const val coroutines = "1.6.4"
const val ktor = "2.3.2"
const val coroutines = "1.7.2"
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
11 changes: 6 additions & 5 deletions radar-commons-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
`maven-publish`
}

version = "1.0.0"
version = "1.0.1"
group = "org.radarbase"
description = "RADAR common Gradle plugins"

Expand All @@ -17,11 +17,12 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.8.10")
implementation("com.github.ben-manes:gradle-versions-plugin:0.46.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.8.20")
implementation("com.github.ben-manes:gradle-versions-plugin:0.47.0")
implementation("io.github.gradle-nexus:publish-plugin:1.3.0")
implementation("org.jlleitschuh.gradle:ktlint-gradle:11.3.2")
implementation("org.jlleitschuh.gradle:ktlint-gradle:11.4.2")
implementation("com.github.jk1.dependency-license-report:com.github.jk1.dependency-license-report.gradle.plugin:2.5")
}

gradlePlugin {
Expand Down
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package org.radarbase.gradle.plugin

import com.github.jk1.license.LicenseReportPlugin
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.ApplicationPlugin
import org.gradle.api.plugins.JavaApplication
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.bundling.Compression
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
Expand All @@ -23,6 +26,7 @@ fun Project.radarKotlin(configure: RadarKotlinExtension.() -> Unit) {
interface RadarKotlinExtension {
val javaVersion: Property<Int>
val kotlinVersion: Property<String>
val kotlinApiVersion: Property<String>
val junitVersion: Property<String>
val log4j2Version: Property<String>
val slf4jVersion: Property<String>
Expand All @@ -34,6 +38,7 @@ class RadarKotlinPlugin : Plugin<Project> {
val extension = extensions.create<RadarKotlinExtension>("radarKotlin").apply {
javaVersion.convention(Versions.java)
kotlinVersion.convention(Versions.kotlin)
kotlinApiVersion.convention("")
junitVersion.convention(Versions.junit)
ktlintVersion.convention(Versions.ktlint)
slf4jVersion.convention(Versions.ktlint)
Expand Down Expand Up @@ -67,17 +72,21 @@ class RadarKotlinPlugin : Plugin<Project> {

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(extension.javaVersion.map { JvmTarget.fromTarget(it.toString()) })
val kotlinVersion = extension.kotlinVersion.map { version ->
KotlinVersion.fromVersion(
version
.splitToSequence('.')
.take(2)
.joinToString(separator = "."),
)
}
apiVersion.set(kotlinVersion)
languageVersion.set(kotlinVersion)
jvmTarget.set(
extension.javaVersion.map { JvmTarget.fromTarget(it.toString()) }
)
apiVersion.set(
extension.kotlinApiVersion.zip(extension.kotlinVersion) { apiVersion, kotlinVersion ->
if (apiVersion.isNotEmpty()) {
KotlinVersion.fromVersion(apiVersion)
} else {
kotlinVersion.toKotlinVersion()
}
}
)
languageVersion.set(
extension.kotlinVersion.map { it.toKotlinVersion() }
)
}
}

Expand Down Expand Up @@ -117,6 +126,19 @@ class RadarKotlinPlugin : Plugin<Project> {
}
}

apply<LicenseReportPlugin>()

tasks.register<Tar>("collectLicenses") {
from(
fileTree("$buildDir/reports/dependency-license"),
rootDir.resolve("LICENSE"),
)
compression = Compression.GZIP
destinationDirectory.set(file("$buildDir/reports"))
archiveBaseName.set("${project.name}-dependency-license")
dependsOn(tasks["generateLicenseReport"])
}

afterEvaluate {
if (extension.slf4jVersion.isPresent) {
dependencies {
Expand Down Expand Up @@ -164,4 +186,12 @@ class RadarKotlinPlugin : Plugin<Project> {
resolutionStrategy.cacheChangingModulesFor(0, "SECONDS")
}
}

companion object {
fun String.toKotlinVersion() = KotlinVersion.fromVersion(
splitToSequence('.')
.take(2)
.joinToString(separator = "."),
)
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.radarbase.gradle.plugin

object Versions {
const val wrapper = "8.1.1"
const val kotlin = "1.8.21"
const val ktlint = "0.48.2"
const val wrapper = "8.2"
const val kotlin = "1.8.22"
const val ktlint = "0.49.1"
const val java = 11
const val junit = "5.9.3"
}
2 changes: 1 addition & 1 deletion radar-commons-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ dependencies {
implementation("io.ktor:ktor-client-content-negotiation")
implementation("io.ktor:ktor-serialization-kotlinx-json")

testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.hamcrest:hamcrest:${Versions.hamcrest}")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package org.radarbase.kotlin.util

fun String?.removeSensitive(): String = if (this == null) "null" else "***"
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.radarbase.ktor.auth

import org.radarbase.kotlin.util.removeSensitive

data class ClientCredentialsConfig(
val tokenUrl: String,
val clientId: String? = null,
Expand All @@ -21,4 +23,7 @@ data class ClientCredentialsConfig(
}
return result
}

override fun toString(): String =
"ClientCredentialsConfig(tokenUrl='$tokenUrl', clientId=$clientId, clientSecret=${clientSecret.removeSensitive()})"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ 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.plugins.contentnegotiation.*
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.serialization.kotlinx.json.*
import io.ktor.util.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
Expand Down
8 changes: 7 additions & 1 deletion radar-commons-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ dependencies {

api("org.apache.avro:avro:${Versions.avro}")

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

testImplementation("org.mockito:mockito-core:${Versions.mockito}")
// Direct producer uses KafkaAvroSerializer if initialized
Expand Down
13 changes: 11 additions & 2 deletions radar-commons-testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,17 @@ dependencies {
implementation(platform("com.fasterxml.jackson:jackson-bom:${Versions.jackson}"))
implementation("com.fasterxml.jackson.core:jackson-databind")

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

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

implementation(platform("io.ktor:ktor-bom:${Versions.ktor}"))
implementation("io.ktor:ktor-serialization-kotlinx-json")
Expand Down
4 changes: 3 additions & 1 deletion radar-commons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ repositories {

// In this section you declare the dependencies for your production and test code
dependencies {
api("org.apache.avro:avro:${Versions.avro}")
api("org.apache.avro:avro:${Versions.avro}") {
runtimeOnly("com.fasterxml.jackson.core:jackson-databind:${Versions.jackson}")
}
api(kotlin("reflect"))

implementation(project(":radar-commons-kotlin"))
Expand Down
13 changes: 4 additions & 9 deletions radar-commons/src/main/java/org/radarbase/data/Record.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ package org.radarbase.data
/**
* A single data record.
*
* @param <K> key type
* @param <V> value type
</V></K> */
class Record<K, V>
/**
* Single record, with current time as time added.
* @param key key
* @param value value
*/(val key: K, val value: V)
* @param K key type
* @param V value type
*/
class Record<K, V>(val key: K, val value: V)
Loading