buildscript { repositories { mavenCentral() } dependencies { classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.13' } } plugins { id 'java' id 'com.google.protobuf' version '0.9.1' id 'com.github.johnrengelman.shadow' version '6.0.0' } group 'org.bdware' version 'dev-221113' compileJava { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } def grpc_java_version = '1.41.0' def junit_version = '5.7.0' tasks.withType(JavaCompile) { options.encoding = "UTF-8" } sourceSets { main { proto { // In addition to the default 'src/main/proto' srcDir 'api/grpc/pb' } } } test { useJUnitPlatform() // testLogging { // events "passed", "skipped", "failed" // } } javadoc { source = sourceSets.main.allJava classpath = configurations.runtimeClasspath options { encoding 'UTF-8' charSet 'UTF-8' title "BDLedger Java SDK API" } } protobuf { protoc { artifact = "com.google.protobuf:protoc:3.13.0" } plugins { grpc { artifact = 'io.grpc:protoc-gen-grpc-java:' + grpc_java_version } } generatedFilesBaseDir = "$projectDir/src" generateProtoTasks { all()*.plugins { grpc { outputSubDir = 'java' } } } } repositories { mavenCentral() } dependencies { 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 if (JavaVersion.current().isJava9Compatible()) { // Workaround for @javax.annotation.Generated // see: https://github.com/grpc/grpc-java/issues/3633 implementation 'javax.annotation:javax.annotation-api:1.3.2' } 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 }