-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from woltapp/dev
move the existing imlementation
- Loading branch information
Showing
20 changed files
with
1,588 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gradle | ||
directory: "/" | ||
schedule: | ||
interval: daily |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kotlin.code.style=official |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.