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 libraries.guava 18 19 testProtobuf libraries.protobuf 20 21 signature "org.codehaus.mojo.signature:java17:1.0@signature" 22 signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature" 23} 24 25compileTestJava { 26 // Protobuf-generated Lite produces quite a few warnings. 27 options.compilerArgs += [ 28 "-Xlint:-rawtypes", 29 "-Xlint:-unchecked", 30 "-Xlint:-fallthrough", 31 "-XepExcludedPaths:.*/build/generated/source/proto/.*" 32 ] 33} 34 35protobuf { 36 protoc { 37 if (project.hasProperty('protoc')) { 38 path = project.protoc 39 } else { 40 artifact = "com.google.protobuf:protoc:${protocVersion}" 41 } 42 } 43 plugins { 44 javalite { 45 if (project.hasProperty('protoc-gen-javalite')) { 46 path = project['protoc-gen-javalite'] 47 } else { 48 artifact = libraries.protoc_lite 49 } 50 } 51 } 52 generateProtoTasks { 53 ofSourceSet('test')*.each { task -> 54 task.builtins { remove java } 55 task.plugins { javalite {} } 56 } 57 } 58} 59