Skip to content

Commit f25c8ac

Browse files
authored
Merge pull request #1 from 1gravity/feature/publish_artifact
Feature/publish artifact
2 parents 75ba6cb + 3471859 commit f25c8ac

File tree

8 files changed

+100
-68
lines changed

8 files changed

+100
-68
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ktor OpenAPI Generator
2-
[![](https://jitpack.io/v/papsign/Ktor-OpenAPI-Generator.svg)](https://jitpack.io/#papsign/Ktor-OpenAPI-Generator)
3-
[![Build](https://github.com/papsign/Ktor-OpenAPI-Generator/workflows/Build/badge.svg)](https://github.com/papsign/Ktor-OpenAPI-Generator/actions)
2+
[![](https://jitpack.io/v/1gravity/Ktor-OpenAPI-Generator.svg)](https://jitpack.io/#1gravity/Ktor-OpenAPI-Generator)
3+
[![Build](https://github.com/1gravity/Ktor-OpenAPI-Generator/workflows/Build/badge.svg)](https://github.com/1gravity/Ktor-OpenAPI-Generator/actions)
44

55
The Ktor OpenAPI Generator is a library to automatically generate the descriptor as you route your ktor application.
66

@@ -24,7 +24,7 @@ Extra Features:
2424

2525
## Examples
2626

27-
Take a look at [a few examples](https://github.com/papsign/Ktor-OpenAPI-Generator/wiki/A-few-examples)
27+
Take a look at [a few examples](https://github.com/1gravity/Ktor-OpenAPI-Generator/wiki/A-few-examples)
2828

2929
### Who is using it?
3030

@@ -48,14 +48,14 @@ allprojects {
4848
Step 2. Add the dependency:
4949
```groovy
5050
dependencies {
51-
implementation 'com.github.papsign:Ktor-OpenAPI-Generator:-SNAPSHOT'
51+
implementation 'com.1gravity:Ktor-OpenAPI-Generator:-SNAPSHOT'
5252
}
5353
```
5454

5555
### Git Submodule
5656
Install the submodule:
5757
```shell
58-
git submodule add https://github.com/papsign/Ktor-OpenAPI-Generator.git openapigen
58+
git submodule add https://github.com/1gravity/Ktor-OpenAPI-Generator.git openapigen
5959
```
6060

6161
Declare the folder in settings.gradle:

build.gradle

Lines changed: 0 additions & 50 deletions
This file was deleted.

build.gradle.kts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
4+
plugins {
5+
kotlin("jvm")
6+
id("maven-publish")
7+
}
8+
9+
repositories {
10+
mavenCentral()
11+
}
12+
13+
val kotlinVersion = plugins.getPlugin(KotlinPluginWrapper::class.java).kotlinPluginVersion
14+
val ktorVersion = findProperty("ktor_version")?.toString() ?: ""
15+
val slf4jVersion = findProperty("slf4j_version")?.toString() ?: ""
16+
val logVersion = findProperty("logback_version")?.toString() ?: ""
17+
18+
dependencies {
19+
implementation(kotlin("stdlib", kotlinVersion))
20+
implementation("org.slf4j:slf4j-api:$slf4jVersion")
21+
implementation("io.ktor:ktor-server-core:$ktorVersion")
22+
implementation("io.ktor:ktor-server-host-common:$ktorVersion")
23+
implementation("io.ktor:ktor-metrics:$ktorVersion")
24+
implementation("io.ktor:ktor-server-sessions:$ktorVersion")
25+
26+
implementation("io.ktor:ktor-jackson:$ktorVersion") // needed for parameter parsing and multipart parsing
27+
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8") // needed for multipart parsing
28+
implementation("org.webjars:swagger-ui:3.25.0")
29+
30+
implementation("org.reflections:reflections:0.9.11") // only used while initializing
31+
32+
testImplementation("io.ktor:ktor-server-netty:$ktorVersion")
33+
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
34+
testImplementation("ch.qos.logback:logback-classic:$logVersion")
35+
testImplementation("io.ktor:ktor-auth:$ktorVersion")
36+
testImplementation("io.ktor:ktor-auth-jwt:$ktorVersion")
37+
}
38+
39+
java {
40+
sourceCompatibility = JavaVersion.VERSION_1_8
41+
targetCompatibility = JavaVersion.VERSION_1_8
42+
}
43+
44+
tasks.withType<KotlinCompile> {
45+
kotlinOptions {
46+
jvmTarget = "1.8"
47+
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn", "-Xuse-experimental=kotlin.ExperimentalStdlibApi")
48+
}
49+
}
50+
51+
publishing {
52+
publications {
53+
create<MavenPublication>("maven") {
54+
group = "com.1gravity"
55+
artifactId = "ktor-openapi-generator"
56+
version = "0.2-beta.17"
57+
58+
from(components["java"])
59+
60+
pom {
61+
name.set("Ktor OpenAPI Generator")
62+
description.set("The Ktor OpenAPI Generator automatically generate the OpenAPI documentation based on the Ktor application routing definition")
63+
packaging = "jar"
64+
65+
licenses {
66+
license {
67+
name.set("The Apache License, Version 2.0")
68+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
69+
}
70+
}
71+
}
72+
}
73+
}
74+
}

gradle.properties

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
kotlin.code.style=official
2-
ktor_version=1.3.2
3-
logback_version=1.2.1
2+
3+
# plugins
4+
kotlinVersion=1.4.32
5+
6+
# libraries
7+
ktor_version=1.5.3
8+
logback_version=1.2.2
49
slf4j_version=1.7.30
5-
kotlin_version=1.3.70
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle

Lines changed: 0 additions & 2 deletions
This file was deleted.

settings.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
rootProject.name = "com.papsign.ktor.openapigen"
2+
3+
pluginManagement {
4+
val kotlinVersion: String by settings
5+
6+
plugins {
7+
kotlin("jvm") version kotlinVersion
8+
}
9+
}

src/test/kotlin/com/papsign/ktor/openapigen/content/type/binary/BinaryContentTypeParserTest.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import com.papsign.ktor.openapigen.route.path.normal.post
55
import com.papsign.ktor.openapigen.route.response.respond
66
import com.papsign.ktor.openapigen.route.route
77
import installOpenAPI
8-
import io.ktor.http.ContentType
9-
import io.ktor.http.HttpHeaders
10-
import io.ktor.http.HttpMethod
8+
import io.ktor.http.*
119
import io.ktor.server.testing.contentType
1210
import io.ktor.server.testing.handleRequest
1311
import io.ktor.server.testing.setBody
@@ -21,7 +19,6 @@ const val contentType = "image/png"
2119

2220
class BinaryContentTypeParserTest {
2321

24-
2522
@BinaryRequest([contentType])
2623
@BinaryResponse([contentType])
2724
data class Stream(val stream: InputStream)
@@ -68,7 +65,7 @@ class BinaryContentTypeParserTest {
6865
addHeader(HttpHeaders.Accept, contentType)
6966
setBody(bytes)
7067
}.apply {
71-
assertNull(response.status())
68+
assertEquals(response.status(), HttpStatusCode.NotFound)
7269
}
7370

7471
println("Test: Bad Accept")
@@ -77,7 +74,7 @@ class BinaryContentTypeParserTest {
7774
addHeader(HttpHeaders.Accept, ContentType.Application.Json.toString())
7875
setBody(bytes)
7976
}.apply {
80-
assertNull(response.status())
77+
assertEquals(response.status(), HttpStatusCode.NotFound)
8178
}
8279

8380
println("Test: Bad Content-Type")
@@ -86,7 +83,7 @@ class BinaryContentTypeParserTest {
8683
addHeader(HttpHeaders.Accept, contentType)
8784
setBody(bytes)
8885
}.apply {
89-
assertNull(response.status())
86+
assertEquals(response.status(), HttpStatusCode.NotFound)
9087
}
9188
}
9289
}

0 commit comments

Comments
 (0)