Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: build/protoc_java.gypi

Issue 511283003: Add support for Java nano protocol buffers for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments from darin Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | build/protoc_java.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/protoc_java.gypi
diff --git a/build/protoc_java.gypi b/build/protoc_java.gypi
index a99ec6a5df7cdad6da69ee2fef1277a08f1d95cd..853760c7a30cbac1b8f8149ade161a28495a899b 100644
--- a/build/protoc_java.gypi
+++ b/build/protoc_java.gypi
@@ -23,6 +23,9 @@
# 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
@@ -38,7 +41,7 @@
{
'variables': {
- 'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
+ 'proto_runtime%': 'lite',
'java_out_dir': '<(PRODUCT_DIR)/java_proto/<(_target_name)/src',
'proto_in_dir%': '.',
'stamp_file': '<(java_out_dir).stamp',
@@ -68,15 +71,32 @@
'<(protoc)',
'<(proto_in_dir)',
'<(java_out_dir)',
+ '<(proto_runtime)',
'<(stamp_file)',
'<@(_sources)',
],
- 'message': 'Generating Java code from <(proto_in_dir)',
+ 'message': 'Generating <(proto_runtime) Java code from protobuf files in <(proto_in_dir)',
},
],
- 'dependencies': [
- '<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host',
- '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite_javalib',
+ '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',
+ ],
+ }],
],
'includes': [ 'java.gypi' ],
}
« no previous file with comments | « DEPS ('k') | build/protoc_java.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698