diff --git a/README.md b/README.md index 908fe1a..8ce0979 100644 --- a/README.md +++ b/README.md @@ -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+ diff --git a/codec/gradle.properties b/codec/gradle.properties new file mode 100644 index 0000000..21588ff --- /dev/null +++ b/codec/gradle.properties @@ -0,0 +1 @@ +artifact-id=codec diff --git a/common/src/main/java/net/infumia/pubsub/Codec.java b/codec/src/main/java/net/infumia/pubsub/Codec.java similarity index 82% rename from common/src/main/java/net/infumia/pubsub/Codec.java rename to codec/src/main/java/net/infumia/pubsub/Codec.java index 92c90b7..f017b9b 100644 --- a/common/src/main/java/net/infumia/pubsub/Codec.java +++ b/codec/src/main/java/net/infumia/pubsub/Codec.java @@ -3,7 +3,7 @@ /** * The interface for encoding and decoding objects of type {@link T} to and from byte arrays. * - * @param the type of the object to be encoded and decoded. + * @param type of the object to be encoded and decoded. */ public interface Codec { /** @@ -17,7 +17,7 @@ public interface Codec { /** * 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); diff --git a/common/src/main/java/net/infumia/pubsub/CodecProvider.java b/codec/src/main/java/net/infumia/pubsub/CodecProvider.java similarity index 100% rename from common/src/main/java/net/infumia/pubsub/CodecProvider.java rename to codec/src/main/java/net/infumia/pubsub/CodecProvider.java diff --git a/common/src/main/java/net/infumia/pubsub/CodecProviderCached.java b/codec/src/main/java/net/infumia/pubsub/CodecProviderCached.java similarity index 100% rename from common/src/main/java/net/infumia/pubsub/CodecProviderCached.java rename to codec/src/main/java/net/infumia/pubsub/CodecProviderCached.java diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 26caeb1..5cf7c7c 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,3 +1,5 @@ dependencies { + compileOnly(project(":codec")) + compileOnly(libs.caffeine) } diff --git a/jackson/build.gradle.kts b/jackson/build.gradle.kts index c778490..a247c02 100644 --- a/jackson/build.gradle.kts +++ b/jackson/build.gradle.kts @@ -1,5 +1,5 @@ dependencies { - compileOnly(project(":common")) + compileOnly(project(":codec")) compileOnly(libs.jackson) } diff --git a/kotlin/protobuf/build.gradle.kts b/kotlin/protobuf/build.gradle.kts index ec909e7..5393cfb 100644 --- a/kotlin/protobuf/build.gradle.kts +++ b/kotlin/protobuf/build.gradle.kts @@ -3,7 +3,7 @@ plugins { } dependencies { - compileOnly(project(":common")) + compileOnly(project(":codec")) compileOnly(libs.kotlin.reflect) compileOnly(libs.kotlinx.serialization.core) diff --git a/redis/build.gradle.kts b/redis/build.gradle.kts index f07a39f..623996a 100644 --- a/redis/build.gradle.kts +++ b/redis/build.gradle.kts @@ -1,4 +1,5 @@ dependencies { + compileOnly(project(":codec")) compileOnly(project(":common")) compileOnly(libs.redis) diff --git a/settings.gradle.kts b/settings.gradle.kts index 10cb0b4..a9cd125 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -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")