Skip to content

Commit

Permalink
Merge branch 'master' of github.com:google/protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
liujisi committed Mar 30, 2016
2 parents 3b3c8ab + a25e996 commit 0de06f5
Show file tree
Hide file tree
Showing 114 changed files with 4,729 additions and 6,935 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ os:
# The Objective C build needs Xcode 7.0 or later.
osx_image: xcode7.2
script:
- ./travis.sh $CONFIG
- ./tests.sh $CONFIG
env:
- CONFIG=cpp
- CONFIG=cpp_distcheck
Expand Down Expand Up @@ -71,5 +71,14 @@ matrix:
# we moved to an OS X image that is 10.11.
- os: osx
env: CONFIG=python_cpp
# xctool 0.2.8 seems to have a bug where it randomly kills tests saying
# they failed.
# https://github.com/facebook/xctool/issues/619
# https://github.com/google/protobuf/issues/1232
# travis updated their images to include 0.2.8:
# https://blog.travis-ci.com/2016-03-23-xcode-image-updates
# Mark the iOS test as flakey so these failures don't turn things red.
- os: osx
env: CONFIG=objectivec_ios
notifications:
email: false
75 changes: 64 additions & 11 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,41 @@ load(
"protobuf",
"cc_proto_library",
"py_proto_library",
"internal_gen_well_known_protos_java",
"internal_protobuf_py_tests",
)

config_setting(
name = "ios_armv7",
values = {
"ios_cpu": "armv7",
},
)

config_setting(
name = "ios_armv7s",
values = {
"ios_cpu": "armv7s",
},
)

config_setting(
name = "ios_arm64",
values = {
"ios_cpu": "arm64",
},
)

IOS_ARM_COPTS = COPTS + [
"-DOS_IOS",
"-miphoneos-version-min=7.0",
"-arch armv7",
"-arch armv7s",
"-arch arm64",
"-D__thread=",
"-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/",
]

