Skip to content
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
16 changes: 10 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
build-and-publish:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: "Set Up JDK"
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: corretto
java-version: 17
Expand All @@ -26,13 +26,17 @@ jobs:
shell: bash

- name: "Decode GPG Key"
env:
RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
run: |
echo "${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}" > ~/.gradle/secring.gpg.b64
echo "$RING_FILE" > ~/.gradle/secring.gpg.b64
base64 --decode -i ~/.gradle/secring.gpg.b64 -o ~/.gradle/secring.gpg
shell: bash

- name: "Publish"
run: ./gradlew publishAllPublicationsToMavenCentralRepository -Psigning.keyId=${{ secrets.SIGNING_KEY_ID }} -Psigning.password=${{ secrets.SIGNING_PASSWORD }} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg)
run: ./gradlew publishToMavenCentral -Psigning.keyId=$KEY_ID -Psigning.password=$PASSWORD -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg)
env:
MAVEN_TOKEN_USERNAME: ${{ secrets.MAVEN_TOKEN_USERNAME }}
MAVEN_TOKEN_PASSWORD: ${{ secrets.MAVEN_TOKEN_PASSWORD }}
KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_TOKEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_TOKEN_PASSWORD }}
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: "Set Up JDK"
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: corretto
java-version: 17
Expand All @@ -32,7 +32,7 @@ jobs:
shell: bash

- name: "Tests Report"
uses: dorny/test-reporter@v2
uses: dorny/test-reporter@ee446707ff3bdadb3c039ff1af4286a09acb79c6
if: success() || failure()
with:
name: jUnit Tests
Expand All @@ -45,7 +45,7 @@ jobs:
shell: bash

- name: "Coverage Report"
uses: mi-kas/kover-report@v1
uses: mi-kas/kover-report@624c610e0c054a270ce07a40972c643261c513bb
if: ${{ github.event_name == 'pull_request' }}
with:
path: |
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
tasks.wrapper {
gradleVersion = "8.14.2"
gradleVersion = "9.2.1"
}

