Skip to content
Merged
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
4 changes: 1 addition & 3 deletions client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
id 'java-test-fixtures'
id 'com.palantir.docker' version "${dockerPluginVersion}"
id 'net.ltgt.errorprone' version "${errorpronePluginVersion}"
id "com.github.spotbugs" version "${spotbugsPluginVersion}"
Expand Down Expand Up @@ -35,8 +34,7 @@ dependencies {
api group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jacksonVersion}"

// for tests
testFixturesImplementation group: 'info.picocli', name: 'picocli', version: "${picoCliVersion}"
testFixturesImplementation group: 'org.assertj', name: 'assertj-core', version: "${assertjVersion}"
testImplementation project(':common-test')

// for Error Prone
errorprone "com.google.errorprone:error_prone_core:${errorproneVersion}"
Expand Down
49 changes: 49 additions & 0 deletions common-test/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
plugins {
id 'net.ltgt.errorprone' version "${errorpronePluginVersion}"
id "com.github.spotbugs" version "${spotbugsPluginVersion}"
}

dependencies {
implementation project(':client')
implementation group: 'info.picocli', name: 'picocli', version: "${picoCliVersion}"
implementation group: 'org.assertj', name: 'assertj-core', version: "${assertjVersion}"
implementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "${junitVersion}"
runtimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "${junitVersion}"
Comment on lines +1 to +11

Choose a reason for hiding this comment

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

high

The new common-test module is a library for test utilities. To correctly expose its dependencies to consumer modules, it should use the java-library plugin and the api dependency configuration.

  1. Apply java-library plugin: This plugin should be applied to enable the api and implementation configurations for better dependency management.
  2. Use api for exposed dependencies:
    • picocli: Its types are used in the public API of CommandLineTestUtils, so it must be an api dependency.
    • junit-jupiter-api: This should also be an api dependency so that projects using common-test can use JUnit APIs for their tests without declaring the dependency themselves.
plugins {
    id 'java-library'
    id 'net.ltgt.errorprone' version "${errorpronePluginVersion}"
    id "com.github.spotbugs" version "${spotbugsPluginVersion}"
}

dependencies {
    implementation project(':client')
    api group: 'info.picocli', name: 'picocli', version: "${picoCliVersion}"
    implementation group: 'org.assertj', name: 'assertj-core', version: "${assertjVersion}"
    api group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: "${junitVersion}"
    runtimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: "${junitVersion}"


// for Error Prone
errorprone "com.google.errorprone:error_prone_core:${errorproneVersion}"
errorproneJavac "com.google.errorprone:javac:${errorproneJavacVersion}"

// for SpotBugs
spotbugs "com.github.spotbugs:spotbugs:${spotbugsVersion}"
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugsVersion}"
testCompileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugsVersion}"
}

spotless {
java {
target 'src/*/java/**/*.java'
importOrder()
removeUnusedImports()
googleJavaFormat('1.7')

Choose a reason for hiding this comment

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

medium

For consistency with other modules (like client) and for better maintainability, please use the googleJavaFormatVersion project property instead of hardcoding the version '1.7'. This ensures that all modules use the same version of the formatter and it can be updated in one place.

        googleJavaFormat(googleJavaFormatVersion)

}
}

spotbugs {
ignoreFailures = false
showStackTraces = true
showProgress = true
effort = 'default'
reportLevel = 'default'
maxHeapSize = '1g'
extraArgs = [ '-nested:false' ]
jvmArgs = [ '-Duser.language=en' ]
}

spotbugsMain.reports {
html.enabled = true
}

spotbugsTest.reports {
html.enabled = true
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ include 'client'
include 'schema-loader'
include 'generic-contracts'
include 'table-store'
include 'common-test'
2 changes: 1 addition & 1 deletion table-store/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies {
implementation group: 'org.partiql', name: 'partiql-parser', version: "${partiqlVersion}"

// for test
testImplementation testFixtures(project(':client')) // to use CommandLineTestUtils
testImplementation project(':common-test')

// for Error Prone
errorprone "com.google.errorprone:error_prone_core:${errorproneVersion}"
Expand Down