forked from aatarasoff/thrift-api-gateway-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
117 lines (94 loc) · 2.6 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
import org.gradle.internal.os.OperatingSystem
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1'
classpath "ru.trylogic.gradle.plugins:gradle-thrift-plugin:0.1.1"
}
}
group 'ru.aatarasoff.thrift'
version '0.2.1'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'thrift'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
repositories {
ivy {
artifactPattern "http://dl.bintray.com/bsideup/thirdparty/[artifact]-[revision](-[classifier]).[ext]"
artifactPattern "http://dl.bintray.com/aatarasoff/maven/[artifact]-[revision](-[classifier]).[ext]"
}
}
apply plugin: 'thrift'
task generateThriftJava(type : ru.trylogic.gradle.thrift.tasks.ThriftCompileTask) {
generator = 'java:privatemembers'
destinationDir = file("generated-src/generated/java")
source = "src/test/thrift"
}
sourceSets {
test {
java {
srcDir generateThriftJava.destinationDir
}
}
}
clean {
delete generateThriftJava.destinationDir
}
idea {
module {
sourceDirs += file('src/test/thrift')
sourceDirs += generateThriftJava.destinationDir
}
}
compileJava.dependsOn generateThriftJava
dependencies {
def thriftVersion = '0.9.2';
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"
}
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
compile 'org.apache.thrift:libthrift:0.9.2'
compile 'ch.qos.logback:logback-classic:1.1.3'
compile 'org.apache.commons:commons-lang3:3.4'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
idea.module.excludeDirs = []
idea.module.testSourceDirs += file(generateThriftJava.destinationDir)
idea.module.generatedSourceDirs += file(generateThriftJava.destinationDir)
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
}
}
}
bintray {
user = System.properties['BINTRAY_USER']
key = System.properties['BINTRAY_KEY']
publications = ['mavenJava']
publish = true
pkg {
repo = 'maven'
name = 'thrift-api-gateway-core'
}
}