-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
157 lines (126 loc) · 4.06 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'application'
group = 'com.xored'
version = '1.01'
description = """TRex Scapy Packet Editor GUI Application"""
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
mainClassName='com.xored.javafx.packeteditor.TRexPacketCraftingTool'
if (!hasProperty('mainClass')) {
ext.mainClass = mainClassName
}
repositories {
mavenLocal()
mavenCentral()
}
sourceSets {
intTest {
compileClasspath = sourceSets.main.output + configurations.testRuntime
runtimeClasspath = output + sourceSets.main.output + configurations.testRuntime
java {
srcDirs = ['src/integration-test/java']
}
}
uiTest {
compileClasspath = sourceSets.main.output + configurations.testRuntime
runtimeClasspath = output + sourceSets.main.output + configurations.testRuntime
java {
srcDirs = ['src/ui-test/java']
}
}
}
test {
testLogging {
events "passed", "skipped", "failed"
}
}
task intTest(type: Test) {
description 'Runs Scapy Server integration testing'
outputs.upToDateWhen { false }
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
}
task copyTestResources(type: Copy) {
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/resources/test"
}
task uiTest(type: Test) {
description 'Runs UI testing(E2E)'
outputs.upToDateWhen { false }
testClassesDirs = sourceSets.uiTest.output.classesDirs
classpath = sourceSets.uiTest.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
exceptionFormat "full"
}
if (project.hasProperty('headless')) {
// for running JavaFX tests headless using Monocle
jvmArgs "-Dheadless=true"
}
}
processUiTestResources.dependsOn copyTestResources
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile "org.testfx:testfx-core:4.0.+"
testCompile "org.testfx:testfx-junit:4.0.+"
testRuntime "org.testfx:openjfx-monocle:1.8.0_20"
compile group: 'com.google.inject', name: 'guice', version: '4.0'
compile group: 'org.zeromq', name: 'jeromq', version: '0.5.1'
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21'
if (project.hasProperty('release') || !project.hasProperty('packetEditorLogger') ) {
compile group: 'org.slf4j', name: 'slf4j-nop', version: '1.7.21'
} else {
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.7'
}
compile group: 'org.controlsfx', name: 'controlsfx', version: '8.40.12'
testCompile group: 'org.controlsfx', name: 'controlsfx', version: '8.40.12'
}
jar {
manifest {
attributes 'Main-Class': mainClassName
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
task createPom << {
pom {
project {
groupId = group
artifactId 'TRexPacketCraftingTool'
version = version
inceptionYear '2016'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}.writeTo("pom.xml")
}
apply plugin: 'javafx-gradle-plugin'
buildscript {
dependencies {
classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.+'
}
repositories {
mavenLocal()
mavenCentral()
}
}
jfx {
mainClass = mainClassName
jfxMainAppJarName = "TRexPacketCraftingTool.jar"
appName = "TRexPacketCraftingTool"
nativeReleaseVersion = version
vendor = 'Xored'
}