bdledger-java-sdk/build.gradle

93 lines
2.1 KiB
Groovy
Raw Normal View History

2018-09-11 14:19:08 +00:00
buildscript {
repositories {
mavenCentral()
}
dependencies {
2020-09-23 02:52:25 +00:00
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.13'
2018-09-11 14:19:08 +00:00
}
}
2018-09-11 08:06:10 +00:00
plugins {
id 'java'
2022-11-14 07:25:58 +00:00
id 'com.google.protobuf' version '0.9.1'
2020-11-04 03:05:47 +00:00
id 'com.github.johnrengelman.shadow' version '6.0.0'
2018-09-11 08:06:10 +00:00
}
2020-02-07 09:39:34 +00:00
group 'org.bdware'
2022-11-14 07:40:02 +00:00
version 'dev-221113'
2018-09-11 08:06:10 +00:00
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
2018-09-11 08:06:10 +00:00
2022-11-14 07:25:58 +00:00
def grpc_java_version = '1.41.0'
2020-09-23 02:52:25 +00:00
def junit_version = '5.7.0'
2018-09-11 14:19:08 +00:00
2018-09-14 02:15:36 +00:00
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
2020-04-18 13:45:18 +00:00
sourceSets {
main {
proto {
// In addition to the default 'src/main/proto'
srcDir 'api/grpc/pb'
}
}
}
2018-11-28 08:44:52 +00:00
test {
useJUnitPlatform()
// testLogging {
// events "passed", "skipped", "failed"
// }
}
2018-09-14 02:15:36 +00:00
javadoc {
source = sourceSets.main.allJava
2022-11-14 07:25:58 +00:00
classpath = configurations.runtimeClasspath
2018-09-14 02:15:36 +00:00
options {
encoding 'UTF-8'
charSet 'UTF-8'
2020-03-03 18:53:07 +00:00
title "BDLedger Java SDK API"
2018-09-14 02:15:36 +00:00
}
}
2018-09-11 14:19:08 +00:00
protobuf {
protoc {
2020-11-04 03:05:47 +00:00
artifact = "com.google.protobuf:protoc:3.13.0"
2018-09-11 14:19:08 +00:00
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:' + grpc_java_version
}
}
generatedFilesBaseDir = "$projectDir/src"
generateProtoTasks {
all()*.plugins {
grpc {
outputSubDir = 'java'
}
}
}
}
2018-09-11 08:06:10 +00:00
repositories {
mavenCentral()
}
dependencies {
2022-11-14 07:25:58 +00:00
implementation 'io.grpc:grpc-netty-shaded:' + grpc_java_version
implementation 'io.grpc:grpc-protobuf:' + grpc_java_version
implementation 'io.grpc:grpc-stub:' + grpc_java_version
2020-02-07 09:39:34 +00:00
if (JavaVersion.current().isJava9Compatible()) {
// Workaround for @javax.annotation.Generated
// see: https://github.com/grpc/grpc-java/issues/3633
2022-11-14 07:25:58 +00:00
implementation 'javax.annotation:javax.annotation-api:1.3.2'
2020-02-07 09:39:34 +00:00
}
2018-11-28 08:44:52 +00:00
testImplementation 'org.junit.jupiter:junit-jupiter-api:' + junit_version
testImplementation 'org.junit.jupiter:junit-jupiter-params:' + junit_version
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:' + junit_version
2018-09-11 08:06:10 +00:00
}