Minor: Move trogdor out of tools and into its own gradle module (#10539)

Move Trogdor out of tools and into its own gradle module.  This allows us to minimize
the dependencies of the tools module.  We still keep Trogdor in the CLASSPATH
created by kafka-run-class.sh.

Reviewers: Colin P. McCabe <cmccabe@apache.org>
This commit is contained in:
Shay Elkin 2021-04-15 11:37:15 -07:00 committed by GitHub
parent 31b4ba8c5a
commit fc405d792d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
139 changed files with 84 additions and 4 deletions

View File

@ -159,6 +159,18 @@ do
CLASSPATH="$CLASSPATH:$dir/*" CLASSPATH="$CLASSPATH:$dir/*"
done done
for file in "$base_dir"/trogdor/build/libs/trogdor-*.jar;
do
if should_include_file "$file"; then
CLASSPATH="$CLASSPATH":"$file"
fi
done
for dir in "$base_dir"/trogdor/build/dependant-libs-${SCALA_VERSION}*;
do
CLASSPATH="$CLASSPATH:$dir/*"
done
for cc_pkg in "api" "transforms" "runtime" "file" "mirror" "mirror-client" "json" "tools" "basic-auth-extension" for cc_pkg in "api" "transforms" "runtime" "file" "mirror" "mirror-client" "json" "tools" "basic-auth-extension"
do do
for file in "$base_dir"/connect/${cc_pkg}/build/libs/connect-${cc_pkg}*.jar; for file in "$base_dir"/connect/${cc_pkg}/build/libs/connect-${cc_pkg}*.jar;

View File

@ -428,7 +428,7 @@ subprojects {
exceptionFormat = testExceptionFormat exceptionFormat = testExceptionFormat
} }
logTestStdout.rehydrate(delegate, owner, this)() logTestStdout.rehydrate(delegate, owner, this)()
// The suites are for running sets of tests in IDEs. // The suites are for running sets of tests in IDEs.
// Gradle will run each test class, so we exclude the suites to avoid redundantly running the tests twice. // Gradle will run each test class, so we exclude the suites to avoid redundantly running the tests twice.
exclude '**/*Suite.class' exclude '**/*Suite.class'
@ -761,7 +761,7 @@ tasks.create(name: "testConnect", dependsOn: connectPkgs.collect { it + ":test"
project(':core') { project(':core') {
apply plugin: 'scala' apply plugin: 'scala'
// scaladoc generation is configured at the sub-module level with an artifacts // scaladoc generation is configured at the sub-module level with an artifacts
// block (cf. see streams-scala). If scaladoc generation is invoked explicitly // block (cf. see streams-scala). If scaladoc generation is invoked explicitly
// for the `core` module, this ensures the generated jar doesn't include scaladoc // for the `core` module, this ensures the generated jar doesn't include scaladoc
@ -983,6 +983,8 @@ project(':core') {
from(project.siteDocsTar) { into("site-docs/") } from(project.siteDocsTar) { into("site-docs/") }
from(project(':tools').jar) { into("libs/") } from(project(':tools').jar) { into("libs/") }
from(project(':tools').configurations.runtimeClasspath) { into("libs/") } from(project(':tools').configurations.runtimeClasspath) { into("libs/") }
from(project(':trogdor').jar) { into("libs/") }
from(project(':trogdor').configurations.runtimeClasspath) { into("libs/") }
from(project(':shell').jar) { into("libs/") } from(project(':shell').jar) { into("libs/") }
from(project(':shell').configurations.runtimeClasspath) { into("libs/") } from(project(':shell').configurations.runtimeClasspath) { into("libs/") }
from(project(':connect:api').jar) { into("libs/") } from(project(':connect:api').jar) { into("libs/") }
@ -1318,7 +1320,7 @@ project(':raft') {
} }
} }
} }
compileJava.dependsOn 'processMessages' compileJava.dependsOn 'processMessages'
jar { jar {
@ -1468,6 +1470,49 @@ project(':storage') {
project(':tools') { project(':tools') {
archivesBaseName = "kafka-tools" archivesBaseName = "kafka-tools"
dependencies {
implementation project(':clients')
implementation project(':log4j-appender')
implementation libs.argparse4j
implementation libs.jacksonDatabind
implementation libs.jacksonJDK8Datatypes
implementation libs.slf4jApi
implementation libs.log4j
implementation libs.jacksonJaxrsJsonProvider
testImplementation project(':clients')
testImplementation libs.junitJupiter
testImplementation project(':clients').sourceSets.test.output
testImplementation libs.mockitoInline // supports mocking static methods, final classes, etc.
testRuntimeOnly libs.slf4jlog4j
}
javadoc {
enabled = false
}
tasks.create(name: "copyDependantLibs", type: Copy) {
from (configurations.testRuntimeClasspath) {
include('slf4j-log4j12*')
include('log4j*jar')
}
from (configurations.runtimeClasspath) {
exclude('kafka-clients*')
}
into "$buildDir/dependant-libs-${versions.scala}"
duplicatesStrategy 'exclude'
}
jar {
dependsOn 'copyDependantLibs'
}
}
project(':trogdor') {
archivesBaseName = "trogdor"
dependencies { dependencies {
implementation project(':clients') implementation project(':clients')
implementation project(':log4j-appender') implementation project(':log4j-appender')

View File

@ -50,4 +50,5 @@ include 'clients',
'streams:upgrade-system-tests-25', 'streams:upgrade-system-tests-25',
'streams:upgrade-system-tests-26', 'streams:upgrade-system-tests-26',
'streams:upgrade-system-tests-27', 'streams:upgrade-system-tests-27',
'tools' 'tools',
'trogdor'

Some files were not shown because too many files have changed in this diff Show More