-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
187 lines (170 loc) · 8.78 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
apply plugin: 'scala'
compileScala.options.encoding = 'UTF-8'
// fix scala+java mix to all use compileScala which uses correct dependency order
sourceSets.main.scala.srcDir 'src/main/scala/aqp'
sourceSets.main.java.srcDirs = ['src/test/java/app', 'gemfire-core/src/main/java']
sourceSets.test.java.srcDirs = []
sourceSets.test.scala.srcDirs = [ 'src/test/java', 'src/test/scala',
'src/dunit/java', 'src/dunit/scala' ,'src/test/scala/aqp']
ext {
PRODUCT_NAME = 'SnappyData AQP'
createdBy = System.getProperty('user.name')
if (rootProject.hasProperty('enablePublish')) {
createdBy = vendorName
}
osArch = System.getProperty('os.arch')
osName = org.gradle.internal.os.OperatingSystem.current()
osVersion = System.getProperty('os.version')
buildDate = new Date().format('yyyy-MM-dd HH:mm:ss Z')
buildNumber = new Date().format('MMddyy')
jdkVersion = System.getProperty('java.version')
gitCmd = "git --git-dir=${project.projectDir}/.git --work-tree=${project.projectDir}"
gitBranch = "${gitCmd} rev-parse --abbrev-ref HEAD".execute().text.trim()
commitId = "${gitCmd} rev-parse HEAD".execute().text.trim()
sourceDate = "${gitCmd} log -n 1 --format=%ai".execute().text.trim()
clusterType = ''
}
dependencies {
compile 'org.scala-lang:scala-library:' + scalaVersion
compile 'org.scala-lang:scala-reflect:' + scalaVersion
runtime project(':snappy-cluster_' + scalaBinaryVersion)
compile (project(':snappy-core_' + scalaBinaryVersion)) {
exclude(group: 'org.apache.spark', module: 'spark-unsafe_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-core_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-catalyst_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-sql_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-hive_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-streaming_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-streaming-kafka-0-10_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-sql-kafka-0-10_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-mllib_' + scalaBinaryVersion)
exclude(group: 'org.eclipse.jetty', module: 'jetty-servlet')
}
if (new File(rootDir, 'spark/build.gradle').exists()) {
compile project(':snappy-spark:snappy-spark-repl_' + scalaBinaryVersion)
compile project(':snappy-spark:snappy-spark-yarn_' + scalaBinaryVersion)
compile project(':snappy-spark:snappy-spark-graphx_' + scalaBinaryVersion)
compile project(':snappy-spark:snappy-spark-hive-thriftserver_' + scalaBinaryVersion)
} else {
compile 'io.snappydata:snappy-spark-repl_' + scalaBinaryVersion + ':' + snappySparkVersion
compile 'io.snappydata:snappy-spark-yarn_' + scalaBinaryVersion + ':' + snappySparkVersion
compile 'io.snappydata:snappy-spark-graphx_' + scalaBinaryVersion + ':' + snappySparkVersion
compile 'io.snappydata:snappy-spark-hive-thriftserver_' + scalaBinaryVersion + ':' + snappySparkVersion
}
if (new File(rootDir, 'store/build.gradle').exists()) {
testCompile project(':snappy-store:snappydata-store-client')
testCompile project(':snappy-store:snappydata-store-core')
testCompile project(':snappy-store:snappydata-store-tools')
testCompile project(path: ':snappy-store:snappydata-store-tools', configuration: 'testOutput')
} else {
testCompile group: 'io.snappydata', name: 'snappydata-store-client', version: snappyStoreVersion
testCompile group: 'io.snappydata', name: 'snappydata-store-core', version: snappyStoreVersion
testCompile group: 'io.snappydata', name: 'snappydata-store-tools', version: snappyStoreVersion
testCompile group: 'io.snappydata', name: 'snappydata-store-tools', version: snappyStoreVersion, classifier: 'tests'
}
testRuntime (project(':snappy-core_' + scalaBinaryVersion)) {
exclude(group: 'org.apache.spark', module: 'spark-unsafe_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-core_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-catalyst_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-sql_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-hive_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-streaming_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-streaming-kafka-0-10_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-sql-kafka-0-10_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-mllib_' + scalaBinaryVersion)
exclude(group: 'org.eclipse.jetty', module: 'jetty-servlet')
}
testRuntime project(':snappy-cluster_' + scalaBinaryVersion)
testCompile project(':dunit')
testCompile (project(path: ':snappy-core_' + scalaBinaryVersion, configuration: 'testOutput')) {
exclude(group: 'org.apache.spark', module: 'spark-unsafe_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-core_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-catalyst_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-sql_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-hive_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-streaming_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-streaming-kafka-0-10_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-sql-kafka-0-10_' + scalaBinaryVersion)
exclude(group: 'org.apache.spark', module: 'spark-mllib_' + scalaBinaryVersion)
exclude(group: 'org.eclipse.jetty', module: 'jetty-servlet')
}
testRuntime project(':snappy-core_' + scalaBinaryVersion)
testCompile project(':snappy-cluster_' + scalaBinaryVersion)
testCompile project(':dunit')
testCompile project(path: ':snappy-core_' + scalaBinaryVersion, configuration: 'testOutput')
testCompile project(path: ':snappy-cluster_' + scalaBinaryVersion, configuration: 'testOutput')
testCompile "org.scalatest:scalatest_${scalaBinaryVersion}:${scalatestVersion}"
testRuntime files("${projectDir}/../tests/common/src/main/resources")
testRuntime "org.pegdown:pegdown:${pegdownVersion}"
}
// Creates the version properties file and writes it to the resources dir
task createVersionPropertiesFile(dependsOn: 'processResources') {
def propertiesDir = file("${sourceSets.main.scala.outputDir}/io/snappydata")
outputs.file "${propertiesDir}/SnappyAQPVersion.properties"
inputs.file "${rootProject.projectDir}/build.gradle"
if (rootProject.hasProperty('clusterType')) {
clusterType = rootProject.property('clusterType')
}
doLast {
def props = [
'Product-Name' : PRODUCT_NAME,
'Product-Version' : version,
'Build-Id' : buildIdPrefix + buildNumber,
'Build-Date' : buildDate,
'Build-Platform' : osName.getName() + osVersion + osArch,
'Build-Java-Version': jdkVersion,
'Source-Date' : sourceDate,
'Source-Revision' : commitId,
'Source-Repository' : gitBranch,
'Cluster-Type' : clusterType
]
writeProperties(propertiesDir, 'SnappyAQPVersion.properties',
"Properties that control what version ${PRODUCT_NAME} will think it is. Changing these values may cause ${PRODUCT_NAME} to no longer function.", props)
}
}
compileJava {
dependsOn createVersionPropertiesFile
doLast {
// copy native JNI libraries to snappy-spark-unsafe output
if (new File(rootDir, 'spark/build.gradle').exists()) {
def unsafeProject = project(":snappy-spark:snappy-spark-unsafe_${scalaBinaryVersion}")
copy {
from "${projectDir}/lib"
into "${unsafeProject.buildDir}/libs"
}
copy {
from "${projectDir}/lib"
into "${unsafeProject.sourceSets.main.java.outputDir}/.."
}
}
}
}
publishArtifacts.add(packageTests)
archivesBaseName = 'snappydata-aqp-scala-tests'
testClasses.doLast {
if (new File(rootDir, 'store/build.gradle').exists()) {
copy {
from ("src/test/java"){
include '**/*.bt'
include '**/*.conf'
include '**/*.sql'
}
into project(':snappy-store:snappydata-store-tests').sourceSets.main.java.outputDir
}
}
}
scalaTest {
dependsOn ':cleanScalaTest'
doFirst {
// cleanup files since scalatest plugin does not honour workingDir yet
cleanIntermediateFiles(project.path)
}
doLast {
// cleanup files since scalatest plugin does not honour workingDir yet
cleanIntermediateFiles(project.path)
}
}
test.dependsOn ':cleanJUnit'
check.dependsOn.clear()
check.dependsOn test, scalaTest, dunitTest
archivesBaseName = 'snappydata-aqp_' + scalaBinaryVersion