-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
137 lines (115 loc) · 3.65 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
plugins {
id "groovy"
id "maven-publish"
id "com.github.node-gradle.node" version "3.4.0"
}
description = "Use React together with Tapestry"
group = "de.eddyson"
version = "0.36.0"
def versions= [
tapestry: '5.8.2',
slf4j: '1.7.36',
// test scopes
geb: '5.1',
selenium: '3.141.59'
]
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
node {
download = true
version = "14.20.0"
}
dependencies {
implementation "org.slf4j:slf4j-api:$versions.slf4j"
implementation "org.apache.tapestry:tapestry-core:$versions.tapestry"
implementation ("org.apache.tapestry:tapestry-webresources:$versions.tapestry"){
exclude group:'com.google.javascript', module: 'closure-compiler'
exclude group:'com.github.sommeri', module: 'less4j'
}
implementation "commons-io:commons-io:2.11.0"
implementation "org.mozilla:rhino:1.7.14" // DNK-2311
testImplementation "javax.servlet:javax.servlet-api:4.0.1"
testImplementation "org.apache.tapestry:tapestry-spock:$versions.tapestry"
testImplementation "com.github.eddyson-de:tapestry-geb:0.47.0"
testImplementation "org.gebish:geb-spock:$versions.geb"
testImplementation "org.seleniumhq.selenium:selenium-firefox-driver:$versions.selenium"
testImplementation "org.seleniumhq.selenium:selenium-chrome-driver:$versions.selenium"
testImplementation "org.apache.tapestry:tapestry-webresources:$versions.tapestry"
testImplementation "io.github.bonigarcia:webdrivermanager:5.2.1"
testImplementation "org.slf4j:slf4j-simple:$versions.slf4j"
}
def compiledCoffeeScriptDir = "${project.buildDir}/compiled-coffeescript"
task compileCoffeeScript(type: NpxTask) {
dependsOn npmInstall
command = "coffee"
args = [ "-c", "-o", compiledCoffeeScriptDir, 'src/main/resources/META-INF/modules' ]
inputs.files fileTree(dir: 'src/main/resources/META-INF/modules', include: '**/*.coffee')
outputs.dir compiledCoffeeScriptDir
doFirst {
delete compiledCoffeeScriptDir
}
}
processResources {
dependsOn npmInstall, compileCoffeeScript
from('node_modules/react/umd'){
into 'de/eddyson/tapestry/react/services'
}
from('node_modules/react-dom/umd'){
into 'de/eddyson/tapestry/react/services'
}
from('node_modules/prop-types'){
include 'prop-types*.js'
into 'de/eddyson/tapestry/react/services'
}
from('node_modules/babel-standalone'){
include 'babel.min.js'
into 'de/eddyson/tapestry/react/services'
}
}
test {
useJUnitPlatform()
}
tasks.withType(Test){
systemProperty "geb.env", System.getProperty("geb.env") ?: 'firefox'
systemProperty "tapestry.service-reloading-enabled", "false"
systemProperty "tapestry.execution-mode", "test"
systemProperty 'webappLocation', 'src/test/webapp'
systemProperty 'jettyPort', 9040
enableAssertions = true
testLogging {
exceptionFormat "full"
}
}
jar {
manifest { attributes 'Tapestry-Module-Classes': 'de.eddyson.tapestry.react.modules.ReactModule' }
rootSpec.exclude 'META-INF/modules/**/*.coffee'
from(compiledCoffeeScriptDir){ into "META-INF/modules" }
}
task sourceJar(type: Jar) {
dependsOn classes
classifier "sources"
from sourceSets.main.allSource
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact tasks.sourceJar
}
}
}
task runTestApp(type:JavaExec) {
mainClass = "org.apache.tapestry5.test.JettyRunner"
args "-d", "src/test/webapp/", "-p", "9040"
systemProperties["tapestry.execution-mode"] = "test"
classpath = configurations.testRuntimeClasspath + sourceSets.test.output + sourceSets.main.output
}
clean {
delete 'node_modules'
}