• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1buildscript {
2    repositories {
3        maven { // The google mirror is less flaky than mavenCentral()
4            url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
5        mavenLocal()
6    }
7    dependencies { classpath libraries.protobuf_plugin }
8}
9
10apply plugin: 'com.google.protobuf'
11
12description = 'gRPC: Protobuf Lite'
13
14dependencies {
15    compile project(':grpc-core'),
16            libraries.protobuf_lite
17    compile (libraries.guava) {
18        // prefer 2.2.0 from libraries instead of 2.1.3
19        exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
20        // prefer 3.0.2 from libraries instead of 3.0.1
21        exclude group: 'com.google.code.findbugs', module: 'jsr305'
22        // prefer 1.17 from libraries instead of 1.14
23        exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
24    }
25
26    testProtobuf libraries.protobuf
27
28    signature "org.codehaus.mojo.signature:java17:1.0@signature"
29    signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature"
30}
31
32compileTestJava {
33    // Protobuf-generated Lite produces quite a few warnings.
34    options.compilerArgs += [
35        "-Xlint:-rawtypes",
36        "-Xlint:-unchecked",
37        "-Xlint:-fallthrough",
38        "-XepExcludedPaths:.*/build/generated/source/proto/.*"
39    ]
40}
41
42protobuf {
43    protoc {
44        if (project.hasProperty('protoc')) {
45            path = project.protoc
46        } else {
47            artifact = "com.google.protobuf:protoc:${protocVersion}"
48        }
49    }
50    plugins {
51        javalite {
52            if (project.hasProperty('protoc-gen-javalite')) {
53                path = project['protoc-gen-javalite']
54            } else {
55                artifact = libraries.protoc_lite
56            }
57        }
58    }
59    generateProtoTasks {
60        ofSourceSet('test')*.each { task ->
61            task.builtins { remove java }
62            task.plugins { javalite {} }
63        }
64    }
65}
66