forked from bsideup/spring-boot-thrift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththrift.gradle
58 lines (45 loc) · 1.27 KB
/
thrift.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
import org.gradle.internal.os.OperatingSystem
repositories {
ivy {
artifactPattern "http://dl.bintray.com/bsideup/thirdparty/[artifact]-[revision](-[classifier]).[ext]"
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "ru.trylogic.gradle.plugins:gradle-thrift-plugin:0.1.1"
}
}
apply plugin: ru.trylogic.gradle.thrift.plugins.ThriftPlugin
task generateThrift(type : ru.trylogic.gradle.thrift.tasks.ThriftCompileTask) {
generator = 'java:beans,hashcode'
destinationDir = file("generated-src/main/java")
}
sourceSets {
main {
java {
srcDir generateThrift.destinationDir
}
}
}
clean {
delete generateThrift.destinationDir
}
idea {
module {
sourceDirs += [file('src/main/thrift'), generateThrift.destinationDir]
}
}
compileJava.dependsOn generateThrift
dependencies {
def thriftVersion = '0.9.1';
Map platformMapping = [
(OperatingSystem.WINDOWS) : 'win',
(OperatingSystem.MAC_OS) : 'osx'
].withDefault { 'nix' }
thrift "org.apache.thrift:thrift:$thriftVersion:${platformMapping.get(OperatingSystem.current())}@bin"
compile "org.apache.thrift:libthrift:$thriftVersion"
compile 'org.slf4j:slf4j-api:1.7.7'
}