Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: gradle catalog dependencies #147

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions attribute-projection-functions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions attribute-projection-registry/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 3 additions & 7 deletions attribute-service-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
6 changes: 3 additions & 3 deletions attribute-service-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
6 changes: 3 additions & 3 deletions attribute-service-factory/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
24 changes: 12 additions & 12 deletions attribute-service-impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion attribute-service-tenant-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

dependencies {
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
testImplementation(libs.junit.jupiter)
}

tasks.test {
Expand Down
16 changes: 8 additions & 8 deletions attribute-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
31 changes: 15 additions & 16 deletions caching-attribute-service-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
44 changes: 44 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[versions]
hypertrace-serviceFramework = "0.1.43"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth waiting for the couple pending framework prs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that was the plan

hypertrace-grpcUtils = "0.9.0"
hypertrace-documentStore = "0.7.18"

protoc = "3.21.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an older version with vulnerabilities. we've been using 3.21.7 (although looks like 3.21.8 is out now)

grpc = "1.48.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
grpc = "1.48.0"
grpc = "1.50.0"

mockito = "4.8.1"
jackson = "2.13.4.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this isn't a full jackson version - jackson hotfixes are inconsistent across modules (i.e. most jackson modules don't have a 2.13.4.2, only a 2.13.4). So it works since we only use databind, but probably just want to inline this version there to avoid a mistake in the future (or rename it specifically jacksonDatabind would be fine too)


[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" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you do a quick check on version numbers. I think a few of these are outdated - log4j, rxjava and lombok at least


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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grpc-bom got removed, please restore it (and if doing other repos, add it)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fuller explanation of my thinking behind using the grpc bom here - hypertrace/service-framework#56 (comment)

mockito = ["mockito-core", "mockito-junit"]
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down