-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
76 lines (67 loc) · 2.11 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
plugins {
id 'application'
}
group 'com.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
def javaFXPlatform = getJavaFXPlatform()
def javaFXVersion = "15.0.1"
dependencies {
// you need a dependency for each of the JavaFX modules you're going to use
implementation "org.openjfx:javafx-base:${javaFXVersion}:${javaFXPlatform}"
implementation "org.openjfx:javafx-controls:${javaFXVersion}:${javaFXPlatform}"
implementation "org.openjfx:javafx-graphics:${javaFXVersion}:${javaFXPlatform}"
implementation "org.openjfx:javafx-fxml:${javaFXVersion}:${javaFXPlatform}"
testImplementation 'io.cucumber:cucumber-java:6.1.1'
testImplementation 'io.cucumber:cucumber-java8:6.1.1'
implementation 'junit:junit:4.12'
}
configurations {
cucumberRuntime {
extendsFrom testImplementation
}
}
sourceSets {
main {
resources {
srcDirs = ["src/main/java"]
includes = ["**/*.fxml","**/*.css","**/*.png","**/*.PNG"]
}
}
}
application {
//Your JavaFX application class
mainClass.set('Launcher')
}
java {
// this enables Java Modularity in Gradle (version 6.7 and above)
modularity.inferModulePath.set(true)
}
// Based on this StackOverflow answer: https://stackoverflow.com/a/65209664/653519
private static String getJavaFXPlatform() {
def currentOS = org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.currentOperatingSystem;
if (currentOS.isWindows()) {
return 'win'
} else if (currentOS.isLinux()) {
return 'linux'
} else if (currentOS.isMacOsX()) {
return 'mac'
}
return null
}
task cucumberTests() {
dependsOn assemble, testClasses
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin', 'pretty',
'--plugin', 'html:target/cucumber-report.html',
'src/test/resources']
}
}
}
rootProject.tasks.getByName('build').dependsOn cucumberTests