Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
82 lines (76 loc) · 2.96 KB
/
Copy pathbuild.gradle
File metadata and controls
82 lines (76 loc) · 2.96 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
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'project-report'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
//apply plugin: 'distribution'
sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:+'
}
jar.destinationDir = file("${project.buildDir}/lib")
task createAllStartScripts() << {
// just a placeholder
}
def scripts = [
'jmxServer': 'com.anagram.server.jmx.AnagramServiceJMXServer',
'tcpServer': 'com.anagram.server.tcp.AnagramServiceTCPServer',
'jmxClient': 'com.anagram.client.AnagramClient',
'localClient': 'com.anagram.client.AnagramClient',
'tcpClient': 'com.anagram.client.AnagramClient'
]
scripts.each() { scriptName, className ->
def t = tasks.create(name: scriptName+'StartScript', type: CreateStartScripts) {
mainClassName = className
applicationName = scriptName
outputDir = new File(project.buildDir, 'scripts')
classpath = jar.outputs.files + project.configurations.runtime
switch (scriptName) {
case 'jmxServer':
defaultJvmOpts = [
'-Dcom.sun.management.jmxremote',
'-Dcom.sun.management.jmxremote.local.only=false',
'-Dcom.sun.management.jmxremote.port=9999',
'-Dcom.sun.management.jmxremote.authenticate=false',
'-Dcom.sun.management.jmxremote.ssl=false',
'-Danagram.service.stripes.count=10'
]
break;
case 'jmxClient':
defaultJvmOpts = [
'-Danagram.service.factory.mode=JMX',
'-Danagram.service.stripes.count=1'
]
break;
case 'localClient':
defaultJvmOpts = [
'-Danagram.service.factory.mode=LOCAL',
'-Danagram.service.stripes.count=1'
]
break;
case 'tcpServer':
defaultJvmOpts = [
'-Danagram.service.stripes.count=10'
]
break;
case 'tcpClient':
defaultJvmOpts = [
'-Danagram.service.factory.mode=TCP',
'-Danagram.service.stripes.count=1'
]
break;
}
}
applicationDistribution.into("bin") {
from(t)
fileMode = 0755
}
createAllStartScripts.dependsOn(t)
}