-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
121 lines (107 loc) · 3.96 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
plugins {
id 'java'
id 'com.google.protobuf' version '0.8.8'
// distribution
id 'application'
id 'com.github.johnrengelman.shadow' version '4.0.4'
// ide
id 'idea'
id 'eclipse'
// test coverage
id 'jacoco'
// quality
id 'org.sonarqube' version '2.7.1'
// xenon --version reads version from this file
id 'de.fuerstenau.buildconfig' version '1.1.8'
}
description = 'Perform files and jobs operations with Xenon library from grpc service'
version = '3.0.2'
applicationName = 'xenon-grpc'
group = 'nl.esciencecenter.xenon.grpc'
mainClassName = 'nl.esciencecenter.xenon.grpc.XenonServerWrapper'
ext.grpcVersion = '1.21.0'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
ext.xenonLibVersion = '3.1.0'
ext.xenonCloudLibVersion = '3.0.2'
dependencies {
implementation "io.grpc:grpc-netty:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-services:${grpcVersion}"
compileOnly "javax.annotation:javax.annotation-api:1.2"
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation group: 'nl.esciencecenter.xenon', name: 'xenon', version: xenonLibVersion
// implementation group: 'nl.esciencecenter.xenon', name: 'xenon-all', version: xenonLibVersion
implementation group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-cloud', version: xenonCloudLibVersion
// implementation group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-hadoop', version: xenonLibVersion
// implementation group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-grid', version: xenonLibVersion
implementation 'net.sourceforge.argparse4j:argparse4j:0.8.1'
runtimeOnly 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.27.0'
testImplementation 'com.github.stefanbirkner:system-rules:1.19.0'
}
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.7.1'
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
clean {
delete protobuf.generatedFilesBaseDir
}
// Inform IntelliJ projects about the generated code. See https://github.com/google/protobuf-gradle-plugin#intellij-idea
idea {
module {
// Not using generatedSourceDirs because of
// https://discuss.gradle.org/t/support-for-intellij-2016/15294/8
sourceDirs += file("${projectDir}/build/generated/source/proto/main/java")
sourceDirs += file("${projectDir}/build/generated/source/proto/main/grpc")
}
}
// use shadow tasks everywhere
distZip.enabled = false
distTar.enabled = false
installDist.enabled = true
jacocoTestReport {
// Exclude classes of generated source code by protoc
// See https://stackoverflow.com/questions/29887805/filter-jacoco-coverage-reports-with-gradle
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['nl/esciencecenter/xenon/grpc/XenonProto*',
'nl/esciencecenter/xenon/grpc/*ServiceGrpc*'])
})
}
}
sonarqube {
properties {
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', 'xenon-middleware'
property 'sonar.projectKey', 'xenon-middleware_xenon-grpc'
property 'sonar.language', 'java'
property 'sonar.links.homepage', 'https://github.com/xenon-middleware/xenon-grpc'
}
}
buildConfig {
appName = project.applicationName
buildConfigField 'String', 'XENON_LIB_VERSION', "${xenonLibVersion}"
buildConfigField 'String', 'XENON_CLOUD_LIB_VERSION', "${xenonCloudLibVersion}"
}
shadowJar {
mergeServiceFiles()
}