blob: f4d8748b6e28a5e7648e265f023fcef615b212cd [file] [log] [blame]
plugins {
id 'eclipse'
id 'idea'
id 'java'
id 'groovy'
id 'application'
}
description = "${artifactId} application"
group = "${groupId}"
version = "${version}"
mainClassName = '${package}.App'
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
ext {
versions = [
tapestry: "@tapestryVersion@",
tapestryTestify: "@tapestryTestifyVersion@",
tapestryXpath: "@tapestryXpathVersion@",
geb: "@gebVersion@",
groovy: "@groovyVersion@",
htmlunitDriver: "@htmlunitDriverVersion@",
jackson: "@jacksonVersion@",
json: "@jsonVersion@",
selenium: "@seleniumVersion@",
servletApi: "@servletApiVersion@",
spock: "@spockVersion@",
springBoot: "@springBootVersion@",
yasson: "@yassonVersion@"
]
}
repositories {
mavenCentral()
maven {
url 'https://repository.apache.org/content/repositories/staging/'
}
}
configurations {
provided
testUnitTapestryCompile.extendsFrom(testImplementation, provided)
testUnitTapestryRuntime.extendsFrom(testRuntimeOnly, provided)
testFunctionalTapestryCompile.extendsFrom(testImplementation, provided)
testFunctionalTapestryRuntime.extendsFrom(testRuntimeOnly, provided)
}
sourceSets {
main {
compileClasspath += configurations.provided
// To give the same path as IDEA has
// output.resourcesDir = 'build/production/${artifactId}'
// output.classesDir = 'build/production/${artifactId}'
}
test {
compileClasspath += configurations.provided
runtimeClasspath += configurations.provided
groovy {
exclude '**/tapestry/unit/**'
exclude '**/tapestry/functional/**'
}
}
testUnitTapestry {
groovy.srcDir file('src/test/groovy')
resources.srcDir file('src/test/resources')
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath + configurations.provided
runtimeClasspath += output + compileClasspath + configurations.provided
groovy {
include '**/tapestry/unit/**'
}
}
testFunctionalTapestry {
groovy.srcDir file('src/test/groovy')
resources.srcDir file('src/test/resources')
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath + configurations.provided
runtimeClasspath += output + compileClasspath + configurations.provided
groovy {
include '**/tapestry/functional/**'
}
}
}
dependencies {
implementation platform("org.springframework.boot:spring-boot-dependencies:${versions.springBoot}")
// Spring Boot
def excludeSpringBootStarterLogging = { exclude(group: 'org.springframework.boot', module: 'spring-boot-starter-logging') }
implementation("org.springframework.boot:spring-boot-starter", excludeSpringBootStarterLogging)
implementation("org.springframework.boot:spring-boot-starter-web", excludeSpringBootStarterLogging)
implementation("org.springframework.boot:spring-boot-starter-log4j2")
// Apache Tapestry
implementation("org.apache.tapestry:tapestry-core:${versions.tapestry}")
// CoffeeScript & Less support, plus resource minification
implementation("org.apache.tapestry:tapestry-webresources:${versions.tapestry}")
// Uncomment this to add support for spring, hibernate, bean validation and uploads
//implementation("org.apache.tapestry:tapestry-spring:$versions.tapestry")
//implementation("org.apache.tapestry:tapestry-hibernate:$versions.tapestry")
//implementation("org.apache.tapestry:tapestry-beanvalidator:$versions.tapestry")
//implementation("org.apache.tapestry:tapestry-upload:${tapestry}")
// Test
def excludeTestng = { exclude(group: 'org.testng'); }
testImplementation("org.springframework.boot:spring-boot-starter-test", excludeSpringBootStarterLogging)
testImplementation("org.spockframework:spock-core:${versions.spock}")
testImplementation("org.spockframework:spock-spring:${versions.spock}")
testImplementation("org.codehaus.groovy:groovy-all:${versions.groovy}", excludeTestng)
// Test Unit Tapestry
testUnitTapestryCompile("org.apache.tapestry:tapestry-test:${versions.tapestry}", excludeTestng)
testUnitTapestryCompile("net.sourceforge.tapestrytestify:tapestry-testify:${versions.tapestryTestify}", excludeTestng)
testUnitTapestryCompile("net.sourceforge.tapestryxpath:tapestry-xpath:${versions.tapestryXpath}", excludeTestng)
// Test Functional Tapestry
testFunctionalTapestryCompile("org.gebish:geb-spock:${versions.geb}")
testFunctionalTapestryCompile("org.seleniumhq.selenium:selenium-support:${versions.selenium}")
testFunctionalTapestryCompile("org.seleniumhq.selenium:htmlunit-driver:${versions.htmlunitDiver}")
// Miscellaneous
runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl")
runtimeOnly("org.eclipse:yasson:${versions.yasson}")
runtimeOnly("org.glassfish:javax.json:${versions.json}")
runtimeOnly("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")
runtimeOnly("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}")
provided("javax.servlet:javax.servlet-api:${versions.servletApi}")
}
run {
systemProperty 'tapestry.execution-mode', System.getProperty('tapestry.execution-mode')
}
test {
}
task testUnitTapestry(type: Test) {
group = 'Verification'
description = 'Runs the tapestry unit tests.'
systemProperty 'tapestry.service-reloading-enabled', 'false'
systemProperty 'tapestry.execution-mode', 'development'
systemProperty 'geb.driver', 'htmlunit'
testClassesDirs = sourceSets.testUnitTapestry.output.classesDirs
classpath = project.sourceSets.testUnitTapestry.runtimeClasspath
include '**/*Spec*'
}
task testFunctionalTapestry(type: Test) {
group = 'Verification'
description = 'Runs the tapestry functional tests.'
systemProperty 'tapestry.service-reloading-enabled', 'false'
systemProperty 'tapestry.execution-mode', 'development'
systemProperty 'geb.driver', 'htmlunit'
testClassesDirs = sourceSets.testFunctionalTapestry.output.classesDirs
classpath = project.sourceSets.testFunctionalTapestry.runtimeClasspath
}