forked from TIBCOSoftware/snappy-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
164 lines (136 loc) · 4.87 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
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '1.2.3'
id 'com.commercehub.gradle.plugin.avro' version "0.5.0"
}
archivesBaseName = 'AdImpressionLogAggr'
allprojects {
version = '0.2'
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:8089/repository/internal" }
maven { url "http://repository.snappydata.io:8089/repository/snapshots" }
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"
configurations {
provided {
description 'a dependency that is provided externally at runtime'
visible true
}
}
idea {
module {
scopes.PROVIDED.plus += [ configurations.provided ]
}
}
eclipse {
classpath {
plusConfigurations += [ configurations.provided ]
}
}
sourceSets {
main.compileClasspath += configurations.provided
main.runtimeClasspath -= configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}
javadoc.classpath += configurations.provided
ext {
sparkVersion = '1.6.1'
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 4, 'hours'
}
dependencies {
compile 'org.scala-lang:scala-library:2.10.6'
compile 'org.scala-lang:scala-reflect:2.10.6'
compile 'org.scala-lang:scala-compiler:2.10.6'
}
}
dependencies {
provided 'io.snappydata:snappy-core_2.10:0.2-SNAPSHOT'
provided 'io.snappydata:snappy-cluster_2.10:0.2-SNAPSHOT'
provided "io.snappydata:snappy-spark-core_2.10:${sparkVersion}"
provided "io.snappydata:snappy-spark-catalyst_2.10:${sparkVersion}"
provided "io.snappydata:snappy-spark-sql_2.10:${sparkVersion}"
provided "io.snappydata:snappy-spark-streaming_2.10:${sparkVersion}"
// provided 'io.snappydata:snappy-aqp:0.2-SNAPSHOT'
compile 'com.miguno:kafka-avro-codec_2.10:0.1.1-SNAPSHOT'
compile 'org.apache.kafka:kafka_2.10: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'
}
task generateAvro(type: com.commercehub.gradle.plugin.avro.GenerateAvroJavaTask) {
source("src/avro")
outputDir = file("src/main/java")
}
compileJava.source(generateAvro.outputs)
avro.stringType = "charSequence"
def assemblyJar = tasks.getByPath(':assembly:shadowJar').outputs
task generateAdImpressions(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.adanalytics.aggregator.KafkaAdImpressionGenerator'
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar
}
task aggeregateAdImpressions_API(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.adanalytics.aggregator.SnappyAPILogAggregator'
jvmArgs = ['-XX:MaxPermSize=512m']
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar
}
task aggeregateAdImpressions_SQL(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.adanalytics.aggregator.SnappySQLLogAggregator'
jvmArgs = ['-XX:MaxPermSize=512m']
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar
}
task generateAdImpressions_Socket(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.adanalytics.aggregator.SocketAdImpressionGenerator'
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar
}
task startSnappyIngestionPerf_Socket(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.adanalytics.benchmark.SocketSnappyIngestionPerf'
jvmArgs = ['-XX:MaxPermSize=512m']
maxHeapSize = "8196m"
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar
}
task startSnappyIngestionPerf_Kafka(type: JavaExec, dependsOn: classes) {
main = 'io.snappydata.adanalytics.benchmark.KafkaSnappyIngestionPerf'
jvmArgs = ['-XX:MaxPermSize=512m']
maxHeapSize = "8196m"
classpath sourceSets.test.runtimeClasspath
environment 'PROJECT_ASSEMBLY_JAR', assemblyJar
}
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"
}
}
}