-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
100 lines (94 loc) · 2.63 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
// How to run
// (1) modify ext block below, if need be.
// (2) "gradle run"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin:'application'
mainClassName = 'sophie.net.pac.PacTest'
ext {
pac = "testbed/proxy.pac" // pac file written in JaveScript
// pac = 'testbed/PacFunctionParade.pac'
urls = "testbed/urls.txt" // URL list to be tested
// trace = false
// date = "2016-9-30" // yyyy-mm-dd
// time = "12:30:00" // hh:mm[:ss]
// timezone = "JST" // timezone
// myIpAddress = "125.152.2.128"
// hosts = ["hello.world.com", "128.56.22.55", "not.resolvable.com", "0.0.0.0"]
// encoding = "UTF-8" // encoding of pac and urls files
}
repositories { jcenter() }
dependencies {
}
test {
useTestNG()
}
jar {
from (configurations.compile.resolve().collect { it.isDirectory() ? it : fileTree(it) }) {
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
exclude '**/*.jar'
}
def manifestClasspath = configurations.compile.collect{ 'lib/' + it.getName() }.join(' ')
manifest {
attributes 'Main-Class': project.mainClassName
}
copy {
from configurations.compile
into "build/libs/lib"
}
}
run {
doFirst {
main(project.mainClassName)
if(project.hasProperty('trace')) {
if(!trace) args += "trace=false"
}
if(project.hasProperty('date')) {
if(date) {
args += '-date'
args += date
}
}
if(project.hasProperty('time')) {
if(time) {
args += '-time'
args += time
}
}
if(project.hasProperty('timezone')) {
if(timezone) {
args += '-timezone'
args += timezone
}
}
if(project.hasProperty('myIpAddress')) {
if(myIpAddress) {
args += '-myIpAddress'
args += myIpAddress
}
}
if(project.hasProperty('hosts')) {
if(hosts) {
args += '-hosts'
args += '('
hosts.each {
args += it
}
args += ')'
}
}
if(project.hasProperty('encoding')) {
if(encoding) {
args += '-encoding'
args += encoding
}
}
args += "${pac}"
args += "${urls}"
println args
}
}