-
Notifications
You must be signed in to change notification settings - Fork 55
/
build.gradle
140 lines (125 loc) · 4.7 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
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
}
project.repositories {
mavenCentral()
mavenLocal()
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
group = 'ru.yandex'
version = '1.1-SNAPSHOT'
sourceCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
def log4jVersion = '2.17.0'
def jettyVersion = '9.2.10.v20150310'
def springVersion = '4.1.6.RELEASE'
dependencies {
compile 'ru.yandex.clickhouse:clickhouse-jdbc:0.1.50'
compile 'com.google.guava:guava:21.0'
compile 'com.github.ben-manes.caffeine:caffeine:2.8.2'
compile 'com.google.code.gson:gson:2.3.1'
compile "org.springframework:spring-jdbc:$springVersion"
compile "org.springframework:spring-context:$springVersion"
compile "org.apache.logging.log4j:log4j-api:$log4jVersion"
compile "org.apache.logging.log4j:log4j-core:$log4jVersion"
compile "org.apache.logging.log4j:log4j-web:$log4jVersion"
compile 'commons-dbcp:commons-dbcp:1.4'
compile "org.eclipse.jetty:jetty-server:$jettyVersion"
compile "org.eclipse.jetty:jetty-servlet:$jettyVersion"
compile 'com.beust:jcommander:1.60'
compile 'com.zaxxer:HikariCP:3.4.5'
testCompile group: 'junit', name: 'junit', version: '4.8.1'
testCompile 'org.mockito:mockito-core:2.28.2'
testCompile group: 'com.mockrunner', name: 'mockrunner-jdbc', version: '2.0.1'
testCompile 'xerces:xercesImpl:2.12.0'
}
project.sourceSets {
script {
resources {
srcDir 'src/main/script'
}
}
}
mainClassName = 'ru.yandex.market.graphouse.GraphouseMain'
task insertPerfTest(type: CreateStartScripts) {
mainClassName = 'ru.yandex.market.graphouse.perf.InsertTest'
applicationName = 'inputPerfTest'
outputDir = new File(project.buildDir, 'scripts')
classpath = jar.outputs.files + project.configurations.runtime
applicationDefaultJvmArgs = [
'-Xmx1g',
]
doLast {
delete windowsScript
}
}
applicationDistribution.into("bin") {
from(insertPerfTest)
fileMode = 0755
}
distributions {
main {
contents {
from('src/main/script/log4j2.xml') {
into 'conf'
}
from('src/main/script/graphouse.vmoptions') {
into 'conf'
}
from('src/main/resources/graphouse-default.properties') {
rename('graphouse-default.properties', 'graphouse.properties')
into 'conf'
}
from('LICENSE') {
into ''
}
//Creating empty dir
into('') {
def logDirBase = new File("$buildDir/tmp/logDirBase")
new File(logDirBase.absolutePath + '/log').mkdirs()
from { logDirBase }
}
}
}
}
applicationDefaultJvmArgs = [
'-Dapp.home=GRAPHOUSE_APP_HOME',
'-Dlog4j.configurationFile=GRAPHOUSE_APP_HOME/conf/log4j2.xml',
'-XX:+HeapDumpOnOutOfMemoryError', '-XX:HeapDumpPath=GRAPHOUSE_APP_HOME/log/',
'-showversion', '-server', '-XX:+UseCompressedOops',
'-Dsun.net.inetaddr.ttl=60', '-Dsun.net.inetaddr.negative.ttl=0'
]
startScripts {
doLast {
// Make a version dependent GC logging
unixScript.text = unixScript.text.replace(
'# Collect all arguments for the java command, following the shell quoting and substitution rules\n',
'''\
GC_LOG_FILE=GRAPHOUSE_APP_HOME/log/graphouse.gc.log
UNIFIED_JVM_LOGGING="$JAVACMD -Xlog:gc -version 1>/dev/null 2>&1"
LEGACY_JVM_LOGGING="$JAVACMD -XX:+PrintGCDateStamps -version 1>/dev/null 2>&1"
if eval $UNIFIED_JVM_LOGGING && eval ! $LEGACY_JVM_LOGGING; then
GC_LOGGING_OPTIONS="-Xlog:gc*:file=${GC_LOG_FILE}:time:filecount=7,filesize=50M"
elif eval $LEGACY_JVM_LOGGING && eval ! $UNIFIED_JVM_LOGGING; then
GC_LOGGING_OPTIONS="-verbose:gc -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=50M -Xloggc:${GC_LOG_FILE}"
fi
GRAPHOUSE_OPTS="${GRAPHOUSE_OPTS} ${GC_LOGGING_OPTIONS}"
# Collect all arguments for the java command, following the shell quoting and substitution rules
'''.stripIndent()
)
unixScript.text = unixScript.text.replace('GRAPHOUSE_APP_HOME', '\$APP_HOME')
unixScript.text = unixScript.text.replace(
'APP_HOME="`pwd -P`"',
'APP_HOME="`pwd -P`"\n' +
'GRAPHOUSE_OPTS=$(cat $APP_HOME/conf/graphouse.vmoptions)'
)
delete windowsScript
}
}