1// Copyright (C) 2009 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14// 15// 16 17IGNORED_WARNINGS = [ 18 "-Wno-sign-compare", 19 "-Wno-unused-parameter", 20 "-Wno-sign-promo", 21 "-Wno-error=return-type", 22] 23 24cc_defaults { 25 name: "protobuf-cflags-defaults", 26 clang_cflags: [ 27 "-Wno-unused-const-variable", 28 "-Wno-error=user-defined-warnings", 29 ], 30 cflags: [ 31 "-Wall", 32 "-Wno-error=format", 33 "-Wno-error=format-extra-args", 34 "-Wno-error=ignored-qualifiers", 35 "-Wno-error=sign-promo", 36 "-Wno-unused-function", 37 ], 38 target: { 39 windows: { 40 cflags: ["-Wno-error"], 41 }, 42 // cannot suppress gcc warning on redefined macros 43 not_windows: { 44 cflags: ["-Werror"], 45 }, 46 android: { 47 cflags: ["-Werror"], 48 }, 49 }, 50} 51 52cc_defaults { 53 name: "libprotobuf-cpp-lite-defaults", 54 defaults: ["protobuf-cflags-defaults"], 55 srcs: [ 56 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", 57 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", 58 "src/google/protobuf/stubs/bytestream.cc", 59 "src/google/protobuf/stubs/common.cc", 60 "src/google/protobuf/stubs/int128.cc", 61 "src/google/protobuf/stubs/once.cc", 62 "src/google/protobuf/stubs/status.cc", 63 "src/google/protobuf/stubs/statusor.cc", 64 "src/google/protobuf/stubs/stringpiece.cc", 65 "src/google/protobuf/stubs/stringprintf.cc", 66 "src/google/protobuf/stubs/structurally_valid.cc", 67 "src/google/protobuf/stubs/strutil.cc", 68 "src/google/protobuf/stubs/time.cc", 69 "src/google/protobuf/arena.cc", 70 "src/google/protobuf/arenastring.cc", 71 "src/google/protobuf/extension_set.cc", 72 "src/google/protobuf/generated_message_util.cc", 73 "src/google/protobuf/message_lite.cc", 74 "src/google/protobuf/repeated_field.cc", 75 "src/google/protobuf/wire_format_lite.cc", 76 "src/google/protobuf/io/coded_stream.cc", 77 "src/google/protobuf/io/zero_copy_stream.cc", 78 "src/google/protobuf/io/zero_copy_stream_impl.cc", 79 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", 80 ], 81 82 local_include_dirs: [ 83 "android", 84 "src", 85 ], 86 export_include_dirs: ["src"], 87 88 cflags: IGNORED_WARNINGS, 89} 90 91// C++ lite library for the NDK. 92// ======================================================= 93cc_library_static { 94 name: "libprotobuf-cpp-lite-ndk", 95 defaults: ["libprotobuf-cpp-lite-defaults"], 96 97 cflags: ["-DGOOGLE_PROTOBUF_NO_RTTI"], 98 99 sdk_version: "9", 100 101 stl: "c++_static", 102} 103 104// C++ lite library for the platform and host. 105// ======================================================= 106cc_library { 107 name: "libprotobuf-cpp-lite", 108 host_supported: true, 109 recovery_available: true, 110 vendor_available: true, 111 vndk: { 112 enabled: true, 113 }, 114 double_loadable: true, 115 defaults: ["libprotobuf-cpp-lite-defaults"], 116 117 cflags: ["-DGOOGLE_PROTOBUF_NO_RTTI"], 118 119 target: { 120 windows: { 121 enabled: true, 122 }, 123 }, 124} 125 126// C++ lite library for the platform and host. 127// ======================================================= 128cc_library_static { 129 name: "libprotobuf-cpp-lite_static", 130 host_supported: true, 131 defaults: ["libprotobuf-cpp-lite-defaults"], 132 cflags: ["-DGOOGLE_PROTOBUF_NO_RTTI"], 133} 134 135// C++ lite library + rtti (libc++ flavored for the platform and host) 136// ======================================================= 137cc_library_shared { 138 name: "libprotobuf-cpp-lite-rtti", 139 host_supported: true, 140 vendor_available: true, 141 defaults: ["libprotobuf-cpp-lite-defaults"], 142 143 rtti: true, 144} 145 146// C++ full library 147// ======================================================= 148cc_defaults { 149 name: "libprotobuf-cpp-full-defaults", 150 defaults: ["libprotobuf-cpp-lite-defaults"], 151 152 srcs: [ 153 "src/google/protobuf/any.pb.cc", 154 "src/google/protobuf/api.pb.cc", 155 "src/google/protobuf/stubs/mathlimits.cc", 156 "src/google/protobuf/any.cc", 157 "src/google/protobuf/descriptor.cc", 158 "src/google/protobuf/descriptor_database.cc", 159 "src/google/protobuf/descriptor.pb.cc", 160 "src/google/protobuf/duration.pb.cc", 161 "src/google/protobuf/dynamic_message.cc", 162 "src/google/protobuf/empty.pb.cc", 163 "src/google/protobuf/extension_set_heavy.cc", 164 "src/google/protobuf/field_mask.pb.cc", 165 "src/google/protobuf/generated_message_reflection.cc", 166 "src/google/protobuf/map_field.cc", 167 "src/google/protobuf/message.cc", 168 "src/google/protobuf/reflection_ops.cc", 169 "src/google/protobuf/service.cc", 170 "src/google/protobuf/source_context.pb.cc", 171 "src/google/protobuf/struct.pb.cc", 172 "src/google/protobuf/stubs/substitute.cc", 173 "src/google/protobuf/text_format.cc", 174 "src/google/protobuf/timestamp.pb.cc", 175 "src/google/protobuf/type.pb.cc", 176 "src/google/protobuf/unknown_field_set.cc", 177 "src/google/protobuf/wire_format.cc", 178 "src/google/protobuf/wrappers.pb.cc", 179 "src/google/protobuf/io/gzip_stream.cc", 180 "src/google/protobuf/io/printer.cc", 181 "src/google/protobuf/io/strtod.cc", 182 "src/google/protobuf/io/tokenizer.cc", 183 "src/google/protobuf/compiler/importer.cc", 184 "src/google/protobuf/compiler/parser.cc", 185 "src/google/protobuf/util/field_comparator.cc", 186 "src/google/protobuf/util/field_mask_util.cc", 187 "src/google/protobuf/util/internal/datapiece.cc", 188 "src/google/protobuf/util/internal/default_value_objectwriter.cc", 189 "src/google/protobuf/util/internal/error_listener.cc", 190 "src/google/protobuf/util/internal/field_mask_utility.cc", 191 "src/google/protobuf/util/internal/json_escaping.cc", 192 "src/google/protobuf/util/internal/json_objectwriter.cc", 193 "src/google/protobuf/util/internal/json_stream_parser.cc", 194 "src/google/protobuf/util/internal/object_writer.cc", 195 "src/google/protobuf/util/internal/protostream_objectsource.cc", 196 "src/google/protobuf/util/internal/protostream_objectwriter.cc", 197 "src/google/protobuf/util/internal/proto_writer.cc", 198 "src/google/protobuf/util/internal/type_info.cc", 199 "src/google/protobuf/util/internal/type_info_test_helper.cc", 200 "src/google/protobuf/util/internal/utility.cc", 201 "src/google/protobuf/util/json_util.cc", 202 "src/google/protobuf/util/message_differencer.cc", 203 "src/google/protobuf/util/time_util.cc", 204 "src/google/protobuf/util/type_resolver_util.cc", 205 ], 206 207 cflags: ["-DHAVE_ZLIB=1"], 208 shared_libs: ["libz"], 209} 210 211// C++ full library for the NDK. 212// ======================================================= 213cc_library_static { 214 name: "libprotobuf-cpp-full-ndk", 215 defaults: ["libprotobuf-cpp-full-defaults"], 216 217 cflags: ["-DGOOGLE_PROTOBUF_NO_RTTI"], 218 219 sdk_version: "9", 220 221 stl: "c++_static", 222} 223 224// C++ full library for the platform and host 225// ======================================================= 226cc_library_shared { 227 name: "libprotobuf-cpp-full", 228 defaults: ["libprotobuf-cpp-full-defaults"], 229 host_supported: true, 230 vendor_available: true, 231 vndk: { 232 enabled: true, 233 }, 234 235 cflags: ["-DGOOGLE_PROTOBUF_NO_RTTI"], 236 target: { 237 android: { 238 shared_libs: ["liblog"], 239 }, 240 }, 241} 242 243// C++ full library + rtti for the platform and host 244// ======================================================= 245cc_library_shared { 246 name: "libprotobuf-cpp-full-rtti", 247 defaults: ["libprotobuf-cpp-full-defaults"], 248 vendor_available: true, 249 250 rtti: true, 251 target: { 252 android: { 253 shared_libs: ["liblog"], 254 }, 255 }, 256} 257 258// Compiler library for the host 259// ======================================================= 260cc_library_host_shared { 261 name: "libprotoc", 262 defaults: ["libprotobuf-cpp-full-defaults"], 263 264 srcs: [ 265 "src/google/protobuf/compiler/code_generator.cc", 266 "src/google/protobuf/compiler/plugin.cc", 267 "src/google/protobuf/compiler/plugin.pb.cc", 268 ], 269 270 local_include_dirs: [ 271 "config", 272 ], 273 export_include_dirs: [ 274 "src", 275 "config", 276 ], 277 278 rtti: true, 279} 280 281// Android Protocol buffer compiler, aprotoc (host executable) 282// used by the build systems as $(PROTOC) defined in 283// build/core/config.mk 284// ======================================================= 285cc_binary_host { 286 name: "aprotoc", 287 defaults: ["protobuf-cflags-defaults"], 288 289 target: { 290 windows: { 291 enabled: true, 292 }, 293 }, 294 295 // Statically link libc++ because we copy aprotoc to unbundled projects where 296 // libc++.so may not be available. 297 stl: "libc++_static", 298 299 srcs: [ 300 "src/google/protobuf/any.cc", 301 "src/google/protobuf/arena.cc", 302 "src/google/protobuf/arenastring.cc", 303 "src/google/protobuf/descriptor.cc", 304 "src/google/protobuf/descriptor.pb.cc", 305 "src/google/protobuf/descriptor_database.cc", 306 "src/google/protobuf/dynamic_message.cc", 307 "src/google/protobuf/extension_set.cc", 308 "src/google/protobuf/extension_set_heavy.cc", 309 "src/google/protobuf/generated_message_reflection.cc", 310 "src/google/protobuf/generated_message_util.cc", 311 "src/google/protobuf/map_field.cc", 312 "src/google/protobuf/message.cc", 313 "src/google/protobuf/message_lite.cc", 314 "src/google/protobuf/reflection_ops.cc", 315 "src/google/protobuf/repeated_field.cc", 316 "src/google/protobuf/service.cc", 317 "src/google/protobuf/text_format.cc", 318 "src/google/protobuf/unknown_field_set.cc", 319 "src/google/protobuf/wire_format.cc", 320 "src/google/protobuf/wire_format_lite.cc", 321 "src/google/protobuf/compiler/code_generator.cc", 322 "src/google/protobuf/compiler/command_line_interface.cc", 323 "src/google/protobuf/compiler/cpp/cpp_enum.cc", 324 "src/google/protobuf/compiler/cpp/cpp_enum_field.cc", 325 "src/google/protobuf/compiler/cpp/cpp_extension.cc", 326 "src/google/protobuf/compiler/cpp/cpp_field.cc", 327 "src/google/protobuf/compiler/cpp/cpp_file.cc", 328 "src/google/protobuf/compiler/cpp/cpp_generator.cc", 329 "src/google/protobuf/compiler/cpp/cpp_helpers.cc", 330 "src/google/protobuf/compiler/cpp/cpp_map_field.cc", 331 "src/google/protobuf/compiler/cpp/cpp_message.cc", 332 "src/google/protobuf/compiler/cpp/cpp_message_field.cc", 333 "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc", 334 "src/google/protobuf/compiler/cpp/cpp_service.cc", 335 "src/google/protobuf/compiler/cpp/cpp_string_field.cc", 336 "src/google/protobuf/compiler/csharp/csharp_doc_comment.cc", 337 "src/google/protobuf/compiler/csharp/csharp_enum.cc", 338 "src/google/protobuf/compiler/csharp/csharp_enum_field.cc", 339 "src/google/protobuf/compiler/csharp/csharp_field_base.cc", 340 "src/google/protobuf/compiler/csharp/csharp_generator.cc", 341 "src/google/protobuf/compiler/csharp/csharp_helpers.cc", 342 "src/google/protobuf/compiler/csharp/csharp_map_field.cc", 343 "src/google/protobuf/compiler/csharp/csharp_message.cc", 344 "src/google/protobuf/compiler/csharp/csharp_message_field.cc", 345 "src/google/protobuf/compiler/csharp/csharp_primitive_field.cc", 346 "src/google/protobuf/compiler/csharp/csharp_reflection_class.cc", 347 "src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc", 348 "src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc", 349 "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc", 350 "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc", 351 "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc", 352 "src/google/protobuf/compiler/importer.cc", 353 "src/google/protobuf/compiler/java/java_context.cc", 354 "src/google/protobuf/compiler/java/java_doc_comment.cc", 355 "src/google/protobuf/compiler/java/java_enum.cc", 356 "src/google/protobuf/compiler/java/java_enum_field.cc", 357 "src/google/protobuf/compiler/java/java_enum_field_lite.cc", 358 "src/google/protobuf/compiler/java/java_enum_lite.cc", 359 "src/google/protobuf/compiler/java/java_extension.cc", 360 "src/google/protobuf/compiler/java/java_extension_lite.cc", 361 "src/google/protobuf/compiler/java/java_field.cc", 362 "src/google/protobuf/compiler/java/java_file.cc", 363 "src/google/protobuf/compiler/java/java_generator.cc", 364 "src/google/protobuf/compiler/java/java_generator_factory.cc", 365 "src/google/protobuf/compiler/java/java_helpers.cc", 366 "src/google/protobuf/compiler/java/java_lazy_message_field.cc", 367 "src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc", 368 "src/google/protobuf/compiler/java/java_map_field.cc", 369 "src/google/protobuf/compiler/java/java_map_field_lite.cc", 370 "src/google/protobuf/compiler/java/java_message_builder.cc", 371 "src/google/protobuf/compiler/java/java_message_builder_lite.cc", 372 "src/google/protobuf/compiler/java/java_message.cc", 373 "src/google/protobuf/compiler/java/java_message_field.cc", 374 "src/google/protobuf/compiler/java/java_message_field_lite.cc", 375 "src/google/protobuf/compiler/java/java_message_lite.cc", 376 "src/google/protobuf/compiler/java/java_name_resolver.cc", 377 "src/google/protobuf/compiler/java/java_primitive_field.cc", 378 "src/google/protobuf/compiler/java/java_primitive_field_lite.cc", 379 "src/google/protobuf/compiler/java/java_service.cc", 380 "src/google/protobuf/compiler/java/java_shared_code_generator.cc", 381 "src/google/protobuf/compiler/java/java_string_field.cc", 382 "src/google/protobuf/compiler/java/java_string_field_lite.cc", 383 "src/google/protobuf/compiler/javamicro/javamicro_enum.cc", 384 "src/google/protobuf/compiler/javamicro/javamicro_enum_field.cc", 385 "src/google/protobuf/compiler/javamicro/javamicro_field.cc", 386 "src/google/protobuf/compiler/javamicro/javamicro_file.cc", 387 "src/google/protobuf/compiler/javamicro/javamicro_generator.cc", 388 "src/google/protobuf/compiler/javamicro/javamicro_helpers.cc", 389 "src/google/protobuf/compiler/javamicro/javamicro_message.cc", 390 "src/google/protobuf/compiler/javamicro/javamicro_message_field.cc", 391 "src/google/protobuf/compiler/javamicro/javamicro_primitive_field.cc", 392 "src/google/protobuf/compiler/javanano/javanano_enum.cc", 393 "src/google/protobuf/compiler/javanano/javanano_enum_field.cc", 394 "src/google/protobuf/compiler/javanano/javanano_extension.cc", 395 "src/google/protobuf/compiler/javanano/javanano_field.cc", 396 "src/google/protobuf/compiler/javanano/javanano_file.cc", 397 "src/google/protobuf/compiler/javanano/javanano_generator.cc", 398 "src/google/protobuf/compiler/javanano/javanano_helpers.cc", 399 "src/google/protobuf/compiler/javanano/javanano_map_field.cc", 400 "src/google/protobuf/compiler/javanano/javanano_message.cc", 401 "src/google/protobuf/compiler/javanano/javanano_message_field.cc", 402 "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc", 403 "src/google/protobuf/compiler/js/js_generator.cc", 404 "src/google/protobuf/compiler/main.cc", 405 "src/google/protobuf/compiler/objectivec/objectivec_enum.cc", 406 "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc", 407 "src/google/protobuf/compiler/objectivec/objectivec_extension.cc", 408 "src/google/protobuf/compiler/objectivec/objectivec_field.cc", 409 "src/google/protobuf/compiler/objectivec/objectivec_file.cc", 410 "src/google/protobuf/compiler/objectivec/objectivec_generator.cc", 411 "src/google/protobuf/compiler/objectivec/objectivec_helpers.cc", 412 "src/google/protobuf/compiler/objectivec/objectivec_map_field.cc", 413 "src/google/protobuf/compiler/objectivec/objectivec_message.cc", 414 "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc", 415 "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc", 416 "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc", 417 "src/google/protobuf/compiler/parser.cc", 418 "src/google/protobuf/compiler/plugin.cc", 419 "src/google/protobuf/compiler/plugin.pb.cc", 420 "src/google/protobuf/compiler/python/python_generator.cc", 421 "src/google/protobuf/compiler/ruby/ruby_generator.cc", 422 "src/google/protobuf/compiler/subprocess.cc", 423 "src/google/protobuf/compiler/zip_writer.cc", 424 "src/google/protobuf/io/coded_stream.cc", 425 "src/google/protobuf/io/gzip_stream.cc", 426 "src/google/protobuf/io/printer.cc", 427 "src/google/protobuf/io/strtod.cc", 428 "src/google/protobuf/io/tokenizer.cc", 429 "src/google/protobuf/io/zero_copy_stream.cc", 430 "src/google/protobuf/io/zero_copy_stream_impl.cc", 431 "src/google/protobuf/io/zero_copy_stream_impl_lite.cc", 432 "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc", 433 "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc", 434 "src/google/protobuf/stubs/common.cc", 435 "src/google/protobuf/stubs/int128.cc", 436 "src/google/protobuf/stubs/once.cc", 437 "src/google/protobuf/stubs/status.cc", 438 "src/google/protobuf/stubs/stringpiece.cc", 439 "src/google/protobuf/stubs/structurally_valid.cc", 440 "src/google/protobuf/stubs/strutil.cc", 441 "src/google/protobuf/stubs/substitute.cc", 442 "src/google/protobuf/stubs/stringprintf.cc", 443 ], 444 445 local_include_dirs: [ 446 "android", 447 "src", 448 ], 449 450 static_libs: ["libz"], 451 452 cflags: IGNORED_WARNINGS + [ 453 "-DHAVE_ZLIB=1", 454 ], 455 456} 457 458java_defaults { 459 name: "libprotobuf_errorprone_defaults", 460 errorprone: { 461 javacflags: ["-Xep:MissingOverride:OFF"], // b/73499927 462 }, 463} 464 465// Java nano library 466// ======================================================= 467java_library_static { 468 name: "libprotobuf-java-nano", 469 defaults: ["libprotobuf_errorprone_defaults"], 470 host_supported: true, 471 472 sdk_version: "9", 473 474 srcs: [ 475 "javanano/src/main/java/com/google/protobuf/nano/**/*.java", 476 ], 477 478 target: { 479 android: { 480 srcs: ["javanano/src/device/main/java/com/google/protobuf/nano/**/*.java"], 481 }, 482 }, 483 484 java_version: "1.7", 485} 486 487// Java nano library (compatibility for old host-side users) 488// ======================================================= 489java_library_host { 490 name: "host-libprotobuf-java-nano", 491 static_libs: ["libprotobuf-java-nano"], 492 493 java_version: "1.7", 494} 495 496// Java micro library 497// ======================================================= 498java_library_static { 499 name: "libprotobuf-java-micro", 500 defaults: ["libprotobuf_errorprone_defaults"], 501 host_supported: true, 502 503 sdk_version: "8", 504 505 srcs: ["javamicro/src/main/java/com/google/protobuf/micro/**/*.java"], 506} 507 508// Java micro library (compatibility for old host-side users) 509// ======================================================= 510java_library_host { 511 name: "host-libprotobuf-java-micro", 512 static_libs: ["libprotobuf-java-micro"], 513} 514 515// Java lite library 516// ======================================================= 517java_library_static { 518 name: "libprotobuf-java-lite", 519 host_supported: true, 520 sdk_version: "core_current", 521 522 srcs: [ 523 "java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java", 524 "java/core/src/main/java/com/google/protobuf/AbstractParser.java", 525 "java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java", 526 "java/core/src/main/java/com/google/protobuf/ByteOutput.java", 527 "java/core/src/main/java/com/google/protobuf/ByteString.java", 528 "java/core/src/main/java/com/google/protobuf/BooleanArrayList.java", 529 "java/core/src/main/java/com/google/protobuf/CodedInputStream.java", 530 "java/core/src/main/java/com/google/protobuf/CodedOutputStream.java", 531 "java/core/src/main/java/com/google/protobuf/DoubleArrayList.java", 532 "java/core/src/main/java/com/google/protobuf/ExperimentalApi.java", 533 "java/core/src/main/java/com/google/protobuf/ExtensionLite.java", 534 "java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java", 535 "java/core/src/main/java/com/google/protobuf/FieldSet.java", 536 "java/core/src/main/java/com/google/protobuf/FloatArrayList.java", 537 "java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java", 538 "java/core/src/main/java/com/google/protobuf/IntArrayList.java", 539 "java/core/src/main/java/com/google/protobuf/Internal.java", 540 "java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java", 541 "java/core/src/main/java/com/google/protobuf/LazyField.java", 542 "java/core/src/main/java/com/google/protobuf/LazyFieldLite.java", 543 "java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java", 544 "java/core/src/main/java/com/google/protobuf/LazyStringList.java", 545 "java/core/src/main/java/com/google/protobuf/LongArrayList.java", 546 "java/core/src/main/java/com/google/protobuf/MapFieldLite.java", 547 "java/core/src/main/java/com/google/protobuf/MessageLite.java", 548 "java/core/src/main/java/com/google/protobuf/MessageLiteToString.java", 549 "java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java", 550 "java/core/src/main/java/com/google/protobuf/MutabilityOracle.java", 551 "java/core/src/main/java/com/google/protobuf/Parser.java", 552 "java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java", 553 "java/core/src/main/java/com/google/protobuf/ProtocolStringList.java", 554 "java/core/src/main/java/com/google/protobuf/RopeByteString.java", 555 "java/core/src/main/java/com/google/protobuf/SmallSortedMap.java", 556 "java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java", 557 "java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java", 558 "java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java", 559 "java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java", 560 "java/core/src/main/java/com/google/protobuf/Utf8.java", 561 "java/core/src/main/java/com/google/protobuf/WireFormat.java", 562 ], 563 564 target: { 565 android: { 566 libs: ["libcore_private.stubs"], 567 }, 568 }, 569 570 java_version: "1.7", 571} 572 573// Java lite library (compatibility for old host-side users) 574// ======================================================= 575java_library_host { 576 name: "host-libprotobuf-java-lite", 577 static_libs: ["libprotobuf-java-lite"], 578} 579 580// Java full library (for host-side users) 581// ======================================================= 582java_library_host { 583 name: "libprotobuf-java-full", 584 defaults: ["libprotobuf_errorprone_defaults"], 585 586 srcs: [ 587 "java/core/src/main/java/**/*.java", 588 ":libprotobuf-internal-protos", 589 ], 590 591 proto: { 592 local_include_dirs: [ 593 "src", 594 ], 595 canonical_path_from_root: false, 596 }, 597 598 java_version: "1.7", 599} 600 601// Java full library (compatibility for old host-side users) 602// ======================================================= 603java_library_host { 604 name: "host-libprotobuf-java-full", 605 static_libs: ["libprotobuf-java-full"], 606} 607 608// Stubs library for using hidden APIs in core-oj and core-libart 609// ======================================================= 610java_library { 611 name: "libcore_private.stubs", 612 srcs: ["java/core/src/stubs/**/*.java"], 613 sdk_version: "core_current", 614 installable: false, 615} 616 617// Python library 618// ======================================================= 619python_library { 620 name: "libprotobuf-python", 621 srcs: [ 622 ":libprotobuf-internal-python-srcs", 623 ":libprotobuf-internal-protos", 624 ], 625 version: { 626 py2: { 627 enabled: true, 628 }, 629 py3: { 630 enabled: true, 631 }, 632 }, 633 libs: [ 634 "py-six", 635 ], 636 proto: { 637 local_include_dirs: [ 638 "src", 639 ], 640 canonical_path_from_root: false, 641 }, 642 host_supported: true, 643} 644 645filegroup { 646 name: "libprotobuf-internal-python-srcs", 647 srcs: ["python/google/**/*.py"], 648 path: "python", 649} 650 651filegroup { 652 name: "libprotobuf-internal-protos", 653 srcs: [ 654 "src/google/protobuf/descriptor.proto", 655 "src/google/protobuf/any.proto", 656 "src/google/protobuf/source_context.proto", 657 "src/google/protobuf/type.proto", 658 "src/google/protobuf/compiler/plugin.proto", 659 "src/google/protobuf/api.proto", 660 "src/google/protobuf/duration.proto", 661 "src/google/protobuf/empty.proto", 662 "src/google/protobuf/field_mask.proto", 663 "src/google/protobuf/struct.proto", 664 "src/google/protobuf/timestamp.proto", 665 "src/google/protobuf/wrappers.proto", 666 ], 667 path: "src", 668} 669 670// To test java proto params build rules. 671// ======================================================= 672java_test { 673 name: "aprotoc-test-nano-params", 674 sdk_version: "current", 675 proto: { 676 type: "nano", 677 local_include_dirs: ["src"], 678 output_params: [ 679 "java_package=javanano/src/test/java/com/google/protobuf/nano/unittest_import_nano.proto\\|com.google.protobuf.nano", 680 "java_outer_classname=javanano/src/test/java/com/google/protobuf/nano/unittest_import_nano.proto\\|UnittestImportNano", 681 ], 682 }, 683 srcs: [ 684 "javanano/src/test/java/com/google/protobuf/nano/unittest_import_nano.proto", 685 "javanano/src/test/java/com/google/protobuf/nano/unittest_simple_nano.proto", 686 "javanano/src/test/java/com/google/protobuf/nano/unittest_stringutf8_nano.proto", 687 "javanano/src/test/java/com/google/protobuf/nano/unittest_recursive_nano.proto", 688 ], 689 java_version: "1.7", 690} 691 692// To test Android-specific nanoproto features. 693// ======================================================= 694java_test { 695 // Parcelable messages 696 name: "android-nano-test-parcelable", 697 sdk_version: "current", 698 // Only needed at compile-time. 699 libs: ["android-support-annotations"], 700 proto: { 701 type: "nano", 702 local_include_dirs: ["src"], 703 output_params: [ 704 "parcelable_messages=true", 705 "generate_intdefs=true", 706 ], 707 }, 708 srcs: ["javanano/src/test/java/com/google/protobuf/nano/unittest_simple_nano.proto"], 709} 710 711java_test { 712 // Parcelable and extendable messages 713 name: "android-nano-test-parcelable-extendable", 714 sdk_version: "current", 715 // Only needed at compile-time. 716 libs: ["android-support-annotations"], 717 proto: { 718 type: "nano", 719 local_include_dirs: ["src"], 720 output_params: [ 721 "parcelable_messages=true", 722 "generate_intdefs=true", 723 "store_unknown_fields=true", 724 ], 725 }, 726 srcs: ["javanano/src/test/java/com/google/protobuf/nano/unittest_extension_nano.proto"], 727 java_version: "1.7", 728} 729 730android_test { 731 // Test APK 732 name: "NanoAndroidTest", 733 sdk_version: "8", 734 srcs: ["javanano/src/device/test/java/com/google/protobuf/nano/**/*.java"], 735 manifest: "javanano/src/device/test/AndroidManifest.xml", 736 static_libs: [ 737 "libprotobuf-java-nano", 738 "android-nano-test-parcelable", 739 "android-nano-test-parcelable-extendable", 740 ], 741 dex_preopt: { 742 enabled: false, 743 }, 744} 745