Merge pull request #5820 from protocolbuffers/3.7.x-fix
Merge 3.7.x to master
This commit is contained in:
commit
59cc6d01ac
66
CHANGES.txt
66
CHANGES.txt
@ -1,3 +1,69 @@
|
||||
2019-01-24 version 3.7.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
|
||||
|
||||
C++
|
||||
* Introduced new MOMI (maybe-outside-memory-interval) parser.
|
||||
* Add an option to json_util to parse enum as case-insensitive. In the future, enum parsing in json_util will become case-sensitive.
|
||||
* Added conformance test for enum aliases
|
||||
* Added support for --cpp_out=speed:...
|
||||
* Added use of C++ override keyword where appropriate
|
||||
* Many other cleanups and fixes.
|
||||
|
||||
Java
|
||||
* Fix illegal reflective access warning in JDK 9+
|
||||
* Add BOM
|
||||
|
||||
Python
|
||||
* Added Python 3.7 compatibility.
|
||||
* Modified ParseFromString to return bytes parsed .
|
||||
* Introduce Proto C API.
|
||||
* FindFileContainingSymbol in descriptor pool is now able to find field and enum values.
|
||||
* reflection.MakeClass() and reflection.ParseMessage() are deprecated.
|
||||
* Added DescriptorPool.FindMethodByName() method in pure python (c extension alreay has it)
|
||||
* Flipped proto3 to preserve unknown fields by default.
|
||||
* Added support for memoryview in python3 proto message parsing.
|
||||
* Added MergeFrom for repeated scalar fields in c extension (pure python already has it)
|
||||
* Surrogates are now rejected at setters in python3.
|
||||
* Added public unknown field API.
|
||||
* RecursionLimit is also set to max if allow_oversize_protos is enabled.
|
||||
* Disallow duplicate scalars in proto3 text_format parse.
|
||||
* Fix some segment faults for c extension map field.
|
||||
|
||||
PHP
|
||||
* Most issues for json encoding/decoding in the c extension have been fixed. There are still some edge cases not fixed. For more details, check conformance/failure_list_php_c.txt.
|
||||
* Supports php 7.3
|
||||
* Added helper methods to convert between enum values and names.
|
||||
* Allow setting/getting wrapper message fields using primitive values.
|
||||
* Various bug fixes.
|
||||
|
||||
Ruby
|
||||
* Ruby 2.6 support.
|
||||
* Drops support for ruby < 2.3.
|
||||
* Most issues for json encoding/decoding in the c extension have been fixed. There are still some edge cases not fixed. For more details, check conformance/failure_list_ruby.txt.
|
||||
* Json parsing can specify an option to ignore unknown fields: msg.decode_json(data, {ignore_unknown_fields: true}).
|
||||
* Added support for proto2 syntax (partially).
|
||||
* Various bug fixes.
|
||||
|
||||
Csharp
|
||||
* More support for FieldMask include merge, intersect and more.
|
||||
* Increasing the default recursion limit to 100.
|
||||
* Support loading FileDescriptors dynamically.
|
||||
* Provide access to comments from descriptors.
|
||||
* Added Any.Is method.
|
||||
* Compatible with C# 6
|
||||
* Added IComparable and comparison operators on Timestamp.
|
||||
|
||||
Objective C
|
||||
* Add ability to introspect list of enum values (#4678)
|
||||
* Copy the value when setting message/data fields (#5215)
|
||||
* Support suppressing the objc package prefix checks on a list of files (#5309)
|
||||
* More complete keyword and NSObject method (via categories) checks for field names, can result in more fields being rename, but avoids the collisions at runtime (#5289)
|
||||
* Small fixes to TextFormat generation for extensions (#5362)
|
||||
* Provide more details/context in deprecation messages (#5412)
|
||||
* Array/Dictionary enumeration blocks NS_NOESCAPE annotation for Swift (#5421)
|
||||
* Properly annotate extensions for ARC when their names imply behaviors (#5427)
|
||||
* Enum alias name collision improvements (#5480)
|
||||
|
||||
|
||||
2018-07-27 version 3.6.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
|
||||
|
||||
C++
|
||||
|
@ -607,6 +607,7 @@ php_EXTRA_DIST= \
|
||||
php/ext/google/protobuf/utf8.h \
|
||||
php/generate_descriptor_protos.sh \
|
||||
php/phpunit.xml \
|
||||
php/release.sh \
|
||||
php/src/GPBMetadata/Google/Protobuf/Any.php \
|
||||
php/src/GPBMetadata/Google/Protobuf/Api.php \
|
||||
php/src/GPBMetadata/Google/Protobuf/Duration.php \
|
||||
@ -1089,6 +1090,7 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \
|
||||
cmake/protoc.cmake \
|
||||
cmake/tests.cmake \
|
||||
cmake/version.rc.in \
|
||||
compiler_config_setting.bzl \
|
||||
editors/README.txt \
|
||||
editors/proto.vim \
|
||||
editors/protobuf-mode.el \
|
||||
|
@ -5,7 +5,7 @@
|
||||
# dependent projects use the :git notation to refer to the library.
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'Protobuf'
|
||||
s.version = '3.6.1'
|
||||
s.version = '3.7.0'
|
||||
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
|
||||
s.homepage = 'https://github.com/protocolbuffers/protobuf'
|
||||
s.license = '3-Clause BSD License'
|
||||
|
@ -68,23 +68,28 @@ string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\2"
|
||||
string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\3"
|
||||
protobuf_CONTACT "${protobuf_AC_INIT_LINE}")
|
||||
# Parse version tweaks
|
||||
set(protobuf_VERSION_REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+)-?(.*)$")
|
||||
set(protobuf_VERSION_REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+)([-]rc[-]|\\.)?([0-9]*)$")
|
||||
string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\1"
|
||||
protobuf_VERSION_MAJOR "${protobuf_VERSION_STRING}")
|
||||
string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\2"
|
||||
protobuf_VERSION_MINOR "${protobuf_VERSION_STRING}")
|
||||
string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\3"
|
||||
protobuf_VERSION_PATCH "${protobuf_VERSION_STRING}")
|
||||
string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\4"
|
||||
string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\5"
|
||||
protobuf_VERSION_PRERELEASE "${protobuf_VERSION_STRING}")
|
||||
|
||||
message(STATUS "${protobuf_VERSION_PRERELEASE}")
|
||||
|
||||
# Package version
|
||||
set(protobuf_VERSION
|
||||
"${protobuf_VERSION_MAJOR}.${protobuf_VERSION_MINOR}.${protobuf_VERSION_PATCH}")
|
||||
|
||||
if(protobuf_VERSION_PRERELEASE)
|
||||
set(protobuf_VERSION "${protobuf_VERSION}-${protobuf_VERSION_PRERELEASE}")
|
||||
set(protobuf_VERSION "${protobuf_VERSION}.${protobuf_VERSION_PRERELEASE}")
|
||||
else()
|
||||
set(protobuf_VERSION "${protobuf_VERSION}.0")
|
||||
endif()
|
||||
message(STATUS "${protobuf_VERSION}")
|
||||
|
||||
if(protobuf_VERBOSE)
|
||||
message(STATUS "Configuration script parsing status [")
|
||||
|
@ -44,6 +44,7 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\duration.pb.h" includ
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\dynamic_message.h" include\google\protobuf\dynamic_message.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\empty.pb.h" include\google\protobuf\empty.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\extension_set.h" include\google\protobuf\extension_set.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\extension_set_inl.h" include\google\protobuf\extension_set_inl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_mask.pb.h" include\google\protobuf\field_mask.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_reflection.h" include\google\protobuf\generated_enum_reflection.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_util.h" include\google\protobuf\generated_enum_util.h
|
||||
@ -94,7 +95,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\mutex.h" includ
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\once.h" include\google\protobuf\stubs\once.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\platform_macros.h" include\google\protobuf\stubs\platform_macros.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\port.h" include\google\protobuf\stubs\port.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\singleton.h" include\google\protobuf\stubs\singleton.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\status.h" include\google\protobuf\stubs\status.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\stl_util.h" include\google\protobuf\stubs\stl_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\strutil.h" include\google\protobuf\stubs\strutil.h
|
||||
|
@ -151,6 +151,7 @@ set(libprotoc_headers
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_map_field.h
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_message.h
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_message_field.h
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_oneof.h
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h
|
||||
${protobuf_source_dir}/src/google/protobuf/compiler/scc.h
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION @protobuf_RC_FILEVERSION@,0
|
||||
PRODUCTVERSION @protobuf_RC_FILEVERSION@,0
|
||||
FILEVERSION @protobuf_RC_FILEVERSION@
|
||||
PRODUCTVERSION @protobuf_RC_FILEVERSION@
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEFLAGS VER_DEBUG
|
||||
FILEOS VOS__WINDOWS32
|
||||
|
11
configure.ac
11
configure.ac
@ -17,7 +17,7 @@ AC_PREREQ(2.59)
|
||||
# In the SVN trunk, the version should always be the next anticipated release
|
||||
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
|
||||
# the size of one file name in the dist tarfile over the 99-char limit.)
|
||||
AC_INIT([Protocol Buffers],[3.6.1],[protobuf@googlegroups.com],[protobuf])
|
||||
AC_INIT([Protocol Buffers],[3.7.0],[protobuf@googlegroups.com],[protobuf])
|
||||
|
||||
AM_MAINTAINER_MODE([enable])
|
||||
|
||||
@ -205,15 +205,6 @@ AM_CONDITIONAL([HAVE_PTHREAD], [test "x$ax_pthread_ok" = "xyes"])
|
||||
# We still keep this for improving pbconfig.h for unsupported platforms.
|
||||
AC_CXX_STL_HASH
|
||||
|
||||
case "$target_os" in
|
||||
mingw* | cygwin* | win* | aix* | *android* )
|
||||
;;
|
||||
*)
|
||||
# Need to link against rt on Solaris
|
||||
AC_SEARCH_LIBS([sched_yield], [rt], [], [AC_MSG_FAILURE([sched_yield was not found on your system])])
|
||||
;;
|
||||
esac
|
||||
|
||||
# Enable ObjC support for conformance directory on OS X.
|
||||
OBJC_CONFORMANCE_TEST=0
|
||||
case "$target_os" in
|
||||
|
@ -13,6 +13,8 @@ Required.Proto3.JsonInput.FloatFieldTooSmall
|
||||
Required.Proto3.JsonInput.DoubleFieldTooSmall
|
||||
Required.Proto3.JsonInput.Int32FieldNotInteger
|
||||
Required.Proto3.JsonInput.Int64FieldNotInteger
|
||||
Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
|
||||
Required.Proto3.JsonInput.StringFieldNotAString
|
||||
Required.Proto3.JsonInput.Uint32FieldNotInteger
|
||||
Required.Proto3.JsonInput.Uint64FieldNotInteger
|
||||
Required.Proto3.JsonInput.Int32FieldLeadingSpace
|
||||
|
@ -5,7 +5,7 @@
|
||||
<title>Google Protocol Buffers tools</title>
|
||||
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
|
||||
<description>See project site for more info.</description>
|
||||
<version>3.6.1</version>
|
||||
<version>3.7.0</version>
|
||||
<authors>Google Inc.</authors>
|
||||
<owners>protobuf-packages</owners>
|
||||
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
|
||||
<Copyright>Copyright 2015, Google Inc.</Copyright>
|
||||
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
|
||||
<VersionPrefix>3.6.1</VersionPrefix>
|
||||
<VersionPrefix>3.7.0</VersionPrefix>
|
||||
<LangVersion>6</LangVersion>
|
||||
<Authors>Google Inc.</Authors>
|
||||
<TargetFrameworks>netstandard1.0;net45</TargetFrameworks>
|
||||
|
@ -1,13 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-bom</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.7.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Protocol Buffers [BOM]</name>
|
||||
@ -19,6 +16,17 @@
|
||||
<url>https://cloud.google.com</url>
|
||||
</organization>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>haon</id>
|
||||
<name>Hao Nguyen</name>
|
||||
<email>haon@google.com</email>
|
||||
<organization>Google</organization>
|
||||
<organizationUrl>https://cloud.google.com</organizationUrl>
|
||||
<timezone>America/Los_Angeles</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache License, Version 2.0</name>
|
||||
@ -26,6 +34,11 @@
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<scm>
|
||||
<url>https://github.com/protocolbuffers/protobuf</url>
|
||||
<connection>scm:git:https://github.com/protocolbuffers/protobuf.git</connection>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-parent</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.7.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
|
@ -272,7 +272,7 @@ public abstract class ByteString implements Iterable<Byte>, Serializable {
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a {@link Comparator<ByteString>} which compares {@link ByteString}-s lexicographically
|
||||
* Returns a {@link Comparator} which compares {@link ByteString}-s lexicographically
|
||||
* as sequences of unsigned bytes (i.e. values between 0 and 255, inclusive).
|
||||
*
|
||||
* <p>For example, {@code (byte) -1} is considered to be greater than {@code (byte) 1} because it
|
||||
@ -640,7 +640,7 @@ public abstract class ByteString implements Iterable<Byte>, Serializable {
|
||||
* @param targetOffset offset within the target buffer
|
||||
* @param numberToCopy number of bytes to copy
|
||||
* @throws IndexOutOfBoundsException if an offset or size is negative or too large
|
||||
* @deprecation Instead, call {@code byteString.substring(sourceOffset, sourceOffset +
|
||||
* @deprecated Instead, call {@code byteString.substring(sourceOffset, sourceOffset +
|
||||
* numberToCopy).copyTo(target, targetOffset)}
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -710,19 +710,23 @@ public abstract class GeneratedMessageV3 extends AbstractMessage
|
||||
return (BuilderType) this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuilderType setUnknownFields(final UnknownFieldSet unknownFields) {
|
||||
private BuilderType setUnknownFieldsInternal(final UnknownFieldSet unknownFields) {
|
||||
this.unknownFields = unknownFields;
|
||||
onChanged();
|
||||
return (BuilderType) this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuilderType setUnknownFields(final UnknownFieldSet unknownFields) {
|
||||
return setUnknownFieldsInternal(unknownFields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delegates to setUnknownFields. This method is obsolete, but we must retain it for
|
||||
* compatibility with older generated code.
|
||||
* This method is obsolete, but we must retain it for compatibility with
|
||||
* older generated code.
|
||||
*/
|
||||
protected BuilderType setUnknownFieldsProto3(final UnknownFieldSet unknownFields) {
|
||||
return setUnknownFields(unknownFields);
|
||||
return setUnknownFieldsInternal(unknownFields);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -151,10 +151,13 @@ public interface Message extends MessageLite, MessageOrBuilder {
|
||||
/**
|
||||
* Create a builder for messages of the appropriate type for the given field. The
|
||||
* builder is NOT nested in the current builder. However, messages built with the
|
||||
* builder can then be passed to the {@link #setField()}, {@link #setRepeatedField()}, or {@link
|
||||
* #addRepeatedField()} method of the current builder.
|
||||
* builder can then be passed to the {@link #setField(Descriptors.FieldDescriptor, Object)},
|
||||
* {@link #setRepeatedField(Descriptors.FieldDescriptor, int, Object)}, or
|
||||
* {@link #addRepeatedField(Descriptors.FieldDescriptor, Object)}
|
||||
* method of the current builder.
|
||||
*
|
||||
* <p>To obtain a builder nested in the current builder, use {@link #getFieldBuilder()} instead.
|
||||
* <p>To obtain a builder nested in the current builder, use
|
||||
* {@link #getFieldBuilder(Descriptors.FieldDescriptor)} instead.
|
||||
*/
|
||||
Builder newBuilderForField(Descriptors.FieldDescriptor field);
|
||||
|
||||
|
13
java/pom.xml
13
java/pom.xml
@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-parent</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.7.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Protocol Buffers [Parent]</name>
|
||||
@ -15,6 +15,17 @@
|
||||
extensible format.
|
||||
</description>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>haon</id>
|
||||
<name>Hao Nguyen</name>
|
||||
<email>haon@google.com</email>
|
||||
<organization>Google</organization>
|
||||
<organizationUrl>https://cloud.google.com</organizationUrl>
|
||||
<timezone>America/Los_Angeles</timezone>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-parent</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.7.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>protobuf-java-util</artifactId>
|
||||
|
@ -194,7 +194,7 @@ public final class Durations {
|
||||
|
||||
/**
|
||||
* Builds the given builder and throws an {@link IllegalArgumentException} if it is not valid. See
|
||||
* {@link #checkValid(Duration}).
|
||||
* {@link #checkValid(Duration)}.
|
||||
*
|
||||
* @return A valid, built {@link Duration}.
|
||||
*/
|
||||
|
@ -180,7 +180,7 @@ public final class Timestamps {
|
||||
|
||||
/**
|
||||
* Builds the given builder and throws an {@link IllegalArgumentException} if it is not valid. See
|
||||
* {@link #checkValid(Timestamp}).
|
||||
* {@link #checkValid(Timestamp)}.
|
||||
*
|
||||
* @return A valid, built {@link Timestamp}.
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "google-protobuf",
|
||||
"version": "3.6.1",
|
||||
"version": "3.7.0",
|
||||
"description": "Protocol Buffers for JavaScript",
|
||||
"main": "google-protobuf.js",
|
||||
"files": [
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
# Build file to set up and run tests
|
||||
|
||||
set -e # exit immediately on error
|
||||
set -ex # exit immediately on error
|
||||
|
||||
# Change to repo root
|
||||
cd $(dirname $0)/../../..
|
||||
|
11
kokoro/release/csharp/windows/continuous.cfg
Normal file
11
kokoro/release/csharp/windows/continuous.cfg
Normal file
@ -0,0 +1,11 @@
|
||||
# Config file for running tests in Kokoro
|
||||
|
||||
# Location of the build script in repository
|
||||
build_file: "protobuf/kokoro/release/csharp/windows/build_nuget.bat"
|
||||
timeout_mins: 60
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "**/*.nupkg"
|
||||
}
|
||||
}
|
11
kokoro/release/csharp/windows/presubmit.cfg
Normal file
11
kokoro/release/csharp/windows/presubmit.cfg
Normal file
@ -0,0 +1,11 @@
|
||||
# Config file for running tests in Kokoro
|
||||
|
||||
# Location of the build script in repository
|
||||
build_file: "protobuf/kokoro/release/csharp/windows/build_nuget.bat"
|
||||
timeout_mins: 60
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "**/*.nupkg"
|
||||
}
|
||||
}
|
@ -5,13 +5,17 @@ set -ex
|
||||
# change to repo root
|
||||
pushd $(dirname $0)/../../../..
|
||||
|
||||
# Create stage dir
|
||||
ORIGINAL_DIR=`pwd`
|
||||
pushd ..
|
||||
cp -R $ORIGINAL_DIR stage
|
||||
export STAGE_DIR="`pwd`/stage"
|
||||
popd
|
||||
|
||||
export REPO_DIR=protobuf
|
||||
export BUILD_VERSION=`grep -i "version" python/google/protobuf/__init__.py | grep -o "'.*'" | tr -d "'"`
|
||||
if [ -z $KOKORO_JOB_NAME ]; then
|
||||
export BUILD_COMMIT=master
|
||||
else
|
||||
export BUILD_COMMIT=`echo "$KOKORO_JOB_NAME" | cut -d '/' -f 3`
|
||||
fi
|
||||
|
||||
export BUILD_COMMIT=`git rev-parse HEAD`
|
||||
export PLAT=x86_64
|
||||
export UNICODE_WIDTH=32
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
@ -29,8 +33,8 @@ build_artifact_version() {
|
||||
|
||||
# Clean up env
|
||||
rm -rf venv
|
||||
sudo rm -rf protobuf
|
||||
git clone https://github.com/google/protobuf.git
|
||||
sudo rm -rf $REPO_DIR
|
||||
cp -R $STAGE_DIR $REPO_DIR
|
||||
|
||||
source multibuild/common_utils.sh
|
||||
source multibuild/travis_steps.sh
|
||||
|
8
kokoro/release/python/linux/continuous.cfg
Normal file
8
kokoro/release/python/linux/continuous.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Config file for running tests in Kokoro
|
||||
build_file: "protobuf/kokoro/release/python/linux/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
8
kokoro/release/python/linux/presubmit.cfg
Normal file
8
kokoro/release/python/linux/presubmit.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Config file for running tests in Kokoro
|
||||
build_file: "protobuf/kokoro/release/python/linux/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
@ -5,13 +5,16 @@ set -ex
|
||||
# change to repo root
|
||||
pushd $(dirname $0)/../../../..
|
||||
|
||||
# Create stage dir
|
||||
ORIGINAL_DIR=`pwd`
|
||||
pushd ..
|
||||
cp -R $ORIGINAL_DIR stage
|
||||
export STAGE_DIR="`pwd`/stage"
|
||||
popd
|
||||
|
||||
export REPO_DIR=protobuf
|
||||
export BUILD_VERSION=`grep -i "version" python/google/protobuf/__init__.py | grep -o "'.*'" | tr -d "'"`
|
||||
if [ -z $KOKORO_JOB_NAME ]; then
|
||||
export BUILD_COMMIT=master
|
||||
else
|
||||
export BUILD_COMMIT=`echo "$KOKORO_JOB_NAME" | cut -d '/' -f 3`
|
||||
fi
|
||||
export BUILD_COMMIT=`git rev-parse HEAD`
|
||||
export PLAT=x86_64
|
||||
export UNICODE_WIDTH=32
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
@ -32,8 +35,8 @@ build_artifact_version() {
|
||||
|
||||
# Clean up env
|
||||
rm -rf venv
|
||||
sudo rm -rf protobuf
|
||||
git clone https://github.com/google/protobuf.git
|
||||
sudo rm -rf $REPO_DIR
|
||||
cp -R $STAGE_DIR $REPO_DIR
|
||||
export PATH=$OLD_PATH
|
||||
|
||||
source multibuild/common_utils.sh
|
||||
|
8
kokoro/release/python/macos/continuous.cfg
Normal file
8
kokoro/release/python/macos/continuous.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Mac OSX release builds
|
||||
build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
8
kokoro/release/python/macos/presubmit.cfg
Normal file
8
kokoro/release/python/macos/presubmit.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Mac OSX release builds
|
||||
build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
REM Move scripts to root
|
||||
set REPO_DIR_STAGE=%cd%\github\protobuf-stage
|
||||
xcopy /S github\protobuf "%REPO_DIR_STAGE%\"
|
||||
cd github\protobuf
|
||||
copy kokoro\release\python\windows\build_single_artifact.bat build_single_artifact.bat
|
||||
|
||||
REM Set environment variables
|
||||
set REPO_DIR=protobuf
|
||||
set PACKAGE_NAME=protobuf
|
||||
set REPO_DIR=protobuf
|
||||
set BUILD_DLL=OFF
|
||||
set UNICODE=ON
|
||||
set PB_TEST_DEP="six==1.9"
|
||||
set OTHER_TEST_DEP="setuptools==38.5.1"
|
||||
set OLD_PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH%
|
||||
for /f "tokens=*" %%i in ( 'grep -i "version" python/google/protobuf/__init__.py ^| grep -o "'.*'"' ) do set BUILD_VERSION=%%i
|
||||
set BUILD_COMMIT=v%BUILD_VERSION:'=%
|
||||
|
||||
REM Fetch multibuild
|
||||
git clone https://github.com/matthew-brett/multibuild.git
|
||||
@ -35,29 +35,34 @@ REM Build wheel
|
||||
SET PYTHON=C:\python35_32bit
|
||||
SET PYTHON_VERSION=3.5
|
||||
SET PYTHON_ARCH=32
|
||||
CALL build_single_artifact.bat
|
||||
CALL build_single_artifact.bat || goto :error
|
||||
|
||||
SET PYTHON=C:\python35
|
||||
SET PYTHON_VERSION=3.5
|
||||
SET PYTHON_ARCH=64
|
||||
CALL build_single_artifact.bat
|
||||
CALL build_single_artifact.bat || goto :error
|
||||
|
||||
SET PYTHON=C:\python36_32bit
|
||||
SET PYTHON_VERSION=3.6
|
||||
SET PYTHON_ARCH=32
|
||||
CALL build_single_artifact.bat
|
||||
CALL build_single_artifact.bat || goto :error
|
||||
|
||||
SET PYTHON=C:\python36
|
||||
SET PYTHON_VERSION=3.6
|
||||
SET PYTHON_ARCH=64
|
||||
CALL build_single_artifact.bat
|
||||
CALL build_single_artifact.bat || goto :error
|
||||
|
||||
SET PYTHON=C:\python37_32bit
|
||||
SET PYTHON_VERSION=3.7
|
||||
SET PYTHON_ARCH=32
|
||||
CALL build_single_artifact.bat
|
||||
CALL build_single_artifact.bat || goto :error
|
||||
|
||||
SET PYTHON=C:\python37
|
||||
SET PYTHON_VERSION=3.7
|
||||
SET PYTHON_ARCH=64
|
||||
CALL build_single_artifact.bat
|
||||
CALL build_single_artifact.bat || goto :error
|
||||
|
||||
goto :EOF
|
||||
|
||||
:error
|
||||
exit /b %errorlevel%
|
||||
|
@ -12,6 +12,12 @@ if %PYTHON%==C:\python36_32bit set vcplatform=Win32
|
||||
if %PYTHON%==C:\python36 set generator=Visual Studio 14 Win64
|
||||
if %PYTHON%==C:\python36 set vcplatform=x64
|
||||
|
||||
if %PYTHON%==C:\python37_32bit set generator=Visual Studio 14
|
||||
if %PYTHON%==C:\python37_32bit set vcplatform=Win32
|
||||
|
||||
if %PYTHON%==C:\python37 set generator=Visual Studio 14 Win64
|
||||
if %PYTHON%==C:\python37 set vcplatform=x64
|
||||
|
||||
REM Prepend newly installed Python to the PATH of this build (this cannot be
|
||||
REM done from inside the powershell script as it would require to restart
|
||||
REM the parent CMD process).
|
||||
@ -23,12 +29,11 @@ REM Check that we have the expected version and architecture for Python
|
||||
python --version
|
||||
python -c "import struct; print(struct.calcsize('P') * 8)"
|
||||
|
||||
rmdir /s/q protobuf
|
||||
git clone https://github.com/google/protobuf.git
|
||||
rmdir /s/q %REPO_DIR%
|
||||
xcopy /s %REPO_DIR_STAGE% "%REPO_DIR%\"
|
||||
|
||||
REM Checkout release commit
|
||||
cd %REPO_DIR%
|
||||
git checkout %BUILD_COMMIT%
|
||||
|
||||
REM ======================
|
||||
REM Build Protobuf Library
|
||||
@ -38,8 +43,8 @@ mkdir src\.libs
|
||||
|
||||
mkdir vcprojects
|
||||
pushd vcprojects
|
||||
cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=OFF ../cmake
|
||||
msbuild protobuf.sln /p:Platform=%vcplatform% /p:Configuration=Release
|
||||
cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=OFF ../cmake || goto :error
|
||||
msbuild protobuf.sln /p:Platform=%vcplatform% /p:Configuration=Release || goto :error
|
||||
dir /s /b
|
||||
popd
|
||||
copy vcprojects\Release\libprotobuf.lib src\.libs\libprotobuf.a
|
||||
@ -60,3 +65,8 @@ dir dist
|
||||
copy dist\* %ARTIFACT_DIR%
|
||||
dir %ARTIFACT_DIR%
|
||||
cd ..\..
|
||||
|
||||
goto :EOF
|
||||
|
||||
:error
|
||||
exit /b %errorlevel%
|
||||
|
8
kokoro/release/python/windows/continuous.cfg
Normal file
8
kokoro/release/python/windows/continuous.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Windows protoc release builds
|
||||
build_file: "protobuf/kokoro/release/python/windows/build_artifacts.bat"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
8
kokoro/release/python/windows/presubmit.cfg
Normal file
8
kokoro/release/python/windows/presubmit.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Windows protoc release builds
|
||||
build_file: "protobuf/kokoro/release/python/windows/build_artifacts.bat"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
8
kokoro/release/ruby/linux/continuous.cfg
Normal file
8
kokoro/release/ruby/linux/continuous.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Linux release builds
|
||||
build_file: "protobuf/kokoro/release/ruby/linux/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
8
kokoro/release/ruby/linux/presubmit.cfg
Normal file
8
kokoro/release/ruby/linux/presubmit.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Linux release builds
|
||||
build_file: "protobuf/kokoro/release/ruby/linux/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
# Build protoc
|
||||
if test ! -e src/protoc; then
|
||||
./autogen.sh
|
||||
|
8
kokoro/release/ruby/macos/continuous.cfg
Normal file
8
kokoro/release/ruby/macos/continuous.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Mac OSX release builds
|
||||
build_file: "protobuf/kokoro/release/ruby/macos/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
8
kokoro/release/ruby/macos/presubmit.cfg
Normal file
8
kokoro/release/ruby/macos/presubmit.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
# Configuration for Mac OSX release builds
|
||||
build_file: "protobuf/kokoro/release/ruby/macos/build_artifacts.sh"
|
||||
|
||||
action {
|
||||
define_artifacts {
|
||||
regex: "github/protobuf/artifacts/**"
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
# Build protoc
|
||||
if test ! -e src/protoc; then
|
||||
./autogen.sh
|
||||
|
@ -789,47 +789,44 @@ static bool is_reserved(const char *segment, int length) {
|
||||
return result;
|
||||
}
|
||||
|
||||
static char* fill_prefix(const char *segment, int length,
|
||||
const char *prefix_given,
|
||||
const char *package_name, char *classname) {
|
||||
static void fill_prefix(const char *segment, int length,
|
||||
const char *prefix_given,
|
||||
const char *package_name,
|
||||
stringsink *classname) {
|
||||
size_t i;
|
||||
|
||||
if (prefix_given != NULL && strcmp(prefix_given, "") != 0) {
|
||||
size_t prefix_len = strlen(prefix_given);
|
||||
memcpy(classname, prefix_given, strlen(prefix_given));
|
||||
classname += prefix_len;
|
||||
stringsink_string(classname, NULL, prefix_given,
|
||||
strlen(prefix_given), NULL);
|
||||
} else {
|
||||
if (is_reserved(segment, length)) {
|
||||
if (package_name != NULL &&
|
||||
strcmp("google.protobuf", package_name) == 0) {
|
||||
memcpy(classname, "GPB", 3);
|
||||
classname += 3;
|
||||
stringsink_string(classname, NULL, "GPB", 3, NULL);
|
||||
} else {
|
||||
memcpy(classname, "PB", 2);
|
||||
classname += 2;
|
||||
stringsink_string(classname, NULL, "PB", 2, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
return classname;
|
||||
}
|
||||
|
||||
static char* fill_segment(const char *segment, int length,
|
||||
char *classname, bool use_camel) {
|
||||
memcpy(classname, segment, length);
|
||||
static void fill_segment(const char *segment, int length,
|
||||
stringsink *classname, bool use_camel) {
|
||||
if (use_camel && (segment[0] < 'A' || segment[0] > 'Z')) {
|
||||
classname[0] += 'A' - 'a';
|
||||
char first = segment[0] + ('A' - 'a');
|
||||
stringsink_string(classname, NULL, &first, 1, NULL);
|
||||
stringsink_string(classname, NULL, segment + 1, length - 1, NULL);
|
||||
} else {
|
||||
stringsink_string(classname, NULL, segment, length, NULL);
|
||||
}
|
||||
return classname + length;
|
||||
}
|
||||
|
||||
static char* fill_namespace(const char *package, const char *namespace_given,
|
||||
char *classname) {
|
||||
static void fill_namespace(const char *package, const char *namespace_given,
|
||||
stringsink *classname) {
|
||||
if (namespace_given != NULL) {
|
||||
size_t namespace_len = strlen(namespace_given);
|
||||
memcpy(classname, namespace_given, namespace_len);
|
||||
classname += namespace_len;
|
||||
*classname = '\\';
|
||||
classname++;
|
||||
stringsink_string(classname, NULL, namespace_given,
|
||||
strlen(namespace_given), NULL);
|
||||
stringsink_string(classname, NULL, "\\", 1, NULL);
|
||||
} else if (package != NULL) {
|
||||
int i = 0, j, offset = 0;
|
||||
size_t package_len = strlen(package);
|
||||
@ -838,29 +835,27 @@ static char* fill_namespace(const char *package, const char *namespace_given,
|
||||
while (j < package_len && package[j] != '.') {
|
||||
j++;
|
||||
}
|
||||
classname = fill_prefix(package + i, j - i, "", package, classname);
|
||||
classname = fill_segment(package + i, j - i, classname, true);
|
||||
classname[0] = '\\';
|
||||
classname++;
|
||||
fill_prefix(package + i, j - i, "", package, classname);
|
||||
fill_segment(package + i, j - i, classname, true);
|
||||
stringsink_string(classname, NULL, "\\", 1, NULL);
|
||||
i = j + 1;
|
||||
}
|
||||
}
|
||||
return classname;
|
||||
}
|
||||
|
||||
static char* fill_classname(const char *fullname,
|
||||
const char *package,
|
||||
const char *namespace_given,
|
||||
const char *prefix, char *classname) {
|
||||
static void fill_classname(const char *fullname,
|
||||
const char *package,
|
||||
const char *namespace_given,
|
||||
const char *prefix,
|
||||
stringsink *classname,
|
||||
bool use_nested_submsg) {
|
||||
int classname_start = 0;
|
||||
if (package != NULL) {
|
||||
size_t package_len = strlen(package);
|
||||
classname_start = package_len == 0 ? 0 : package_len + 1;
|
||||
}
|
||||
size_t fullname_len = strlen(fullname);
|
||||
classname = fill_prefix(fullname + classname_start,
|
||||
fullname_len - classname_start,
|
||||
prefix, package, classname);
|
||||
bool is_first_segment = true;
|
||||
|
||||
int i = classname_start, j;
|
||||
while (i < fullname_len) {
|
||||
@ -868,22 +863,31 @@ static char* fill_classname(const char *fullname,
|
||||
while (j < fullname_len && fullname[j] != '.') {
|
||||
j++;
|
||||
}
|
||||
classname = fill_segment(fullname + i, j - i, classname, false);
|
||||
if (use_nested_submsg || is_first_segment && j == fullname_len) {
|
||||
fill_prefix(fullname + i, j - i, prefix, package, classname);
|
||||
}
|
||||
is_first_segment = false;
|
||||
fill_segment(fullname + i, j - i, classname, false);
|
||||
if (j != fullname_len) {
|
||||
*classname = '_';
|
||||
classname++;
|
||||
if (use_nested_submsg) {
|
||||
stringsink_string(classname, NULL, "\\", 1, NULL);
|
||||
} else {
|
||||
stringsink_string(classname, NULL, "_", 1, NULL);
|
||||
}
|
||||
}
|
||||
i = j + 1;
|
||||
}
|
||||
return classname;
|
||||
}
|
||||
|
||||
static char* fill_qualified_classname(const char *fullname,
|
||||
const char *package,
|
||||
const char *namespace_given,
|
||||
const char *prefix, char *classname) {
|
||||
classname = fill_namespace(package, namespace_given, classname);
|
||||
return fill_classname(fullname, package, namespace_given, prefix, classname);
|
||||
static void fill_qualified_classname(const char *fullname,
|
||||
const char *package,
|
||||
const char *namespace_given,
|
||||
const char *prefix,
|
||||
stringsink *classname,
|
||||
bool use_nested_submsg) {
|
||||
fill_namespace(package, namespace_given, classname);
|
||||
fill_classname(fullname, package, namespace_given, prefix,
|
||||
classname, use_nested_submsg);
|
||||
}
|
||||
|
||||
static void classname_no_prefix(const char *fullname, const char *package_name,
|
||||
@ -905,7 +909,8 @@ static void classname_no_prefix(const char *fullname, const char *package_name,
|
||||
}
|
||||
|
||||
void internal_add_generated_file(const char *data, PHP_PROTO_SIZE data_len,
|
||||
InternalDescriptorPool *pool TSRMLS_DC) {
|
||||
InternalDescriptorPool *pool,
|
||||
bool use_nested_submsg TSRMLS_DC) {
|
||||
upb_filedef **files;
|
||||
size_t i;
|
||||
|
||||
@ -946,16 +951,15 @@ void internal_add_generated_file(const char *data, PHP_PROTO_SIZE data_len,
|
||||
const char *package = upb_filedef_package(files[0]); \
|
||||
const char *php_namespace = upb_filedef_phpnamespace(files[0]); \
|
||||
const char *prefix_given = upb_filedef_phpprefix(files[0]); \
|
||||
size_t classname_len = classname_len_max(fullname, package, \
|
||||
php_namespace, prefix_given); \
|
||||
char *classname = ecalloc(sizeof(char), classname_len); \
|
||||
stringsink namesink; \
|
||||
stringsink_init(&namesink); \
|
||||
fill_qualified_classname(fullname, package, php_namespace, \
|
||||
prefix_given, classname); \
|
||||
prefix_given, &namesink, use_nested_submsg); \
|
||||
PHP_PROTO_CE_DECLARE pce; \
|
||||
if (php_proto_zend_lookup_class(classname, strlen(classname), &pce) == \
|
||||
if (php_proto_zend_lookup_class(namesink.ptr, namesink.len, &pce) == \
|
||||
FAILURE) { \
|
||||
zend_error(E_ERROR, "Generated message class %s hasn't been defined", \
|
||||
classname); \
|
||||
namesink.ptr); \
|
||||
return; \
|
||||
} else { \
|
||||
desc->klass = PHP_PROTO_CE_UNREF(pce); \
|
||||
@ -963,7 +967,7 @@ void internal_add_generated_file(const char *data, PHP_PROTO_SIZE data_len,
|
||||
add_ce_obj(desc->klass, desc_php); \
|
||||
add_proto_obj(upb_##def_type_lower##_fullname(desc->def_type_lower), \
|
||||
desc_php); \
|
||||
efree(classname); \
|
||||
stringsink_uninit(&namesink); \
|
||||
break; \
|
||||
}
|
||||
|
||||
@ -993,15 +997,18 @@ PHP_METHOD(InternalDescriptorPool, internalAddGeneratedFile) {
|
||||
char *data = NULL;
|
||||
PHP_PROTO_SIZE data_len;
|
||||
upb_filedef **files;
|
||||
zend_bool use_nested_submsg = false;
|
||||
size_t i;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data, &data_len) ==
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b",
|
||||
&data, &data_len, &use_nested_submsg) ==
|
||||
FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
InternalDescriptorPool *pool = UNBOX(InternalDescriptorPool, getThis());
|
||||
internal_add_generated_file(data, data_len, pool TSRMLS_CC);
|
||||
internal_add_generated_file(data, data_len, pool,
|
||||
use_nested_submsg TSRMLS_CC);
|
||||
}
|
||||
|
||||
PHP_METHOD(DescriptorPool, getDescriptorByClassName) {
|
||||
|
@ -36,22 +36,14 @@
|
||||
|
||||
/* stringsink *****************************************************************/
|
||||
|
||||
typedef struct {
|
||||
upb_byteshandler handler;
|
||||
upb_bytessink sink;
|
||||
char *ptr;
|
||||
size_t len, size;
|
||||
} stringsink;
|
||||
|
||||
|
||||
static void *stringsink_start(void *_sink, const void *hd, size_t size_hint) {
|
||||
stringsink *sink = _sink;
|
||||
sink->len = 0;
|
||||
return sink;
|
||||
}
|
||||
|
||||
static size_t stringsink_string(void *_sink, const void *hd, const char *ptr,
|
||||
size_t len, const upb_bufhandle *handle) {
|
||||
size_t stringsink_string(void *_sink, const void *hd, const char *ptr,
|
||||
size_t len, const upb_bufhandle *handle) {
|
||||
stringsink *sink = _sink;
|
||||
size_t new_size = sink->size;
|
||||
|
||||
|
@ -464,17 +464,29 @@ void Message_construct(zval* msg, zval* array_wrapper) {
|
||||
const upb_msgdef* submsgdef = upb_fielddef_msgsubdef(field);
|
||||
PHP_PROTO_HASHTABLE_VALUE desc_php = get_def_obj(submsgdef);
|
||||
Descriptor* desc = UNBOX_HASHTABLE_VALUE(Descriptor, desc_php);
|
||||
zend_property_info* property_info;
|
||||
PHP_PROTO_FAKE_SCOPE_BEGIN(Z_OBJCE_P(msg));
|
||||
|
||||
CACHED_VALUE* cached = NULL;
|
||||
if (upb_fielddef_containingoneof(field)) {
|
||||
void* memory = slot_memory(intern->descriptor->layout,
|
||||
message_data(intern), field);
|
||||
int property_cache_index =
|
||||
intern->descriptor->layout->fields[upb_fielddef_index(field)]
|
||||
.cache_index;
|
||||
cached = OBJ_PROP(Z_OBJ_P(msg), property_cache_index);
|
||||
*(CACHED_VALUE**)(memory) = cached;
|
||||
} else {
|
||||
zend_property_info* property_info;
|
||||
PHP_PROTO_FAKE_SCOPE_BEGIN(Z_OBJCE_P(msg));
|
||||
#if PHP_MAJOR_VERSION < 7
|
||||
property_info =
|
||||
zend_get_property_info(Z_OBJCE_P(msg), &key, true TSRMLS_CC);
|
||||
property_info =
|
||||
zend_get_property_info(Z_OBJCE_P(msg), &key, true TSRMLS_CC);
|
||||
#else
|
||||
property_info =
|
||||
zend_get_property_info(Z_OBJCE_P(msg), Z_STR_P(&key), true);
|
||||
property_info =
|
||||
zend_get_property_info(Z_OBJCE_P(msg), Z_STR_P(&key), true);
|
||||
#endif
|
||||
PHP_PROTO_FAKE_SCOPE_END;
|
||||
CACHED_VALUE* cached = OBJ_PROP(Z_OBJ_P(msg), property_info->offset);
|
||||
PHP_PROTO_FAKE_SCOPE_END;
|
||||
cached = OBJ_PROP(Z_OBJ_P(msg), property_info->offset);
|
||||
}
|
||||
#if PHP_MAJOR_VERSION < 7
|
||||
SEPARATE_ZVAL_IF_NOT_REF(cached);
|
||||
#endif
|
||||
@ -689,7 +701,8 @@ static void init_file_any(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_any = true;
|
||||
}
|
||||
@ -729,7 +742,8 @@ static void init_file_api(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_api = true;
|
||||
}
|
||||
@ -749,7 +763,8 @@ static void init_file_duration(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_duration = true;
|
||||
}
|
||||
@ -769,7 +784,8 @@ static void init_file_field_mask(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_field_mask = true;
|
||||
}
|
||||
@ -788,7 +804,8 @@ static void init_file_empty(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_empty = true;
|
||||
}
|
||||
@ -809,7 +826,8 @@ static void init_file_source_context(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_source_context = true;
|
||||
}
|
||||
@ -843,7 +861,8 @@ static void init_file_struct(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_struct = true;
|
||||
}
|
||||
@ -863,7 +882,8 @@ static void init_file_timestamp(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_timestamp = true;
|
||||
}
|
||||
@ -931,7 +951,8 @@ static void init_file_type(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_type = true;
|
||||
}
|
||||
@ -958,7 +979,8 @@ static void init_file_wrappers(TSRMLS_D) {
|
||||
char* binary;
|
||||
int binary_len;
|
||||
hex_to_binary(generated_file, &binary, &binary_len);
|
||||
internal_add_generated_file(binary, binary_len, generated_pool TSRMLS_CC);
|
||||
internal_add_generated_file(binary, binary_len,
|
||||
generated_pool, true TSRMLS_CC);
|
||||
FREE(binary);
|
||||
is_inited_file_wrappers = true;
|
||||
}
|
||||
|
@ -10,11 +10,11 @@
|
||||
<email>protobuf-opensource@google.com</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2018-08-03</date>
|
||||
<time>11:02:07</time>
|
||||
<date>2019-02-28</date>
|
||||
<time>10:19:15</time>
|
||||
<version>
|
||||
<release>3.6.1</release>
|
||||
<api>3.6.1</api>
|
||||
<release>3.7.0</release>
|
||||
<api>3.7.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
@ -262,5 +262,47 @@ G A release.
|
||||
G A release.
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>3.7.0RC2</release>
|
||||
<api>3.7.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2019-02-1</date>
|
||||
<time>10:22:43</time>
|
||||
<license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
|
||||
<notes>GA release.</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>3.7.0RC3</release>
|
||||
<api>3.7.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<date>2019-02-22</date>
|
||||
<time>11:31:21</time>
|
||||
<license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
|
||||
<notes>GA release.</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>3.7.0</release>
|
||||
<api>3.7.0</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
</stability>
|
||||
<date>2019-02-28</date>
|
||||
<time>10:19:15</time>
|
||||
<license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
|
||||
<notes>GA release.</notes>
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "upb.h"
|
||||
|
||||
#define PHP_PROTOBUF_EXTNAME "protobuf"
|
||||
#define PHP_PROTOBUF_VERSION "3.6.1"
|
||||
#define PHP_PROTOBUF_VERSION "3.7.0"
|
||||
|
||||
#define MAX_LENGTH_OF_INT64 20
|
||||
#define SIZEOF_INT64 8
|
||||
@ -770,7 +770,8 @@ PHP_METHOD(InternalDescriptorPool, getGeneratedPool);
|
||||
PHP_METHOD(InternalDescriptorPool, internalAddGeneratedFile);
|
||||
|
||||
void internal_add_generated_file(const char* data, PHP_PROTO_SIZE data_len,
|
||||
InternalDescriptorPool* pool TSRMLS_DC);
|
||||
InternalDescriptorPool* pool,
|
||||
bool use_nested_submsg TSRMLS_DC);
|
||||
void init_generated_pool_once(TSRMLS_D);
|
||||
|
||||
// wrapper of generated pool
|
||||
@ -1453,6 +1454,18 @@ const zend_class_entry* field_type_class(
|
||||
const upb_fielddef* field PHP_PROTO_TSRMLS_DC);
|
||||
void stringsink_uninit_opaque(void *sink);
|
||||
|
||||
typedef struct {
|
||||
upb_byteshandler handler;
|
||||
upb_bytessink sink;
|
||||
char *ptr;
|
||||
size_t len, size;
|
||||
} stringsink;
|
||||
|
||||
void stringsink_init(stringsink *sink);
|
||||
void stringsink_uninit(stringsink *sink);
|
||||
size_t stringsink_string(void *_sink, const void *hd, const char *ptr,
|
||||
size_t len, const upb_bufhandle *handle);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Utilities.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
37
php/release.sh
Normal file
37
php/release.sh
Normal file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
# Make sure we are in a protobuf source tree.
|
||||
[ -f "php/release.sh" ] || {
|
||||
echo "This script must be ran under root of protobuf source tree."
|
||||
exit 1
|
||||
}
|
||||
|
||||
VERSION=$1
|
||||
|
||||
git clone https://github.com/protocolbuffers/protobuf-php.git
|
||||
git clone https://github.com/protocolbuffers/protobuf.git
|
||||
|
||||
# Clean old files
|
||||
pushd protobuf-php
|
||||
rm -rf src
|
||||
popd
|
||||
|
||||
# Checkout the target version
|
||||
pushd protobuf/php
|
||||
git checkout $VERSION
|
||||
popd
|
||||
|
||||
# Copy files
|
||||
pushd protobuf-php
|
||||
mv ../protobuf/php/src src
|
||||
mv ../protobuf/composer.json composer.json
|
||||
sed -i 's|php/src|src|g' composer.json
|
||||
git add .
|
||||
git commit -m "$VERSION"
|
||||
git tag "$VERSION"
|
||||
popd
|
||||
|
||||
# Clean up
|
||||
rm -rf protobuf
|
@ -832,6 +832,9 @@ class Message
|
||||
if (is_null($value)) {
|
||||
return $this->defaultValue($field);
|
||||
}
|
||||
if (is_numeric($value)) {
|
||||
return strval($value);
|
||||
}
|
||||
if (!is_string($value)) {
|
||||
throw new GPBDecodeException(
|
||||
"String field only accepts string value");
|
||||
|
@ -1148,4 +1148,14 @@ class EncodeDecodeTest extends TestBase
|
||||
$m->serializeToJsonString());
|
||||
}
|
||||
|
||||
public function testJsonDecodeNumericStringMapKey()
|
||||
{
|
||||
$m = new TestMessage();
|
||||
$m->getMapStringString()["1"] = "1";
|
||||
$data = $m->serializeToJsonString();
|
||||
$this->assertSame("{\"mapStringString\":{\"1\":\"1\"}}", $data);
|
||||
$n = new TestMessage();
|
||||
$n->mergeFromJsonString($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1447,6 +1447,20 @@ class GeneratedClassTest extends TestBase
|
||||
}
|
||||
}
|
||||
|
||||
public function testOneofMessageInArrayConstructor()
|
||||
{
|
||||
$m = new TestMessage([
|
||||
'oneof_message' => new Sub(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function testOneofStringInArrayConstructor()
|
||||
{
|
||||
$m = new TestMessage([
|
||||
'oneof_string' => 'abc',
|
||||
]);
|
||||
}
|
||||
|
||||
#########################################################
|
||||
# Test message equals.
|
||||
#########################################################
|
||||
|
@ -121,6 +121,8 @@ target directory layout:
|
||||
protoc.exe
|
||||
+ aarch_64
|
||||
protoc.exe
|
||||
+ ppcle_64
|
||||
protoc.exe
|
||||
+ osx
|
||||
+ x86_64
|
||||
protoc.exe
|
||||
|
@ -13,8 +13,9 @@ Example:
|
||||
This script will download pre-built protoc or protoc plugin binaries from maven
|
||||
repository and create .zip packages suitable to be included in the github
|
||||
release page. If the target is protoc, well-known type .proto files will also be
|
||||
included. Each invocation will create 7 zip packages:
|
||||
included. Each invocation will create 8 zip packages:
|
||||
dist/<TARGET>-<VERSION_NUMBER>-win32.zip
|
||||
dist/<TARGET>-<VERSION_NUMBER>-win64.zip
|
||||
dist/<TARGET>-<VERSION_NUMBER>-osx-x86_32.zip
|
||||
dist/<TARGET>-<VERSION_NUMBER>-osx-x86_64.zip
|
||||
dist/<TARGET>-<VERSION_NUMBER>-linux-x86_32.zip
|
||||
@ -31,6 +32,7 @@ VERSION_NUMBER=$2
|
||||
# <zip file name> <binary file name> pairs.
|
||||
declare -a FILE_NAMES=( \
|
||||
win32.zip windows-x86_32.exe \
|
||||
win64.zip windows-x86_64.exe \
|
||||
osx-x86_32.zip osx-x86_32.exe \
|
||||
osx-x86_64.zip osx-x86_64.exe \
|
||||
linux-x86_32.zip linux-x86_32.exe \
|
||||
|
@ -8,7 +8,7 @@
|
||||
</parent>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protoc</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.7.0</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Protobuf Compiler</name>
|
||||
<description>
|
||||
@ -80,6 +80,11 @@
|
||||
<classifier>linux-aarch_64</classifier>
|
||||
<type>exe</type>
|
||||
</artifact>
|
||||
<artifact>
|
||||
<file>${basedir}/target/linux/ppcle_64/protoc.exe</file>
|
||||
<classifier>linux-ppcle_64</classifier>
|
||||
<type>exe</type>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
# Copyright 2007 Google Inc. All Rights Reserved.
|
||||
|
||||
__version__ = '3.6.1'
|
||||
__version__ = '3.7.0'
|
||||
|
||||
if __name__ != '__main__':
|
||||
try:
|
||||
|
@ -84,13 +84,13 @@ python setup.py sdist upload -r https://test.pypi.org/legacy/
|
||||
|
||||
# Test locally with different python versions.
|
||||
run_install_test ${TESTING_VERSION} python2.7 https://test.pypi.org/simple
|
||||
run_install_test ${TESTING_VERSION} python3.4 https://test.pypi.org/simple
|
||||
run_install_test ${TESTING_VERSION} python3 https://test.pypi.org/simple
|
||||
|
||||
# Deploy egg/wheel packages to testing PyPI and test again.
|
||||
python setup.py bdist_egg bdist_wheel upload -r https://test.pypi.org/legacy/
|
||||
|
||||
run_install_test ${TESTING_VERSION} python2.7 https://test.pypi.org/simple
|
||||
run_install_test ${TESTING_VERSION} python3.4 https://test.pypi.org/simple
|
||||
run_install_test ${TESTING_VERSION} python3 https://test.pypi.org/simple
|
||||
|
||||
echo "All install tests have passed using testing PyPI."
|
||||
|
||||
|
@ -2,7 +2,13 @@
|
||||
|
||||
require 'mkmf'
|
||||
|
||||
$CFLAGS += " -std=c99 -O3 -DNDEBUG"
|
||||
if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
|
||||
# XOPEN_SOURCE needed for strptime:
|
||||
# https://stackoverflow.com/questions/35234152/strptime-giving-implicit-declaration-and-undefined-reference
|
||||
$CFLAGS += " -std=c99 -O3 -DNDEBUG -D_XOPEN_SOURCE=700"
|
||||
else
|
||||
$CFLAGS += " -std=c99 -O3 -DNDEBUG"
|
||||
end
|
||||
|
||||
|
||||
if RUBY_PLATFORM =~ /linux/
|
||||
|
@ -12610,11 +12610,6 @@ done:
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Need to define __USE_XOPEN before including time.h to make strptime work. */
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
||||
|
||||
@ -14127,12 +14122,19 @@ static bool end_timestamp_base(upb_json_parser *p, const char *ptr) {
|
||||
memcpy(timestamp_buf + UPB_TIMESTAMP_BASE_SIZE, "GMT", 3);
|
||||
timestamp_buf[UPB_TIMESTAMP_BASE_SIZE + 3] = 0;
|
||||
|
||||
#if defined __MINGW32__ || defined __MINGW64__
|
||||
upb_status_seterrf(
|
||||
&p->status, "error parsing timestamp: mingw doesn't support strptime");
|
||||
upb_env_reporterror(p->env, &p->status);
|
||||
return false;
|
||||
#else
|
||||
/* Parse seconds */
|
||||
if (strptime(timestamp_buf, "%FT%H:%M:%S%Z", &p->tm) == NULL) {
|
||||
upb_status_seterrf(&p->status, "error parsing timestamp: %s", buf);
|
||||
upb_env_reporterror(p->env, &p->status);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Clean up buffer */
|
||||
multipart_end(p);
|
||||
|
@ -1,6 +1,6 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "google-protobuf"
|
||||
s.version = "3.6.1"
|
||||
s.version = "3.7.0"
|
||||
s.licenses = ["BSD-3-Clause"]
|
||||
s.summary = "Protocol Buffers"
|
||||
s.description = "Protocol Buffers are Google's data interchange format."
|
||||
|
@ -18,7 +18,7 @@ else
|
||||
PTHREAD_DEF =
|
||||
endif
|
||||
|
||||
PROTOBUF_VERSION = 17:0:0
|
||||
PROTOBUF_VERSION = 18:0:0
|
||||
|
||||
if GCC
|
||||
# Turn on all warnings except for sign comparison (we ignore sign comparison
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -1010,7 +1010,7 @@ void GenerateAddFileToPool(const FileDescriptor* file, bool is_descriptor,
|
||||
|
||||
Outdent(printer);
|
||||
printer->Print(
|
||||
"));\n\n");
|
||||
"), true);\n\n");
|
||||
}
|
||||
printer->Print(
|
||||
"static::$is_initialized = true;\n");
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -259,13 +259,13 @@
|
||||
|
||||
// Shared google3/opensource definitions. //////////////////////////////////////
|
||||
|
||||
#define PROTOBUF_VERSION 3006001
|
||||
#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3006001
|
||||
#define PROTOBUF_VERSION 3007000
|
||||
#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3007000
|
||||
#define PROTOBUF_VERSION_SUFFIX ""
|
||||
|
||||
// The minimum library version which works with the current version of the
|
||||
// headers.
|
||||
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3006001
|
||||
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3007000
|
||||
|
||||
#if defined(GOOGLE_PROTOBUF_NO_RTTI) && GOOGLE_PROTOBUF_NO_RTTI
|
||||
#define PROTOBUF_RTTI 0
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -81,27 +81,27 @@ namespace internal {
|
||||
|
||||
// The current version, represented as a single integer to make comparison
|
||||
// easier: major * 10^6 + minor * 10^3 + micro
|
||||
#define GOOGLE_PROTOBUF_VERSION 3006001
|
||||
#define GOOGLE_PROTOBUF_VERSION 3007000
|
||||
|
||||
// A suffix string for alpha, beta or rc releases. Empty for stable releases.
|
||||
#define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
|
||||
|
||||
// The minimum library version which works with the current version of the
|
||||
// headers.
|
||||
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3006001
|
||||
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3007000
|
||||
|
||||
// The minimum header version which works with the current version of
|
||||
// the library. This constant should only be used by protoc's C++ code
|
||||
// generator.
|
||||
static const int kMinHeaderVersionForLibrary = 3006001;
|
||||
static const int kMinHeaderVersionForLibrary = 3007000;
|
||||
|
||||
// The minimum protoc version which works with the current version of the
|
||||
// headers.
|
||||
#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3006001
|
||||
#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3007000
|
||||
|
||||
// The minimum header version which works with the current version of
|
||||
// protoc. This constant should only be used in VerifyVersion().
|
||||
static const int kMinHeaderVersionForProtoc = 3006001;
|
||||
static const int kMinHeaderVersionForProtoc = 3007000;
|
||||
|
||||
// Verifies that the headers and libraries are compatible. Use the macro
|
||||
// below to call this.
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -8,12 +8,12 @@
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/port_def.inc>
|
||||
#if PROTOBUF_VERSION < 3006001
|
||||
#if PROTOBUF_VERSION < 3007000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3006001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3007000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
2
tests.sh
2
tests.sh
@ -482,7 +482,7 @@ build_php5.6_mac() {
|
||||
export PATH="$PHP_FOLDER/bin:$PATH"
|
||||
|
||||
# Install phpunit
|
||||
curl https://phar.phpunit.de/phpunit-5.6.10.phar -L -o phpunit.phar
|
||||
curl https://phar.phpunit.de/phpunit-5.6.8.phar -L -o phpunit.phar
|
||||
chmod +x phpunit.phar
|
||||
sudo mv phpunit.phar /usr/local/bin/phpunit
|
||||
|
||||
|
@ -222,16 +222,16 @@ def UpdatePhp():
|
||||
return elem
|
||||
|
||||
root = document.documentElement
|
||||
now = datetime.datetime.now()
|
||||
ReplaceText(Find(root, 'date'), now.strftime('%Y-%m-%d'))
|
||||
ReplaceText(Find(root, 'time'), now.strftime('%H:%M:%S'))
|
||||
version = Find(root, 'version')
|
||||
ReplaceText(Find(version, 'release'), GetFullVersion(rc_suffix = 'RC'))
|
||||
ReplaceText(Find(version, 'api'), NEW_VERSION)
|
||||
stability = Find(root, 'stability')
|
||||
ReplaceText(Find(version, 'release'),
|
||||
ReplaceText(Find(stability, 'release'),
|
||||
'stable' if RC_VERSION == 0 else 'beta')
|
||||
ReplaceText(Find(version, 'api'), 'stable' if RC_VERSION == 0 else 'beta')
|
||||
now = datetime.datetime.now()
|
||||
ReplaceText(Find(root, 'date'), now.strftime('%Y-%m-%d'))
|
||||
ReplaceText(Find(root, 'time'), now.strftime('%H:%M:%S'))
|
||||
ReplaceText(Find(stability, 'api'), 'stable' if RC_VERSION == 0 else 'beta')
|
||||
changelog = Find(root, 'changelog')
|
||||
for old_version in changelog.getElementsByTagName('version'):
|
||||
if Find(old_version, 'release').firstChild.nodeValue == NEW_VERSION:
|
||||
@ -256,6 +256,17 @@ def UpdatePhp():
|
||||
changelog.appendChild(release)
|
||||
changelog.appendChild(document.createTextNode('\n '))
|
||||
RewriteXml('php/ext/google/protobuf/package.xml', Callback)
|
||||
RewriteTextFile('php/ext/google/protobuf/protobuf.h',
|
||||
lambda line : re.sub(
|
||||
r'PHP_PROTOBUF_VERSION ".*"$',
|
||||
'PHP_PROTOBUF_VERSION "%s"' % NEW_VERSION,
|
||||
line))
|
||||
|
||||
RewriteTextFile('php/ext/google/protobuf/protobuf.h',
|
||||
lambda line : re.sub(
|
||||
r"^#define PHP_PROTOBUF_VERSION .*$",
|
||||
"#define PHP_PROTOBUF_VERSION \"%s\"" % GetFullVersion(rc_suffix = 'RC'),
|
||||
line))
|
||||
|
||||
RewriteTextFile('php/ext/google/protobuf/protobuf.h',
|
||||
lambda line : re.sub(
|
||||
|
Loading…
Reference in New Issue
Block a user