Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
72 lines (63 loc) · 1.51 KB
/
Copy pathbuild.gradle
File metadata and controls
72 lines (63 loc) · 1.51 KB
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
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id 'java'
id "com.google.protobuf" version "0.8.17"
}
version '0.1.0'
repositories {
mavenCentral()
}
dependencies {
implementation "com.google.protobuf:protobuf-java:$protobufJavaVersion"
}
sourceSets {
main {
java {
srcDirs = [
"src/main/java",
"${buildDir}/generated/source/proto/main/java",
"${buildDir}/generated/source/proto/main/grpc"
]
}
}
}
def extension = Os.isFamily(Os.FAMILY_WINDOWS) ? '.cmd' : ''
// This is an optimization for the CI test workflow, allowing us not to run
// npm install on each test. The typescript files are only relevant when
// building the protocol for use in the website module.
def shouldUseTypescript = System.getenv("JSHEETS_PROTOCOL_BUILD_NO_TYPESCRIPT") != "true"
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.11.4"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.29.0'
}
if (shouldUseTypescript) {
"ts" {
def binary = project.projectDir.toPath().resolve(
"node_modules/.bin/protoc-gen-ts${extension}")
path = binary
}
}
}
generateProtoTasks {
all()*.plugins {
if (shouldUseTypescript) {
"ts" {
option 'service=grpc-web'
outputSubDir = 'js'
}
}
}
all()*.builtins {
"js" {
option 'import_style=commonjs'
option 'binary'
outputSubDir = 'js'
}
}
}
}
apply from: './package.gradle'