Files
Artem Bilan 05b5ed8fbf Upgrade dependencies; prepare for release
* Fix logic in the `SmbSendingMessageHandlerTests` and `SmbSessionFactoryWithCIFSContextTests`
to deal with the remote dir creation properly
2022-05-03 13:10:47 -04:00

241 lines
6.5 KiB
Groovy

buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2' }
maven { url 'https://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'io.spring.gradle:docbook-reference-plugin:0.3.1'
}
}
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'jacoco'
id 'checkstyle'
id 'org.sonarqube' version '2.8'
id 'com.jfrog.artifactory' version '4.15.2'
}
description = 'Spring Integration SMB Support'
group = 'org.springframework.integration'
repositories {
mavenCentral()
if (version.endsWith('BUILD-SNAPSHOT')) {
maven { url 'https://repo.spring.io/libs-snapshot' }
}
maven { url 'https://repo.spring.io/libs-milestone' }
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
ext {
idPrefix = 'smb'
jcifsVersion = '2.1.29'
log4jVersion = '2.17.2'
springIntegrationVersion = '5.3.10.RELEASE'
linkHomepage = 'https://github.com/SpringSource/spring-integration-extensions'
linkCi = 'https://build.springsource.org/browse/INTEXT'
linkIssue = 'https://github.com/spring-projects/spring-integration-extensions/issues'
linkScmUrl = 'https://github.com/SpringSource/spring-integration-extensions'
linkScmConnection = 'https://github.com/SpringSource/spring-integration-extensions.git'
linkScmDevConnection = 'git@github.com:SpringSource/spring-integration-extensions.git'
}
eclipse.project.natures += 'org.springframework.ide.eclipse.core.springnature'
java {
withJavadocJar()
withSourcesJar()
}
sourceSets {
test {
resources {
srcDirs = ['src/test/resources', 'src/test/java']
}
}
}
jacoco {
toolVersion = '0.8.5'
}
checkstyle {
configDirectory.set(rootProject.file("src/checkstyle"))
toolVersion = '8.33'
}
dependencies {
api "org.codelibs:jcifs:$jcifsVersion"
api "org.springframework.integration:spring-integration-file:$springIntegrationVersion"
testImplementation "org.springframework.integration:spring-integration-test:$springIntegrationVersion"
testRuntimeOnly "org.apache.logging.log4j:log4j-core:$log4jVersion"
testRuntimeOnly "org.apache.logging.log4j:log4j-jcl:$log4jVersion"
}
// enable all compiler warnings; individual projects may customize further
[compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:all,-options,-processing']
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/reports/jacoco/html")
}
}
test {
// suppress all console output during testing unless running `gradle -i`
logging.captureStandardOutput(LogLevel.INFO)
maxHeapSize = '1024m'
jacoco {
destinationFile = file("$buildDir/jacoco.exec")
}
}
apply plugin: 'docbook-reference'
reference {
sourceDir = file('src/reference/docbook')
}
sonarqube {
properties {
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
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
property "sonar.java.coveragePlugin", "jacoco"
}
}
task schemaZip(type: Zip) {
group = 'Distribution'
archiveClassifier = 'schema'
description = "Builds -${archiveClassifier} archive containing all " +
"XSDs for deployment at static.springframework.org/schema."
Properties schemas = new Properties()
def shortName = idPrefix.replaceFirst("${idPrefix}-", '')
project.sourceSets.main.resources.find {
it.path.endsWith("META-INF${File.separator}spring.schemas")
}?.withInputStream { schemas.load(it) }
for (def key : schemas.keySet()) {
File xsdFile = project.sourceSets.main.resources.find {
it.path.replaceAll('\\\\', '/').endsWith(schemas.get(key))
}
assert xsdFile != null
into("integration/${shortName}") {
from xsdFile.path
}
}
}
task docsZip(type: Zip) {
group = 'Distribution'
archiveClassifier = 'docs'
description = "Builds -${archiveClassifier} archive containing api and reference " +
"for deployment at static.springframework.org/spring-integration/docs."
from('src/dist') {
include 'changelog.txt'
}
from(javadoc) {
into 'api'
}
from(reference) {
into 'reference'
}
}
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
group = 'Distribution'
archiveClassifier = 'dist'
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${project.name}-${project.version}"
from('src/dist') {
include 'readme.txt'
include 'license.txt'
include 'notice.txt'
into "${baseDir}"
}
from(zipTree(docsZip.archiveFile)) {
into "${baseDir}/docs"
}
from(zipTree(schemaZip.archiveFile)) {
into "${baseDir}/schema"
}
into("${baseDir}/libs") {
from project.jar
from project.sourcesJar
from project.javadocJar
}
}
// Create an optional "with dependencies" distribution.
// Not published by default; only for use when building from source.
task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
group = 'Distribution'
archiveClassifier = 'dist-with-deps'
description = "Builds -${archiveClassifier} archive, containing everything " +
"in the -${distZip.archiveClassifier} archive plus all dependencies."
from zipTree(distZip.archiveFile)
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(":${zipTask.name}")) {
def projectName = rootProject.name
def artifacts = new HashSet()
rootProject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact ->
def dependency = artifact.moduleVersion.id
if (!projectName.equals(dependency.name)) {
artifacts << artifact.file
}
}
zipTask.from(artifacts) {
into "${distZip.baseDir}/deps"
}
}
}
}
task dist(dependsOn: assemble) {
group = 'Distribution'
description = 'Builds -dist, -docs and -schema distribution archives.'
}
apply from: "${rootProject.projectDir}/publish-maven.gradle"