-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
108 lines (93 loc) · 3.09 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
apply plugin: 'java'
apply from: "$rootDir/common.gradle"
repositories {
jcenter()
}
/*
sourceSets {
test {
java {
srcDirs = ['tests/KafkaTests/src/test/java']
}
output.classesDir = 'tests/KafkaTests/bin'
}
}
*/
/* Defs */
def STREAMS_INSTALL = System.getenv("STREAMS_INSTALL")
def toolkitVersion = ext.getVersion()
dependencies {
compile fileTree(dir: STREAMS_INSTALL + '/lib', include: ['com.ibm.streams.operator.jar'])
compile fileTree(dir: STREAMS_INSTALL + '/toolkits/com.ibm.streamsx.topology/lib', include : ['com.ibm.streamsx.topology.jar'])
compile 'junit:junit:4.12'
compile project(':com.ibm.streamsx.kafka')
}
task copyToTemp(type: Copy) {
from 'com.ibm.streamsx.kafka'
into 'build/release/com.ibm.streamsx.kafka'
}
task copySamplesToTemp(type: Copy) {
from 'samples'
into 'build/release/samples'
}
task copyDocToTemp(dependsOn: 'spldoc', type: Copy) {
from 'docs'
into 'build/release/com.ibm.streamsx.kafka/doc'
}
task removeSrc(type: Delete) {
delete 'build/release/com.ibm.streamsx.kafka/build'
delete 'build/release/com.ibm.streamsx.kafka/build.gradle'
delete 'build/release/com.ibm.streamsx.kafka/impl/java/src'
delete 'build/release/com.ibm.streamsx.kafka/impl/src'
delete 'build/release/com.ibm.streamsx.kafka/impl/bin'
delete 'build/release/com.ibm.streamsx.kafka/bin'
delete 'build/release/com.ibm.streamsx.kafka/.gradle'
delete 'build/release/com.ibm.streamsx.kafka/.toolkitList'
delete 'build/release/com.ibm.streamsx.kafka/.classpath'
delete 'build/release/com.ibm.streamsx.kafka/.apt_generated'
delete 'build/release/com.ibm.streamsx.kafka/.project'
delete 'build/release/com.ibm.streamsx.kafka/.settings'
delete 'build/release/com.ibm.streamsx.kafka/impl/include'
delete 'build/release/com.ibm.streamsx.kafka/data'
delete 'build/release/com.ibm.streamsx.kafka/impl/java'
delete fileTree ('build/release/com.ibm.streamsx.kafka/opt/downloaded') {
// log4j is also part of the Streams Java Operator API so any version in the toolkit will be ignored.
include 'log4j-2.17.2.*.jar'
}
}
task removeOldRelease(type: Delete) {
delete fileTree(dir: 'build/release', include: '**/**')
}
task archive(type: Tar) {
dependsOn copyToTemp
dependsOn copySamplesToTemp
dependsOn copyDocToTemp
dependsOn removeSrc
from('build/release/') {
exclude('output')
}
compression = Compression.GZIP
destinationDir = file('build/release/output')
baseName = "com.ibm.streamsx.kafka"
version = toolkitVersion
doLast {
ant.checksum file: archivePath, algorithm: 'SHA-1', fileext: '.sha1'
}
}
task release {
dependsOn build
dependsOn removeOldRelease
dependsOn archive
}
task spldoc(dependsOn: ":com.ibm.streamsx.kafka:build") {
doLast {
spldoc('com.ibm.streamsx.kafka', 'Kafka Toolkit')
}
}
task deleteSplDocDir {
delete "docs"
}
clean.finalizedBy deleteSplDocDir
archive.mustRunAfter removeSrc
removeSrc.mustRunAfter copyToTemp
copyToTemp.mustRunAfter build, removeOldRelease