cc_library(
name = "protobuf_lite",
srcs = [
Expand Down Expand Up @@ -54,7 +86,12 @@ cc_library(
"src/google/protobuf/wire_format_lite.cc",
],
hdrs = glob(["src/google/protobuf/**/*.h"]),
copts = COPTS,
copts = select({
":ios_armv7": IOS_ARM_COPTS,
":ios_armv7s": IOS_ARM_COPTS,
":ios_arm64": IOS_ARM_COPTS,
"//conditions:default": COPTS,
}),
includes = ["src/"],
linkopts = LINK_OPTS,
visibility = ["//visibility:public"],
Expand Down Expand Up @@ -119,7 +156,12 @@ cc_library(
"src/google/protobuf/wrappers.pb.cc",
],
hdrs = glob(["src/**/*.h"]),
copts = COPTS,
copts = select({
":ios_armv7": IOS_ARM_COPTS,
":ios_armv7s": IOS_ARM_COPTS,
":ios_arm64": IOS_ARM_COPTS,
"//conditions:default": COPTS,
}),
includes = ["src/"],
linkopts = LINK_OPTS,
visibility = ["//visibility:public"],
Expand Down Expand Up @@ -152,6 +194,12 @@ RELATIVE_WELL_KNOWN_PROTOS = [

WELL_KNOWN_PROTOS = ["src/" + s for s in RELATIVE_WELL_KNOWN_PROTOS]

filegroup(
name = "well_known_protos",
srcs = WELL_KNOWN_PROTOS,
visibility = ["//visibility:public"],
)

cc_proto_library(
name = "cc_wkt_protos",
srcs = WELL_KNOWN_PROTOS,
Expand Down Expand Up @@ -457,16 +505,8 @@ cc_test(
################################################################################
# Java support
################################################################################
genrule(
name = "gen_well_known_protos_java",
internal_gen_well_known_protos_java(
srcs = WELL_KNOWN_PROTOS,
outs = [
"wellknown.srcjar",
],
cmd = "$(location :protoc) --java_out=$(@D)/wellknown.jar" +
" -Isrc $(SRCS) " +
" && mv $(@D)/wellknown.jar $(@D)/wellknown.srcjar",
tools = [":protoc"],
)

java_library(
Expand All @@ -479,6 +519,19 @@ java_library(
visibility = ["//visibility:public"],
)

java_library(
name = "protobuf_java_util",
srcs = glob([
"java/util/src/main/java/com/google/protobuf/util/*.java",
]),
deps = [
"protobuf_java",
"//external:gson",
"//external:guava",
],
visibility = ["//visibility:public"],
)

################################################################################
# Python support
################################################################################
Expand Down
6 changes: 2 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,11 @@ objectivec_EXTRA_DIST= \
objectivec/DevTools/full_mac_build.sh \
objectivec/DevTools/pddm.py \
objectivec/DevTools/pddm_tests.py \
objectivec/generate_descriptors_proto.sh \
objectivec/generate_well_known_types.sh \
objectivec/google/protobuf/Any.pbobjc.h \
objectivec/google/protobuf/Any.pbobjc.m \
objectivec/google/protobuf/Api.pbobjc.h \
objectivec/google/protobuf/Api.pbobjc.m \
objectivec/google/protobuf/Descriptor.pbobjc.h \
objectivec/google/protobuf/Descriptor.pbobjc.m \
objectivec/google/protobuf/Duration.pbobjc.h \
objectivec/google/protobuf/Duration.pbobjc.m \
objectivec/google/protobuf/Empty.pbobjc.h \
Expand All @@ -421,6 +419,7 @@ objectivec_EXTRA_DIST= \
objectivec/GPBCodedInputStream_PackagePrivate.h \
objectivec/GPBCodedOutputStream.h \
objectivec/GPBCodedOutputStream.m \
objectivec/GPBCodedOutputStream_PackagePrivate.h \
objectivec/GPBDescriptor.h \
objectivec/GPBDescriptor.m \
objectivec/GPBDescriptor_PackagePrivate.h \
Expand Down Expand Up @@ -661,7 +660,6 @@ ruby_EXTRA_DIST= \
ruby/tests/repeated_field_test.rb \
ruby/tests/stress.rb \
ruby/tests/generated_code.proto \
ruby/tests/generated_code.rb \
ruby/tests/generated_code_test.rb \
ruby/travis-test.sh

Expand Down
1 change: 0 additions & 1 deletion Protobuf.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Pod::Spec.new do |s|
s.source_files = 'objectivec/*.{h,m}',
'objectivec/google/protobuf/Any.pbobjc.{h,m}',
'objectivec/google/protobuf/Api.pbobjc.{h,m}',
'objectivec/google/protobuf/Descriptor.pbobjc.{h,m}',
'objectivec/google/protobuf/Duration.pbobjc.h',
'objectivec/google/protobuf/Empty.pbobjc.{h,m}',
'objectivec/google/protobuf/FieldMask.pbobjc.{h,m}',
Expand Down
20 changes: 20 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,23 @@ bind(
name = "six",
actual = "@six_archive//:six",
)

maven_jar(
name = "guava_maven",
artifact = "com.google.guava:guava:18.0",
)

bind(
name = "guava",
actual = "@guava_maven//jar",
)

maven_jar(
name = "gson_maven",
artifact = "com.google.code.gson:gson:2.3",
)

bind(
name = "gson",
actual = "@gson_maven//jar",
)
16 changes: 12 additions & 4 deletions conformance/conformance_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ def do_test(request)
end

when :json_payload
test_message = Conformance::TestAllTypes.decode_json(request.json_payload)
begin
test_message = Conformance::TestAllTypes.decode_json(request.json_payload)
rescue Google::Protobuf::ParseError => err
response.parse_error = err.message.encode('utf-8')
return response
end

when nil
fail "Request didn't have payload"
Expand All @@ -66,6 +71,9 @@ def do_test(request)

when :JSON
response.json_payload = test_message.to_json

when nil
fail "Request didn't have requested output format"
end
rescue StandardError => err
response.runtime_error = err.message.encode('utf-8')
Expand Down Expand Up @@ -96,8 +104,8 @@ def do_test_io
STDOUT.flush

if $verbose
STDERR.puts("conformance-cpp: request={request.to_json}, " \
"response={response.to_json}\n")
STDERR.puts("conformance_ruby: request=#{request.to_json}, " \
"response=#{response.to_json}\n")
end

$test_count += 1
Expand All @@ -107,7 +115,7 @@ def do_test_io

loop do
unless do_test_io
STDERR.puts('conformance-cpp: received EOF from test runner ' \
STDERR.puts('conformance_ruby: received EOF from test runner ' \
"after #{$test_count} tests, exiting")
break
end
Expand Down
Loading

0 comments on commit 0de06f5

Please sign in to comment.