-
Notifications
You must be signed in to change notification settings - Fork 14.7k
KAFKA-19174 Gradle version upgrade 8 -->> 9 #19513
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
79f0415
07cf3e9
04eeb04
c754acd
62649e7
44950bb
744d7bb
41e2d73
dcfda25
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,22 +29,21 @@ buildscript { | |
} | ||
|
||
plugins { | ||
id 'com.github.ben-manes.versions' version '0.48.0' | ||
id 'com.github.ben-manes.versions' version '0.52.0' | ||
id 'idea' | ||
id 'jacoco' | ||
id 'java-library' | ||
id 'org.owasp.dependencycheck' version '8.2.1' | ||
id 'org.owasp.dependencycheck' version '12.1.3' | ||
id 'org.nosphere.apache.rat' version "0.8.1" | ||
id "io.swagger.core.v3.swagger-gradle-plugin" version "${swaggerVersion}" | ||
|
||
id "com.github.spotbugs" version '6.2.3' apply false | ||
id "com.github.spotbugs" version '6.2.5' apply false | ||
id 'org.scoverage' version '8.0.3' apply false | ||
id 'com.gradleup.shadow' version '8.3.6' apply false | ||
id 'com.diffplug.spotless' version "6.25.0" | ||
id 'com.gradleup.shadow' version '8.3.9' apply false | ||
id 'com.diffplug.spotless' version "7.2.1" | ||
} | ||
|
||
ext { | ||
gradleVersion = versions.gradle | ||
minClientJavaVersion = 11 | ||
minNonClientJavaVersion = 17 | ||
modulesNeedingJava11 = [":clients", ":generator", ":streams", ":streams:test-utils", ":streams:examples", ":streams-scala", ":test-common:test-common-util"] | ||
|
@@ -299,7 +298,7 @@ if (repo != null) { | |
} else { | ||
rat.enabled = false | ||
} | ||
println("Starting build with version $version (commit id ${commitId == null ? "null" : commitId.take(8)}) using Gradle $gradleVersion, Java ${JavaVersion.current()} and Scala ${versions.scala}") | ||
println("Starting build with version $version (commit id ${commitId == null ? "null" : commitId.take(8)}) using Gradle $versions.gradle, Java ${JavaVersion.current()} and Scala ${versions.scala}") | ||
println("Build properties: ignoreFailures=$userIgnoreFailures, maxParallelForks=$maxTestForks, maxScalacThreads=$maxScalacThreads, maxTestRetries=$userMaxTestRetries") | ||
|
||
subprojects { | ||
|
@@ -330,6 +329,23 @@ subprojects { | |
tasks.register('uploadArchives').configure { dependsOn(publish) } | ||
} | ||
|
||
def submodulesToIncludeInDistribution = ['core', 'tools', 'trogdor', 'shell', 'api', 'runtime', 'transforms', | ||
'json', 'file', 'basic-auth-extension', 'mirror', 'mirror-client', | ||
'streams', 'streams-scala', 'test-utils', 'examples', 'tools-api'] | ||
|
||
def shouldModuleResolveRuntimeClasspath = (submodulesToIncludeInDistribution.contains(project.name)) | ||
|
||
if (shouldModuleResolveRuntimeClasspath) { | ||
configurations.create('resolvedRuntimeClasspath') { | ||
extendsFrom(configurations.runtimeClasspath) | ||
canBeResolved = true | ||
} | ||
} | ||
|
||
tasks.withType(AbstractTestTask).configureEach { | ||
failOnNoDiscoveredTests = false | ||
} | ||
|
||
// apply the eclipse plugin only to subprojects that hold code. 'connect' is just a folder. | ||
if (!project.name.equals('connect')) { | ||
apply plugin: 'eclipse' | ||
|
@@ -1170,71 +1186,6 @@ project(':core') { | |
standardOutput = new File(generatedDocsDir, "producer_metrics.html").newOutputStream() | ||
} | ||
|
||
task siteDocsTar(dependsOn: ['genProtocolErrorDocs', 'genProtocolTypesDocs', 'genProtocolApiKeyDocs', 'genProtocolMessageDocs', | ||
'genAdminClientConfigDocs', 'genProducerConfigDocs', 'genConsumerConfigDocs', | ||
'genKafkaConfigDocs', 'genTopicConfigDocs', 'genGroupConfigDocs', | ||
':connect:runtime:genConnectConfigDocs', ':connect:runtime:genConnectTransformationDocs', | ||
':connect:runtime:genConnectPredicateDocs', | ||
':connect:runtime:genSinkConnectorConfigDocs', ':connect:runtime:genSourceConnectorConfigDocs', | ||
':streams:genStreamsConfigDocs', 'genConsumerMetricsDocs', 'genProducerMetricsDocs', | ||
':connect:runtime:genConnectMetricsDocs', ':connect:runtime:genConnectOpenAPIDocs', | ||
':connect:mirror:genMirrorSourceConfigDocs', ':connect:mirror:genMirrorCheckpointConfigDocs', | ||
':connect:mirror:genMirrorHeartbeatConfigDocs', ':connect:mirror:genMirrorConnectorConfigDocs', | ||
':storage:genRemoteLogManagerConfigDoc', ':storage:genRemoteLogMetadataManagerConfigDoc'], type: Tar) { | ||
archiveClassifier = 'site-docs' | ||
compression = Compression.GZIP | ||
from project.file("$rootDir/docs") | ||
into 'site-docs' | ||
duplicatesStrategy 'exclude' | ||
} | ||
|
||
tasks.create(name: "releaseTarGz", dependsOn: configurations.archives.artifacts, type: Tar) { | ||
into "kafka_${versions.baseScala}-${archiveVersion.get()}" | ||
compression = Compression.GZIP | ||
from(project.file("$rootDir/bin")) { into "bin/" } | ||
from(project.file("$rootDir/config")) { into "config/" } | ||
from(project.file("$rootDir/licenses")) { into "licenses/" } | ||
from "$rootDir/LICENSE-binary" rename {String filename -> filename.replace("-binary", "")} | ||
from "$rootDir/NOTICE-binary" rename {String filename -> filename.replace("-binary", "")} | ||
from(configurations.runtimeClasspath) { into("libs/") } | ||
from(configurations.archives.artifacts.files) { into("libs/") } | ||
from(configurations.releaseOnly) { into("libs/") } | ||
from(project.siteDocsTar) { into("site-docs/") } | ||
from(project(':tools').jar) { 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').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':connect:api').jar) { into("libs/") } | ||
from(project(':connect:api').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':connect:runtime').jar) { into("libs/") } | ||
from(project(':connect:runtime').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':connect:transforms').jar) { into("libs/") } | ||
from(project(':connect:transforms').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':connect:json').jar) { into("libs/") } | ||
from(project(':connect:json').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':connect:file').jar) { into("libs/") } | ||
from(project(':connect:file').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':connect:basic-auth-extension').jar) { into("libs/") } | ||
from(project(':connect:basic-auth-extension').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':connect:mirror').jar) { into("libs/") } | ||
from(project(':connect:mirror').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':connect:mirror-client').jar) { into("libs/") } | ||
from(project(':connect:mirror-client').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':streams').jar) { into("libs/") } | ||
from(project(':streams').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':streams:streams-scala').jar) { into("libs/") } | ||
from(project(':streams:streams-scala').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':streams:test-utils').jar) { into("libs/") } | ||
from(project(':streams:test-utils').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':streams:examples').jar) { into("libs/") } | ||
from(project(':streams:examples').configurations.runtimeClasspath) { into("libs/") } | ||
from(project(':tools:tools-api').jar) { into("libs/") } | ||
from(project(':tools:tools-api').configurations.runtimeClasspath) { into("libs/") } | ||
duplicatesStrategy 'exclude' | ||
} | ||
|
||
jar { | ||
dependsOn copyDependantLibs | ||
} | ||
|
@@ -3905,6 +3856,109 @@ project(':connect:test-plugins') { | |
} | ||
} | ||
|
||
project(':distribution') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just wondering - does this change matter for the upgrade from gradle 8 to 9 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dejan2609 Curious about your thoughts here - would adding a new module be necessary, or could we simply continue handling the distributions within the core module? |
||
base { | ||
archivesName = "kafka_${versions.baseScala}" | ||
} | ||
|
||
configurations { | ||
includeIntoDistribution | ||
} | ||
|
||
dependencies { | ||
includeIntoDistribution project(path: ':core', configuration: 'releaseOnly') | ||
includeIntoDistribution project(path: ':core', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':tools', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':trogdor', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':shell', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':connect:api', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':connect:runtime', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':connect:transforms', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':connect:json', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':connect:file', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':connect:basic-auth-extension', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':connect:mirror', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':connect:mirror-client', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':streams', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':streams:streams-scala', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':streams:test-utils', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':streams:examples', configuration: 'resolvedRuntimeClasspath') | ||
includeIntoDistribution project(path: ':tools:tools-api', configuration: 'resolvedRuntimeClasspath') | ||
} | ||
|
||
task siteDocsTar(dependsOn: [':core:genProtocolErrorDocs', ':core:genProtocolTypesDocs', ':core:genProtocolApiKeyDocs', ':core:genProtocolMessageDocs', | ||
':core:genAdminClientConfigDocs', ':core:genProducerConfigDocs', ':core:genConsumerConfigDocs', | ||
':core:genKafkaConfigDocs', ':core:genTopicConfigDocs', ':core:genGroupConfigDocs', | ||
':connect:runtime:genConnectConfigDocs', ':connect:runtime:genConnectTransformationDocs', | ||
':connect:runtime:genConnectPredicateDocs', | ||
':connect:runtime:genSinkConnectorConfigDocs', ':connect:runtime:genSourceConnectorConfigDocs', | ||
':streams:genStreamsConfigDocs', ':core:genConsumerMetricsDocs', ':core:genProducerMetricsDocs', | ||
':connect:runtime:genConnectMetricsDocs', ':connect:runtime:genConnectOpenAPIDocs', | ||
':connect:mirror:genMirrorSourceConfigDocs', ':connect:mirror:genMirrorCheckpointConfigDocs', | ||
':connect:mirror:genMirrorHeartbeatConfigDocs', ':connect:mirror:genMirrorConnectorConfigDocs', | ||
':storage:genRemoteLogManagerConfigDoc', ':storage:genRemoteLogMetadataManagerConfigDoc'], type: Tar) { | ||
archiveClassifier = 'site-docs' | ||
compression = Compression.GZIP | ||
from project.file("$rootDir/docs") | ||
into 'site-docs' | ||
destinationDirectory = project(':core').layout.buildDirectory.dir('distributions') | ||
duplicatesStrategy 'exclude' | ||
preserveFileTimestamps = true | ||
} | ||
|
||
tasks.create(name: "releaseTarGz", dependsOn: project(':core').configurations.archives.artifacts, type: Tar) { | ||
into "kafka_${versions.baseScala}-${archiveVersion.get()}" | ||
compression = Compression.GZIP | ||
from(project.file("$rootDir/bin")) { into "bin/" } | ||
from(project.file("$rootDir/config")) { into "config/" } | ||
from(project.file("$rootDir/licenses")) { into "licenses/" } | ||
from "$rootDir/LICENSE-binary" rename {String filename -> filename.replace("-binary", "")} | ||
from "$rootDir/NOTICE-binary" rename {String filename -> filename.replace("-binary", "")} | ||
from(project.siteDocsTar) { into("site-docs/") } | ||
from(configurations.includeIntoDistribution) { into("libs/") } | ||
from(project(':core').configurations.archives.artifacts.files) { into("libs/") } | ||
from(project(':tools').jar) { into("libs/") } | ||
from(project(':trogdor').jar) { into("libs/") } | ||
from(project(':shell').jar) { into("libs/") } | ||
from(project(':connect:api').jar) { into("libs/") } | ||
from(project(':connect:runtime').jar) { into("libs/") } | ||
from(project(':connect:transforms').jar) { into("libs/") } | ||
from(project(':connect:json').jar) { into("libs/") } | ||
from(project(':connect:file').jar) { into("libs/") } | ||
from(project(':connect:basic-auth-extension').jar) { into("libs/") } | ||
from(project(':connect:mirror').jar) { into("libs/") } | ||
from(project(':connect:mirror-client').jar) { into("libs/") } | ||
from(project(':streams').jar) { into("libs/") } | ||
from(project(':streams:streams-scala').jar) { into("libs/") } | ||
from(project(':streams:test-utils').jar) { into("libs/") } | ||
from(project(':streams:examples').jar) { into("libs/") } | ||
from(project(':tools:tools-api').jar) { into("libs/") } | ||
destinationDirectory = project(':core').layout.buildDirectory.dir('distributions') | ||
duplicatesStrategy 'exclude' | ||
preserveFileTimestamps = true | ||
filePermissions { | ||
user { | ||
read = true | ||
write = true | ||
} | ||
group.read = true | ||
other.read = true | ||
} | ||
dirPermissions { | ||
unix('rwxr-xr-x') | ||
} | ||
eachFile { | ||
if (name.endsWith( ".sh")) { | ||
permissions { | ||
user.execute = true | ||
group.execute = true | ||
other.execute = true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
task aggregatedJavadoc(type: Javadoc, dependsOn: compileJava) { | ||
def projectsWithJavadoc = subprojects.findAll { it.javadoc.enabled } | ||
source = projectsWithJavadoc.collect { it.sourceSets.main.allJava } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please use the git commit hash instead, to follow the Apache policy (see below)?
reference: https://infra.apache.org/github-actions-policy.html