diff options
author | nyquist <nyquist@chromium.org> | 2014-09-02 17:08:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-03 00:26:04 +0000 |
commit | e3f2241bc1235a54254f165db374f6013e037233 (patch) | |
tree | f48c98b6b79e6b6d8bc6476158b6483a33ef6657 | |
parent | 278d42a659161b96461b27e166d44224da697eaa (diff) | |
download | chromium_src-e3f2241bc1235a54254f165db374f6013e037233.zip chromium_src-e3f2241bc1235a54254f165db374f6013e037233.tar.gz chromium_src-e3f2241bc1235a54254f165db374f6013e037233.tar.bz2 |
Revert of Add support for Java nano protocol buffers for Android. (patchset #4 id:60001 of https://codereview.chromium.org/511283003/)
Reason for revert:
Breaks some workflows and also should get new quota.
Original issue's description:
> Add support for Java nano protocol buffers for Android.
>
> This CL adds a new dependency on the protocol buffer compiler
> from the android source tree, since this compiler supports
> generating Java files using the nano runtime.
>
> The initial version of this dependency is 2.2.0a, but checked
> out as what the Android 4.4.4 Release 2.0.1 tag points to.
>
> This CL adds a new protoc binary (for compiling protos) that supports
> this, and also adds a Java library with the runtime.
>
> To simplify use of this, it also updates build/protoc_java.gypi to
> support generating nano protos by specifying an optional
> proto_runtime argument. The argument defaults to 'lite' which does
> the same thing as before this change, and setting it to 'nano'
> generates the new style Java files.
>
> The plan is to quickly deprecate the 'lite' runtime for Java, since
> it is too big and uses too many methods.
>
> BUG=377891
>
> Committed: https://chromium.googlesource.com/chromium/src/+/d8ae0a79834531e41912de44b9e212ffa7eb2785
TBR=cjhopman@chromium.org,darin@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=377891
Review URL: https://codereview.chromium.org/534703004
Cr-Commit-Position: refs/heads/master@{#293028}
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | DEPS | 3 | ||||
-rw-r--r-- | build/protoc_java.gypi | 30 | ||||
-rwxr-xr-x | build/protoc_java.py | 34 | ||||
-rw-r--r-- | third_party/android_protobuf/OWNERS | 2 | ||||
-rw-r--r-- | third_party/android_protobuf/README.chromium | 29 | ||||
-rw-r--r-- | third_party/android_protobuf/android_protobuf.gyp | 137 |
7 files changed, 16 insertions, 220 deletions
@@ -215,7 +215,6 @@ v8.log /third_party/adobe/flash/binaries /third_party/adobe/flash/symbols /third_party/amd/ -/third_party/android_protobuf/src /third_party/android_tools/ /third_party/android_tools_internal/ /third_party/angle @@ -465,9 +465,6 @@ deps_os = { Var('chromium_git') + '/external/fontconfig.git' + '@' + 'f16c3118e25546c1b749f9823c51827a60aeb5c1', }, 'android': { - 'src/third_party/android_protobuf/src': - 'https://android.googlesource.com/platform/external/protobuf.git' + '@' + '48ee66d295979372ed0234cefda42385daae8312', - 'src/third_party/android_tools': Var('chromium_git') + '/android_tools.git' + '@' + '31869996507de16812bb53a3d0aaa15cd6194c16', diff --git a/build/protoc_java.gypi b/build/protoc_java.gypi index 853760c..a99ec6a 100644 --- a/build/protoc_java.gypi +++ b/build/protoc_java.gypi @@ -23,9 +23,6 @@ # The 'proto_in_dir' variable must be the relative path to the # directory containing the .proto files. If left out, it defaults to '.'. # -# You can optionally set a variable 'proto_runtime' to either 'lite' or 'nano'. -# The default runtime is 'lite'. -# # The 'output_java_files' variable specifies a list of output files that will # be generated. It is based on the package and java_outer_classname fields in # the proto. All the values must be prefixed with >(java_out_dir), since that @@ -41,7 +38,7 @@ { 'variables': { - 'proto_runtime%': 'lite', + 'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', 'java_out_dir': '<(PRODUCT_DIR)/java_proto/<(_target_name)/src', 'proto_in_dir%': '.', 'stamp_file': '<(java_out_dir).stamp', @@ -71,32 +68,15 @@ '<(protoc)', '<(proto_in_dir)', '<(java_out_dir)', - '<(proto_runtime)', '<(stamp_file)', '<@(_sources)', ], - 'message': 'Generating <(proto_runtime) Java code from protobuf files in <(proto_in_dir)', + 'message': 'Generating Java code from <(proto_in_dir)', }, ], - 'conditions': [ - ['proto_runtime=="lite"', { - 'variables': { - 'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)', - }, - 'dependencies': [ - '<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host', - '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite_javalib', - ], - }], - ['proto_runtime=="nano"', { - 'variables': { - 'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)android_protoc<(EXECUTABLE_SUFFIX)', - }, - 'dependencies': [ - '<(DEPTH)/third_party/android_protobuf/android_protobuf.gyp:android_protoc#host', - '<(DEPTH)/third_party/android_protobuf/android_protobuf.gyp:protobuf_nano_javalib', - ], - }], + 'dependencies': [ + '<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host', + '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite_javalib', ], 'includes': [ 'java.gypi' ], } diff --git a/build/protoc_java.py b/build/protoc_java.py index 3ccbaa7..42e2044 100755 --- a/build/protoc_java.py +++ b/build/protoc_java.py @@ -3,11 +3,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -"""Generate java source files from protobuf files. +"""Generate java source files from protobufs Usage: - protoc_java.py {protoc} {proto_path} {java_out} {proto_runtime} \ - {stamp_file} {proto_files} + protoc_java.py {protoc} {proto_path} {java_out} {stamp_file} {proto_files} This is a helper file for the genproto_java action in protoc_java.gypi. @@ -16,8 +15,6 @@ It performs the following steps: 2. Creates source directory. 3. Generates Java files using protoc. 4. Creates a new stamp file. - -proto_runtime must be one of 'nano' and 'lite'. """ import os @@ -26,36 +23,27 @@ import subprocess import sys def main(argv): - if len(argv) < 6: + if len(argv) < 5: usage() return 1 - protoc_path, proto_path, java_out, proto_runtime, stamp_file = argv[1:6] - proto_files = argv[6:] + protoc_path, proto_path, java_out, stamp_file = argv[1:5] + proto_files = argv[5:] - # Delete all old sources. + # Delete all old sources if os.path.exists(java_out): shutil.rmtree(java_out) - # Create source directory. + # Create source directory os.makedirs(java_out) - # Figure out which runtime to use. - if proto_runtime == 'nano': - out_arg = '--javanano_out=optional_field_style=reftypes,' + \ - 'store_unknown_fields=true:' + java_out - elif proto_runtime == 'lite': - out_arg = '--java_out=' + java_out - else: - usage() - return 1 - - # Generate Java files using protoc. + # Generate Java files using protoc ret = subprocess.call( - [protoc_path, '--proto_path', proto_path, out_arg] + proto_files) + [protoc_path, '--proto_path', proto_path, '--java_out', java_out] + + proto_files) if ret == 0: - # Create a new stamp file. + # Create a new stamp file with file(stamp_file, 'a'): os.utime(stamp_file, None) diff --git a/third_party/android_protobuf/OWNERS b/third_party/android_protobuf/OWNERS deleted file mode 100644 index a612398..0000000 --- a/third_party/android_protobuf/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -cjhopman@chromium.org -nyquist@chromium.org diff --git a/third_party/android_protobuf/README.chromium b/third_party/android_protobuf/README.chromium deleted file mode 100644 index fec1d3a..0000000 --- a/third_party/android_protobuf/README.chromium +++ /dev/null @@ -1,29 +0,0 @@ -Name: Protocol Buffers - Google's data interchange format -Short Name: protobuf -URL: https://android.googlesource.com/platform/external/protobuf.git -Version: 2.2.0a -Revision: Android 4.4.4 Release 2.0.1 -License: BSD -License File: src/COPYING.txt -Security Critical: no - -Name: -Shortname: protobuf -URL: https://android.googlesource.com/platform/external/protobuf.git -License: Google BSD like -License File: src/COPYING -Security Critical: no - -Description: -Android protobuf library contains the nano version of the Java protobuf library, -which generates Java-files with fewer methods than the protobuf lite compiler, -which is needed for big Java projects since Android has a maximum number of -methods per application. - -The 'android_protoc' target file list is taken from COMPILER_SRC_FILES in -src/Android.mk. - -See //third_party/protobuf for the C++ version of protobuf. - -Local Modifications: -None. diff --git a/third_party/android_protobuf/android_protobuf.gyp b/third_party/android_protobuf/android_protobuf.gyp deleted file mode 100644 index 65c7656..0000000 --- a/third_party/android_protobuf/android_protobuf.gyp +++ /dev/null @@ -1,137 +0,0 @@ -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - 'conditions': [ - ['OS=="android"', { - 'targets': [ - { - 'target_name': 'protobuf_nano_javalib', - 'type' : 'none', - 'variables': { - # Using empty dir and additionalk_src_dirs since the nano package - # does not have a src/ subfolder. - 'java_in_dir': '../../build/android/empty', - 'additional_src_dirs': [ 'src/java/src/main/java/com/google/protobuf/nano' ], - }, - 'includes': [ '../../build/java.gypi' ], - }, - { - # This proto compiler supports the nano profile, but should only be used for Android. - 'target_name': 'android_protoc', - 'type': 'executable', - 'variables': { - 'chromium_code': 0, - }, - 'toolsets': [ 'host' ], - 'sources': [ - 'src/src/google/protobuf/descriptor.cc', - 'src/src/google/protobuf/descriptor.pb.cc', - 'src/src/google/protobuf/descriptor_database.cc', - 'src/src/google/protobuf/dynamic_message.cc', - 'src/src/google/protobuf/extension_set.cc', - 'src/src/google/protobuf/extension_set_heavy.cc', - 'src/src/google/protobuf/generated_message_reflection.cc', - 'src/src/google/protobuf/generated_message_util.cc', - 'src/src/google/protobuf/message.cc', - 'src/src/google/protobuf/message_lite.cc', - 'src/src/google/protobuf/reflection_ops.cc', - 'src/src/google/protobuf/repeated_field.cc', - 'src/src/google/protobuf/service.cc', - 'src/src/google/protobuf/text_format.cc', - 'src/src/google/protobuf/unknown_field_set.cc', - 'src/src/google/protobuf/wire_format.cc', - 'src/src/google/protobuf/wire_format_lite.cc', - 'src/src/google/protobuf/compiler/code_generator.cc', - 'src/src/google/protobuf/compiler/command_line_interface.cc', - 'src/src/google/protobuf/compiler/importer.cc', - 'src/src/google/protobuf/compiler/main.cc', - 'src/src/google/protobuf/compiler/parser.cc', - 'src/src/google/protobuf/compiler/plugin.cc', - 'src/src/google/protobuf/compiler/plugin.pb.cc', - 'src/src/google/protobuf/compiler/subprocess.cc', - 'src/src/google/protobuf/compiler/zip_writer.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_enum.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_enum_field.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_extension.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_field.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_file.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_generator.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_helpers.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_message.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_message_field.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_service.cc', - 'src/src/google/protobuf/compiler/cpp/cpp_string_field.cc', - 'src/src/google/protobuf/compiler/java/java_enum.cc', - 'src/src/google/protobuf/compiler/java/java_enum_field.cc', - 'src/src/google/protobuf/compiler/java/java_extension.cc', - 'src/src/google/protobuf/compiler/java/java_field.cc', - 'src/src/google/protobuf/compiler/java/java_file.cc', - 'src/src/google/protobuf/compiler/java/java_generator.cc', - 'src/src/google/protobuf/compiler/java/java_helpers.cc', - 'src/src/google/protobuf/compiler/java/java_message.cc', - 'src/src/google/protobuf/compiler/java/java_message_field.cc', - 'src/src/google/protobuf/compiler/java/java_primitive_field.cc', - 'src/src/google/protobuf/compiler/java/java_service.cc', - 'src/src/google/protobuf/compiler/javamicro/javamicro_enum.cc', - 'src/src/google/protobuf/compiler/javamicro/javamicro_enum_field.cc', - 'src/src/google/protobuf/compiler/javamicro/javamicro_field.cc', - 'src/src/google/protobuf/compiler/javamicro/javamicro_file.cc', - 'src/src/google/protobuf/compiler/javamicro/javamicro_generator.cc', - 'src/src/google/protobuf/compiler/javamicro/javamicro_helpers.cc', - 'src/src/google/protobuf/compiler/javamicro/javamicro_message.cc', - 'src/src/google/protobuf/compiler/javamicro/javamicro_message_field.cc', - 'src/src/google/protobuf/compiler/javamicro/javamicro_primitive_field.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_enum.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_enum_field.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_extension.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_field.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_file.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_generator.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_helpers.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_message.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_message_field.cc', - 'src/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc', - 'src/src/google/protobuf/compiler/python/python_generator.cc', - 'src/src/google/protobuf/io/coded_stream.cc', - 'src/src/google/protobuf/io/gzip_stream.cc', - 'src/src/google/protobuf/io/printer.cc', - 'src/src/google/protobuf/io/tokenizer.cc', - 'src/src/google/protobuf/io/zero_copy_stream.cc', - 'src/src/google/protobuf/io/zero_copy_stream_impl.cc', - 'src/src/google/protobuf/io/zero_copy_stream_impl_lite.cc', - 'src/src/google/protobuf/stubs/common.cc', - 'src/src/google/protobuf/stubs/hash.cc', - 'src/src/google/protobuf/stubs/once.cc', - 'src/src/google/protobuf/stubs/structurally_valid.cc', - 'src/src/google/protobuf/stubs/strutil.cc', - 'src/src/google/protobuf/stubs/substitute.cc', - ], - 'include_dirs': [ - 'src/android', - 'src/src', - ], - 'conditions': [ - ['clang==1', { - 'cflags': [ - '-Wno-null-conversion', - '-Wno-tautological-undefined-compare', - ], - }], - ], - 'defines': [ - # This macro must be defined to suppress the use - # of dynamic_cast<>, which requires RTTI. - 'GOOGLE_PROTOBUF_NO_RTTI', - 'GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER', - ], - 'dependencies': [ - '../zlib/zlib.gyp:zlib', - ], - }, - ], - }], - ], -} |