-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
executable file
·85 lines (66 loc) · 2.19 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
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.0'
id 'application'
id 'idea'
id "com.google.protobuf" version "0.8.6"
}
group 'samgarasx'
version '1.0.0'
apply from: 'versions.gradle'
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://dl.bintray.com/kotlin/exposed/" }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "io.grpc:grpc-netty-shaded:$grpc_version"
implementation "io.grpc:grpc-protobuf:$grpc_version"
implementation "io.grpc:grpc-stub:$grpc_version"
implementation "com.typesafe:config:$typesafe_config_version"
implementation "com.beust:klaxon:$klaxon_version"
implementation "org.jetbrains.exposed:exposed:$exposed_version"
implementation "org.postgresql:postgresql:$postgresql_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
}
sourceSets {
main.java.srcDirs += "$buildDir/generated/source/proto/main/java"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.5.1-1' }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:$grpc_version" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}
startScripts.enabled = false
task fruitStoreServer(type: CreateStartScripts) {
mainClassName = 'grpckotlin.FruitStoreServer'
applicationName = 'fruit-store-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task fruitStoreClient(type: CreateStartScripts) {
mainClassName = 'grpckotlin.FruitStoreClient'
applicationName = 'fruit-store-client'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into('bin') {
from(fruitStoreServer)
from(fruitStoreClient)
fileMode = 0755
}
task startServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'grpckotlin.FruitStoreServerKt'
}
task startClient(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'grpckotlin.FruitStoreClientKt'
}