diff --git a/attribute-projection-functions/build.gradle.kts b/attribute-projection-functions/build.gradle.kts index a76a09e1..1a6713e6 100644 --- a/attribute-projection-functions/build.gradle.kts +++ b/attribute-projection-functions/build.gradle.kts @@ -6,10 +6,10 @@ plugins { } dependencies { - api("com.google.code.findbugs:jsr305:3.0.2") - implementation("com.github.f4b6a3:uuid-creator:5.1.0") + api(libs.findbugs.jsr) + implementation(libs.uuid.creator) - testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") + testImplementation(libs.junit.jupiter) } tasks.test { diff --git a/attribute-projection-registry/build.gradle.kts b/attribute-projection-registry/build.gradle.kts index 69164abe..5b6aae52 100644 --- a/attribute-projection-registry/build.gradle.kts +++ b/attribute-projection-registry/build.gradle.kts @@ -6,10 +6,10 @@ plugins { } dependencies { - api(project(":attribute-service-api")) - implementation(project(":attribute-projection-functions")) - implementation("com.google.guava:guava:31.1-jre") - testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") + api(projects.attributeServiceApi) + implementation(projects.attributeProjectionFunctions) + implementation(libs.google.guava) + testImplementation(libs.junit.jupiter) } tasks.test { diff --git a/attribute-service-api/build.gradle.kts b/attribute-service-api/build.gradle.kts index f24aba3e..67777b09 100644 --- a/attribute-service-api/build.gradle.kts +++ b/attribute-service-api/build.gradle.kts @@ -15,11 +15,11 @@ val generateLocalGoGrpcFiles = false protobuf { protoc { - artifact = "com.google.protobuf:protoc:3.15.6" + artifact = "com.google.protobuf:protoc:${libs.versions.protoc.get()}" } plugins { id("grpc_java") { - artifact = "io.grpc:protoc-gen-grpc-java:1.44.0" + artifact = "io.grpc:protoc-gen-grpc-java:${libs.versions.grpc.get()}" } if (generateLocalGoGrpcFiles) { @@ -57,9 +57,5 @@ sourceSets { } dependencies { - api(platform("io.grpc:grpc-bom:1.44.0")) - api("io.grpc:grpc-stub") - api("io.grpc:grpc-protobuf") - - implementation("javax.annotation:javax.annotation-api:1.3.2") + api(libs.bundles.grpc.api) } diff --git a/attribute-service-client/build.gradle.kts b/attribute-service-client/build.gradle.kts index 014d45eb..4ef0a2d1 100644 --- a/attribute-service-client/build.gradle.kts +++ b/attribute-service-client/build.gradle.kts @@ -4,8 +4,8 @@ plugins { } dependencies { - api(project(":attribute-service-api")) - api("com.typesafe:config:1.4.1") + api(projects.attributeServiceApi) + api(libs.typesafe.config) - implementation("org.hypertrace.core.grpcutils:grpc-client-utils:0.7.2") + implementation(libs.hypertrace.grpc.client.utils) } diff --git a/attribute-service-factory/build.gradle.kts b/attribute-service-factory/build.gradle.kts index 39a33df1..b2f09cac 100644 --- a/attribute-service-factory/build.gradle.kts +++ b/attribute-service-factory/build.gradle.kts @@ -3,10 +3,10 @@ plugins { } dependencies { - api("org.hypertrace.core.serviceframework:platform-grpc-service-framework:0.1.37") + api(libs.hypertrace.serviceFramework.grpcFramework) // Only required because AttributeService constructor test overload uses a doc store API - compileOnly("org.hypertrace.core.documentstore:document-store:0.7.17") + compileOnly(libs.hypertrace.document.store) - implementation(project(":attribute-service-impl")) + implementation(projects.attributeServiceImpl) } diff --git a/attribute-service-impl/build.gradle.kts b/attribute-service-impl/build.gradle.kts index c51299c4..0a0b8a2f 100644 --- a/attribute-service-impl/build.gradle.kts +++ b/attribute-service-impl/build.gradle.kts @@ -5,21 +5,21 @@ plugins { } dependencies { - api(project(":attribute-service-api")) - implementation(project(":attribute-service-tenant-api")) + api(projects.attributeServiceApi) + implementation(projects.attributeServiceTenantApi) - implementation("org.hypertrace.core.documentstore:document-store:0.7.17") - implementation("org.hypertrace.core.grpcutils:grpc-context-utils:0.7.2") + implementation(libs.hypertrace.document.store) + implementation(libs.hypertrace.grpc.context.utils) - implementation("com.fasterxml.jackson.core:jackson-databind:2.13.2.2") - implementation("com.typesafe:config:1.4.1") - implementation("org.slf4j:slf4j-api:1.7.32") - implementation("com.google.protobuf:protobuf-java-util:3.19.2") - implementation("com.google.guava:guava:31.1-jre") + implementation(libs.jackson.databind) + implementation(libs.typesafe.config) + implementation(libs.slf4j.api) + implementation(libs.protobuf.java.util) + implementation(libs.google.guava) - testImplementation("org.mockito:mockito-core:4.2.0") - testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") - testImplementation("org.apache.logging.log4j:log4j-slf4j-impl:2.17.1") + testImplementation(libs.junit.jupiter) + testImplementation(libs.bundles.mockito) + testImplementation(libs.apache.log4j.slf4jImpl) } tasks.test { diff --git a/attribute-service-tenant-api/build.gradle.kts b/attribute-service-tenant-api/build.gradle.kts index 46a5f1a9..25764e9f 100644 --- a/attribute-service-tenant-api/build.gradle.kts +++ b/attribute-service-tenant-api/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } dependencies { - testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") + testImplementation(libs.junit.jupiter) } tasks.test { diff --git a/attribute-service/build.gradle.kts b/attribute-service/build.gradle.kts index c236cd70..6f62b2b0 100644 --- a/attribute-service/build.gradle.kts +++ b/attribute-service/build.gradle.kts @@ -54,16 +54,16 @@ tasks.integrationTest { } dependencies { - implementation(project(":attribute-service-factory")) - implementation("org.hypertrace.core.serviceframework:platform-grpc-service-framework:0.1.37") - runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:2.17.1") - runtimeOnly("io.grpc:grpc-netty") + implementation(projects.attributeServiceFactory) + implementation(libs.hypertrace.serviceFramework.grpcFramework) + runtimeOnly(libs.apache.log4j.slf4jImpl) + runtimeOnly(libs.grpc.netty) // Integration test dependencies - integrationTestImplementation("org.junit.jupiter:junit-jupiter:5.8.2") - integrationTestImplementation("com.google.guava:guava:31.1-jre") - integrationTestImplementation(project(":attribute-service-client")) - integrationTestImplementation("org.hypertrace.core.serviceframework:integrationtest-service-framework:0.1.37") + integrationTestImplementation(projects.attributeServiceClient) + integrationTestImplementation(libs.junit.jupiter) + integrationTestImplementation(libs.google.guava) + integrationTestImplementation(libs.hypertrace.serviceFramework.integrationTestFramework) } application { diff --git a/caching-attribute-service-client/build.gradle.kts b/caching-attribute-service-client/build.gradle.kts index 75142b8b..40b8211d 100644 --- a/caching-attribute-service-client/build.gradle.kts +++ b/caching-attribute-service-client/build.gradle.kts @@ -6,24 +6,23 @@ plugins { } dependencies { - api(project(":attribute-service-api")) - api("io.reactivex.rxjava3:rxjava:3.1.3") - api("io.grpc:grpc-api") + api(projects.attributeServiceApi) + api(libs.rxjava) + api(libs.grpc.api) - implementation("io.grpc:grpc-stub") - implementation("org.hypertrace.core.grpcutils:grpc-client-utils:0.7.2") - implementation("org.hypertrace.core.grpcutils:grpc-client-rx-utils:0.7.2") - implementation("org.hypertrace.core.grpcutils:grpc-context-utils:0.7.2") - implementation("com.google.guava:guava:31.1-jre") - annotationProcessor("org.projectlombok:lombok:1.18.22") - compileOnly("org.projectlombok:lombok:1.18.22") - implementation("org.slf4j:slf4j-api:1.7.32") + implementation(libs.grpc.stub) + implementation(libs.hypertrace.grpc.client.utils) + implementation(libs.hypertrace.grpc.client.rx.utils) + implementation(libs.hypertrace.grpc.context.utils) + implementation(libs.google.guava) + annotationProcessor(libs.lombok) + compileOnly(libs.lombok) + implementation(libs.slf4j.api) - testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") - testImplementation("org.mockito:mockito-core:4.2.0") - testImplementation("org.mockito:mockito-junit-jupiter:4.2.0") - testImplementation("io.grpc:grpc-core") - testImplementation("org.apache.logging.log4j:log4j-slf4j-impl:2.17.1") + testImplementation(libs.junit.jupiter) + testImplementation(libs.bundles.mockito) + testImplementation(libs.grpc.core) + testImplementation(libs.apache.log4j.slf4jImpl) } tasks.test { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..446035c8 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,44 @@ +[versions] +hypertrace-serviceFramework = "0.1.43" +hypertrace-grpcUtils = "0.9.0" +hypertrace-documentStore = "0.7.18" + +protoc = "3.21.2" +grpc = "1.48.0" +mockito = "4.8.1" +jackson = "2.13.4.2" + +[libraries] +hypertrace-serviceFramework-grpcFramework = { module = "org.hypertrace.core.serviceframework:platform-grpc-service-framework", version.ref = "hypertrace-serviceFramework" } +hypertrace-serviceFramework-integrationTestFramework = { module = "org.hypertrace.core.serviceframework:integrationtest-service-framework", version.ref = "hypertrace-serviceFramework" } +hypertrace-grpc-client-utils = { module = "org.hypertrace.core.grpcutils:grpc-client-utils", version.ref = "hypertrace-grpcUtils"} +hypertrace-grpc-client-rx-utils = { module = "org.hypertrace.core.grpcutils:grpc-client-rx-utils", version.ref = "hypertrace-grpcUtils"} +hypertrace-grpc-context-utils = { module = "org.hypertrace.core.grpcutils:grpc-context-utils", version.ref = "hypertrace-grpcUtils"} +hypertrace-document-store = { module = "org.hypertrace.core.documentstore:document-store", version.ref = "hypertrace-documentStore" } + +grpc-netty = { module = "io.grpc:grpc-netty", version.ref = "grpc" } +grpc-stub = { module = "io.grpc:grpc-stub", version.ref = "grpc" } +grpc-protobuf = { module = "io.grpc:grpc-protobuf", version.ref = "grpc" } +grpc-api = { module = "io.grpc:grpc-api", version.ref = "grpc" } +grpc-core = { module = "io.grpc:grpc-core", version.ref = "grpc" } + +protobuf-java-util = { module = "com.google.protobuf:protobuf-java-util", version.ref = "protoc" } + +jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } +rxjava = { module = "io.reactivex.rxjava3:rxjava", version = "3.1.3" } +javax-annotation = { module = "javax.annotation:javax.annotation-api", version = "1.3.2" } +google-guava = { module = "com.google.guava:guava", version = "31.1-jre" } +findbugs-jsr = { module = "com.google.code.findbugs:jsr305", version = "3.0.2" } +uuid-creator = { module = "com.github.f4b6a3:uuid-creator", version = "5.1.0" } +typesafe-config = { module = "com.typesafe:config", version = "1.4.2" } +lombok = { module = "org.projectlombok:lombok", version = "1.18.22" } +slf4j-api = { module = "org.slf4j:slf4j-api", version = "1.7.32" } +apache-log4j-slf4jImpl = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version = "2.17.1" } + +junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version = "5.8.2" } +mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" } +mockito-junit = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" } + +[bundles] +grpc-api = ["grpc-stub", "grpc-protobuf", "javax-annotation"] +mockito = ["mockito-core", "mockito-junit"] \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index f3ebec90..a9946b02 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -12,6 +12,9 @@ plugins { id("org.hypertrace.version-settings") version "0.2.0" } +enableFeaturePreview("VERSION_CATALOGS") +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + include(":attribute-service-api") include(":attribute-service-client") include(":attribute-service-impl")