-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle
More file actions
153 lines (129 loc) · 4.36 KB
/
Copy pathbuild.gradle
File metadata and controls
153 lines (129 loc) · 4.36 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
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.38.0"
def versions = [
tapestry: '5.9.0',
slf4j : '2.0.13',
// test scopes
geb : '6.0',
selenium: '4.30.0'
]
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
node {
download = true
version = "14.20.0"
}
configurations.configureEach {
resolutionStrategy {
force(
"org.codehaus.groovy:groovy:3.0.24"
)
}
}
dependencies {
implementation "org.slf4j:slf4j-api:$versions.slf4j"
implementation "org.apache.tapestry:tapestry-core-jakarta:$versions.tapestry"
implementation("org.apache.tapestry:tapestry-webresources-jakarta:$versions.tapestry") {
exclude group: 'com.google.javascript', module: 'closure-compiler'
exclude group: 'com.github.sommeri', module: 'less4j'
}
implementation "commons-io:commons-io:2.16.1"
implementation "org.mozilla:rhino:1.7.15" // DNK-2311
testImplementation "jakarta.servlet:jakarta.servlet-api:6.1.0"
testImplementation "org.apache.tapestry:tapestry-spock-jakarta:$versions.tapestry"
testImplementation("org.apache.tapestry:tapestry-test-jakarta:$versions.tapestry") {
exclude group: 'org.seleniumhq.selenium'
exclude group: 'org.eclipse.jetty'
}
testImplementation "com.github.eddyson-de:tapestry-geb:v0.51.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-jakarta:$versions.tapestry"
testImplementation "io.github.bonigarcia:webdrivermanager:6.3.1"
testImplementation "org.slf4j:slf4j-simple:$versions.slf4j"
}
def compiledCoffeeScriptDir = "${project.buildDir}/compiled-coffeescript"
tasks.register("compileCoffeeScript", 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).configureEach {
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"
}
//ProcessBuilder can't find 'node' anymore. Therefor we add the version generated by com.github.node-gradle.node to
//the PATH. This could prove problematic on different OSs.
environment 'PATH', "${project.rootDir}/.gradle/nodejs/node-v14.20.0-linux-x64/bin" + System.getProperty("path.separator") + System.getenv("PATH")
}
jar {
manifest { attributes 'Tapestry-Module-Classes': 'de.eddyson.tapestry.react.modules.ReactModule' }
rootSpec.exclude 'META-INF/modules/**/*.coffee'
from(compiledCoffeeScriptDir){ into "META-INF/modules" }
}
tasks.register("sourceJar", Jar) {
dependsOn classes
archiveClassifier.set("sources")
from sourceSets.main.allSource
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact tasks.sourceJar
}
}
}
tasks.register("runTestApp", JavaExec) {
mainClass = "de.eddyson.tapestrygeb.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'
}