Files
spring-webflow/build.gradle
Rossen Stoyanchev 6e09359203 Update dependencies
2021-02-15 10:49:28 +00:00

370 lines
9.1 KiB
Groovy

buildscript {
repositories {
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.9.2")
classpath "org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16"
}
}
plugins {
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
}
ext {
moduleProjects = subprojects.findAll { it.name.startsWith("spring-") }
javaProjects = subprojects - project("spring-js-resources")
withoutJclOverSlf4j = {
exclude group: "org.slf4j", name: "jcl-over-slf4j"
}
}
allprojects {
group = "org.springframework.webflow"
apply plugin: "java"
apply plugin: "io.spring.dependency-management"
apply plugin: "org.springframework.build.optional-dependencies"
apply from: "${rootProject.projectDir}/ide.gradle"
dependencyManagement {
imports {
mavenBom "org.springframework:spring-framework-bom:5.3.3"
mavenBom "org.springframework.security:spring-security-bom:5.4.4"
mavenBom "org.junit:junit-bom:5.7.1"
}
dependencies {
dependency "javax.servlet:javax.servlet-api:4.0.1"
dependency "javax.servlet:jstl:1.2"
dependency "javax.servlet.jsp:javax.servlet.jsp-api:2.3.2-b02"
dependency "javax.el:javax.el-api:3.0.1-b06"
dependency "javax.validation:validation-api:2.0.1.Final"
dependencySet(group: 'org.hibernate', version: '5.4.27.Final') {
entry 'hibernate-core'
entry 'hibernate-entitymanager'
}
dependency "org.hibernate:hibernate-validator:6.2.0.Final"
dependencySet(group: 'com.sun.faces', version: '2.2.20') {
entry 'jsf-api'
entry 'jsf-impl'
}
dependencySet(group: 'org.apache.tiles', version: '3.0.8') {
entry 'tiles-api'
entry('tiles-core', withoutJclOverSlf4j)
entry('tiles-servlet', withoutJclOverSlf4j)
entry('tiles-jsp', withoutJclOverSlf4j)
entry('tiles-el', withoutJclOverSlf4j)
entry('tiles-extras') {
exclude group: "org.springframework", name: "spring-web"
}
}
dependency "org.apache.myfaces.core:myfaces-impl:2.2.14"
dependency "com.sun.facelets:jsf-facelets:1.1.14"
dependency "org.hsqldb:hsqldb:2.5.0"
dependencySet(group: 'org.apache.logging.log4j', version: '2.14.0') {
entry 'log4j-api'
entry 'log4j-core'
entry 'log4j-slf4j-impl'
entry 'log4j-jul'
}
dependency "org.slf4j:slf4j-api:1.7.30"
dependency("junit:junit:4.13.2")
dependency "org.easymock:easymock:4.2"
dependency "org.hamcrest:hamcrest:2.1"
dependency "org.apache.tomcat:tomcat-jasper-el:9.0.34"
dependency "org.apache.myfaces.test:myfaces-test22:1.0.8"
}
generatedPomCustomization {
enabled = false
}
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
}
}
repositories {
mavenCentral()
if (version.endsWith('SNAPSHOT')) {
maven { url "https://repo.spring.io/snapshot" }
}
}
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 0, "seconds"
cacheDynamicVersionsFor 0, "seconds"
}
}
}
subprojects { subproject ->
apply from: "${rootProject.projectDir}/publish-maven.gradle"
sourceCompatibility=1.8
targetCompatibility=1.8
[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none"]
sourceSets.test.resources.srcDirs = ["src/main/java", "src/test/resources", "src/test/java"]
jar {
manifest.attributes["Implementation-Title"] = subproject.name
manifest.attributes["Implementation-Version"] = subproject.version
from("${rootProject.projectDir}/src/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
}
configure(javaProjects) { javaProject ->
test {
useJUnitPlatform()
include(["**/*Tests.class", "**/*Test.class"])
systemProperty("java.awt.headless", "true")
systemProperty("testGroups", project.properties.get("testGroups"))
}
javadoc {
options.memberLevel = JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
}
task sourcesJar(type: Jar, dependsOn:classes) {
archiveClassifier = "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
archiveClassifier = "javadoc"
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
configure(rootProject) {
description = "Spring Web Flow"
repositories {
maven { url "https://repo.spring.io/plugins-release" }
}
configurations {
docs
}
ext {
docResourcesVersion = "0.2.1.RELEASE"
}
dependencies {
docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip"
}
task prepareAsciidocBuild(type: Sync) {
dependsOn configurations.docs
// copy doc resources
from {
configurations.docs.collect { zipTree(it) }
}
// and doc sources
from "src/reference/"
// to a build directory of your choice
into "$buildDir/asciidoc/build"
}
apply plugin: 'org.asciidoctor.convert'
task('makePDF', type: org.asciidoctor.gradle.AsciidoctorTask) {
dependsOn prepareAsciidocBuild
onlyIf { !project.version.endsWith("SNAPSHOT") }
backends 'pdf'
sourceDir "$buildDir/asciidoc/build"
sources {
include 'index.adoc'
}
options doctype: 'book', eruby: 'erubis'
logDocuments = true
attributes 'icons': 'font',
'sectanchors': '',
'toc': '',
'source-highlighter' : 'coderay',
revnumber: project.version
}
asciidoctor {
dependsOn makePDF
// run asciidoctor from that directory
sourceDir "$buildDir/asciidoc/build"
sources {
include 'index.adoc'
}
resources {
from(sourceDir) {
include 'images/*', 'css/**', 'js/**'
}
}
logDocuments = true
backends = ["html5"]
options doctype: 'book', eruby: 'erubis'
attributes 'docinfo': 'shared',
// use provided stylesheet
stylesdir: "css/",
stylesheet: 'spring.css',
'linkcss': true,
'icons': 'font',
// use provided highlighter
'source-highlighter=highlight.js',
'highlightjsdir=js/highlight',
'highlightjs-theme=github',
revnumber: project.version
}
// don"t publish the default jar for the root project
configurations.archives.artifacts.clear()
artifacts {
}
task api(type: Javadoc) {
group = "Documentation"
description = "Generates aggregated Javadoc API documentation."
title = "${rootProject.description} ${version} API"
options.memberLevel = JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.overview = "src/api/overview.html"
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
destinationDir = new File(buildDir, "api")
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
maxMemory = "1024m"
}
task docsZip(type: Zip) {
group = "Distribution"
archiveBaseName = "spring-webflow"
archiveClassifier = "docs"
description = "Builds -${archiveClassifier} archive containing api and reference " +
"for deployment at static.springframework.org/spring-webflow/docs."
from (api) {
into "api"
}
from (asciidoctor) {
include "*.html"
include "css/**"
include "js/**"
include "images/**"
into "reference"
}
from (makePDF) {
include "*.pdf"
into "reference"
}
}
task schemaZip(type: Zip) {
group = "Distribution"
archiveBaseName = "spring-webflow"
archiveClassifier = "schema"
description = "Builds -${archiveClassifier} archive containing all " +
"XSDs for deployment at static.springframework.org/schema."
subprojects.each { subproject ->
Properties schemas = new Properties()
subproject.sourceSets.main.resources.find {
it.path.endsWith("META-INF/spring.schemas")
}?.withInputStream { schemas.load(it) }
for (def key : schemas.keySet()) {
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
assert shortName != key
File xsdFile = subproject.sourceSets.main.allSource.find {
it.path.endsWith(schemas.get(key))
} as File
assert xsdFile != null
into (shortName) {
from xsdFile.path
}
}
}
project(":spring-webflow").sourceSets.main.resources.matching {
include '**/engine/model/builder/xml/*.xsd'
}.each { File file ->
into ('webflow') {
from file.path
}
}
}
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
group = "Distribution"
archiveBaseName = "spring-webflow"
archiveClassifier = "dist"
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
"suitable for community download page."
def baseDir = "${archiveBaseName}-${project.version}"
from("src/dist") {
include "notice.txt"
into "${baseDir}"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
from("src/dist") {
include "readme.txt"
include "license.txt"
into "${baseDir}"
expand(version: project.version)
}
from(zipTree(docsZip.archiveFile)) {
into "${baseDir}/docs"
}
from(zipTree(schemaZip.archiveFile)) {
into "${baseDir}/schema"
}
subprojects.each { subproject ->
into ("${baseDir}/libs") {
from subproject.jar
if (subproject.tasks.findByPath("sourcesJar")) {
from subproject.sourcesJar
}
if (subproject.tasks.findByPath("javadocJar")) {
from subproject.javadocJar
}
}
}
}
artifacts {
archives docsZip
archives schemaZip
archives distZip
}
}