Skip to content

Commit

Permalink
Add spring-js-tiles3 module
Browse files Browse the repository at this point in the history
Issue: SWF-1575
  • Loading branch information
rstoyanchev committed Mar 7, 2014
1 parent 852863f commit 3c1ef54
Show file tree
Hide file tree
Showing 11 changed files with 651 additions and 15 deletions.
80 changes: 69 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ buildscript {
}

configure(allprojects) {
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "javadocHotfix"

group = "org.springframework.webflow"

apply plugin: "propdeps"
apply plugin: "java"
apply from: "${rootProject.projectDir}/ide.gradle"
apply plugin: "javadocHotfix"
}

configure(subprojects) { subproject ->
configure(subprojects - project(":spring-build-src")) { subproject ->

apply plugin: "java"
apply plugin: "propdeps"
apply plugin: "merge"
apply from: "${rootProject.projectDir}/publish-maven.gradle"

sourceCompatibility=1.6
Expand Down Expand Up @@ -58,7 +60,7 @@ configure(subprojects.findAll {it.name != "spring-js-resources"}) { subproject -
subproject.ext {
springVersion = "4.0.1.RELEASE"
springSecurityVersion = "3.2.0.RELEASE"
slf4jVersion = "1.6.1"
slf4jVersion = "1.7.5"
log4jVersion = "1.2.15"
}

Expand Down Expand Up @@ -89,6 +91,18 @@ configure(subprojects.findAll {it.name != "spring-js-resources"}) { subproject -
}
}

project("spring-build-src") {
description = "Exposes gradle buildSrc for IDE support"
apply plugin: "groovy"

dependencies {
compile gradleApi()
compile localGroovy()
}

configurations.archives.artifacts.clear()
}

project("spring-binding") {
description = "Spring Binding"

Expand Down Expand Up @@ -133,10 +147,18 @@ project("spring-js") {
compile("org.springframework:spring-webmvc:$springVersion")
provided("javax.servlet:javax.servlet-api:3.0.1")
optional("org.apache.tiles:tiles-api:2.2.2")
optional("org.apache.tiles:tiles-core:2.2.2")
optional("org.apache.tiles:tiles-jsp:2.2.2")
optional("org.apache.tiles:tiles-servlet:2.2.2")
testCompile("javax.servlet:jstl:1.2")
optional("org.apache.tiles:tiles-core:2.2.2") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
optional("org.apache.tiles:tiles-jsp:2.2.2") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
optional("org.apache.tiles:tiles-servlet:2.2.2") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
testCompile("javax.servlet:jstl:1.2") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
testCompile("log4j:log4j:$log4jVersion") {
exclude group: "javax.mail", module: "mail"
exclude group: "javax.jms", module: "jms"
Expand All @@ -149,6 +171,42 @@ project("spring-js") {
}
}

project("spring-js-tiles3") {
description = "Spring JS Tiles 3 Integration"
merge.into = project(":spring-js")

dependencies {
compile("commons-logging:commons-logging:1.1.1")
compile("org.springframework:spring-core:$springVersion")
compile("org.springframework:spring-webmvc:$springVersion")
optional("javax.el:javax.el-api:2.2.4")
optional("javax.servlet:javax.servlet-api:3.0.1")
optional("javax.servlet.jsp:jsp-api:2.2")
optional("org.apache.tiles:tiles-request-api:1.0.1")
optional("org.apache.tiles:tiles-api:3.0.1")
optional("org.apache.tiles:tiles-core:3.0.1") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
optional("org.apache.tiles:tiles-servlet:3.0.1") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
optional("org.apache.tiles:tiles-jsp:3.0.1") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
optional("org.apache.tiles:tiles-el:3.0.1") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
}
optional("org.apache.tiles:tiles-extras:3.0.1") {
exclude group: "org.slf4j", module: "jcl-over-slf4j"
exclude group: "org.springframework", module: "spring-web"
}
testCompile("javax.servlet:jstl:1.2")
testCompile("org.slf4j:jcl-over-slf4j:$slf4jVersion")
testCompile("org.slf4j:slf4j-api:$slf4jVersion")
testCompile("org.springframework:spring-test:$springVersion")
}
}

project("spring-webflow") {
description = "Spring Web Flow"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
implementation-class=org.springframework.build.gradle.MergePlugin
104 changes: 104 additions & 0 deletions ide.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import org.gradle.plugins.ide.eclipse.model.ProjectDependency
import org.gradle.plugins.ide.eclipse.model.SourceFolder


apply plugin: "propdeps-eclipse"
apply plugin: "propdeps-idea"

eclipse.jdt {
sourceCompatibility = 1.6
targetCompatibility = 1.6
}

// Replace classpath entries with project dependencies (GRADLE-1116)
eclipse.classpath.file.whenMerged { classpath ->
def regexp = /.*?\/([^\/]+)\/build\/[^\/]+\/(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb)
def projectOutputDependencies = classpath.entries.findAll { entry -> entry.path =~ regexp }
projectOutputDependencies.each { entry ->
def matcher = (entry.path =~ regexp)
if(matcher) {
def projectName = matcher[0][1]
def path = "/${projectName}"
if(!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) {
def dependency = new ProjectDependency(path, project(":${projectName}").path)
dependency.exported = true
classpath.entries.add(dependency)
}
classpath.entries.remove(entry)
}
}
classpath.entries.removeAll { entry -> (entry.path =~ /(?!.*?repack.*\.jar).*?\/([^\/]+)\/build\/libs\/[^\/]+\.jar/) }
}


// Use separate main/test outputs (prevents WTP from packaging test classes)
eclipse.classpath.defaultOutputDir = file(project.name+"/bin/eclipse")
eclipse.classpath.file.beforeMerged { classpath ->
classpath.entries.findAll{ it instanceof SourceFolder }.each {
if(it.output.startsWith("bin/")) {
it.output = null
}
}
}
eclipse.classpath.file.whenMerged { classpath ->
classpath.entries.findAll{ it instanceof SourceFolder }.each {
it.output = "bin/" + it.path.split("/")[1]
}
}

// Allow projects to be used as WPT modules
eclipse.project.natures "org.eclipse.wst.common.project.facet.core.nature"


// Include project specific settings
task eclipseSettings(type: Copy) {
from rootProject.files(
"src/eclipse/org.eclipse.jdt.ui.prefs",
"src/eclipse/org.eclipse.wst.common.project.facet.core.xml")
into project.file('.settings/')
outputs.upToDateWhen { false }
}

task eclipseWstComponent(type: Copy) {
from rootProject.files(
"src/eclipse/org.eclipse.wst.common.component")
into project.file('.settings/')
expand(deployname: project.name)
outputs.upToDateWhen { false }
}

task eclipseJdtPrepare(type: Copy) {
from rootProject.file("src/eclipse/org.eclipse.jdt.core.prefs")
into project.file(".settings/")
outputs.upToDateWhen { false }
}

task cleanEclipseJdtUi(type: Delete) {
delete project.file(".settings/org.eclipse.jdt.ui.prefs")
delete project.file("org.eclipse.jdt.core.prefs")
delete project.file(".settings/org.eclipse.wst.common.component")
delete project.file(".settings/org.eclipse.wst.common.project.facet.core.xml")
}

tasks["eclipseJdt"].dependsOn(eclipseJdtPrepare)
tasks["cleanEclipse"].dependsOn(cleanEclipseJdtUi)
tasks["eclipse"].dependsOn(eclipseSettings, eclipseWstComponent)


// Filter 'build' folder

eclipse.project.file.withXml {
def node = it.asNode()

def filteredResources = node.get("filteredResources")
if(filteredResources) {
node.remove(filteredResources)
}
def filterNode = node.appendNode("filteredResources").appendNode("filter")
filterNode.appendNode("id", "1359048889071")
filterNode.appendNode("name", "")
filterNode.appendNode("type", "30")
def matcherNode = filterNode.appendNode("matcher")
matcherNode.appendNode("id", "org.eclipse.ui.ide.multiFilter")
matcherNode.appendNode("arguments", "1.0-projectRelativePath-matches-false-false-build")
}
4 changes: 4 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ rootProject.name = 'webflow'
include 'spring-binding'
include 'spring-faces'
include 'spring-js'
include 'spring-js-tiles3'
include 'spring-js-resources'
include 'spring-webflow'

// Exposes gradle buildSrc
include "buildSrc"
rootProject.children.find{ it.name == "buildSrc" }.name = "spring-build-src"
Loading

0 comments on commit 3c1ef54

Please sign in to comment.