Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
72dd401
KAFKA-14680: Upgrade gradle version from 7.6 to 8.0.1 (#13205)
dejan2609 Feb 24, 2023
9987593
MINOR: enable DynamicBrokerReconfigurationTest.testUncleanLeaderElect…
chia7712 Feb 24, 2023
2fad165
KAFKA-10199: Add task updater metrics, part 1 (#13228)
guozhangwang Feb 24, 2023
400ba0a
KAFKA-14491: [11/N] Add metered wrapper for versioned stores (#13252)
vcrfxia Feb 24, 2023
8d32a0f
[KAFKA-14685] Refactor logic to handle OFFSET_MOVED_TO_TIERED_STORAGE…
mattwong949 Feb 24, 2023
62431dc
KAFKA-14468: Implement CommitRequestManager to manage the commit and …
Feb 24, 2023
ae67257
Kafka-14743: update request metrics after callback (#13297)
showuon Feb 26, 2023
dfd8fdb
MINOR: Replace String literal with existing String variable (#13305)
hogimn Feb 26, 2023
4441a01
MINOR: Enable spotless for streams-scala when Java 11+ is used (#13311)
ijuma Feb 27, 2023
461c5cf
MINOR: Various cleanups in common utils (#13174)
mimaison Feb 27, 2023
8d7d563
MINOR: Remove duplicate empty string check (#13145)
mimaison Feb 27, 2023
5f9d016
KAFKA-14060: Replace EasyMock and PowerMock with Mockito in AbstractW…
hgeraldino Feb 27, 2023
3079567
MINOR: update docs of 'replica.socket.receive.buffer.bytes' (#13308)
chia7712 Feb 27, 2023
be55733
addressing merge conflicts in Jenkinsfile and build.gradle
rittikaadhikari Feb 27, 2023
b0a36cf
integrating changes in doValidation into Jenkinsfile
rittikaadhikari Feb 27, 2023
4abfe60
excluding .github/** directory from rat
rittikaadhikari Feb 27, 2023
867fb29
KAFKA-14742: Throttle connectors in ExactlyOnceSourceIntegrationTest …
gharris1727 Feb 28, 2023
d143d34
MINOR: ExponentialBackoff Javadoc improvements (#13317)
yashmayya Feb 28, 2023
a1b8586
KAFKA-14659 source-record-write-[rate|total] metrics should exclude f…
hgeraldino Feb 28, 2023
dcc1799
MINOR: srcJar should depend on processMessages task (#13316)
ijuma Feb 28, 2023
1b6b03e
Merge commit 'dcc179995153c22c6248702976b60755b0b9fda8' into sync-ups…
rittikaadhikari Feb 28, 2023
1ab6fbd
syncing up to apache#13316 and addressing comments in Jenkinsfile
rittikaadhikari Feb 28, 2023
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
12 changes: 8 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ def job = {
}

stage("Check compilation compatibility with Scala 2.12") {
sh "./retry_zinc ./gradlew clean assemble spotlessScalaCheck checkstyleMain checkstyleTest spotbugsMain " +
"--no-daemon --stacktrace -PxmlSpotBugsReport=true -PscalaVersion=2.12"
sh """
./retry_zinc ./gradlew clean build -x test \
--no-daemon --stacktrace -PxmlSpotBugsReport=true -PscalaVersion=2.12
"""
}


stage("Compile and validate") {
sh "./retry_zinc ./gradlew clean assemble publishToMavenLocal spotlessScalaCheck checkstyleMain checkstyleTest spotbugsMain " +
"--no-daemon --stacktrace -PxmlSpotBugsReport=true"
sh """
./retry_zinc ./gradlew clean publishToMavenLocal build -x test \
--no-daemon --stacktrace -PxmlSpotBugsReport=true
"""
}

if (config.publish) {
Expand Down
59 changes: 37 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.

import org.ajoberstar.grgit.Grgit
import org.gradle.api.JavaVersion

import java.nio.charset.StandardCharsets

Expand All @@ -30,26 +31,18 @@ buildscript {
}

plugins {
id 'com.diffplug.spotless' version '6.13.0'
id 'com.github.ben-manes.versions' version '0.44.0'
id 'idea'
id 'java-library'
id 'org.owasp.dependencycheck' version '8.0.2'
id 'org.nosphere.apache.rat' version "0.8.0"
id "io.swagger.core.v3.swagger-gradle-plugin" version "2.2.0"

id "com.github.spotbugs" version '5.0.13' apply false
id 'org.gradle.test-retry' version '1.5.1' apply false
id 'org.scoverage' version '7.0.1' apply false
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
id "io.swagger.core.v3.swagger-gradle-plugin" version "2.2.0"
}

spotless {
scala {
target 'streams/**/*.scala'
scalafmt("$versions.scalafmt").configFile('checkstyle/.scalafmt.conf').scalaMajorVersion(versions.baseScala)
licenseHeaderFile 'checkstyle/java.header', 'package'
}
id 'com.diffplug.spotless' version '6.14.0' apply false // 6.14.1 and newer require Java 11 at compile time, so we can't upgrade until AK 4.0
}

task copyGitHooks(type: Copy) {
Expand All @@ -74,7 +67,7 @@ task installGitHooks(type: Exec) {

ext {
gradleVersion = versions.gradle
minJavaVersion = "8"
minJavaVersion = 8
buildVersionFileName = "kafka-version.properties"

defaultMaxHeapSize = "2g"
Expand Down Expand Up @@ -229,6 +222,7 @@ if (file('.git').exists()) {
'**/build/**',
'CONTRIBUTING.md',
'PULL_REQUEST_TEMPLATE.md',
'.github/**',
'gradlew',
'gradlew.bat',
'gradle/wrapper/gradle-wrapper.properties',
Expand Down Expand Up @@ -286,9 +280,6 @@ subprojects {
fineTuneEclipseClasspathFile(eclipse, project)
}

sourceCompatibility = minJavaVersion
targetCompatibility = minJavaVersion

java {
consistentResolution {
// resolve the compileClasspath and then "inject" the result of resolution as strict constraints into the runtimeClasspath
Expand All @@ -306,12 +297,16 @@ subprojects {
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
// --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
// set --source and --target via `sourceCompatibility` and `targetCompatibility`. If/when Gradle supports `--release`
// natively (https://github.com/gradle/gradle/issues/2510), we should switch to that.
// set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
if (JavaVersion.current().isJava9Compatible())
options.compilerArgs << "--release" << minJavaVersion
options.release = minJavaVersion
dependsOn installGitHooks
}

// We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
// `-target` incorrectly if this is unset
sourceCompatibility = minJavaVersion
targetCompatibility = minJavaVersion

if (shouldPublish) {

Expand Down Expand Up @@ -447,7 +442,7 @@ subprojects {
"**/KafkaConfigBackingStoreTest.*",
"**/KafkaBasedLogTest.*", "**/StandaloneHerderTest.*",
"**/WorkerSinkTaskTest.*", "**/WorkerSinkTaskThreadedTest.*",
"**/WorkerSourceTaskTest.*", "**/AbstractWorkerSourceTaskTest.*"
"**/WorkerSourceTaskTest.*"
])
}

Expand Down Expand Up @@ -716,9 +711,12 @@ subprojects {
]
}

// Scalac's `-release` requires Java 9 or higher
if (JavaVersion.current().isJava9Compatible())
scalaCompileOptions.additionalParameters += ["-release", minJavaVersion]
// Scalac 2.12 `-release` requires Java 9 or higher, but Scala 2.13 doesn't have that restriction
if (versions.baseScala == "2.13")
scalaCompileOptions.additionalParameters += ["-release:" + minJavaVersion] // Use `:` here to workaround Gradle bug (see https://github.com/gradle/gradle/issues/23962#issuecomment-1437348400)
else if (JavaVersion.current().isJava9Compatible())
scalaCompileOptions.additionalParameters += ["-release", String.valueOf(minJavaVersion)] // Don't use `:` here as it breaks compilation with Scala 2.12


configure(scalaCompileOptions.forkOptions) {
memoryMaximumSize = defaultMaxHeapSize
Expand Down Expand Up @@ -1040,6 +1038,7 @@ project(':core') {
}

compileJava.dependsOn 'processMessages'
srcJar.dependsOn 'processMessages'

task genProtocolErrorDocs(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
Expand Down Expand Up @@ -1271,6 +1270,7 @@ project(':metadata') {
}

compileJava.dependsOn 'processMessages'
srcJar.dependsOn 'processMessages'

sourceSets {
main {
Expand Down Expand Up @@ -1345,6 +1345,7 @@ project(':group-coordinator') {
}

compileJava.dependsOn 'processMessages'
srcJar.dependsOn 'processMessages'
}

project(':examples') {
Expand Down Expand Up @@ -1483,6 +1484,7 @@ project(':clients') {
}

compileJava.dependsOn 'processMessages'
srcJar.dependsOn 'processMessages'

compileTestJava.dependsOn 'processTestMessages'

Expand Down Expand Up @@ -1585,6 +1587,7 @@ project(':raft') {
}

compileJava.dependsOn 'processMessages'
srcJar.dependsOn 'processMessages'

jar {
dependsOn createVersionFile
Expand Down Expand Up @@ -1807,6 +1810,7 @@ project(':storage') {
}

compileJava.dependsOn 'processMessages'
srcJar.dependsOn 'processMessages'

jar {
dependsOn createVersionFile
Expand Down Expand Up @@ -2045,6 +2049,7 @@ project(':streams') {
}

compileJava.dependsOn 'processMessages'
srcJar.dependsOn 'processMessages'

javadoc {
include "**/org/apache/kafka/streams/**"
Expand Down Expand Up @@ -2167,7 +2172,17 @@ project(':streams:streams-scala') {
dependsOn 'copyDependantLibs'
}

test.dependsOn(':spotlessScalaCheck')
// spotless 6.14 requires Java 11 at runtime
if (JavaVersion.current().isJava11Compatible()) {
apply plugin: 'com.diffplug.spotless'
spotless {
scala {
target '**/*.scala'
scalafmt("$versions.scalafmt").configFile('../../checkstyle/.scalafmt.conf').scalaMajorVersion(versions.baseScala)
licenseHeaderFile '../../checkstyle/java.header', 'package'
}
}
}
}

project(':streams:test-utils') {
Expand Down
6 changes: 2 additions & 4 deletions checkstyle/import-control-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@
</subpackage>

<subpackage name="server">
<subpackage name="builders">
<allow pkg="kafka" />
<allow pkg="org.apache.kafka" />
</subpackage>
<allow pkg="kafka" />
<allow pkg="org.apache.kafka" />
</subpackage>

<subpackage name="test">
Expand Down
Loading