Skip to content

Commit

Permalink
Adjust Gradle for new GHA CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
artembilan committed Dec 7, 2023
1 parent cd8c2b3 commit 2312e53
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 146 deletions.
31 changes: 0 additions & 31 deletions .github/release-files-spec.json

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/verify-staged-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: spring-projects/spring-integration
ref: 6.1.x
show-progress: false

- name: Set up JDK
Expand Down
108 changes: 15 additions & 93 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.kotlinVersion = '1.7.20'
ext.isCI = System.getenv('GITHUB_ACTION') || System.getenv('bamboo_buildKey')
ext.isCI = System.getenv('GITHUB_ACTION')
repositories {
mavenCentral()
gradlePluginPortal()
Expand All @@ -19,24 +19,15 @@ plugins {
id 'base'
id 'project-report'
id 'idea'
id 'org.sonarqube' version '4.3.0.3225'
id 'org.ajoberstar.grgit' version '4.0.1' apply false
id 'org.ajoberstar.grgit' version '4.1.1'
id 'io.spring.nohttp' version '0.0.11'
id 'io.spring.dependency-management' version '1.0.10.RELEASE' apply false
id 'com.jfrog.artifactory' version '4.33.1' apply false
id 'io.spring.dependency-management' version '1.1.4' apply false
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
id 'org.asciidoctor.jvm.gems' version '3.3.2'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
}

apply plugin: 'io.spring.nohttp'

def gitPresent = new File('.git').exists()

if(gitPresent) {
apply plugin: 'org.ajoberstar.grgit'
}

description = 'Spring for Apache Kafka'

ext {
Expand All @@ -46,18 +37,21 @@ ext {
linkScmUrl = 'https://github.com/spring-projects/spring-kafka'
linkScmConnection = 'https://github.com/spring-projects/spring-kafka.git'
linkScmDevConnection = '[email protected]:spring-projects/spring-kafka.git'
springAsciidoctorBackendsVersion = '0.0.3'
springAsciidoctorBackendsVersion = '0.0.7'

javadocLinks = [
'https://docs.oracle.com/en/java/javase/17/docs/api/',
'https://docs.spring.io/spring-framework/docs/current/javadoc-api/'
] as String[]


if (gitPresent) {
modifiedFiles =
files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
}
modifiedFiles =
files()
.from {
files(grgit.status().unstaged.modified)
.filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
}
modifiedFiles.finalizeValueOnRead()

assertjVersion = '3.24.2'
awaitilityVersion = '4.2.0'
Expand All @@ -84,13 +78,13 @@ ext {

idPrefix = 'kafka'

javaProjects = subprojects - project(':spring-kafka-bom')
javaProjects = subprojects - project(':spring-kafka-bom') - project(':spring-kafka-docs')

}

nohttp {
source.include '**/src/**'
source.exclude '**/*.gif', '**/*.ks'
source.exclude '**/*.gif', '**/*.ks', '**/.gradle/**'
}

allprojects {
Expand Down Expand Up @@ -120,7 +114,6 @@ allprojects {

repositories {
mavenCentral()
maven { url 'https://repo.spring.io/release' }
maven { url 'https://repo.spring.io/milestone' }
if (version.endsWith('SNAPSHOT')) {
maven { url 'https://repo.spring.io/snapshot' }
Expand All @@ -136,7 +129,6 @@ configure(javaProjects) { subproject ->
apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
Expand All @@ -147,9 +139,6 @@ configure(javaProjects) { subproject ->
registerFeature('optional') {
usingSourceSet(sourceSets.main)
}
registerFeature('provided') {
usingSourceSet(sourceSets.main)
}
}

compileJava {
Expand All @@ -170,10 +159,6 @@ configure(javaProjects) { subproject ->

eclipse.project.natures += 'org.springframework.ide.eclipse.core.springnature'

jacoco {
toolVersion = '0.8.10'
}

// dependencies that are common across all java projects
dependencies {
implementation "com.google.code.findbugs:jsr305:$googleJsr305Version"
Expand Down Expand Up @@ -208,10 +193,6 @@ configure(javaProjects) { subproject ->
}

maxHeapSize = '1536m'
// jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:8111'
jacoco {
destinationFile = file("$buildDir/jacoco.exec")
}
useJUnitPlatform()

}
Expand All @@ -221,39 +202,19 @@ configure(javaProjects) { subproject ->
toolVersion = '10.8.0'
}

jacocoTestReport {
onlyIf { System.properties['sonar.host.url'] }
dependsOn test
reports {
xml.required = true
csv.required = false
html.required = false
}
}

rootProject.tasks['sonarqube'].dependsOn jacocoTestReport

publishing {
publications {
mavenJava(MavenPublication) {
suppressAllPomMetadataWarnings()
from components.java
pom.withXml {
def pomDeps = asNode().dependencies.first()
subproject.configurations.providedImplementation.allDependencies.each { dep ->
pomDeps.remove(pomDeps.'*'.find { it.artifactId.text() == dep.name })
}
}
}
}
}

task updateCopyrights {
onlyIf { !isCI }
if (gitPresent) {
inputs.files(modifiedFiles.filter { f -> f.path.contains(subproject.name) })
}
outputs.dir('build')
inputs.files(modifiedFiles.filter { f -> f.path.contains(subproject.name) })
outputs.dir('build/classes')

doLast {
def now = Calendar.instance.get(Calendar.YEAR) as String
Expand Down Expand Up @@ -358,9 +319,7 @@ project ('spring-kafka') {
testImplementation ('io.micrometer:micrometer-tracing-integration-test') {
exclude group: "org.mockito"
}

}

}

project('spring-kafka-bom') {
Expand All @@ -386,10 +345,6 @@ project('spring-kafka-bom') {
}
}
}

sonarqube {
skipProject = true
}
}

project ('spring-kafka-test') {
Expand Down Expand Up @@ -424,39 +379,6 @@ project ('spring-kafka-test') {
}
}

project ('spring-kafka-docs') {
description = 'Spring Kafka Code Snippets For Docs'

dependencies {
api "org.springframework.boot:spring-boot-starter:$springBootVersion"
api project (':spring-kafka')
optionalApi 'org.jetbrains.kotlin:kotlin-stdlib'
optionalApi 'com.fasterxml.jackson.core:jackson-core'
optionalApi 'com.fasterxml.jackson.core:jackson-databind'
}

compileKotlin {
kotlinOptions {
jvmTarget = '17'
}
}

sonarqube {
skipProject = true
}

}

sonarqube {
properties {
property 'sonar.links.homepage', linkHomepage
property 'sonar.links.ci', linkCi
property 'sonar.links.issue', linkIssue
property 'sonar.links.scm', linkScmUrl
property 'sonar.links.scm_dev', linkScmDevConnection
}
}

configurations {
asciidoctorExtensions
micrometerDocs
Expand Down
2 changes: 1 addition & 1 deletion gradle/docs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ configurations {
}

dependencies {
asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.5.0")
asciidoctorExt('io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.6.0')
}

repositories {
Expand Down
22 changes: 11 additions & 11 deletions gradle/publish-maven.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'

publishing {
publications {
Expand Down Expand Up @@ -27,17 +26,23 @@ publishing {
developerConnection = linkScmDevConnection
}
developers {
developer {
id = 'sobychacko'
name = 'Soby Chacko'
email = '[email protected]'
roles = ['project lead']
}
developer {
id = 'garyrussell'
name = 'Gary Russell'
email = '[email protected]'
roles = ["project lead"]
email = '[email protected]'
roles = ['project founder and project lead emeritus']
}
developer {
id = 'abilan'
id = 'artembilan'
name = 'Artem Bilan'
email = 'abilan@vmware.com'
roles = ["contributor"]
email = 'artem.bilan@broadcom.com'
roles = ['contributor']
}
}
issueManagement {
Expand All @@ -56,8 +61,3 @@ publishing {
}
}
}

artifactoryPublish {
dependsOn build
publications(publishing.publications.mavenJava)
}
29 changes: 19 additions & 10 deletions spring-kafka-docs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
jar {
enabled = false
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'

sourcesJar {
enabled = false
}
description = 'Spring Kafka Docs module'

javadocJar {
enabled = false
dependencies {
implementation "org.springframework.boot:spring-boot-starter:$springBootVersion"
implementation project (':spring-kafka')
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
implementation 'com.fasterxml.jackson.core:jackson-core'
implementation 'com.fasterxml.jackson.core:jackson-databind'
}

publishMavenJavaPublicationToMavenLocal {
enabled = false
compileJava {
options.release = 17
}

compileKotlin {
kotlinOptions {
jvmTarget = '17'
}
}

0 comments on commit 2312e53

Please sign in to comment.