forked from JoelCourtney/parspice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
82 lines (69 loc) · 2.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
plugins {
id 'java'
id 'com.google.protobuf' version '0.8.13'
}
def grpcVersion = '1.33.0'
def protobufVersion = '3.12.0'
def protocVersion = protobufVersion
sourceSets {
main {
java {
srcDir 'build/generated/sources/automation/main/java'
srcDir 'build/generated/source/proto/main/grpc'
srcDir 'build/generated/source/proto/main/java'
}
proto {
srcDir 'build/generated/sources/automation/main/proto'
}
}
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
implementation files("/${System.env.JNISPICE_ROOT}/src/JNISpice")
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "javax.annotation:javax.annotation-api:1.3.2"
runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}"
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.12.0"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.33.0'
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
all().each { task ->
task.dependsOn 'genFromCSPICE'
}
}
}
test {
useJUnitPlatform()
systemProperty "java.library.path", file("/${System.env.JNISPICE_ROOT}/lib")
}
import org.apache.tools.ant.taskdefs.condition.Os
task genFromCSPICE(type: Exec) {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', file("$rootDir/src/build/gen.py"), file("/${System.env.JNISPICE_ROOT}/src/JNISpice/spice/basic/CSPICE.java")
} else if (Os.isFamily(Os.FAMILY_UNIX)) {
commandLine file("$rootDir/src/build/gen.py"), file("/${System.env.JNISPICE_ROOT}/src/JNISpice/spice/basic/CSPICE.java")
} else {
println('OS not supported: ' + Os.toString())
}
}
tasks.compileJava.dependsOn(genFromCSPICE)
compileJava {
options.compilerArgs << '-Xlint:unchecked'
}