Add ExpiringMemoryCache implementation #1

Merged
william merged 2 commits from develop into master 2022-01-30 17:59:36 -05:00
3 changed files with 66 additions and 3 deletions
Showing only changes of commit 8b8dcb7ebe - Show all commits

29
.drone.yml Normal file
View File

@ -0,0 +1,29 @@
---
global-variables:
gradle-image: &gradle-image gradle:7.1-jdk11
kind: pipeline
name: default
type: docker
steps:
- name: gradle-test
image: *gradle-image
commands:
- gradle test
when:
branch: develop
- name: publish
image: *gradle-image
environment:
MAVEN_REPOSITORY_URL: https://archiva.fyloz.dev/repository/internal/
MAVEN_REPOSITORY_USERNAME:
from_secret: maven_repository_username
MAVEN_REPOSITORY_PASSWORD:
from_secret: maven_repository_password
commands:
- gradle publish -Pversion=${DRONE_TAG}
when:
event:
- tag

View File

@ -1,8 +1,8 @@
group = "dev.fyloz" group = "dev.fyloz"
version = "1.0"
plugins { plugins {
id("org.jetbrains.kotlin.jvm") version "1.6.10" id("org.jetbrains.kotlin.jvm") version "1.6.10"
id("maven-publish")
} }
repositories { repositories {
@ -21,6 +21,39 @@ dependencies {
testImplementation("io.mockk:mockk:1.12.2") testImplementation("io.mockk:mockk:1.12.2")
} }
tasks.withType<Test> { publishing {
useJUnitPlatform() publications {
create<MavenPublication>("memory-cache") {
from(components["kotlin"])
}
}
repositories {
maven {
val repoUrl = System.getenv("MAVEN_REPOSITORY_URL")
val repoUsername = System.getenv("MAVEN_REPOSITORY_USERNAME")
val repoPassword = System.getenv("MAVEN_REPOSITORY_PASSWORD")
val repoName = System.getenv("MAVEN_REPOSITORY_NAME") ?: "Archiva"
if (repoUrl != null && repoUsername != null && repoPassword != null) {
url = uri(repoUrl)
name = repoName
credentials {
username = repoUsername
password = repoPassword
}
} else {
print("Some maven repository credentials were not configured, publishing is not configured")
}
}
}
}
tasks.test {
useJUnitPlatform()
testLogging {
events("failed")
}
} }

View File

@ -1 +1,2 @@
kotlin.code.style=official kotlin.code.style=official
version=dev