From 62f8b31cf00cbc81238aa90874d562a7ecb74f45 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Sat, 5 Nov 2016 22:47:18 +0300 Subject: [PATCH] Google protobuf has been added to the build --- backend.native/build.gradle | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/backend.native/build.gradle b/backend.native/build.gradle index 300b8294b9d..eab4f5fe8d0 100644 --- a/backend.native/build.gradle +++ b/backend.native/build.gradle @@ -5,10 +5,12 @@ buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.0" } } +apply plugin: "com.google.protobuf" apply plugin: 'java' apply plugin: 'kotlin' apply plugin: org.jetbrains.kotlin.NativeInteropPlugin @@ -40,7 +42,8 @@ allprojects { sourceSets { compiler { - java.srcDir 'compiler/ir/backend.native/src/' + proto.srcDir 'compiler/ir/backend.native/src/' + java.srcDirs 'compiler/ir/backend.native/src/', 'build/generated/source/proto/compiler/java/' kotlin.srcDir 'compiler/ir/backend.native/src/' } cli_bc { @@ -53,6 +56,12 @@ sourceSets { } } +// The protobuf plugin specifies this dependency for java by itself, +// but not for Kotlin. +compileCompilerKotlin { + dependsOn('generateCompilerProto') +} + String[] linkerOpts1() { def libs = ['-lLLVMX86Disassembler', '-lLLVMX86AsmParser', @@ -132,6 +141,9 @@ configurations { } dependencies { + + compilerCompile "com.google.protobuf:protobuf-java:3.0.0" + compilerCompile kotlinCompilerModule compilerCompile kotlinNativeInterop['llvm'].configuration compilerCompile kotlinNativeInterop['hash'].configuration @@ -178,3 +190,12 @@ task jars { } } } + + +protobuf { + protoc { + artifact = 'com.google.protobuf:protoc:3.0.0' + } +} + +