Skip to content

Commit

Permalink
Merge pull request #35 from sourceplusplus/dev
Browse files Browse the repository at this point in the history
v0.4.0
  • Loading branch information
BFergerson authored Feb 6, 2022
2 parents 2b755a4 + 3ea399e commit 14eb903
Show file tree
Hide file tree
Showing 94 changed files with 367 additions and 1,880 deletions.
25 changes: 22 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ val vertxVersion: String by project
val kotlinVersion: String by project
val projectVersion: String by project
val jacksonVersion: String by project
val slf4jVersion: String by project

group = "spp.protocol"
version = projectVersion
Expand Down Expand Up @@ -49,10 +50,11 @@ kotlin {
}
val jvmMain by getting {
dependencies {
implementation("org.slf4j:slf4j-api:$slf4jVersion")
implementation("io.vertx:vertx-core:$vertxVersion")
implementation("io.vertx:vertx-codegen:$vertxVersion")
implementation("io.vertx:vertx-tcp-eventbus-bridge:$vertxVersion")
implementation("io.vertx:vertx-service-proxy:4.1.5")
implementation("io.vertx:vertx-service-proxy:$vertxVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-guava:$jacksonVersion")
Expand All @@ -79,15 +81,32 @@ kotlin {
}

dependencies {
"kapt"("io.vertx:vertx-codegen:4.1.5:processor")
"kapt"("io.vertx:vertx-codegen:$vertxVersion:processor")
}

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

tasks.register<Exec>("restrictDeletionOfJsonMappers") {
mustRunAfter("setupJsonMappers")
commandLine("chmod", "a-w", "$buildDir/generated/source/kapt/main/META-INF/vertx")
}
tasks.getByName("compileKotlinJvm").dependsOn("restrictDeletionOfJsonMappers")

tasks.register<Exec>("unrestrictDeletionOfJsonMappers") {
mustRunAfter("compileKotlinJvm")
if (file("$buildDir/generated/source/kapt/main/META-INF/vertx").exists()) {
commandLine("chmod", "a+w", "$buildDir/generated/source/kapt/main/META-INF/vertx")
} else {
commandLine("true") //no-op
}
}
tasks.getByName("jvmJar").dependsOn("unrestrictDeletionOfJsonMappers")
tasks.getByName("clean").dependsOn("unrestrictDeletionOfJsonMappers")

configure<org.jetbrains.kotlin.noarg.gradle.NoArgExtension> {
annotation("kotlinx.serialization.Serializable")
}
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
kotlin.code.style=official

projectVersion=0.3.1
projectVersion=0.4.0

kotlinVersion=1.6.10
vertxVersion=4.2.4
jacksonVersion=2.13.0
jacksonVersion=2.13.1
slf4jVersion=1.7.33
131 changes: 0 additions & 131 deletions src/commonMain/kotlin/spp.protocol/ProtocolAddress.kt

This file was deleted.

19 changes: 1 addition & 18 deletions src/commonMain/kotlin/spp.protocol/Serializers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
*/
package spp.protocol

import spp.protocol.artifact.ArtifactType
import spp.protocol.portal.PageType
import kotlinx.datetime.Instant
import kotlinx.serialization.KSerializer
import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import spp.protocol.artifact.ArtifactType

/**
* Used to serialize/deserialize protocol messages.
Expand Down Expand Up @@ -65,20 +64,4 @@ class Serializers {
override fun deserialize(decoder: Decoder) = ArtifactType.valueOf(decoder.decodeString())
override fun serialize(encoder: Encoder, value: ArtifactType) = encoder.encodeString(value.name)
}

/**
* Used to serialize/deserialize [PageType] classes.
*
* @since 0.2.0
*/
class PageTypeSerializer : KSerializer<PageType> {

override val descriptor = PrimitiveSerialDescriptor(
"spp.protocol.PageTypeSerializer",
PrimitiveKind.STRING
)

override fun deserialize(decoder: Decoder) = PageType.valueOf(decoder.decodeString())
override fun serialize(encoder: Encoder, value: PageType) = encoder.encodeString(value.name)
}
}
29 changes: 0 additions & 29 deletions src/commonMain/kotlin/spp.protocol/advice/AdviceType.kt

This file was deleted.

50 changes: 0 additions & 50 deletions src/commonMain/kotlin/spp.protocol/advice/ArtifactAdvice.kt

This file was deleted.

This file was deleted.

Loading

0 comments on commit 14eb903

Please sign in to comment.