Remove the usage of proto lite specific handling
This is causing issues for chrome, since it is wrongly removing methods, see: http://crbug.com/872904
Performance of some internal projects takes a big hit (but should now be correct), see:
http://shortn/_njwj3697I6
Actually implementing a working solution is tracked in
Bug: 112437944
Change-Id: I0dc02b12513eb445405ef9c1c7a33148ce92fba1
diff --git a/build.gradle b/build.gradle
index e49bbb5..f42501a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -20,7 +20,6 @@
junitVersion = '4.12'
kotlinVersion = '1.2.30'
kotlinExtMetadataJVMVersion = '0.0.3'
- protobufVersion = '3.0.0'
smaliVersion = '2.2b4'
}
@@ -65,7 +64,6 @@
}
}
dependencies {
- classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.1'
classpath 'com.cookpad.android.licensetools:license-tools-plugin:0.23.0'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath "net.ltgt.gradle:gradle-errorprone-plugin:0.0.13"
@@ -83,7 +81,6 @@
apply plugin: 'java'
apply plugin: 'idea'
-apply plugin: 'com.google.protobuf'
apply plugin: 'com.cookpad.android.licensetools'
apply plugin: 'net.ltgt.errorprone-base'
apply plugin: "net.ltgt.apt"
@@ -151,12 +148,7 @@
}
examples {
java {
- srcDirs = ['src/test/examples', 'build/generated/source/proto/examples/javalite/' ]
- }
- proto {
- srcDirs = [
- 'src/test/examples',
- ]
+ srcDirs = ['src/test/examples']
}
output.resourcesDir = 'build/classes/examples'
}
@@ -252,9 +244,7 @@
examplesAndroidPCompile group: 'org.ow2.asm', name: 'asm', version: asmVersion
// Import Guava for @Nullable annotation
examplesCompile "com.google.guava:guava:$guavaVersion"
- examplesCompile "com.google.protobuf:protobuf-lite:$protobufVersion"
examplesCompileOnly "com.google.auto.value:auto-value:$autoValueVersion"
- examplesRuntime "com.google.protobuf:protobuf-lite:$protobufVersion"
supportLibs "com.android.support:support-v4:$androidSupportVersion"
supportLibs "junit:junit:$junitVersion"
supportLibs "com.android.support.test.espresso:espresso-core:$espressoVersion"
@@ -271,29 +261,6 @@
licensesYaml = file('LIBRARY-LICENSE')
}
-protobuf {
- protoc {
- // Download from repositories
- artifact = "com.google.protobuf:protoc:$protobufVersion"
- }
- plugins {
- javalite {
- artifact = "com.google.protobuf:protoc-gen-javalite:$protobufVersion"
- }
- }
- generateProtoTasks {
- all().each { task ->
- task.builtins {
- // Disable the java code generator, as we want javalite only.
- remove java
- }
- task.plugins {
- javalite {}
- }
- }
- }
-}
-
def osString = OperatingSystem.current().isLinux() ? "linux" :
OperatingSystem.current().isMacOsX() ? "mac" : "windows"
@@ -759,7 +726,6 @@
task buildExampleJars {
dependsOn downloadProguard
def examplesDir = file("src/test/examples")
- def protoSourceDir = file("build/generated/source/proto/examples/javalite")
def proguardScript
if (OperatingSystem.current().isWindows()) {
proguardScript = "third_party/proguard/proguard5.2.1/bin/proguard.bat"
@@ -782,9 +748,8 @@
}
task "compile_examples"(type: JavaCompile) {
- dependsOn "generateExamplesProto"
dependsOn "copy_examples_resources"
- source examplesDir, protoSourceDir
+ source examplesDir
include "**/*.java"
destinationDir = file("build/test/examples/classes")
classpath = sourceSets.examples.compileClasspath
@@ -792,8 +757,8 @@
targetCompatibility = JavaVersion.VERSION_1_7
options.compilerArgs = ["-g:source,lines", "-Xlint:none"]
}
- task "compile_examples_debuginfo_all"(type: JavaCompile, dependsOn: "generateExamplesProto") {
- source examplesDir, protoSourceDir
+ task "compile_examples_debuginfo_all"(type: JavaCompile) {
+ source examplesDir
include "**/*.java"
destinationDir = file("build/test/examples/classes_debuginfo_all")
classpath = sourceSets.examples.compileClasspath
@@ -801,8 +766,8 @@
targetCompatibility = JavaVersion.VERSION_1_7
options.compilerArgs = ["-g", "-Xlint:none"]
}
- task "compile_examples_debuginfo_none"(type: JavaCompile, dependsOn: "generateExamplesProto") {
- source examplesDir, protoSourceDir
+ task "compile_examples_debuginfo_none"(type: JavaCompile) {
+ source examplesDir
include "**/*.java"
destinationDir = file("build/test/examples/classes_debuginfo_none")
classpath = sourceSets.examples.compileClasspath
@@ -819,13 +784,6 @@
dependsOn "jar_example_${name}_debuginfo_none"
dependsOn "extractExamplesRuntime"
def runtimeDependencies = copySpec { }
- if (!fileTree(dir: dir, include: '**/*.proto').empty) {
- // If we have any proto use, we have to include those classes and the runtime.
- runtimeDependencies = copySpec {
- from "$buildDir/runtime/examples/"
- include "com/google/protobuf/**/*.class"
- }
- }
// The "throwing" test verifies debugging/stack info on the post-proguarded output.
def proguardConfigPath = "${dir}/proguard.cfg"
if (new File(proguardConfigPath).exists()) {