Skip to content

Commit

Permalink
Merge pull request #1 from woltapp/dev
Browse files Browse the repository at this point in the history
move the existing imlementation
  • Loading branch information
muatik authored May 29, 2024
2 parents b7dd9a6 + d7569be commit 06b1b28
Show file tree
Hide file tree
Showing 20 changed files with 1,588 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: daily
44 changes: 44 additions & 0 deletions .github/workflows/pre-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PR Checks
on:
push:
branches:
- main
pull_request:
branches:
- '*'

jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Run tests
uses: gradle/gradle-build-action@v2
with:
arguments: test
publish:
name: Check that the publish plugin works
runs-on: ubuntu-latest
needs: [tests, lint]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Check that the publish plugin works
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
uses: gradle/gradle-build-action@v2
with:
arguments: publishToMavenLocal
lint:
name: Check that the code is formatted
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Check that the code is formatted
uses: gradle/gradle-build-action@v2
with:
arguments: spotlessCheck
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2022 Wolt Enterprises Oy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
104 changes: 104 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
plugins {
kotlin("jvm") version "1.9.21"
kotlin("plugin.serialization") version "1.9.23"
id("com.diffplug.spotless") version "6.25.0"
id("maven-publish")
id("signing")
}

group = "com.wolt"

version = "1.0-SNAPSHOT"

repositories { mavenCentral() }

java {
withSourcesJar()
withJavadocJar()
}

dependencies {
val ktorVersion = "2.3.9"
api("io.ktor:ktor-server-core-jvm:${ktorVersion}")
implementation("io.ktor:ktor-server-netty-jvm:${ktorVersion}")
implementation("io.ktor:ktor-server-content-negotiation:${ktorVersion}")
implementation("io.ktor:ktor-serialization-kotlinx-json:${ktorVersion}")

implementation("io.github.oshai:kotlin-logging-jvm:5.1.0")

testImplementation("io.ktor:ktor-server-status-pages:2.3.9")
testImplementation("io.ktor:ktor-server-test-host:${ktorVersion}")

testImplementation("io.mockk:mockk:1.13.11")
testImplementation("org.jetbrains.kotlin:kotlin-test")
}

tasks.test { useJUnitPlatform() }

kotlin { jvmToolchain(21) }

spotless {
kotlin {
ktfmt("0.47")
ktlint()
}
kotlinGradle { ktfmt("0.47").kotlinlangStyle() }
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["kotlin"])
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
artifact(tasks.kotlinSourcesJar)
artifact(tasks.named("javadocJar"))

pom {
name.set("Ktor Idempotency Plugin")
description.set("A Ktor plugin for handling idempotency in HTTP requests")
url.set("https://github.com/woltapp/ktor-idempotency")

name.set("Your Project Name")
description.set("A description of your project")
url.set("https://your.project.url")
licenses {
license {
name.set("The MIT License")
url.set("https://github.com/woltapp/ktor-idempotency/blob/main/LICENSE")
}
}
developers {
developer {
id.set("muatik")
name.set("Mustafa Atik")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:https://github.com/woltapp/ktor-idempotency.git")
developerConnection.set(
"scm:git:https://github.com/woltapp/ktor-idempotency.git"
)
url.set("https://github.com/woltapp/ktor-idempotency")
}
}
}
}

repositories {
maven {
name = "sonatype"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials(PasswordCredentials::class)
}
}
}

signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin.code.style=official
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Tue May 28 20:29:37 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 06b1b28

Please sign in to comment.