-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
167 lines (137 loc) · 5.21 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
157
158
159
160
161
162
163
164
165
166
167
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '1.2.3'
id 'com.commercehub.gradle.plugin.avro' version "0.5.0"
}
archivesBaseName = 'snappy-poc'
allprojects {
version = '1.0.0'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/groups/public" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "http://repository.snappydata.io/repository/internal" }
maven { url "http://repository.snappydata.io/repository/snapshots" }
maven { url "http://mvnrepository.com/artifact" }
maven { url 'https://clojars.org/repo' }
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'scala'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: "com.commercehub.gradle.plugin.avro"
ext {
sparkVersion = '2.0.1-3'
snappyVersion = '1.0.0'
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 4, 'hours'
}
dependencies {
compile 'org.scala-lang:scala-library:2.11.6'
compile 'org.scala-lang:scala-reflect:2.11.6'
compile 'org.scala-lang:scala-compiler:2.11.6'
}
}
dependencies {
compileOnly "io.snappydata:snappydata-core_2.11:${snappyVersion}"
compileOnly "io.snappydata:snappydata-cluster_2.11:${snappyVersion}"
compileOnly "io.snappydata:snappy-spark-core_2.11:${sparkVersion}"
compileOnly "io.snappydata:snappy-spark-catalyst_2.11:${sparkVersion}"
compileOnly "io.snappydata:snappy-spark-sql_2.11:${sparkVersion}"
// compileOnly "io.snappydata:snappydata-aqp_2.11:${snappyVersion}"
compile 'com.miguno:kafka-avro-codec_2.10:0.1.1-SNAPSHOT'
compile 'org.apache.kafka:kafka_2.11:0.8.2.1'
compile 'com.twitter:algebird-core_2.10:0.1.11'
compile 'com.googlecode.javaewah:JavaEWAH:1.1.5'
compile 'org.joda:joda-convert:1.2'
compile 'com.opencsv:opencsv:3.3'
}
sourceSets {
test.compileClasspath += configurations.compileOnly
test.runtimeClasspath += configurations.compileOnly
}
task generateAvro(type: com.commercehub.gradle.plugin.avro.GenerateAvroJavaTask) {
source("src/avro")
outputDir = file("src/main/java")
}
compileJava.source(generateAvro.outputs)
avro.stringType = "charSequence"
ext {
assemblyJar = rootProject.tasks.getByPath(':assembly:shadowJar').outputs
}
def assemblyJar = tasks.getByPath(':assembly:shadowJar').outputs
task generateAdImpressions(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.adanalytics.KafkaAdImpressionProducer'
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar.files.asPath
}
task aggeregateAdImpressions_API(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.adanalytics.SnappyAPILogAggregator'
jvmArgs = ['-XX:MaxPermSize=512m']
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar.files.asPath
}
task aggeregateAdImpressions_SQL(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.adanalytics.SnappySQLLogAggregator'
jvmArgs = ['-XX:MaxPermSize=512m']
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar.files.asPath
}
task generateAdImpressions_Socket(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.benchmark.SocketAdImpressionGenerator'
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar.files.asPath
maxHeapSize = "8196m"
}
task startSnappyIngestionPerf_Socket(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.benchmark.SocketSnappyIngestionPerf'
jvmArgs = ['-XX:MaxPermSize=512m']
maxHeapSize = "8196m"
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar.files.asPath
}
task startSnappyIngestionPerf_CustomReceiver(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.benchmark.CustomReceiverSnappyIngestionPerf'
jvmArgs = ['-XX:MaxPermSize=512m']
maxHeapSize = "8196m"
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar.files.asPath
}
task startSnappyIngestionPerf_CSV(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.benchmark.CSVSnappyIngestionPerf'
jvmArgs = ['-XX:MaxPermSize=512m']
maxHeapSize = "8196m"
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar.files.asPath
}
task startSnappyIngestionPerf_Kafka(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.benchmark.KafkaSnappyIngestionPerf'
jvmArgs = ['-XX:MaxPermSize=512m']
maxHeapSize = "8196m"
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar.files.asPath
}
task product(type: Exec) {
dependsOn ':assembly:shadowJar'
def productDir = "${rootProject.buildDir}/snappydata-poc"
def snappyData = System.env.SNAPPYDATA
if (snappyData == null || snappyData.length() == 0) {
snappyData = "${projectDir}/../snappydata"
}
doFirst {
delete productDir
file("${productDir}/lib").mkdirs()
}
// first execute the snappydata "product" target based on env var SNAPPYDATA
workingDir snappyData
commandLine './gradlew', 'copyProduct', "-PcopyToDir=${productDir}"
// lastly copy own assembly fat jar in product lib dir
doLast {
copy {
from assemblyJar
into "${productDir}/lib"
}
}
}