-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
100 lines (86 loc) · 2.41 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
plugins {
id 'java'
id "maven-publish"
id "com.google.protobuf" version "0.8.6"
id "com.jetbrains.ruby.envs" version "0.0.4"
// id "com.jetbrains.python.envs" version "0.0.25"
// id 'com.linkedin.python' version "0.7.16"
// id 'com.linkedin.python-sdist' version "0.7.16"
// id 'com.github.blindpirate.gogradle' version '0.10'
}
apply from: 'ruby.gradle'
//apply from: 'go.gradle'
//apply from: 'python.gradle'
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
version '1.0.0'
dependencies {
//protobuf 'com.google.api.grpc:proto-google-common-protos:1.10.+'
compile 'com.google.protobuf:protobuf-java:3.6.+'
compile 'io.grpc:grpc-all:1.14.+'
}
protobuf {
// Configure the protoc executable
protoc {
// Download from repositories
artifact = 'com.google.protobuf:protoc:3.6.+'
}
plugins {
go {
path = "${System.getProperty('user.home')}/go/bin/protoc-gen-go"
}
// Define a plugin with name 'grpc'
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.11.+'
}
}
generateProtoTasks {
ofSourceSet('main')*.builtins {
python {}
ruby {
outputSubDir = 'ruby/lib'
}
}
ofSourceSet('main')*.plugins {
// Apply the "grpc" plugin whose spec is defined above, without
// options. Note the braces cannot be omitted, otherwise the
// plugin will not be added. This is because of the implicit way
// NamedDomainObjectContainer binds the methods.
grpc {}
go {
options.add('plugins=grpc')
}
}
}
//generatedFilesBaseDir = "$projectDir/build/src/generated"
}
publishing {
publications {
PubProto(MavenPublication) {
from components.java
artifact sourceJar
artifact protoJar
artifact protoTar
}
}
}
task sourceJar(type: Jar) {
classifier = "sources"
from sourceSets.main.allJava
}
task protoJar(type: Jar){
classifier = "protos"
from sourceSets.main.proto
}
task protoTar(type: Tar) {
baseName project.archivesBaseName
destinationDir project.distsDir
compression Compression.GZIP
from(sourceSets.main.proto)
}
assemble.dependsOn sourceJar
assemble.dependsOn protoJar
assemble.dependsOn protoTar