allprojects {

group = "com.ucasoft.ktor"

version = "0.55.3"
version = "0.57.7"

repositories {
mavenCentral()
Expand Down
8 changes: 3 additions & 5 deletions buildSrc/src/main/kotlin/Dependensies.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import org.gradle.api.Project

const val ktorVersion = "3.2.0"
const val kotestVersion = "5.9.1"
const val ktorVersion = "3.3.3"
const val kotestVersion = "6.0.7"

fun Project.ktor(module: String) = "io.ktor:ktor-$module:$ktorVersion"

fun Project.ktorClient(module: String) = ktor("client-$module")

fun Project.ktorServer(module: String) = ktor("server-$module")

fun Project.kotest(module: String, version: String = kotestVersion) = "io.kotest:kotest-$module:$version"

fun Project.kotestEx(module: String, version: String) = "io.kotest.extensions:kotest-$module:$version"
fun Project.kotest(module: String, version: String = kotestVersion) = "io.kotest:kotest-$module:$version"
29 changes: 24 additions & 5 deletions buildSrc/src/main/kotlin/PublishingExtension.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
import org.gradle.api.model.ObjectFactory
import org.gradle.kotlin.dsl.property
import org.gradle.api.publish.maven.MavenPom

open class PublishingExtension(factory: ObjectFactory) {
val name = factory.property<String>()
val description = factory.property<String>()

fun configurePom(name: String, description: String, pom: MavenPom) {
pom.name.set(name)
pom.description.set(description)
pom.url.set("https://github.com/Scogun/ktor-simple-cache")
pom.licenses {
license {
this.name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
pom.developers {
developer {
id.set("Scogun")
this.name.set("Sergey Antonov")
email.set("SAntonov@ucasoft.com")
}
}
pom.scm {
connection.set("scm:git:git://github.com/Scogun/ktor-simple-cache.git")
developerConnection.set("scm:git:ssh://github.com:Scogun/ktor-simple-cache.git")
url.set("https://github.com/Scogun/ktor-simple-cache")
}
}
62 changes: 0 additions & 62 deletions buildSrc/src/main/kotlin/publish.gradle.kts

This file was deleted.

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 3 additions & 3 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ktor-simple-cache/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Ktor Simple Cache
Base solution which provides the plugin implementation and abstract class for cache providers.

[![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.ktor/ktor-simple-cache/0.55.3?color=blue)](https://search.maven.org/artifact/com.ucasoft.ktor/ktor-simple-cache/0.55.3/jar)
[![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.ktor/ktor-simple-cache/0.57.7?color=blue)](https://search.maven.org/artifact/com.ucasoft.ktor/ktor-simple-cache/0.57.7/jar)
## Setup
### Gradle
```kotlin
repositories {
mavenCentral()
}

implementation("com.ucasoft.ktor:ktor-simple-cache:0.55.3")
implementation("com.ucasoft.ktor:ktor-simple-cache:0.57.7")
```
## Usage
```kotlin
Expand Down
16 changes: 10 additions & 6 deletions ktor-simple-cache/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
kotlin("multiplatform")
kotlin("plugin.serialization") apply false
id("org.jetbrains.kotlinx.kover")
id("publish")
id("com.vanniktech.maven.publish")
}

kotlin {
Expand All @@ -26,15 +26,19 @@ kotlin {
implementation(kotlin("test"))
implementation(ktorServer("test-host"))
implementation(kotest("assertions-core"))
implementation(kotestEx("assertions-ktor", "2.0.0"))
implementation("org.mockito.kotlin:mockito-kotlin:5.4.0")
implementation(kotest("assertions-ktor"))
implementation("org.mockito.kotlin:mockito-kotlin:6.1.0")
}
kotlin.srcDir("src/test/kotlin")
}
}
}

libraryData {
name.set("Ktor Simple Cache")
description.set("Base realization of simple output cache for Ktor server")
mavenPublishing {
publishToMavenCentral()
signAllPublications()

pom {
configurePom("Ktor Simple Cache", "Base realization of simple output cache for Ktor server", this)
}
}
4 changes: 2 additions & 2 deletions ktor-simple-memory-cache/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Ktor Simple Memory Cache
Memory cache provider for Ktor Simple Cache plugin

[![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.ktor/ktor-simple-memory-cache/0.55.3?color=blue)](https://search.maven.org/artifact/com.ucasoft.ktor/ktor-simple-memory-cache/0.55.3/jar)
[![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.ktor/ktor-simple-memory-cache/0.57.7?color=blue)](https://search.maven.org/artifact/com.ucasoft.ktor/ktor-simple-memory-cache/0.57.7/jar)
## Setup
### Gradle
```kotlin
repositories {
mavenCentral()
}

implementation("com.ucasoft.ktor:ktor-simple-memory-cache:0.55.3")
implementation("com.ucasoft.ktor:ktor-simple-memory-cache:0.57.7")
```
## Usage
```kotlin
Expand Down
17 changes: 10 additions & 7 deletions ktor-simple-memory-cache/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("org.jetbrains.kotlinx.kover")
id("publish")
id("com.vanniktech.maven.publish")
}

kotlin {
Expand All @@ -14,26 +14,29 @@ kotlin {
val commonMain by getting {
dependencies {
implementation(project(":ktor-simple-cache"))
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
}
kotlin.srcDir("src/main/kotlin")
}
val commonTest by getting {
val jvmTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(ktorServer("test-host"))
implementation(ktorClient("content-negotiation"))
implementation(ktorServer("content-negotiation"))
implementation(ktor("serialization-kotlinx-json"))
implementation(kotest("assertions-core"))
implementation(kotestEx("assertions-ktor", "2.0.0"))
implementation(kotest("assertions-ktor"))
}
kotlin.srcDir("src/test/kotlin")
}
}
}

libraryData {
name.set("Ktor Simple Memory Cache")
description.set("Memory cache provider for Simple Cache plugin")
mavenPublishing {
publishToMavenCentral()
signAllPublications()

pom {
configurePom("Ktor Simple Memory Cache", "Memory cache provider for Simple Cache plugin", this)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package com.ucasoft.ktor.simpleMemoryCache

import com.ucasoft.ktor.simpleCache.SimpleCacheConfig
import com.ucasoft.ktor.simpleCache.SimpleCacheProvider
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import kotlin.time.Clock
import kotlin.time.Duration
import kotlin.time.Instant

class SimpleMemoryCacheProvider(config: Config) : SimpleCacheProvider(config) {

Expand Down
4 changes: 2 additions & 2 deletions ktor-simple-redis-cache/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Ktor Simple Redis Cache
Redis cache provider for Ktor Simple Cache plugin

[![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.ktor/ktor-simple-redis-cache/0.55.3?color=blue)](https://search.maven.org/artifact/com.ucasoft.ktor/ktor-simple-redis-cache/0.55.3/jar)
[![Maven Central with version prefix filter](https://img.shields.io/maven-central/v/com.ucasoft.ktor/ktor-simple-redis-cache/0.57.7?color=blue)](https://search.maven.org/artifact/com.ucasoft.ktor/ktor-simple-redis-cache/0.57.7/jar)
## Setup
### Gradle
```kotlin
repositories {
mavenCentral()
}

implementation("com.ucasoft.ktor:ktor-simple-redis-cache:0.55.3")
implementation("com.ucasoft.ktor:ktor-simple-redis-cache:0.57.7")
```
## Usage
```kotlin
Expand Down
Loading