Skip to content

Commit 14eb903

Browse files
authored
Merge pull request #35 from sourceplusplus/dev
v0.4.0
2 parents 2b755a4 + 3ea399e commit 14eb903

File tree

94 files changed

+367
-1880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+367
-1880
lines changed

build.gradle.kts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ val vertxVersion: String by project
1111
val kotlinVersion: String by project
1212
val projectVersion: String by project
1313
val jacksonVersion: String by project
14+
val slf4jVersion: String by project
1415

1516
group = "spp.protocol"
1617
version = projectVersion
@@ -49,10 +50,11 @@ kotlin {
4950
}
5051
val jvmMain by getting {
5152
dependencies {
53+
implementation("org.slf4j:slf4j-api:$slf4jVersion")
5254
implementation("io.vertx:vertx-core:$vertxVersion")
5355
implementation("io.vertx:vertx-codegen:$vertxVersion")
5456
implementation("io.vertx:vertx-tcp-eventbus-bridge:$vertxVersion")
55-
implementation("io.vertx:vertx-service-proxy:4.1.5")
57+
implementation("io.vertx:vertx-service-proxy:$vertxVersion")
5658
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
5759
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion")
5860
implementation("com.fasterxml.jackson.datatype:jackson-datatype-guava:$jacksonVersion")
@@ -79,15 +81,32 @@ kotlin {
7981
}
8082

8183
dependencies {
82-
"kapt"("io.vertx:vertx-codegen:4.1.5:processor")
84+
"kapt"("io.vertx:vertx-codegen:$vertxVersion:processor")
8385
}
8486

8587
tasks.register<Copy>("setupJsonMappers") {
8688
from(file("$projectDir/src/jvmMain/resources/META-INF/vertx/json-mappers.properties"))
87-
into(file("$buildDir/tmp/kapt3/src/main/resources/META-INF/vertx"))
89+
into(file("$buildDir/generated/source/kapt/main/META-INF/vertx"))
8890
}
8991
tasks.getByName("compileKotlinJvm").dependsOn("setupJsonMappers")
9092

93+
tasks.register<Exec>("restrictDeletionOfJsonMappers") {
94+
mustRunAfter("setupJsonMappers")
95+
commandLine("chmod", "a-w", "$buildDir/generated/source/kapt/main/META-INF/vertx")
96+
}
97+
tasks.getByName("compileKotlinJvm").dependsOn("restrictDeletionOfJsonMappers")
98+
99+
tasks.register<Exec>("unrestrictDeletionOfJsonMappers") {
100+
mustRunAfter("compileKotlinJvm")
101+
if (file("$buildDir/generated/source/kapt/main/META-INF/vertx").exists()) {
102+
commandLine("chmod", "a+w", "$buildDir/generated/source/kapt/main/META-INF/vertx")
103+
} else {
104+
commandLine("true") //no-op
105+
}
106+
}
107+
tasks.getByName("jvmJar").dependsOn("unrestrictDeletionOfJsonMappers")
108+
tasks.getByName("clean").dependsOn("unrestrictDeletionOfJsonMappers")
109+
91110
configure<org.jetbrains.kotlin.noarg.gradle.NoArgExtension> {
92111
annotation("kotlinx.serialization.Serializable")
93112
}

gradle.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
kotlin.code.style=official
22

3-
projectVersion=0.3.1
3+
projectVersion=0.4.0
44

55
kotlinVersion=1.6.10
66
vertxVersion=4.2.4
7-
jacksonVersion=2.13.0
7+
jacksonVersion=2.13.1
8+
slf4jVersion=1.7.33

src/commonMain/kotlin/spp.protocol/ProtocolAddress.kt

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

src/commonMain/kotlin/spp.protocol/Serializers.kt

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
*/
1818
package spp.protocol
1919

20-
import spp.protocol.artifact.ArtifactType
21-
import spp.protocol.portal.PageType
2220
import kotlinx.datetime.Instant
2321
import kotlinx.serialization.KSerializer
2422
import kotlinx.serialization.descriptors.PrimitiveKind
2523
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
2624
import kotlinx.serialization.encoding.Decoder
2725
import kotlinx.serialization.encoding.Encoder
26+
import spp.protocol.artifact.ArtifactType
2827

2928
/**
3029
* Used to serialize/deserialize protocol messages.
@@ -65,20 +64,4 @@ class Serializers {
6564
override fun deserialize(decoder: Decoder) = ArtifactType.valueOf(decoder.decodeString())
6665
override fun serialize(encoder: Encoder, value: ArtifactType) = encoder.encodeString(value.name)
6766
}
68-
69-
/**
70-
* Used to serialize/deserialize [PageType] classes.
71-
*
72-
* @since 0.2.0
73-
*/
74-
class PageTypeSerializer : KSerializer<PageType> {
75-
76-
override val descriptor = PrimitiveSerialDescriptor(
77-
"spp.protocol.PageTypeSerializer",
78-
PrimitiveKind.STRING
79-
)
80-
81-
override fun deserialize(decoder: Decoder) = PageType.valueOf(decoder.decodeString())
82-
override fun serialize(encoder: Encoder, value: PageType) = encoder.encodeString(value.name)
83-
}
8467
}

src/commonMain/kotlin/spp.protocol/advice/AdviceType.kt

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

src/commonMain/kotlin/spp.protocol/advice/ArtifactAdvice.kt

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

src/commonMain/kotlin/spp.protocol/advice/ArtifactAdviceListener.kt

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

0 commit comments

Comments
 (0)