From 519bbfd21e9e2f04eae75f094eb9bd3e6bf79d87 Mon Sep 17 00:00:00 2001 From: Nex Date: Tue, 11 Sep 2018 22:19:08 +0800 Subject: [PATCH] Add dependencies --- .gitmodules | 3 +++ build.gradle | 34 ++++++++++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 3 ++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..05d91d3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/main/proto"] + path = src/main/proto + url = ssh://vcs@phabricator.internetapi.cn:2222/source/bdchain-grpc-api.git diff --git a/build.gradle b/build.gradle index a3060ce..5f8c5e3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,15 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6' + } +} + plugins { id 'java' + id 'com.google.protobuf' version '0.8.6' } group 'org.bdchain' @@ -7,10 +17,34 @@ version '1.0-SNAPSHOT' sourceCompatibility = 1.8 +def grpc_java_version = '1.14.0' + +protobuf { + protoc { + artifact = "com.google.protobuf:protoc:3.6.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 { + compile 'io.grpc:grpc-netty-shaded:' + grpc_java_version + compile 'io.grpc:grpc-protobuf:' + grpc_java_version + compile 'io.grpc:grpc-stub:' + grpc_java_version testCompile group: 'junit', name: 'junit', version: '4.12' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d2c45a4..881053b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Tue Sep 11 16:37:15 CST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip