diff options
36 files changed, 201 insertions, 90 deletions
diff --git a/.travis.yml b/.travis.yml index 1417cb98..094235e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,10 @@ matrix: # tests on jenkins running in parallel. - os: linux env: CONFIG=cpp_distcheck + # The Java compatibility test currently only runs on Linux because it will + # fetch pre-built Linux protoc binaries in the test. + - os: linux + env: CONFIG=java_compatibility allow_failures: # These currently do not work on OS X but are being worked on by @haberman. - os: osx diff --git a/CHANGES.txt b/CHANGES.txt index 04fa418e..822136c0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,54 @@ +2016-07-27 version 3.0.0 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite) + General + * This log only contains changes since the beta-4 release. Summarized change + log since the last stable release (v2.6.1) can be found in the github + release page. + + Compatibility Notice + * v3.0.0 is the first API stable release of the v3.x series. We do not expect + any future API breaking changes. + * For C++, Java Lite and Objective-C, source level compatibility is + guaranteed. Upgrading from v3.0.0 to newer minor version releases will be + source compatible. For example, if your code compiles against protobuf + v3.0.0, it will continue to compile after you upgrade protobuf library to + v3.1.0. + * For other languages, both source level compatibility and binary level + compatibility are guaranteed. For example, if you have a Java binary built + against protobuf v3.0.0. After switching the protobuf runtime binary to + v3.1.0, your built binary should continue to work. + * Compatibility is only guaranteed for documented API and documented + behaviors. If you are using undocumented API (e.g., use anything in the C++ + internal namespace), it can be broken by minor version releases in an + undetermined manner. + + Ruby + * When you assign a string field `a.string_field = "X"`, we now call + #encode(UTF-8) on the string and freeze the copy. This saves you from + needing to ensure the string is already encoded as UTF-8. It also prevents + you from mutating the string after it has been assigned (this is how we + ensure it stays valid UTF-8). + * The generated file for `foo.proto` is now `foo_pb.rb` instead of just + `foo.rb`. This makes it easier to see which imports/requires are from + protobuf generated code, and also prevents conflicts with any `foo.rb` file + you might have written directly in Ruby. It is a backward-incompatible + change: you will need to update all of your `require` statements. + * For package names like `foo_bar`, we now translate this to the Ruby module + `FooBar`. This is more idiomatic Ruby than what we used to do (`Foo_bar`). + + JavaScript + * Scalar fields like numbers and boolean now return defaults instead of + `undefined` or `null` when they are unset. You can test for presence + explicitly by calling `hasFoo()`, which we now generate for scalar fields. + + Java Lite + * Java Lite is now implemented as a separate plugin, maintained in the + `javalite` branch. Both lite runtime and protoc artifacts will be available + in Maven. + + C# + * Target platforms now .NET 4.5, selected portable subsets and .NET Core. + * legacy_enum_values option is no longer supported. + 2016-07-15 version 3.0.0-beta-4 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript) General * Added a deterministic serialization API for C++. The deterministic diff --git a/Makefile.am b/Makefile.am index d4096b03..41d25823 100644 --- a/Makefile.am +++ b/Makefile.am @@ -656,6 +656,7 @@ python_EXTRA_DIST= \ python/google/protobuf/text_encoding.py \ python/google/protobuf/text_format.py \ python/mox.py \ + python/setup.cfg \ python/setup.py \ python/stubout.py \ python/tox.ini \ diff --git a/Protobuf.podspec b/Protobuf.podspec index ac27f03e..642fc3e2 100644 --- a/Protobuf.podspec +++ b/Protobuf.podspec @@ -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.0.0-beta-4' + s.version = '3.0.0' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.homepage = 'https://github.com/google/protobuf' s.license = 'New BSD' diff --git a/cmake/extract_includes.bat.in b/cmake/extract_includes.bat.in index c76973c9..9edafca8 100644 --- a/cmake/extract_includes.bat.in +++ b/cmake/extract_includes.bat.in @@ -69,7 +69,6 @@ copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata.h include\goo copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\reflection.h include\google\protobuf\reflection.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\reflection_ops.h include\google\protobuf\reflection_ops.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\repeated_field.h include\google\protobuf\repeated_field.h -copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\repeated_field_reflection.h include\google\protobuf\repeated_field_reflection.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\service.h include\google\protobuf\service.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\source_context.pb.h include\google\protobuf\source_context.pb.h copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\struct.pb.h include\google\protobuf\struct.pb.h diff --git a/configure.ac b/configure.ac index 7ae4a88b..41887997 100644 --- a/configure.ac +++ b/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.0.0-beta-4],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.0.0],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc index 59a61e51..598ef732 100644 --- a/conformance/conformance_test.cc +++ b/conformance/conformance_test.cc @@ -814,18 +814,26 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner, "Uint64FieldMaxValue", R"({"optionalUint64": "18446744073709551615"})", "optional_uint64: 18446744073709551615"); + // While not the largest Int64, this is the largest + // Int64 which can be exactly represented within an + // IEEE-754 64-bit float, which is the expected level + // of interoperability guarantee. Larger values may + // work in some implementations, but should not be + // relied upon. RunValidJsonTest( "Int64FieldMaxValueNotQuoted", - R"({"optionalInt64": 9223372036854775807})", - "optional_int64: 9223372036854775807"); + R"({"optionalInt64": 9223372036854774784})", + "optional_int64: 9223372036854774784"); RunValidJsonTest( "Int64FieldMinValueNotQuoted", R"({"optionalInt64": -9223372036854775808})", "optional_int64: -9223372036854775808"); + // Largest interoperable Uint64; see comment above + // for Int64FieldMaxValueNotQuoted. RunValidJsonTest( "Uint64FieldMaxValueNotQuoted", - R"({"optionalUint64": 18446744073709551615})", - "optional_uint64: 18446744073709551615"); + R"({"optionalUint64": 18446744073709549568})", + "optional_uint64: 18446744073709549568"); // Values can be represented as JSON strings. RunValidJsonTest( "Int32FieldStringValue", diff --git a/conformance/failure_list_csharp.txt b/conformance/failure_list_csharp.txt index e7de4b96..1716bcbd 100644 --- a/conformance/failure_list_csharp.txt +++ b/conformance/failure_list_csharp.txt @@ -4,8 +4,4 @@ JsonInput.FieldNameInSnakeCase.ProtobufOutput JsonInput.FieldNameWithMixedCases.JsonOutput JsonInput.FieldNameWithMixedCases.ProtobufOutput JsonInput.FieldNameWithMixedCases.Validator -JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput -JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput JsonInput.OriginalProtoFieldName.JsonOutput -JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput -JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index 659b2e77..24b4a776 100644 --- a/csharp/Google.Protobuf.Tools.nuspec +++ b/csharp/Google.Protobuf.Tools.nuspec @@ -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.0.0-beta4</version> + <version>3.0.0</version> <authors>Google Inc.</authors> <owners>protobuf-packages</owners> <licenseUrl>https://github.com/google/protobuf/blob/master/LICENSE</licenseUrl> diff --git a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs index 51b3ca2d..261ac6a7 100644 --- a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs @@ -230,6 +230,12 @@ namespace Google.Protobuf [TestCase("foo_bar", "fooBar")] [TestCase("bananaBanana", "bananaBanana")] [TestCase("BANANABanana", "bananaBanana")] + [TestCase("simple", "simple")] + [TestCase("ACTION_AND_ADVENTURE", "actionAndAdventure")] + [TestCase("action_and_adventure", "actionAndAdventure")] + [TestCase("kFoo", "kFoo")] + [TestCase("HTTPServer", "httpServer")] + [TestCase("CLIENT", "client")] public void ToCamelCase(string original, string expected) { Assert.AreEqual(expected, JsonFormatter.ToCamelCase(original)); diff --git a/csharp/src/Google.Protobuf/JsonFormatter.cs b/csharp/src/Google.Protobuf/JsonFormatter.cs index a894ffa1..d8a814d9 100644 --- a/csharp/src/Google.Protobuf/JsonFormatter.cs +++ b/csharp/src/Google.Protobuf/JsonFormatter.cs @@ -274,7 +274,6 @@ namespace Google.Protobuf } // Converted from src/google/protobuf/util/internal/utility.cc ToCamelCase - // TODO: Use the new field in FieldDescriptor. internal static string ToCamelCase(string input) { bool capitalizeNext = false; @@ -305,6 +304,7 @@ namespace Google.Protobuf (!wasCap || (i + 1 < input.Length && char.IsLower(input[i + 1])))) { firstWord = false; + result.Append(input[i]); } else { @@ -320,8 +320,16 @@ namespace Google.Protobuf result.Append(char.ToUpperInvariant(input[i])); continue; } + else + { + result.Append(input[i]); + continue; + } + } + else + { + result.Append(char.ToLowerInvariant(input[i])); } - result.Append(input[i]); } return result.ToString(); } diff --git a/csharp/src/Google.Protobuf/project.json b/csharp/src/Google.Protobuf/project.json index c8eae6d0..9b831f12 100644 --- a/csharp/src/Google.Protobuf/project.json +++ b/csharp/src/Google.Protobuf/project.json @@ -1,5 +1,5 @@ { - "version": "3.0.0-beta4", + "version": "3.0.0", "title": "Google Protocol Buffers", "description": "See project site for more info.", "authors": [ "Google Inc." ], diff --git a/java/compatibility_tests/v2.5.0/test.sh b/java/compatibility_tests/v2.5.0/test.sh index 08df12ef..5d5e9ed4 100755 --- a/java/compatibility_tests/v2.5.0/test.sh +++ b/java/compatibility_tests/v2.5.0/test.sh @@ -21,23 +21,23 @@ case "$1" in ;; 2.6.1) OLD_VERSION=2.6.1 - OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/2.6.1-build2/protoc-2.6.1-build2-linux-x86_32.exe + OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/2.6.1-build2/protoc-2.6.1-build2-linux-x86_64.exe ;; 3.0.0-beta-1) OLD_VERSION=3.0.0-beta-1 - OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-1/protoc-3.0.0-beta-1-linux-x86_32.exe + OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-1/protoc-3.0.0-beta-1-linux-x86_64.exe ;; 3.0.0-beta-2) OLD_VERSION=3.0.0-beta-2 - OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-2/protoc-3.0.0-beta-2-linux-x86_32.exe + OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-2/protoc-3.0.0-beta-2-linux-x86_64.exe ;; 3.0.0-beta-3) OLD_VERSION=3.0.0-beta-3 - OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-3/protoc-3.0.0-beta-3-linux-x86_32.exe + OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-3/protoc-3.0.0-beta-3-linux-x86_64.exe ;; 3.0.0-beta-4) OLD_VERSION=3.0.0-beta-4 - OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-4/protoc-3.0.0-beta-4-linux-x86_32.exe + OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-4/protoc-3.0.0-beta-4-linux-x86_64.exe ;; *) echo "[ERROR]: Unknown version number: $1" diff --git a/java/core/pom.xml b/java/core/pom.xml index 422bde82..39d67818 100644 --- a/java/core/pom.xml +++ b/java/core/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-parent</artifactId> - <version>3.0.0-beta-4</version> + <version>3.0.0</version> </parent> <artifactId>protobuf-java</artifactId> diff --git a/java/lite/pom.xml b/java/lite/pom.xml index 87a5c44d..9862cd94 100644 --- a/java/lite/pom.xml +++ b/java/lite/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-parent</artifactId> - <version>3.0.0-beta-4</version> + <version>3.0.0</version> </parent> <artifactId>protobuf-lite</artifactId> diff --git a/java/pom.xml b/java/pom.xml index 2d8e9a13..3a91a0ba 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -11,7 +11,7 @@ <groupId>com.google.protobuf</groupId> <artifactId>protobuf-parent</artifactId> - <version>3.0.0-beta-4</version> + <version>3.0.0</version> <packaging>pom</packaging> <name>Protocol Buffers [Parent]</name> diff --git a/java/util/pom.xml b/java/util/pom.xml index d8f64eb1..0d5e8e37 100644 --- a/java/util/pom.xml +++ b/java/util/pom.xml @@ -6,7 +6,7 @@ <parent> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-parent</artifactId> - <version>3.0.0-beta-4</version> + <version>3.0.0</version> </parent> <artifactId>protobuf-java-util</artifactId> diff --git a/js/README.md b/js/README.md index 15d48c87..f4184621 100644 --- a/js/README.md +++ b/js/README.md @@ -152,8 +152,7 @@ idea of how the library generally works: // Serializes to a UInt8Array. bytes = message.serializeBinary(); - var message2 = new MyMessage(); - message2.deserializeBinary(bytes); + var message2 = MyMessage.deserializeBinary(bytes); For more examples, see the tests. You can also look at the generated code to see what methods are defined for your generated messages. @@ -365,7 +365,7 @@ jspb.Map.prototype.serializeBinary = function( valueWriterFn.call(writer, 2, this.wrapEntry_(entry), opt_valueWriterCallback); } else { - valueWriterFn_.call(writer, 2, entry.value); + valueWriterFn.call(writer, 2, entry.value); } writer.endSubMessage(); } diff --git a/js/package.json b/js/package.json index 76ce0c1d..3f51d96b 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "google-protobuf", - "version": "3.0.0-alpha.7", + "version": "3.0.0", "description": "Protocol Buffers for JavaScript", "main": "google-protobuf.js", "files": [ diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 88e6ae50..e31948e9 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -1,17 +1,30 @@ #!/bin/bash -# Builds protoc executable into target/protoc.exe +# Builds protoc executable into target/protoc.exe; optionally build protoc +# plugins into target/protoc-gen-*.exe # To be run from Maven. -# Usage: build-protoc.sh <OS> <ARCH> +# Usage: build-protoc.sh <OS> <ARCH> <TARGET> # <OS> and <ARCH> are ${os.detected.name} and ${os.detected.arch} from os-maven-plugin +# <TARGET> can be "protoc" or "protoc-gen-javalite" OS=$1 ARCH=$2 +MAKE_TARGET=$3 -if [[ $# < 2 ]]; then +if [[ $# < 3 ]]; then echo "No arguments provided. This script is intended to be run from Maven." exit 1 fi +case $MAKE_TARGET in + protoc-gen-javalite) + ;; + protoc) + ;; + *) + echo "Target ""$TARGET"" invalid." + exit 1 +esac + # Under Cygwin, bash doesn't have these in PATH when called from Maven which # runs in Windows version of Java. export PATH="/bin:/usr/bin:$PATH" @@ -126,7 +139,7 @@ checkDependencies () } ############################################################################ -echo "Building protoc, OS=$OS ARCH=$ARCH" +echo "Building protoc, OS=$OS ARCH=$ARCH TARGET=$TARGET" # Nested double quotes are unintuitive, but it works. cd "$(dirname "$0")" @@ -134,7 +147,7 @@ cd "$(dirname "$0")" WORKING_DIR=$(pwd) CONFIGURE_ARGS="--disable-shared" -MAKE_TARGET="protoc" +TARGET_FILE=target/$MAKE_TARGET.exe if [[ "$OS" == windows ]]; then MAKE_TARGET="${MAKE_TARGET}.exe" fi @@ -209,12 +222,10 @@ fi export CXXFLAGS LDFLAGS -TARGET_FILE=target/protoc.exe - cd "$WORKING_DIR"/.. && ./configure $CONFIGURE_ARGS && cd src && make clean && make $MAKE_TARGET && cd "$WORKING_DIR" && mkdir -p target && - (cp ../src/protoc $TARGET_FILE || cp ../src/protoc.exe $TARGET_FILE) || + cp ../src/$MAKE_TARGET $TARGET_FILE || exit 1 if [[ "$OS" == osx ]]; then diff --git a/protoc-artifacts/build-zip.sh b/protoc-artifacts/build-zip.sh index 054e2ea1..3c5e887b 100755 --- a/protoc-artifacts/build-zip.sh +++ b/protoc-artifacts/build-zip.sh @@ -1,26 +1,30 @@ #!/bin/bash -if [ $# -eq 0 ]; then +if [ $# -ne 2 ]; then cat <<EOF -Usage: $0 <VERSION_NUMBER> +Usage: $0 <TARGET> <VERSION_NUMBER> + +TARGET: protoc | protoc-gen-javalite Example: - $ $0 3.0.0-beta-4 + $ $0 protoc 3.0.0 + $ $0 protoc-gen-javalite 3.0.0 -This script will download pre-built protoc binaries from maven repository -and package them with well-known type .proto files to create .zip packages -suitable to be included in the github release page. Each invocation will -create 5 zip packages: - dist/protoc-<VERSION_NUMBER>-win32.zip - dist/protoc-<VERSION_NUMBER>-osx-x86_32.zip - dist/protoc-<VERSION_NUMBER>-osx-x86_64.zip - dist/protoc-<VERSION_NUMBER>-linux-x86_32.zip - dist/protoc-<VERSION_NUMBER>-linux-x86_64.zip +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 5 zip packages: + dist/<TARGET>-<VERSION_NUMBER>-win32.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 + dist/<TARGET>-<VERSION_NUMBER>-linux-x86_64.zip EOF exit 1 fi -VERSION_NUMBER=$1 +TARGET=$1 +VERSION_NUMBER=$2 # <zip file name> <binary file name> pairs. declare -a FILE_NAMES=( \ @@ -78,17 +82,27 @@ mkdir -p ${DIR}/bin # Create a zip file for each binary. for((i=0;i<${#FILE_NAMES[@]};i+=2));do ZIP_NAME=${FILE_NAMES[$i]} + if [ ${ZIP_NAME:0:3} = "win" ]; then + BINARY="$TARGET.exe" + else + BINARY="$TARGET" + fi BINARY_NAME=${FILE_NAMES[$(($i+1))]} - BINARY_URL=http://repo1.maven.org/maven2/com/google/protobuf/protoc/${VERSION_NUMBER}/protoc-${VERSION_NUMBER}-${BINARY_NAME} - if ! wget ${BINARY_URL} -O ${DIR}/bin/protoc &> /dev/null; then + BINARY_URL=http://repo1.maven.org/maven2/com/google/protobuf/$TARGET/${VERSION_NUMBER}/$TARGET-${VERSION_NUMBER}-${BINARY_NAME} + if ! wget ${BINARY_URL} -O ${DIR}/bin/$BINARY &> /dev/null; then echo "[ERROR] Failed to download ${BINARY_URL}" >&2 - echo "[ERROR] Skipped protoc-${VERSION_NAME}-${ZIP_NAME}" >&2 + echo "[ERROR] Skipped $TARGET-${VERSION_NAME}-${ZIP_NAME}" >&2 continue fi - TARGET_ZIP_FILE=`pwd`/dist/protoc-${VERSION_NUMBER}-${ZIP_NAME} + TARGET_ZIP_FILE=`pwd`/dist/$TARGET-${VERSION_NUMBER}-${ZIP_NAME} pushd $DIR &> /dev/null - chmod +x bin/protoc - zip -r ${TARGET_ZIP_FILE} include bin readme.txt &> /dev/null + chmod +x bin/$BINARY + if [ "$TARGET" = "protoc" ]; then + zip -r ${TARGET_ZIP_FILE} include bin readme.txt &> /dev/null + else + zip -r ${TARGET_ZIP_FILE} bin &> /dev/null + fi + rm bin/$BINARY popd &> /dev/null echo "[INFO] Successfully created ${TARGET_ZIP_FILE}" done diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index 8fad896a..840bc60a 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -10,7 +10,7 @@ </parent> <groupId>com.google.protobuf</groupId> <artifactId>protoc</artifactId> - <version>3.0.0-beta-4</version> + <version>3.0.0</version> <packaging>pom</packaging> <name>Protobuf Compiler</name> <description> @@ -59,6 +59,7 @@ <argument>build-protoc.sh</argument> <argument>${os.detected.name}</argument> <argument>${os.detected.arch}</argument> + <argument>protoc</argument> </arguments> </configuration> </plugin> diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 7213496e..6210a404 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -30,7 +30,7 @@ # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.0.0b4' +__version__ = '3.0.0' if __name__ != '__main__': try: diff --git a/python/setup.cfg b/python/setup.cfg new file mode 100644 index 00000000..2a9acf13 --- /dev/null +++ b/python/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 8cf40e3f..286d8fe3 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "3.0.0.alpha.7.0.0" + s.version = "3.0.0" s.licenses = ["BSD"] s.summary = "Protocol Buffers" s.description = "Protocol Buffers are Google's data interchange format." diff --git a/ruby/pom.xml b/ruby/pom.xml index 62845815..99e8449b 100644 --- a/ruby/pom.xml +++ b/ruby/pom.xml @@ -86,7 +86,7 @@ <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> - <version>3.0.0-beta-3</version> + <version>3.0.0-beta-4</version> </dependency> </dependencies> </project> diff --git a/src/Makefile.am b/src/Makefile.am index 6e7dacfc..f70e9550 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,6 +33,10 @@ AM_LDFLAGS = $(PTHREAD_CFLAGS) # If I say "dist_include_DATA", automake complains that $(includedir) is not # a "legitimate" directory for DATA. Screw you, automake. protodir = $(includedir) + +# If you are adding new files here, also remember to change the build files for +# all other languages, //protoc-artifacts/build-zip.sh and run +# //update_file_list.sh for bazel. nobase_dist_proto_DATA = google/protobuf/descriptor.proto \ google/protobuf/any.proto \ google/protobuf/api.proto \ @@ -547,7 +551,7 @@ EXTRA_DIST = \ google/protobuf/package_info.h \ google/protobuf/io/package_info.h \ google/protobuf/compiler/ruby/ruby_generated_code.proto \ - google/protobuf/compiler/ruby/ruby_generated_code.rb \ + google/protobuf/compiler/ruby/ruby_generated_code_pb.rb \ google/protobuf/compiler/package_info.h \ google/protobuf/compiler/zip_output_unittest.sh \ README.md diff --git a/src/google/protobuf/compiler/csharp/csharp_enum.cc b/src/google/protobuf/compiler/csharp/csharp_enum.cc index 64381d0f..9e4da1ed 100644 --- a/src/google/protobuf/compiler/csharp/csharp_enum.cc +++ b/src/google/protobuf/compiler/csharp/csharp_enum.cc @@ -68,9 +68,7 @@ void EnumGenerator::Generate(io::Printer* printer) { for (int i = 0; i < descriptor_->value_count(); i++) { WriteEnumValueDocComment(printer, descriptor_->value(i)); string original_name = descriptor_->value(i)->name(); - string name = options()->legacy_enum_values - ? descriptor_->value(i)->name() - : GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name()); + string name = GetEnumValueName(descriptor_->name(), descriptor_->value(i)->name()); // Make sure we don't get any duplicate names due to prefix removal. while (!used_names.insert(name).second) { // It's possible we'll end up giving this warning multiple times, but that's better than not at all. diff --git a/src/google/protobuf/compiler/csharp/csharp_generator.cc b/src/google/protobuf/compiler/csharp/csharp_generator.cc index d74e8c88..c13ed65b 100644 --- a/src/google/protobuf/compiler/csharp/csharp_generator.cc +++ b/src/google/protobuf/compiler/csharp/csharp_generator.cc @@ -83,9 +83,6 @@ bool Generator::Generate( cli_options.base_namespace_specified = true; } else if (options[i].first == "internal_access") { cli_options.internal_access = true; - } else if (options[i].first == "legacy_enum_values") { - // TODO: Remove this before final release - cli_options.legacy_enum_values = true; } else { *error = "Unknown generator option: " + options[i].first; return false; diff --git a/src/google/protobuf/compiler/csharp/csharp_options.h b/src/google/protobuf/compiler/csharp/csharp_options.h index 4079bf7f..426fb3b5 100644 --- a/src/google/protobuf/compiler/csharp/csharp_options.h +++ b/src/google/protobuf/compiler/csharp/csharp_options.h @@ -45,8 +45,7 @@ struct Options { file_extension(".cs"), base_namespace(""), base_namespace_specified(false), - internal_access(false), - legacy_enum_values(false) { + internal_access(false) { } // Extension of the generated file. Defaults to ".cs" string file_extension; @@ -69,12 +68,6 @@ struct Options { // Whether the generated classes should have accessibility level of "internal". // Defaults to false that generates "public" classes. bool internal_access; - // By default, C# codegen now uses PascalCased enum values names, after - // removing the enum type name as a prefix (if it *is* a prefix of the value). - // Setting this option reverts to the previous behavior of just copying the - // value name specified in the .proto file, allowing gradual migration. - // This option will be removed before final release. - bool legacy_enum_values; }; } // namespace csharp diff --git a/src/google/protobuf/stubs/int128.cc b/src/google/protobuf/stubs/int128.cc index 3a36b4b1..a5090801 100644 --- a/src/google/protobuf/stubs/int128.cc +++ b/src/google/protobuf/stubs/int128.cc @@ -145,15 +145,15 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) { std::streamsize div_base_log; switch (flags & std::ios::basefield) { case std::ios::hex: - div = GOOGLE_ULONGLONG(0x1000000000000000); // 16^15 + div = static_cast<uint64>(GOOGLE_ULONGLONG(0x1000000000000000)); // 16^15 div_base_log = 15; break; case std::ios::oct: - div = GOOGLE_ULONGLONG(01000000000000000000000); // 8^21 + div = static_cast<uint64>(GOOGLE_ULONGLONG(01000000000000000000000)); // 8^21 div_base_log = 21; break; default: // std::ios::dec - div = GOOGLE_ULONGLONG(10000000000000000000); // 10^19 + div = static_cast<uint64>(GOOGLE_ULONGLONG(10000000000000000000)); // 10^19 div_base_log = 19; break; } diff --git a/src/google/protobuf/stubs/map_util.h b/src/google/protobuf/stubs/map_util.h index 4cccbbed..887f12a6 100644 --- a/src/google/protobuf/stubs/map_util.h +++ b/src/google/protobuf/stubs/map_util.h @@ -208,7 +208,7 @@ typename Collection::value_type::second_type::element_type& FindLinkedPtrOrDie(const Collection& collection, const typename Collection::value_type::first_type& key) { typename Collection::const_iterator it = collection.find(key); - CHECK(it != collection.end()) << "key not found: " << key; + GOOGLE_CHECK(it != collection.end()) << "key not found: " << key; // Since linked_ptr::operator*() is a const member returning a non const, // we do not need a version of this function taking a non const collection. return *it->second; @@ -337,14 +337,15 @@ bool InsertIfNotPresent( template <class Collection> void InsertOrDie(Collection* const collection, const typename Collection::value_type& value) { - CHECK(InsertIfNotPresent(collection, value)) << "duplicate value: " << value; + GOOGLE_CHECK(InsertIfNotPresent(collection, value)) + << "duplicate value: " << value; } // Same as above except doesn't log the value on error. template <class Collection> void InsertOrDieNoPrint(Collection* const collection, const typename Collection::value_type& value) { - CHECK(InsertIfNotPresent(collection, value)) << "duplicate value."; + GOOGLE_CHECK(InsertIfNotPresent(collection, value)) << "duplicate value."; } // Inserts the key-value pair into the collection. Dies if key was already diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index 328258b7..d7f93b4c 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -109,15 +109,15 @@ typedef unsigned __int16 uint16; typedef unsigned __int32 uint32; typedef unsigned __int64 uint64; #else -typedef signed char int8; -typedef short int16; -typedef int int32; -typedef long long int64; - -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; -typedef unsigned long long uint64; +typedef int8_t int8; +typedef int16_t int16; +typedef int32_t int32; +typedef int64_t int64; + +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +typedef uint64_t uint64; #endif // long long macros to be used because gcc and vc++ use different suffixes, @@ -131,8 +131,10 @@ typedef unsigned long long uint64; #define GOOGLE_ULONGLONG(x) x##UI64 #define GOOGLE_LL_FORMAT "I64" // As in printf("%I64d", ...) #else +// By long long, we actually mean int64. #define GOOGLE_LONGLONG(x) x##LL #define GOOGLE_ULONGLONG(x) x##ULL +// Used to format real long long integers. #define GOOGLE_LL_FORMAT "ll" // As in "%lld". Note that "q" is poor form also. #endif diff --git a/src/google/protobuf/util/time_util.cc b/src/google/protobuf/util/time_util.cc index c782d691..031d019a 100644 --- a/src/google/protobuf/util/time_util.cc +++ b/src/google/protobuf/util/time_util.cc @@ -142,6 +142,13 @@ int64 RoundTowardZero(int64 value, int64 divider) { } } // namespace +// Actually define these static const integers. Required by C++ standard (but +// omitting them may still work with some compilers). +const int64 TimeUtil::kTimestampMinSeconds; +const int64 TimeUtil::kTimestampMaxSeconds; +const int64 TimeUtil::kDurationMaxSeconds; +const int64 TimeUtil::kDurationMinSeconds; + string TimeUtil::ToString(const Timestamp& timestamp) { return FormatTime(timestamp.seconds(), timestamp.nanos()); } @@ -174,7 +181,7 @@ string TimeUtil::ToString(const Duration& duration) { seconds = -seconds; nanos = -nanos; } - result += StringPrintf("%" GOOGLE_LL_FORMAT "d", seconds); + result += SimpleItoa(seconds); if (nanos != 0) { result += "." + FormatNanos(nanos); } @@ -195,6 +195,14 @@ build_java_oracle7() { use_java oracle7 build_java oracle7 } +build_java_compatibility() { + use_java jdk7 + internal_build_cpp + # Use the unit-tests extraced from 2.5.0 to test the compatibilty between + # 3.0.0-beta-4 and the current version. + cd java/compatibility_tests/v2.5.0 + ./test.sh 3.0.0-beta-4 +} build_javanano_jdk7() { use_java jdk7 @@ -340,6 +348,7 @@ Usage: $0 { cpp | csharp | java_jdk7 | java_oracle7 | + java_compatibility | javanano_jdk7 | javanano_oracle7 | objectivec_ios | |