/
build.gradle
167 lines (142 loc) · 5.28 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
buildscript {
ext {
kotlin_version = '1.9.+'
serialization_version = '1.0.0'
kotlin_exposed_version = '0.35.+'
kotlin_coroutines_version = '1.7.+'
h2_database_version = '1.4.200' // mvcc support broke in an update (as of 10/2020). until fixed, use this ver
jvm_target = '1.8'
junit_version = '5.2.0'
log4j2_version = '2.16.+'
protobuf_plugin_version = '0.8.16'
protobuf_version = '3.21.7'
grpc_version = '1.37.+'
grpc_kotlin_version = '1.1.0'
kotlinx_html_version = '0.9.1'
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: kotlin_version
classpath group: 'org.jetbrains.kotlin', name: 'kotlin-serialization', version: kotlin_version
classpath group: 'com.google.protobuf', name: 'protobuf-gradle-plugin', version: protobuf_plugin_version
classpath group: 'com.ullink.gradle', name: 'gradle-msbuild-plugin', version: '3.12'
}
}
apply plugin: 'kotlin'
apply plugin: 'kotlinx-serialization'
apply plugin: 'com.google.protobuf'
apply plugin: 'com.ullink.msbuild'
allprojects {
apply plugin: 'kotlin'
apply plugin: 'kotlinx-serialization'
group 'net.cydhra'
version '0.1.0'
repositories {
mavenCentral()
maven { url 'https://jitpack.io/' }
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
kotlinOptions.jvmTarget = jvm_target
}
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobuf_version"
}
plugins {
client {
artifact = 'com.github.googleapis:gapic-generator-kotlin:master-SNAPSHOT:core@jar'
}
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:$grpc_version"
}
grpckt {
artifact = "io.grpc:protoc-gen-grpc-kotlin:$grpc_kotlin_version:jdk7@jar"
}
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.plugins {
// generate client side stuff and message builders
client {
option("test-output=build/generated/source/clientTest")
}
// generate server API
grpc {}
grpckt {}
}
}
}
}
sourceSets {
main {
java.srcDirs += "${protobuf.generatedFilesBaseDir}/main/java"
java.srcDirs += "${protobuf.generatedFilesBaseDir}/main/grpc"
java.srcDirs += "${protobuf.generatedFilesBaseDir}/main/grpckt"
java.srcDirs += "${protobuf.generatedFilesBaseDir}/main/client"
}
test {
java.srcDirs += "${project.buildDir}/generated/source/clientTest"
}
}
// main source set and test
dependencies {
// kotlin
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: kotlin_coroutines_version
implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-serialization-protobuf',
version: serialization_version
implementation group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlin_version
// modules
api project(':Workspace')
api project(':Features')
// protobuf
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: protobuf_version
// grpc
implementation group: 'com.github.googleapis.gax-kotlin', name: 'kgax-grpc', version: 'main-SNAPSHOT'
implementation group: 'io.grpc', name: 'grpc-netty-shaded', version: grpc_version
implementation group: 'io.grpc', name: 'grpc-services', version: grpc_version
implementation group: 'io.grpc', name: 'grpc-kotlin-stub', version: grpc_kotlin_version
// logging
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4j2_version
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4j2_version
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4j2_version
// argument parsing for CLI
implementation group: 'com.xenomachina', name: 'kotlin-argparser', version: '2.0.7'
// testing (mocking required for autogenerated grpc tests)
testImplementation group: 'org.jetbrains.kotlin', name: 'kotlin-test'
testImplementation group: 'org.jetbrains.kotlin', name: 'kotlin-test-junit'
testImplementation group: 'com.nhaarman', name: 'mockito-kotlin', version: '1.6.0'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.23.4'
}
test {
useJUnit()
testLogging {
events "passed", "skipped", "failed"
}
}
jar {
manifest {
attributes "Implementation-Title": project.name,
"Implementation-Version": project.version,
"Main-Class": "net.cydhra.acromantula.AcromantulaServiceKt"
}
}
msbuild {
solutionFile = 'Gui/Acromantula GUI.sln'
verbosity = 'detailed'
targets = ['Rebuild']
}
task runGui(type: Exec) {
dependsOn(':msbuild')
group = 'run'
workingDir 'Gui/Acromantula GUI'
commandLine 'cmd', '/c', '"bin\\Debug\\Acromantula GUI.exe"'
}