Skip to content

Commit

Permalink
seperate the codec.
Browse files Browse the repository at this point in the history
  • Loading branch information
portlek committed Jun 14, 2024
1 parent 43fcefa commit b073b2d
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ repositories {
}
dependencies {
// Base module
// Base modules
implementation "net.infumia:pubsub:VERSION"
implementation "net.infumia:pubsub-codec:VERSION"
// Required, https://mvnrepository.com/artifact/com.github.ben-manes.caffeine/caffeine/
implementation "com.github.ben-manes.caffeine:caffeine:2.9.3" // for java-8+
implementation "com.github.ben-manes.caffeine:caffeine:3.1.8" // for java-11+
Expand Down
1 change: 1 addition & 0 deletions codec/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
artifact-id=codec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* The interface for encoding and decoding objects of type {@link T} to and from byte arrays.
*
* @param <T> the type of the object to be encoded and decoded.
* @param <T> type of the object to be encoded and decoded.
*/
public interface Codec<T> {
/**
Expand All @@ -17,7 +17,7 @@ public interface Codec<T> {
/**
* Decodes a byte array into an object of type {@link T}.
*
* @param bytes the byte array to decode.
* @param bytes the bytes array to decode.
* @return the decoded object.
*/
T decode(byte[] bytes);
Expand Down
2 changes: 2 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dependencies {
compileOnly(project(":codec"))

compileOnly(libs.caffeine)
}
2 changes: 1 addition & 1 deletion jackson/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
compileOnly(project(":common"))
compileOnly(project(":codec"))

compileOnly(libs.jackson)
}
2 changes: 1 addition & 1 deletion kotlin/protobuf/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
compileOnly(project(":common"))
compileOnly(project(":codec"))

compileOnly(libs.kotlin.reflect)
compileOnly(libs.kotlinx.serialization.core)
Expand Down
1 change: 1 addition & 0 deletions redis/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dependencies {
compileOnly(project(":codec"))
compileOnly(project(":common"))

compileOnly(libs.redis)
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

rootProject.name = "pubsub"

include("common", "redis", "jackson", "kotlin-extensions", "kotlin-coroutines", "kotlin-protobuf")
include("codec", "common", "redis", "jackson", "kotlin-extensions", "kotlin-coroutines", "kotlin-protobuf")

project(":kotlin-extensions").projectDir = file("kotlin/extensions")
project(":kotlin-coroutines").projectDir = file("kotlin/coroutines")
Expand Down

0 comments on commit b073b2d

Please sign in to comment.