Revert "Merge changes from topic "protobuf3.5.2""

This reverts commit 584979bf55601bd23e533d704a75cd0e95af66b9, reversing
changes made to 219bbcdcd5b1dbf19758ff2e75d971b98215896d:
      Remove libprotobuf-java-lite
      Update stubs
      Revert "Wrap liblog dependency in GOOGLE_PROTOBUF_MIN_LOG_LEVEL"
      Update javamicro to compile against v3.5.2
      Update Android.bp to match BUILD
      Rerun configure
      Merge tag 'v3.5.2' into master
      Revert "Remove 2 usage of isspace as they are not stl port compatible"
      Revert "Use GOOGLE_CHECK Macro for validation"
      Revert "Emit macros with proper parentheses."
      Revert "Generate syntactically correct java for imports from classes with no packages."
      Revert "Fix some unused parameter warnings"
      Revert "protobuf: work around a static analyzer bug"
      Revert "Suppress clang-analyzer-core.uninitialized.UndefReturn warning."

Change-Id: Ia04c0b15ebd45e8c7e02edaa6e1f10aeb11ef337
(cherry picked from commit 11fb7aeddd6ff7229bcf0834017f8091f97d7edb)
diff --git a/.gitignore b/.gitignore
index af88e22..27eeb9c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,7 +47,6 @@
 map*unittest.pb.*
 unittest*.pb.*
 cpp_test*.pb.*
-src/google/protobuf/compiler/js/well_known_types_embed.cc
 src/google/protobuf/util/**/*.pb.cc
 src/google/protobuf/util/**/*.pb.h
 
@@ -61,16 +60,10 @@
 python/google/protobuf/compiler/
 python/google/protobuf/util/
 
-src/js_embed
 src/protoc
 src/unittest_proto_middleman
 
-# vim generated
-*.swp
-
 # Generated test scaffolding
-src/no_warning_test.cc
-src/no-warning-test
 src/protobuf*-test
 src/test_plugin
 src/testzip.*
@@ -84,11 +77,8 @@
 src/**/*.trs
 
 # JavaBuild output.
-java/core/target
-java/util/target
+java/target
 javanano/target
-java/.idea
-java/**/*.iml
 
 # Windows native output.
 cmake/build
@@ -98,14 +88,16 @@
 # packages themselves.
 /csharp/src/packages/*/
 
+# Directories created by opening the Objective C Xcode projects.
+objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcuserdata/
+objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/ProtocolBuffers_OSX.xccheckout
+objectivec/ProtocolBuffers_OSX.xcodeproj/xcuserdata/
+objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcuserdata/
+objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/ProtocolBuffers_iOS.xccheckout
+objectivec/ProtocolBuffers_iOS.xcodeproj/xcuserdata/
 # OS X's Finder creates these for state about opened windows/etc.
 **/.DS_Store
 
-# Cocoapods artifacts
-# Podfile.lock and the workspace file are tracked, to ease deleting them. That's
-# needed to trigger "pod install" to rerun the preinstall commands.
-Pods/
-
 # Comformance test output
 conformance/.libs/
 conformance/com/
@@ -118,65 +110,8 @@
 conformance/conformance.pb.h
 conformance/Conformance.pbobjc.h
 conformance/Conformance.pbobjc.m
-conformance/conformance_pb.js
-conformance/conformance_pb.rb
-conformance/failing_tests.txt
+conformance/conformance.rb
 conformance/google/
-conformance/google-protobuf/
 conformance/javac_middleman
 conformance/lite/
-conformance/nonexistent_tests.txt
 conformance/protoc_middleman
-conformance/succeeding_tests.txt
-conformance/Conformance/
-conformance/GPBMetadata/
-conformance/Google/
-conformance/Protobuf_test_messages/
-conformance/conformance-php
-conformance/conformance-php-c
-conformance/*.class
-
-# php test output
-composer.lock
-php/tests/generated/
-php/tests/old_protoc
-php/tests/protobuf/
-php/ext/google/protobuf/.libs/
-php/ext/google/protobuf/Makefile.fragments
-php/ext/google/protobuf/Makefile.global
-php/ext/google/protobuf/Makefile.objects
-php/ext/google/protobuf/acinclude.m4
-php/ext/google/protobuf/build/
-php/ext/google/protobuf/config.h
-php/ext/google/protobuf/config.nice
-php/ext/google/protobuf/configure.in
-php/ext/google/protobuf/mkinstalldirs
-php/ext/google/protobuf/run-tests.php
-vendor/
-
-# JavaScript artifacts
-js/commonjs_out/
-js/compatibility_tests/v3.0.0/commonjs_out*
-js/compatibility_tests/v3.0.0/protoc
-js/compatibility_tests/v3.0.0/testproto_libs1.js
-js/compatibility_tests/v3.0.0/testproto_libs1_new.js
-js/compatibility_tests/v3.0.0/testproto_libs2.js
-js/compatibility_tests/v3.0.0/testproto_libs2_new.js
-js/deps.js
-js/google-protobuf.js
-js/google/
-js/node_modules/
-js/testproto_libs1.js
-js/testproto_libs2.js
-
-# Ignore the bazel symlinks
-/bazel-*
-
-# ruby test output
-ruby/lib/
-ruby/tests/generated_code_pb.rb
-ruby/tests/test_import_pb.rb
-ruby/Gemfile.lock
-ruby/compatibility_tests/v3.0.0/protoc
-ruby/compatibility_tests/v3.0.0/tests/generated_code_pb.rb
-ruby/compatibility_tests/v3.0.0/tests/test_import_pb.rb
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 55a47ce..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "third_party/benchmark"]
-	path = third_party/benchmark
-	url = https://github.com/google/benchmark.git
diff --git a/.travis.yml b/.travis.yml
index e7853eb..bcf3851 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,76 +1,66 @@
 sudo: required
-dist: trusty
 # Note: travis currently does not support listing more than one language so
 # this cheats and claims to only be cpp.  If they add multiple language
 # support, this should probably get updated to install steps and/or
 # rvm/gemfile/jdk/etc. entries rather than manually doing the work.
 language: cpp
 os:
+  - linux
   - osx
 # The Objective C build needs Xcode 7.0 or later.
-osx_image: xcode8.3
+osx_image: xcode7.2
 script:
   - ./tests.sh $CONFIG
 env:
   - CONFIG=cpp
   - CONFIG=cpp_distcheck
+  - CONFIG=csharp
   - CONFIG=golang
+  - CONFIG=java_jdk6
   - CONFIG=java_jdk7
   - CONFIG=java_oracle7
+  - CONFIG=javanano_jdk6
   - CONFIG=javanano_jdk7
   - CONFIG=javanano_oracle7
   - CONFIG=javascript
-  # iOS build log was starting to choke travis UI, so split to cover the
-  # Xcode Debug and Release Configurations independently.
-  - CONFIG=objectivec_ios_debug
-  - CONFIG=objectivec_ios_release
-  - CONFIG=objectivec_osx
-  - CONFIG=objectivec_cocoapods_integration
   - CONFIG=python
   - CONFIG=python_cpp
+  - CONFIG=ruby19
+  - CONFIG=ruby20
   - CONFIG=ruby21
   - CONFIG=ruby22
   - CONFIG=jruby
-  - CONFIG=php5.6_mac
-  - CONFIG=php7.0_mac
 matrix:
   exclude:
     # It's nontrivial to programmatically install a new JDK from the command
     # line on OS X, so we rely on testing on Linux for Java code.
     - os: osx
+      env: CONFIG=java_jdk6
+    - os: osx
       env: CONFIG=java_jdk7
     - os: osx
       env: CONFIG=java_oracle7
     - os: osx
+      env: CONFIG=javanano_jdk6
+    - os: osx
       env: CONFIG=javanano_jdk7
     - os: osx
       env: CONFIG=javanano_oracle7
+    # Requires installing mono, currently travis.sh is doing that with apt-get
+    # which doesn't work on OS X.
+    - os: osx
+      env: CONFIG=csharp
     # Requires installing golang, currently travis.sh is doing that with apt-get
     # which doesn't work on OS X.
     - os: osx
       env: CONFIG=golang
+  # Add into the matrix OS X tests of Objective C (needs Xcode, so it won't
+  # work on other platforms). These are split so it doesn't take as long to run.
   include:
-    # The dotnet environment requires Ubuntu 14.04 or 16.04. This
-    # configuration is effectively an "extra" one, outside the
-    # autogenerated matrix.
-    - os: linux
-      env: CONFIG=csharp
-      language: csharp
-      dist: trusty
-      dotnet: 1.0.1
-      mono: none
-    # This test is kept on travis because it doesn't play nicely with other
-    # 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
-    # The Python compatibility test currently only runs on Linux because it will
-    # fetch pre-built Linux protoc binaries in the test.
-    - os: linux
-      env: CONFIG=python_compatibility
+    - os: osx
+      env: CONFIG=objectivec_ios
+    - os: osx
+      env: CONFIG=objectivec_osx
   allow_failures:
     # These currently do not work on OS X but are being worked on by @haberman.
     - os: osx
@@ -81,11 +71,14 @@
     # we moved to an OS X image that is 10.11.
     - os: osx
       env: CONFIG=python_cpp
-    # Mark the iOS test as flakey as xcodebuild some times fails to start the
-    # iOS Simulator.
+    # xctool 0.2.8 seems to have a bug where it randomly kills tests saying
+    # they failed.
+    #   https://github.com/facebook/xctool/issues/619
+    #   https://github.com/google/protobuf/issues/1232
+    # travis updated their images to include 0.2.8:
+    #   https://blog.travis-ci.com/2016-03-23-xcode-image-updates
+    # Mark the iOS test as flakey so these failures don't turn things red.
     - os: osx
-      env: CONFIG=objectivec_ios_debug
-    - os: osx
-      env: CONFIG=objectivec_ios_release
+      env: CONFIG=objectivec_ios
 notifications:
   email: false
diff --git a/Android.bp b/Android.bp
index 578a2ab..c63d138 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,20 +14,37 @@
 //
 //
 
+IGNORED_WARNINGS = [
+    "-Wno-sign-compare",
+    "-Wno-unused-parameter",
+    "-Wno-sign-promo",
+    "-Wno-error=return-type",
+]
+
 cc_defaults {
     name: "protobuf-cflags-defaults",
+    clang_cflags: [
+        "-Wno-error=unused-const-variable",
+        "-Wno-error=user-defined-warnings",
+    ],
     cflags: [
         "-Wall",
-        "-Werror",
+        "-Wno-error=format",
+        "-Wno-error=format-extra-args",
+        "-Wno-error=ignored-qualifiers",
+        "-Wno-error=sign-promo",
         "-Wno-unused-function",
-        "-Wno-sign-compare",
-        "-Wno-unused-parameter",
-        "-Wno-sign-promo",
     ],
-
     target: {
         windows: {
-            cflags: ["-Wno-macro-redefined"],
+            cflags: ["-Wno-error"],
+        },
+        // cannot suppress gcc warning on redefined macros
+        not_windows: {
+            cflags: ["-Werror"],
+        },
+        android: {
+            cflags: ["-Werror"],
         },
     },
 }
@@ -36,22 +53,11 @@
     name: "libprotobuf-cpp-lite-defaults",
     defaults: ["protobuf-cflags-defaults"],
     srcs: [
-        "src/google/protobuf/arena.cc",
-        "src/google/protobuf/arenastring.cc",
-        "src/google/protobuf/extension_set.cc",
-        "src/google/protobuf/generated_message_table_driven_lite.cc",
-        "src/google/protobuf/generated_message_util.cc",
-        "src/google/protobuf/io/coded_stream.cc",
-        "src/google/protobuf/io/zero_copy_stream.cc",
-        "src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
-        "src/google/protobuf/message_lite.cc",
-        "src/google/protobuf/repeated_field.cc",
         "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
         "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
         "src/google/protobuf/stubs/bytestream.cc",
         "src/google/protobuf/stubs/common.cc",
         "src/google/protobuf/stubs/int128.cc",
-        "src/google/protobuf/stubs/io_win32.cc",
         "src/google/protobuf/stubs/once.cc",
         "src/google/protobuf/stubs/status.cc",
         "src/google/protobuf/stubs/statusor.cc",
@@ -60,7 +66,16 @@
         "src/google/protobuf/stubs/structurally_valid.cc",
         "src/google/protobuf/stubs/strutil.cc",
         "src/google/protobuf/stubs/time.cc",
+        "src/google/protobuf/arena.cc",
+        "src/google/protobuf/arenastring.cc",
+        "src/google/protobuf/extension_set.cc",
+        "src/google/protobuf/generated_message_util.cc",
+        "src/google/protobuf/message_lite.cc",
+        "src/google/protobuf/repeated_field.cc",
         "src/google/protobuf/wire_format_lite.cc",
+        "src/google/protobuf/io/coded_stream.cc",
+        "src/google/protobuf/io/zero_copy_stream.cc",
+        "src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
     ],
 
     local_include_dirs: [
@@ -69,30 +84,7 @@
     ],
     export_include_dirs: ["src"],
 
-    target: {
-        android: {
-            shared_libs: ["liblog"],
-        },
-    },
-}
-
-cc_binary_host {
-    name: "js_embed",
-    defaults: ["protobuf-cflags-defaults"],
-    srcs: ["src/google/protobuf/compiler/js/embed.cc"],
-    cflags: ["-Wno-unused-const-variable"],
-}
-
-genrule {
-    name: "generate_js_well_known_types_embed",
-    srcs: [
-        "src/google/protobuf/compiler/js/well_known_types/any.js",
-        "src/google/protobuf/compiler/js/well_known_types/struct.js",
-        "src/google/protobuf/compiler/js/well_known_types/timestamp.js",
-    ],
-    out: ["src/google/protobuf/compiler/js/well_known_types_embed.cc"],
-    cmd: "$(location :js_embed) $(in) > $(out)",
-    tools: [":js_embed"],
+    cflags: IGNORED_WARNINGS,
 }
 
 // C++ lite library for the NDK.
@@ -156,39 +148,39 @@
     defaults: ["libprotobuf-cpp-lite-defaults"],
 
     srcs: [
-        "src/google/protobuf/any.cc",
         "src/google/protobuf/any.pb.cc",
         "src/google/protobuf/api.pb.cc",
-        "src/google/protobuf/compiler/importer.cc",
-        "src/google/protobuf/compiler/parser.cc",
+        "src/google/protobuf/stubs/mathlimits.cc",
+        "src/google/protobuf/any.cc",
         "src/google/protobuf/descriptor.cc",
-        "src/google/protobuf/descriptor.pb.cc",
         "src/google/protobuf/descriptor_database.cc",
+        "src/google/protobuf/descriptor.pb.cc",
         "src/google/protobuf/duration.pb.cc",
         "src/google/protobuf/dynamic_message.cc",
         "src/google/protobuf/empty.pb.cc",
         "src/google/protobuf/extension_set_heavy.cc",
         "src/google/protobuf/field_mask.pb.cc",
         "src/google/protobuf/generated_message_reflection.cc",
-        "src/google/protobuf/generated_message_table_driven.cc",
-        "src/google/protobuf/io/gzip_stream.cc",
-        "src/google/protobuf/io/printer.cc",
-        "src/google/protobuf/io/strtod.cc",
-        "src/google/protobuf/io/tokenizer.cc",
-        "src/google/protobuf/io/zero_copy_stream_impl.cc",
         "src/google/protobuf/map_field.cc",
         "src/google/protobuf/message.cc",
         "src/google/protobuf/reflection_ops.cc",
         "src/google/protobuf/service.cc",
         "src/google/protobuf/source_context.pb.cc",
         "src/google/protobuf/struct.pb.cc",
-        "src/google/protobuf/stubs/mathlimits.cc",
         "src/google/protobuf/stubs/substitute.cc",
         "src/google/protobuf/text_format.cc",
         "src/google/protobuf/timestamp.pb.cc",
         "src/google/protobuf/type.pb.cc",
         "src/google/protobuf/unknown_field_set.cc",
-        "src/google/protobuf/util/delimited_message_util.cc",
+        "src/google/protobuf/wire_format.cc",
+        "src/google/protobuf/wrappers.pb.cc",
+        "src/google/protobuf/io/gzip_stream.cc",
+        "src/google/protobuf/io/printer.cc",
+        "src/google/protobuf/io/strtod.cc",
+        "src/google/protobuf/io/tokenizer.cc",
+        "src/google/protobuf/io/zero_copy_stream_impl.cc",
+        "src/google/protobuf/compiler/importer.cc",
+        "src/google/protobuf/compiler/parser.cc",
         "src/google/protobuf/util/field_comparator.cc",
         "src/google/protobuf/util/field_mask_util.cc",
         "src/google/protobuf/util/internal/datapiece.cc",
@@ -199,9 +191,9 @@
         "src/google/protobuf/util/internal/json_objectwriter.cc",
         "src/google/protobuf/util/internal/json_stream_parser.cc",
         "src/google/protobuf/util/internal/object_writer.cc",
-        "src/google/protobuf/util/internal/proto_writer.cc",
         "src/google/protobuf/util/internal/protostream_objectsource.cc",
         "src/google/protobuf/util/internal/protostream_objectwriter.cc",
+        "src/google/protobuf/util/internal/proto_writer.cc",
         "src/google/protobuf/util/internal/type_info.cc",
         "src/google/protobuf/util/internal/type_info_test_helper.cc",
         "src/google/protobuf/util/internal/utility.cc",
@@ -209,8 +201,6 @@
         "src/google/protobuf/util/message_differencer.cc",
         "src/google/protobuf/util/time_util.cc",
         "src/google/protobuf/util/type_resolver_util.cc",
-        "src/google/protobuf/wire_format.cc",
-        "src/google/protobuf/wrappers.pb.cc",
     ],
 
     cflags: ["-DHAVE_ZLIB=1"],
@@ -242,6 +232,11 @@
     },
 
     cflags: ["-DGOOGLE_PROTOBUF_NO_RTTI"],
+    target: {
+        android: {
+            shared_libs: ["liblog"],
+        },
+    },
 }
 
 // C++ full library + rtti for the platform and host
@@ -261,11 +256,8 @@
 
 // Compiler library for the host
 // =======================================================
-cc_library {
+cc_library_host_shared {
     name: "libprotoc",
-    host_supported: true,
-    device_supported: false,
-
     defaults: ["libprotobuf-cpp-full-defaults"],
 
     srcs: [
@@ -282,14 +274,6 @@
         "config",
     ],
 
-    target: {
-        windows: {
-            enabled: true,
-            // defined by the global cflags, but redefined by protobuf
-            cflags: ["-UWIN32_LEAN_AND_MEAN"],
-        },
-    },
-
     rtti: true,
 }
 
@@ -304,8 +288,6 @@
     target: {
         windows: {
             enabled: true,
-            // defined by the global cflags, but redefined by protobuf
-            cflags: ["-UWIN32_LEAN_AND_MEAN"],
         },
     },
 
@@ -314,8 +296,27 @@
     stl: "libc++_static",
 
     srcs: [
-        "src/google/protobuf/compiler/main.cc",
-        ":generate_js_well_known_types_embed",
+        "src/google/protobuf/any.cc",
+        "src/google/protobuf/arena.cc",
+        "src/google/protobuf/arenastring.cc",
+        "src/google/protobuf/descriptor.cc",
+        "src/google/protobuf/descriptor.pb.cc",
+        "src/google/protobuf/descriptor_database.cc",
+        "src/google/protobuf/dynamic_message.cc",
+        "src/google/protobuf/extension_set.cc",
+        "src/google/protobuf/extension_set_heavy.cc",
+        "src/google/protobuf/generated_message_reflection.cc",
+        "src/google/protobuf/generated_message_util.cc",
+        "src/google/protobuf/map_field.cc",
+        "src/google/protobuf/message.cc",
+        "src/google/protobuf/message_lite.cc",
+        "src/google/protobuf/reflection_ops.cc",
+        "src/google/protobuf/repeated_field.cc",
+        "src/google/protobuf/service.cc",
+        "src/google/protobuf/text_format.cc",
+        "src/google/protobuf/unknown_field_set.cc",
+        "src/google/protobuf/wire_format.cc",
+        "src/google/protobuf/wire_format_lite.cc",
         "src/google/protobuf/compiler/code_generator.cc",
         "src/google/protobuf/compiler/command_line_interface.cc",
         "src/google/protobuf/compiler/cpp/cpp_enum.cc",
@@ -328,7 +329,6 @@
         "src/google/protobuf/compiler/cpp/cpp_map_field.cc",
         "src/google/protobuf/compiler/cpp/cpp_message.cc",
         "src/google/protobuf/compiler/cpp/cpp_message_field.cc",
-        "src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
         "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
         "src/google/protobuf/compiler/cpp/cpp_service.cc",
         "src/google/protobuf/compiler/cpp/cpp_string_field.cc",
@@ -348,6 +348,7 @@
         "src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc",
         "src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc",
         "src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc",
+        "src/google/protobuf/compiler/importer.cc",
         "src/google/protobuf/compiler/java/java_context.cc",
         "src/google/protobuf/compiler/java/java_doc_comment.cc",
         "src/google/protobuf/compiler/java/java_enum.cc",
@@ -365,9 +366,9 @@
         "src/google/protobuf/compiler/java/java_lazy_message_field_lite.cc",
         "src/google/protobuf/compiler/java/java_map_field.cc",
         "src/google/protobuf/compiler/java/java_map_field_lite.cc",
-        "src/google/protobuf/compiler/java/java_message.cc",
         "src/google/protobuf/compiler/java/java_message_builder.cc",
         "src/google/protobuf/compiler/java/java_message_builder_lite.cc",
+        "src/google/protobuf/compiler/java/java_message.cc",
         "src/google/protobuf/compiler/java/java_message_field.cc",
         "src/google/protobuf/compiler/java/java_message_field_lite.cc",
         "src/google/protobuf/compiler/java/java_message_lite.cc",
@@ -399,6 +400,7 @@
         "src/google/protobuf/compiler/javanano/javanano_message_field.cc",
         "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
         "src/google/protobuf/compiler/js/js_generator.cc",
+        "src/google/protobuf/compiler/main.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
@@ -411,13 +413,32 @@
         "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
-        "src/google/protobuf/compiler/php/php_generator.cc",
+        "src/google/protobuf/compiler/parser.cc",
         "src/google/protobuf/compiler/plugin.cc",
         "src/google/protobuf/compiler/plugin.pb.cc",
         "src/google/protobuf/compiler/python/python_generator.cc",
         "src/google/protobuf/compiler/ruby/ruby_generator.cc",
         "src/google/protobuf/compiler/subprocess.cc",
         "src/google/protobuf/compiler/zip_writer.cc",
+        "src/google/protobuf/io/coded_stream.cc",
+        "src/google/protobuf/io/gzip_stream.cc",
+        "src/google/protobuf/io/printer.cc",
+        "src/google/protobuf/io/strtod.cc",
+        "src/google/protobuf/io/tokenizer.cc",
+        "src/google/protobuf/io/zero_copy_stream.cc",
+        "src/google/protobuf/io/zero_copy_stream_impl.cc",
+        "src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
+        "src/google/protobuf/stubs/atomicops_internals_x86_gcc.cc",
+        "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
+        "src/google/protobuf/stubs/common.cc",
+        "src/google/protobuf/stubs/int128.cc",
+        "src/google/protobuf/stubs/once.cc",
+        "src/google/protobuf/stubs/status.cc",
+        "src/google/protobuf/stubs/stringpiece.cc",
+        "src/google/protobuf/stubs/structurally_valid.cc",
+        "src/google/protobuf/stubs/strutil.cc",
+        "src/google/protobuf/stubs/substitute.cc",
+        "src/google/protobuf/stubs/stringprintf.cc",
     ],
 
     local_include_dirs: [
@@ -425,16 +446,12 @@
         "src",
     ],
 
-    static_libs: [
-        "libprotoc",
-        "libz",
-    ],
+    static_libs: ["libz"],
 
-    cflags: [
+    cflags: IGNORED_WARNINGS + [
         "-DHAVE_ZLIB=1",
     ],
 
-    rtti: true,
 }
 
 java_defaults {
@@ -494,6 +511,71 @@
     static_libs: ["libprotobuf-java-micro"],
 }
 
+// Java lite library
+// =======================================================
+java_library_static {
+    name: "libprotobuf-java-lite",
+    host_supported: true,
+    sdk_version: "core_current",
+
+    srcs: [
+        "java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java",
+        "java/core/src/main/java/com/google/protobuf/AbstractParser.java",
+        "java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java",
+        "java/core/src/main/java/com/google/protobuf/ByteOutput.java",
+        "java/core/src/main/java/com/google/protobuf/ByteString.java",
+        "java/core/src/main/java/com/google/protobuf/BooleanArrayList.java",
+        "java/core/src/main/java/com/google/protobuf/CodedInputStream.java",
+        "java/core/src/main/java/com/google/protobuf/CodedOutputStream.java",
+        "java/core/src/main/java/com/google/protobuf/DoubleArrayList.java",
+        "java/core/src/main/java/com/google/protobuf/ExperimentalApi.java",
+        "java/core/src/main/java/com/google/protobuf/ExtensionLite.java",
+        "java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java",
+        "java/core/src/main/java/com/google/protobuf/FieldSet.java",
+        "java/core/src/main/java/com/google/protobuf/FloatArrayList.java",
+        "java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java",
+        "java/core/src/main/java/com/google/protobuf/IntArrayList.java",
+        "java/core/src/main/java/com/google/protobuf/Internal.java",
+        "java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java",
+        "java/core/src/main/java/com/google/protobuf/LazyField.java",
+        "java/core/src/main/java/com/google/protobuf/LazyFieldLite.java",
+        "java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java",
+        "java/core/src/main/java/com/google/protobuf/LazyStringList.java",
+        "java/core/src/main/java/com/google/protobuf/LongArrayList.java",
+        "java/core/src/main/java/com/google/protobuf/MapFieldLite.java",
+        "java/core/src/main/java/com/google/protobuf/MessageLite.java",
+        "java/core/src/main/java/com/google/protobuf/MessageLiteToString.java",
+        "java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java",
+        "java/core/src/main/java/com/google/protobuf/MutabilityOracle.java",
+        "java/core/src/main/java/com/google/protobuf/Parser.java",
+        "java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java",
+        "java/core/src/main/java/com/google/protobuf/ProtocolStringList.java",
+        "java/core/src/main/java/com/google/protobuf/RopeByteString.java",
+        "java/core/src/main/java/com/google/protobuf/SmallSortedMap.java",
+        "java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java",
+        "java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java",
+        "java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java",
+        "java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java",
+        "java/core/src/main/java/com/google/protobuf/Utf8.java",
+        "java/core/src/main/java/com/google/protobuf/WireFormat.java",
+    ],
+
+    target: {
+        android: {
+            libs: ["libcore_private.stubs"],
+        },
+    },
+
+    java_version: "1.7",
+}
+
+// Java lite library (compatibility for old host-side users)
+// =======================================================
+java_library_host {
+    name: "host-libprotobuf-java-lite",
+    static_libs: ["libprotobuf-java-lite"],
+}
+
 // Java full library (for host-side users)
 // =======================================================
 java_library_host {
diff --git a/BUILD b/BUILD
index bcaf9cd..8b1046b 100644
--- a/BUILD
+++ b/BUILD
@@ -2,41 +2,19 @@
 
 licenses(["notice"])
 
-exports_files(["LICENSE"])
-
 ################################################################################
 # Protobuf Runtime Library
 ################################################################################
 
-WIN_COPTS = [
-    "/DHAVE_PTHREAD",
-    "/wd4018", # -Wno-sign-compare
-    "/wd4514", # -Wno-unused-function
+COPTS = [
+    "-DHAVE_PTHREAD",
+    "-Wall",
+    "-Wwrite-strings",
+    "-Woverloaded-virtual",
+    "-Wno-sign-compare",
+    "-Wno-error=unused-function",
 ]
 
-COPTS = select({
-    ":windows" : WIN_COPTS,
-    ":windows_msvc" : WIN_COPTS,
-    "//conditions:default": [
-        "-DHAVE_PTHREAD",
-        "-Wall",
-        "-Wwrite-strings",
-        "-Woverloaded-virtual",
-        "-Wno-sign-compare",
-        "-Wno-unused-function",
-    ],
-})
-
-config_setting(
-    name = "windows",
-    values = { "cpu": "x64_windows" },
-)
-
-config_setting(
-    name = "windows_msvc",
-    values = { "cpu": "x64_windows_msvc" },
-)
-
 config_setting(
     name = "android",
     values = {
@@ -44,23 +22,51 @@
     },
 )
 
-# Android and Windows builds do not need to link in a separate pthread library.
+# Android builds do not need to link in a separate pthread library.
 LINK_OPTS = select({
     ":android": [],
-    ":windows": [],
-    ":windows_msvc": [],
-    "//conditions:default": ["-lpthread", "-lm"],
+    "//conditions:default": ["-lpthread"],
 })
 
 load(
-    ":protobuf.bzl",
+    "protobuf",
     "cc_proto_library",
     "py_proto_library",
-    "internal_copied_filegroup",
     "internal_gen_well_known_protos_java",
     "internal_protobuf_py_tests",
 )
 
+config_setting(
+    name = "ios_armv7",
+    values = {
+        "ios_cpu": "armv7",
+    },
+)
+
+config_setting(
+    name = "ios_armv7s",
+    values = {
+        "ios_cpu": "armv7s",
+    },
+)
+
+config_setting(
+    name = "ios_arm64",
+    values = {
+        "ios_cpu": "arm64",
+    },
+)
+
+IOS_ARM_COPTS = COPTS + [
+    "-DOS_IOS",
+    "-miphoneos-version-min=7.0",
+    "-arch armv7",
+    "-arch armv7s",
+    "-arch arm64",
+    "-D__thread=",
+    "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/",
+]
+
 cc_library(
     name = "protobuf_lite",
     srcs = [
@@ -68,7 +74,6 @@
         "src/google/protobuf/arena.cc",
         "src/google/protobuf/arenastring.cc",
         "src/google/protobuf/extension_set.cc",
-        "src/google/protobuf/generated_message_table_driven_lite.cc",
         "src/google/protobuf/generated_message_util.cc",
         "src/google/protobuf/io/coded_stream.cc",
         "src/google/protobuf/io/zero_copy_stream.cc",
@@ -80,7 +85,6 @@
         "src/google/protobuf/stubs/bytestream.cc",
         "src/google/protobuf/stubs/common.cc",
         "src/google/protobuf/stubs/int128.cc",
-        "src/google/protobuf/stubs/io_win32.cc",
         "src/google/protobuf/stubs/once.cc",
         "src/google/protobuf/stubs/status.cc",
         "src/google/protobuf/stubs/statusor.cc",
@@ -92,7 +96,12 @@
         "src/google/protobuf/wire_format_lite.cc",
     ],
     hdrs = glob(["src/google/protobuf/**/*.h"]),
-    copts = COPTS,
+    copts = select({
+        ":ios_armv7": IOS_ARM_COPTS,
+        ":ios_armv7s": IOS_ARM_COPTS,
+        ":ios_arm64": IOS_ARM_COPTS,
+        "//conditions:default": COPTS,
+    }),
     includes = ["src/"],
     linkopts = LINK_OPTS,
     visibility = ["//visibility:public"],
@@ -116,7 +125,6 @@
         "src/google/protobuf/extension_set_heavy.cc",
         "src/google/protobuf/field_mask.pb.cc",
         "src/google/protobuf/generated_message_reflection.cc",
-        "src/google/protobuf/generated_message_table_driven.cc",
         "src/google/protobuf/io/gzip_stream.cc",
         "src/google/protobuf/io/printer.cc",
         "src/google/protobuf/io/strtod.cc",
@@ -134,7 +142,6 @@
         "src/google/protobuf/timestamp.pb.cc",
         "src/google/protobuf/type.pb.cc",
         "src/google/protobuf/unknown_field_set.cc",
-        "src/google/protobuf/util/delimited_message_util.cc",
         "src/google/protobuf/util/field_comparator.cc",
         "src/google/protobuf/util/field_mask_util.cc",
         "src/google/protobuf/util/internal/datapiece.cc",
@@ -159,24 +166,18 @@
         "src/google/protobuf/wrappers.pb.cc",
     ],
     hdrs = glob(["src/**/*.h"]),
-    copts = COPTS,
+    copts = select({
+        ":ios_armv7": IOS_ARM_COPTS,
+        ":ios_armv7s": IOS_ARM_COPTS,
+        ":ios_arm64": IOS_ARM_COPTS,
+        "//conditions:default": COPTS,
+    }),
     includes = ["src/"],
     linkopts = LINK_OPTS,
     visibility = ["//visibility:public"],
     deps = [":protobuf_lite"],
 )
 
-# This provides just the header files for use in projects that need to build
-# shared libraries for dynamic loading. This target is available until Bazel
-# adds native support for such use cases.
-# TODO(keveman): Remove this target once the support gets added to Bazel.
-cc_library(
-    name = "protobuf_headers",
-    hdrs = glob(["src/**/*.h"]),
-    includes = ["src/"],
-    visibility = ["//visibility:public"],
-)
-
 objc_library(
     name = "protobuf_objc",
     hdrs = ["objectivec/GPBProtocolBuffers.h"],
@@ -185,24 +186,21 @@
     visibility = ["//visibility:public"],
 )
 
-# Map of all well known protos.
-# name => (include path, imports)
-WELL_KNOWN_PROTO_MAP = {
-    "any" : ("google/protobuf/any.proto", []),
-    "api" : ("google/protobuf/api.proto", ["source_context", "type"]),
-    "compiler_plugin" : ("google/protobuf/compiler/plugin.proto", ["descriptor"]),
-    "descriptor" : ("google/protobuf/descriptor.proto", []),
-    "duration" : ("google/protobuf/duration.proto", []),
-    "empty" : ("google/protobuf/empty.proto", []),
-    "field_mask" : ("google/protobuf/field_mask.proto", []),
-    "source_context" : ("google/protobuf/source_context.proto", []),
-    "struct" : ("google/protobuf/struct.proto", []),
-    "timestamp" : ("google/protobuf/timestamp.proto", []),
-    "type" : ("google/protobuf/type.proto", ["any", "source_context"]),
-    "wrappers" : ("google/protobuf/wrappers.proto", []),
-}
-
-RELATIVE_WELL_KNOWN_PROTOS = [proto[1][0] for proto in WELL_KNOWN_PROTO_MAP.items()]
+RELATIVE_WELL_KNOWN_PROTOS = [
+    # AUTOGEN(well_known_protos)
+    "google/protobuf/any.proto",
+    "google/protobuf/api.proto",
+    "google/protobuf/compiler/plugin.proto",
+    "google/protobuf/descriptor.proto",
+    "google/protobuf/duration.proto",
+    "google/protobuf/empty.proto",
+    "google/protobuf/field_mask.proto",
+    "google/protobuf/source_context.proto",
+    "google/protobuf/struct.proto",
+    "google/protobuf/timestamp.proto",
+    "google/protobuf/type.proto",
+    "google/protobuf/wrappers.proto",
+]
 
 WELL_KNOWN_PROTOS = ["src/" + s for s in RELATIVE_WELL_KNOWN_PROTOS]
 
@@ -223,54 +221,9 @@
 )
 
 ################################################################################
-# Well Known Types Proto Library Rules
-#
-# These proto_library rules can be used with one of the language specific proto
-# library rules i.e. java_proto_library:
-#
-# java_proto_library(
-#   name = "any_java_proto",
-#   deps = ["@com_google_protobuf//:any_proto],
-# )
-################################################################################
-
-internal_copied_filegroup(
-    name = "_internal_wkt_protos",
-    srcs = WELL_KNOWN_PROTOS,
-    dest = "",
-    strip_prefix = "src",
-    visibility = ["//visibility:hidden"],
-)
-
-[proto_library(
-    name = proto[0] + "_proto",
-    srcs = [proto[1][0]],
-    deps = [dep + "_proto" for dep in proto[1][1]],
-    visibility = ["//visibility:public"],
-    ) for proto in WELL_KNOWN_PROTO_MAP.items()]
-
-################################################################################
 # Protocol Buffers Compiler
 ################################################################################
 
-cc_binary(
-    name = "js_embed",
-    srcs = ["src/google/protobuf/compiler/js/embed.cc"],
-    visibility = ["//visibility:public"],
-)
-
-genrule(
-    name = "generate_js_well_known_types_embed",
-    srcs = [
-        "src/google/protobuf/compiler/js/well_known_types/any.js",
-        "src/google/protobuf/compiler/js/well_known_types/struct.js",
-        "src/google/protobuf/compiler/js/well_known_types/timestamp.js",
-    ],
-    outs = ["src/google/protobuf/compiler/js/well_known_types_embed.cc"],
-    cmd = "$(location :js_embed) $(SRCS) > $@",
-    tools = [":js_embed"],
-)
-
 cc_library(
     name = "protoc_lib",
     srcs = [
@@ -287,7 +240,6 @@
         "src/google/protobuf/compiler/cpp/cpp_map_field.cc",
         "src/google/protobuf/compiler/cpp/cpp_message.cc",
         "src/google/protobuf/compiler/cpp/cpp_message_field.cc",
-        "src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc",
         "src/google/protobuf/compiler/cpp/cpp_primitive_field.cc",
         "src/google/protobuf/compiler/cpp/cpp_service.cc",
         "src/google/protobuf/compiler/cpp/cpp_string_field.cc",
@@ -349,7 +301,6 @@
         "src/google/protobuf/compiler/javanano/javanano_message_field.cc",
         "src/google/protobuf/compiler/javanano/javanano_primitive_field.cc",
         "src/google/protobuf/compiler/js/js_generator.cc",
-        "src/google/protobuf/compiler/js/well_known_types_embed.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_extension.cc",
@@ -362,7 +313,6 @@
         "src/google/protobuf/compiler/objectivec/objectivec_message_field.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_oneof.cc",
         "src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc",
-        "src/google/protobuf/compiler/php/php_generator.cc",
         "src/google/protobuf/compiler/plugin.cc",
         "src/google/protobuf/compiler/plugin.pb.cc",
         "src/google/protobuf/compiler/python/python_generator.cc",
@@ -416,9 +366,6 @@
     "google/protobuf/unittest_enormous_descriptor.proto",
     "google/protobuf/unittest_import.proto",
     "google/protobuf/unittest_import_public.proto",
-    "google/protobuf/unittest_lazy_dependencies.proto",
-    "google/protobuf/unittest_lazy_dependencies_custom_option.proto",
-    "google/protobuf/unittest_lazy_dependencies_enum.proto",
     "google/protobuf/unittest_lite_imports_nonlite.proto",
     "google/protobuf/unittest_mset.proto",
     "google/protobuf/unittest_mset_wire_format.proto",
@@ -440,10 +387,8 @@
     "google/protobuf/util/internal/testdata/field_mask.proto",
     "google/protobuf/util/internal/testdata/maps.proto",
     "google/protobuf/util/internal/testdata/oneofs.proto",
-    "google/protobuf/util/internal/testdata/proto3.proto",
     "google/protobuf/util/internal/testdata/struct.proto",
     "google/protobuf/util/internal/testdata/timestamp_duration.proto",
-    "google/protobuf/util/internal/testdata/wrappers.proto",
     "google/protobuf/util/json_format_proto3.proto",
     "google/protobuf/util/message_differencer_unittest.proto",
 ]
@@ -484,30 +429,17 @@
 )
 
 cc_test(
-    name = "win32_test",
-    srcs = ["src/google/protobuf/stubs/io_win32_unittest.cc"],
-    deps = [
-        ":protobuf_lite",
-        "//external:gtest_main",
-    ],
-    tags = ["manual", "windows"],
-)
-
-cc_test(
     name = "protobuf_test",
     srcs = COMMON_TEST_SRCS + [
         # AUTOGEN(test_srcs)
         "src/google/protobuf/any_test.cc",
         "src/google/protobuf/arena_unittest.cc",
         "src/google/protobuf/arenastring_unittest.cc",
-        "src/google/protobuf/compiler/annotation_test_util.cc",
         "src/google/protobuf/compiler/command_line_interface_unittest.cc",
         "src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc",
-        "src/google/protobuf/compiler/cpp/cpp_move_unittest.cc",
         "src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc",
         "src/google/protobuf/compiler/cpp/cpp_unittest.cc",
         "src/google/protobuf/compiler/cpp/metadata_test.cc",
-        "src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc",
         "src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc",
         "src/google/protobuf/compiler/importer_unittest.cc",
         "src/google/protobuf/compiler/java/java_doc_comment_unittest.cc",
@@ -541,7 +473,6 @@
         "src/google/protobuf/stubs/bytestream_unittest.cc",
         "src/google/protobuf/stubs/common_unittest.cc",
         "src/google/protobuf/stubs/int128_unittest.cc",
-        "src/google/protobuf/stubs/io_win32_unittest.cc",
         "src/google/protobuf/stubs/once_unittest.cc",
         "src/google/protobuf/stubs/status_test.cc",
         "src/google/protobuf/stubs/statusor_test.cc",
@@ -554,7 +485,6 @@
         "src/google/protobuf/stubs/type_traits_unittest.cc",
         "src/google/protobuf/text_format_unittest.cc",
         "src/google/protobuf/unknown_field_set_unittest.cc",
-        "src/google/protobuf/util/delimited_message_util_test.cc",
         "src/google/protobuf/util/field_comparator_test.cc",
         "src/google/protobuf/util/field_mask_util_test.cc",
         "src/google/protobuf/util/internal/default_value_objectwriter_test.cc",
@@ -575,9 +505,6 @@
         ":test_plugin",
     ] + glob([
         "src/google/protobuf/**/*",
-        # Files for csharp_bootstrap_unittest.cc.
-        "conformance/**/*",
-        "csharp/src/**/*",
     ]),
     includes = [
         "src/",
@@ -605,7 +532,6 @@
     ]) + [
         ":gen_well_known_protos_java",
     ],
-    javacopts = ["-source 6", "-target 6"],
     visibility = ["//visibility:public"],
 )
 
@@ -614,13 +540,12 @@
     srcs = glob([
         "java/util/src/main/java/com/google/protobuf/util/*.java",
     ]),
-    javacopts = ["-source 6", "-target 6"],
-    visibility = ["//visibility:public"],
     deps = [
         "protobuf_java",
         "//external:gson",
         "//external:guava",
     ],
+    visibility = ["//visibility:public"],
 )
 
 ################################################################################
@@ -635,18 +560,16 @@
             "python/google/protobuf/**/*.py",
         ],
         exclude = [
-            "python/google/protobuf/__init__.py",
-            "python/google/protobuf/**/__init__.py",
             "python/google/protobuf/internal/*_test.py",
             "python/google/protobuf/internal/test_util.py",
         ],
     ),
-    imports = ["python"],
     srcs_version = "PY2AND3",
+    imports = ["python"],
 )
 
 cc_binary(
-    name = "python/google/protobuf/internal/_api_implementation.so",
+    name = "internal/_api_implementation.so",
     srcs = ["python/google/protobuf/internal/api_implementation.cc"],
     copts = COPTS + [
         "-DPYTHON_PROTO2_CPP_IMPL_V2",
@@ -660,7 +583,7 @@
 )
 
 cc_binary(
-    name = "python/google/protobuf/pyext/_message.so",
+    name = "pyext/_message.so",
     srcs = glob([
         "python/google/protobuf/pyext/*.cc",
         "python/google/protobuf/pyext/*.h",
@@ -699,65 +622,31 @@
     },
 )
 
-# Copy the builtin proto files from src/google/protobuf to
-# python/google/protobuf. This way, the generated Python sources will be in the
-# same directory as the Python runtime sources. This is necessary for the
-# modules to be imported correctly since they are all part of the same Python
-# package.
-internal_copied_filegroup(
-    name = "protos_python",
-    srcs = WELL_KNOWN_PROTOS,
-    dest = "python",
-    strip_prefix = "src",
-)
-
-# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
-# which case we can simply add :protos_python in srcs.
-COPIED_WELL_KNOWN_PROTOS = ["python/" + s for s in RELATIVE_WELL_KNOWN_PROTOS]
-
 py_proto_library(
     name = "protobuf_python",
-    srcs = COPIED_WELL_KNOWN_PROTOS,
-    include = "python",
+    srcs = WELL_KNOWN_PROTOS,
+    include = "src",
     data = select({
         "//conditions:default": [],
         ":use_fast_cpp_protos": [
-            ":python/google/protobuf/internal/_api_implementation.so",
-            ":python/google/protobuf/pyext/_message.so",
+            ":internal/_api_implementation.so",
+            ":pyext/_message.so",
         ],
     }),
     default_runtime = "",
     protoc = ":protoc",
     py_libs = [
         ":python_srcs",
-        "//external:six",
+        "//external:six"
     ],
     srcs_version = "PY2AND3",
     visibility = ["//visibility:public"],
 )
 
-# Copy the test proto files from src/google/protobuf to
-# python/google/protobuf. This way, the generated Python sources will be in the
-# same directory as the Python runtime sources. This is necessary for the
-# modules to be imported correctly by the tests since they are all part of the
-# same Python package.
-internal_copied_filegroup(
-    name = "protos_python_test",
-    srcs = LITE_TEST_PROTOS + TEST_PROTOS,
-    dest = "python",
-    strip_prefix = "src",
-)
-
-# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
-# which case we can simply add :protos_python_test in srcs.
-COPIED_LITE_TEST_PROTOS = ["python/" + s for s in RELATIVE_LITE_TEST_PROTOS]
-
-COPIED_TEST_PROTOS = ["python/" + s for s in RELATIVE_TEST_PROTOS]
-
 py_proto_library(
     name = "python_common_test_protos",
-    srcs = COPIED_LITE_TEST_PROTOS + COPIED_TEST_PROTOS,
-    include = "python",
+    srcs = LITE_TEST_PROTOS + TEST_PROTOS,
+    include = "src",
     default_runtime = "",
     protoc = ":protoc",
     srcs_version = "PY2AND3",
@@ -783,7 +672,6 @@
         [
             "python/google/protobuf/internal/*_test.py",
             "python/google/protobuf/internal/test_util.py",
-            "python/google/protobuf/internal/import_test_package/__init__.py",
         ],
     ),
     imports = ["python"],
@@ -819,98 +707,3 @@
     ],
     deps = [":python_tests"],
 )
-
-proto_lang_toolchain(
-    name = "cc_toolchain",
-    command_line = "--cpp_out=$(OUT)",
-    runtime = ":protobuf",
-    visibility = ["//visibility:public"],
-)
-
-proto_lang_toolchain(
-    name = "java_toolchain",
-    command_line = "--java_out=$(OUT)",
-    runtime = ":protobuf_java",
-    visibility = ["//visibility:public"],
-)
-
-OBJC_HDRS = [
-    "objectivec/GPBArray.h",
-    "objectivec/GPBBootstrap.h",
-    "objectivec/GPBCodedInputStream.h",
-    "objectivec/GPBCodedOutputStream.h",
-    "objectivec/GPBDescriptor.h",
-    "objectivec/GPBDictionary.h",
-    "objectivec/GPBExtensionInternals.h",
-    "objectivec/GPBExtensionRegistry.h",
-    "objectivec/GPBMessage.h",
-    "objectivec/GPBProtocolBuffers.h",
-    "objectivec/GPBProtocolBuffers_RuntimeSupport.h",
-    "objectivec/GPBRootObject.h",
-    "objectivec/GPBRuntimeTypes.h",
-    "objectivec/GPBUnknownField.h",
-    "objectivec/GPBUnknownFieldSet.h",
-    "objectivec/GPBUtilities.h",
-    "objectivec/GPBWellKnownTypes.h",
-    "objectivec/GPBWireFormat.h",
-    "objectivec/google/protobuf/Any.pbobjc.h",
-    "objectivec/google/protobuf/Api.pbobjc.h",
-    "objectivec/google/protobuf/Duration.pbobjc.h",
-    "objectivec/google/protobuf/Empty.pbobjc.h",
-    "objectivec/google/protobuf/FieldMask.pbobjc.h",
-    "objectivec/google/protobuf/SourceContext.pbobjc.h",
-    "objectivec/google/protobuf/Struct.pbobjc.h",
-    "objectivec/google/protobuf/Timestamp.pbobjc.h",
-    "objectivec/google/protobuf/Type.pbobjc.h",
-    "objectivec/google/protobuf/Wrappers.pbobjc.h",
-]
-
-OBJC_PRIVATE_HDRS = [
-    "objectivec/GPBArray_PackagePrivate.h",
-    "objectivec/GPBCodedInputStream_PackagePrivate.h",
-    "objectivec/GPBCodedOutputStream_PackagePrivate.h",
-    "objectivec/GPBDescriptor_PackagePrivate.h",
-    "objectivec/GPBDictionary_PackagePrivate.h",
-    "objectivec/GPBMessage_PackagePrivate.h",
-    "objectivec/GPBRootObject_PackagePrivate.h",
-    "objectivec/GPBUnknownFieldSet_PackagePrivate.h",
-    "objectivec/GPBUnknownField_PackagePrivate.h",
-    "objectivec/GPBUtilities_PackagePrivate.h",
-]
-
-OBJC_SRCS = [
-    "objectivec/GPBArray.m",
-    "objectivec/GPBCodedInputStream.m",
-    "objectivec/GPBCodedOutputStream.m",
-    "objectivec/GPBDescriptor.m",
-    "objectivec/GPBDictionary.m",
-    "objectivec/GPBExtensionInternals.m",
-    "objectivec/GPBExtensionRegistry.m",
-    "objectivec/GPBMessage.m",
-    "objectivec/GPBRootObject.m",
-    "objectivec/GPBUnknownField.m",
-    "objectivec/GPBUnknownFieldSet.m",
-    "objectivec/GPBUtilities.m",
-    "objectivec/GPBWellKnownTypes.m",
-    "objectivec/GPBWireFormat.m",
-    "objectivec/google/protobuf/Any.pbobjc.m",
-    "objectivec/google/protobuf/Api.pbobjc.m",
-    "objectivec/google/protobuf/Duration.pbobjc.m",
-    "objectivec/google/protobuf/Empty.pbobjc.m",
-    "objectivec/google/protobuf/FieldMask.pbobjc.m",
-    "objectivec/google/protobuf/SourceContext.pbobjc.m",
-    "objectivec/google/protobuf/Struct.pbobjc.m",
-    "objectivec/google/protobuf/Timestamp.pbobjc.m",
-    "objectivec/google/protobuf/Type.pbobjc.m",
-    "objectivec/google/protobuf/Wrappers.pbobjc.m",
-]
-
-objc_library(
-    name = "objectivec",
-    hdrs = OBJC_HDRS + OBJC_PRIVATE_HDRS,
-    includes = [
-        "objectivec",
-    ],
-    non_arc_srcs = OBJC_SRCS,
-    visibility = ["//visibility:public"],
-)
diff --git a/CHANGES.txt b/CHANGES.txt
index c7c4291..3459ccc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,654 +1,3 @@
-2017-12-20 version 3.5.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
-  Planned Future Changes
-  * Make C++ implementation C++11 only: we plan to require C++11 to build
-    protobuf code starting from 3.6.0 release. Please join this github issue:
-    https://github.com/google/protobuf/issues/2780 to provide your feedback.
-
-  protoc
-  * Fixed a bug introduced in 3.5.0 and protoc in Windows now accepts non-ascii
-    characters in paths again.
-
-  C++
-  * Removed several usages of C++11 features in the code base.
-  * Fixed some compiler warnings.
-
-  PHP
-  * Fixed memory leak in C-extension implementation.
-  * Added discardUnknokwnFields API.
-  * Removed duplicatd typedef in C-extension headers.
-  * Avoided calling private php methods (timelib_update_ts).
-  * Fixed Any.php to use fully-qualified name for DescriptorPool.
-
-  Ruby
-  * Added Google_Protobuf_discard_unknown for discarding unknown fields in
-    messages.
-
-  C#
-  * Unknown fields are now preserved by default.
-  * Floating point values are now bitwise compared, affecting message equality
-    check and Contains() API in map and repeated fields.
-
-
-2017-11-13 version 3.5.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
-  Planned Future Changes
-  * Make C++ implementation C++11 only: we plan to require C++11 to build
-    protobuf code starting from 3.6.0 release. Please join this github issue:
-    https://github.com/google/protobuf/issues/2780 to provide your feedback.
-
-  General
-  * Unknown fields are now preserved in proto3 for most of the language
-    implementations for proto3 by default. See the per-language section for
-    details.
-  * reserve keyword are now supported in enums
-
-  C++
-  * Proto3 messages are now preserving unknown fields by default. If you rely on
-    unknowns fields being dropped. Please use DiscardUnknownFields() explicitly.
-  * Deprecated the unsafe_arena_release_* and unsafe_arena_add_allocated_*
-    methods for string fields.
-  * Added move constructor and move assignment to RepeatedField,
-    RepeatedPtrField and google::protobuf::Any.
-  * Added perfect forwarding in Arena::CreateMessage
-  * In-progress experimental support for implicit weak fields with lite protos.
-    This feature allows the linker to strip out more unused messages and reduce
-    binary size.
-  * Various performance optimizations.
-
-  Java
-  * Proto3 messages are now preserving unknown fields by default. If you’d like
-    to drop unknown fields, please use the DiscardUnknownFieldsParser API. For
-    example:
-      Parser<Foo> parser = DiscardUnknownFieldsParser.wrap(Foo.parser());
-      Foo foo = parser.parseFrom(input);
-  * Added a new CodedInputStream decoder for Iterable<ByteBuffer> with direct
-    ByteBuffers.
-  * TextFormat now prints unknown length-delimited fields as messages if
-    possible.
-  * FieldMaskUtil.merge() no longer creates unnecessary empty messages when a
-    message field is unset in both source message and destination message.
-  * Various performance optimizations.
-
-  Python
-  * Proto3 messages are now preserving unknown fields by default. Use
-    message.DiscardUnknownFields() to drop unknown fields.
-  * Add FieldDescriptor.file in generated code.
-  * Add descriptor pool FindOneofByName in pure python.
-  * Change unknown enum values into unknown field set .
-  * Add more Python dict/list compatibility for Struct/ListValue.
-  * Add utf-8 support for text_format.Merge()/Parse().
-  * Support numeric unknown enum values for proto3 JSON format.
-  * Add warning for Unexpected end-group tag in cpp extension.
-
-  PHP
-  * Proto3 messages are now preserving unknown fields.
-  * Provide well known type messages in runtime.
-  * Add prefix ‘PB’ to generated class of reserved names.
-  * Fixed all conformance tests for encode/decode json in php runtime. C
-    extension needs more work.
-
-  Objective-C
-  * Fixed some issues around copying of messages with unknown fields and then
-    mutating the unknown fields in the copy.
-
-  C#
-  * Added unknown field support in JsonParser.
-  * Fixed oneof message field merge.
-  * Simplify parsing messages from array slices.
-
-  Ruby
-  * Unknown fields are now preserved by default.
-  * Fixed several bugs for segment fault.
-
-  Javascript
-  * Decoder can handle both paced and unpacked data no matter how the proto is
-    defined.
-  * Decoder now accept long varint for 32 bit integers.
-
-
-2017-08-14 version 3.4.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
-  Planned Future Changes
-  * There are some changes that are not included in this release but are planned
-    for the near future
-      - Preserve unknown fields in proto3: We are going to bring unknown fields
-        back into proto3. In this release, some languages start to support
-        preserving unknown fields in proto3, controlled by flags/options. Some
-        languages also introduce explicit APIs to drop unknown fields for
-        migration. Please read the change log sections by languages for details.
-        For general timeline and plan:
-
-          https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/view
-
-        For issues and discussions:
-
-          https://github.com/google/protobuf/issues/272
-
-      - Make C++ implementation C++11 only: we plan to require C++11 to build
-        protobuf code starting from 3.5.0 or 3.6.0 release, after unknown fields
-        semantic changes are finished. Please join this
-        github issue:
-
-          https://github.com/google/protobuf/issues/2780
-
-        to provide your feedback.
-
-  General
-  * Extension ranges now accept options and are customizable.
-  * "reserve" keyword now supports “max” in field number ranges,
-    e.g.  reserve 1000 to max;
-
-  C++
-  * Proto3 messages are now able to preserve unknown fields. The default
-    behavior is still to drop unknowns, which will be flipped in a future
-    release. If you rely on unknowns fields being dropped. Please use
-    Message::DiscardUnknownFields() explicitly.
-  * Packable proto3 fields are now packed by default in serialization.
-  * Following C++11 features are introduced when C++11 is available:
-      - move-constructor and move-assignment are introduced to messages
-      - Repeated fields constructor now takes std::initializer_list
-      - rvalue setters are introduced for string fields
-  * Experimental Table-Driven parsing and serialization available to test. To
-    enable it, pass in table_driven_parsing table_driven_serialization protoc
-    generator flags for C++
-
-      $ protoc --cpp_out=table_driven_parsing,table_driven_serialization:./ \
-        test.proto
-
-  * lite generator parameter supported by the generator. Once set, all generated
-    files, use lite runtime regardless of the optimizer_for setting in the
-    .proto file.
-  * Various optimizations to make C++ code more performant on PowerPC platform
-  * Fixed maps data corruption when the maps are modified by both reflection API
-    and generated API.
-  * Deterministic serialization on maps reflection now uses stable sort.
-  * file() accessors are introduced to various *Descriptor classes to make
-    writing template function easier.
-  * ByteSize() and SpaceUsed() are deprecated.Use ByteSizeLong() and
-    SpaceUsedLong() instead
-  * Consistent hash function is used for maps in DEBUG and NDEBUG build.
-  * "using namespace std" is removed from stubs/common.h
-  * Various performance optimizations and bug fixes
-
-  Java
-  * Introduced new parser API DiscardUnknownFieldsParser in preparation of
-    proto3 unknown fields preservation change. Users who want to drop unknown
-    fields should migrate to use this new parser API. For example:
-
-      Parser<Foo> parser = DiscardUnknownFieldsParser.wrap(Foo.parser());
-      Foo foo = parser.parseFrom(input);
-
-  * Introduced new TextFormat API printUnicodeFieldValue() that prints field
-    value without escaping unicode characters.
-  * Added Durations.compare(Duration, Duration) and
-    Timestamps.compare(Timestamp, Timestamp).
-  * JsonFormat now accepts base64url encoded bytes fields.
-  * Optimized CodedInputStream to do less copies when parsing large bytes
-    fields.
-  * Optimized TextFormat to allocate less memory when printing.
-
-  Python
-  * SerializeToString API is changed to SerializeToString(self, **kwargs),
-    deterministic parameter is accepted for deterministic serialization.
-  * Added sort_keys parameter in json format to make the output deterministic.
-  * Added indent parameter in json format.
-  * Added extension support in json format.
-  * Added __repr__ support for repeated field in cpp implementation.
-  * Added file in FieldDescriptor.
-  * Added pretty-print filter to text format.
-  * Services and method descriptors are always printed even if generic_service
-    option is turned off.
-  * Note: AppEngine 2.5 is deprecated on June 2017 that AppEngine 2.5 will
-    never update protobuf runtime. Users who depend on AppEngine 2.5 should use
-    old protoc.
-
-  PHP
-  * Support PHP generic services. Specify file option php_generic_service=true
-    to enable generating service interface.
-  * Message, repeated and map fields setters take value instead of reference.
-  * Added map iterator in c extension.
-  * Support json  encode/decode.
-  * Added more type info in getter/setter phpdoc
-  * Fixed the problem that c extension and php implementation cannot be used
-    together.
-  * Added file option php_namespace to use custom php namespace instead of
-    package.
-  * Added fluent setter.
-  * Added descriptor API in runtime for custom encode/decode.
-  * Various bug fixes.
-
-  Objective-C
-  * Fix for GPBExtensionRegistry copying and add tests.
-  * Optimize GPBDictionary.m codegen to reduce size of overall library by 46K
-    per architecture.
-  * Fix some cases of reading of 64bit map values.
-  * Properly error on a tag with field number zero.
-  * Preserve unknown fields in proto3 syntax files.
-  * Document the exceptions on some of the writing apis.
-
-  C#
-  * Implemented IReadOnlyDictionary<K,V> in MapField<K,V>
-  * Added TryUnpack method for Any message in addition to Unpack.
-  * Converted C# projects to MSBuild (csproj) format.
-
-  Ruby
-  * Several bug fixes.
-
-  Javascript
-  * Added support of field option js_type. Now one can specify the JS type of a
-    64-bit integer field to be string in the generated code by adding option
-    [jstype = JS_STRING] on the field.
-
-2017-04-05 version 3.3.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
-  Planned Future Changes
-  * There are some changes that are not included in this release but are
-    planned for the near future:
-      - Preserve unknown fields in proto3: please read this doc:
-
-          https://docs.google.com/document/d/1KMRX-G91Aa-Y2FkEaHeeviLRRNblgIahbsk4wA14gRk/view
-
-        for the timeline and follow up this github issue:
-
-          https://github.com/google/protobuf/issues/272
-
-        for discussion.
-      - Make C++ implementation C++11 only: we plan to require C++11 to build
-        protobuf code starting from 3.4.0 or 3.5.0 release. Please join this
-        github issue:
-
-          https://github.com/google/protobuf/issues/2780
-
-        to provide your feedback.
-
-  C++
-  * Fixed map fields serialization of DynamicMessage to correctly serialize
-    both key and value regardless of their presence.
-  * Parser now rejects field number 0 correctly.
-  * New API Message::SpaceUsedLong() that’s equivalent to
-    Message::SpaceUsed() but returns the value in size_t.
-  * JSON support
-    - New flag always_print_enums_as_ints in JsonPrintOptions.
-    - New flag preserve_proto_field_names in JsonPrintOptions. It will instruct
-      the JSON printer to use the original field name declared in the .proto
-      file instead of converting them to lowerCamelCase when printing JSON.
-    - JsonPrintOptions.always_print_primtive_fields now works for oneof message
-      fields.
-    - Fixed a bug that doesn’t allow different fields to set the same json_name
-      value.
-    - Fixed a performance bug that causes excessive memory copy when printing
-      large messages.
-  * Various performance optimizations.
-
-  Java
-  * Map field setters eagerly validate inputs and throw NullPointerExceptions
-    as appropriate.
-  * Added ByteBuffer overloads to the generated parsing methods and the Parser
-    interface.
-  * proto3 enum's getNumber() method now throws on UNRECOGNIZED values.
-  * Output of JsonFormat is now locale independent.
-
-  Python
-  * Added FindServiceByName() in the pure-Python DescriptorPool. This works only
-    for descriptors added with DescriptorPool.Add(). Generated descriptor_pool
-    does not support this yet.
-  * Added a descriptor_pool parameter for parsing Any in text_format.Parse().
-  * descriptor_pool.FindFileContainingSymbol() now is able to find nested
-    extensions.
-  * Extending empty [] to repeated field now sets parent message presence.
-
-  PHP
-  * Added file option php_class_prefix. The prefix will be prepended to all
-    generated classes defined in the file.
-  * When encoding, negative int32 values are sign-extended to int64.
-  * Repeated/Map field setter accepts a regular PHP array. Type checking is
-    done on the array elements.
-  * encode/decode are renamed to serializeToString/mergeFromString.
-  * Added mergeFrom, clear method on Message.
-  * Fixed a bug that oneof accessor didn’t return the field name that is
-    actually set.
-  * C extension now works with php7.
-  * This is the first GA release of PHP. We guarantee that old generated code
-    can always work with new runtime and new generated code.
-
-  Objective-C
-  * Fixed help for GPBTimestamp for dates before the epoch that contain
-    fractional seconds.
-  * Added GPBMessageDropUnknownFieldsRecursively() to remove unknowns from a
-    message and any sub messages.
-  * Addressed a threading race in extension registration/lookup.
-  * Increased the max message parsing depth to 100 to match the other languages.
-  * Removed some use of dispatch_once in favor of atomic compare/set since it
-    needs to be heap based.
-  * Fixes for new Xcode 8.3 warnings.
-
-  C#
-  * Fixed MapField.Values.CopyTo, which would throw an exception unnecessarily
-    if provided exactly the right size of array to copy to.
-  * Fixed enum JSON formatting when multiple names mapped to the same numeric
-    value.
-  * Added JSON formatting option to format enums as integers.
-  * Modified RepeatedField<T> to implement IReadOnlyList<T>.
-  * Introduced the start of custom option handling; it's not as pleasant as it
-    might be, but the information is at least present. We expect to extend code
-    generation to improve this in the future.
-  * Introduced ByteString.FromStream and ByteString.FromStreamAsync to
-    efficiently create a ByteString from a stream.
-  * Added whole-message deprecation, which decorates the class with [Obsolete].
-
-  Ruby
-  * Fixed Message#to_h for messages with map fields.
-  * Fixed memcpy() in binary gems to work for old glibc, without breaking the
-    build for non-glibc libc’s like musl.
-
-  Javascript
-  * Added compatibility tests for version 3.0.0.
-  * Added conformance tests.
-  * Fixed serialization of extensions: we need to emit a value even if it is
-    falsy (like the number 0).
-  * Use closurebuilder.py in favor of calcdeps.py for compiling JavaScript.
-
-2017-01-23 version 3.2.0 (C++/Java/Python/PHP/Ruby/Objective-C/C#/JavaScript/Lite)
-  General
-  * Added protoc version number to protoc plugin protocol. It can be used by
-    protoc plugin to detect which version of protoc is used with the plugin and
-    mitigate known problems in certain version of protoc.
-
-  C++
-  * The default parsing byte size limit has been raised from 64MB to 2GB.
-  * Added rvalue setters for non-arena string fields.
-  * Enabled debug logging for Android.
-  * Fixed a double-free problem when using Reflection::SetAllocatedMessage()
-    with extension fields.
-  * Fixed several deterministic serialization bugs:
-    * MessageLite::SerializeAsString() now respects the global deterministic
-      serialization flag.
-    * Extension fields are serialized deterministically as well.  Fixed protocol
-      compiler to correctly report importing-self as an error.
-  * Fixed FileDescriptor::DebugString() to print custom options correctly.
-  * Various performance/codesize optimizations and cleanups.
-
-  Java
-  * The default parsing byte size limit has been raised from 64MB to 2GB.
-  * Added recursion limit when parsing JSON.
-  * Fixed a bug that enumType.getDescriptor().getOptions() doesn't have custom
-    options.
-  * Fixed generated code to support field numbers up to 2^29-1.
-
-  Python
-  * You can now assign NumPy scalars/arrays (np.int32, np.int64) to protobuf
-    fields, and assigning other numeric types has been optimized for
-    performance.
-  * Pure-Python: message types are now garbage-collectable.
-  * Python/C++: a lot of internal cleanup/refactoring.
-
-  PHP (Alpha)
-  * For 64-bit integers type (int64/uint64/sfixed64/fixed64/sint64), use PHP
-    integer on 64-bit environment and PHP string on 32-bit environment.
-  * PHP generated code also conforms to PSR-4 now.
-  * Fixed ZTS build for c extension.
-  * Fixed c extension build on Mac.
-  * Fixed c extension build on 32-bit linux.
-  * Fixed the bug that message without namespace is not found in the descriptor
-    pool. (#2240)
-  * Fixed the bug that repeated field is not iterable in c extension.
-  * Message names Empty will be converted to GPBEmpty in generated code.
-  * Added phpdoc in generated files.
-  * The released API is almost stable. Unless there is large problem, we won't
-    change it. See
-    https://developers.google.com/protocol-buffers/docs/reference/php-generated
-    for more details.
-
-  Objective-C
-  * Added support for push/pop of the stream limit on CodedInputStream for
-    anyone doing manual parsing.
-
-  C#
-  * No changes.
-
-  Ruby
-  * Message objects now support #respond_to? for field getters/setters.
-  * You can now compare “message == non_message_object” and it will return false
-    instead of throwing an exception.
-  * JRuby: fixed #hashCode to properly reflect the values in the message.
-
-  Javascript
-  * Deserialization of repeated fields no longer has quadratic performance
-    behavior.
-  * UTF-8 encoding/decoding now properly supports high codepoints.
-  * Added convenience methods for some well-known types: Any, Struct, and
-    Timestamp. These make it easier to convert data between native JavaScript
-    types and the well-known protobuf types.
-
-2016-09-23 version 3.1.0 (C++/Java/Python/PHP/Ruby/Objective-C/C#/JavaScript/Lite)
-  General
-  * Proto3 support in PHP (alpha).
-  * Various bug fixes.
-
-  C++
-  * Added MessageLite::ByteSizeLong() that’s equivalent to
-    MessageLite::ByteSize() but returns the value in size_t. Useful to check
-    whether a message is over the 2G size limit that protobuf can support.
-  * Moved default_instances to global variables. This allows default_instance
-    addresses to be known at compile time.
-  * Adding missing generic gcc 64-bit atomicops.
-  * Restore New*Callback into google::protobuf namespace since these are used
-    by the service stubs code
-  * JSON support.
-    * Fixed some conformance issues.
-  * Fixed a JSON serialization bug for bytes fields.
-
-  Java
-  * Fixed a bug in TextFormat that doesn’t accept empty repeated fields (i.e.,
-    “field: [ ]”).
-  * JSON support
-    * Fixed JsonFormat to do correct snake_case-to-camelCase conversion for
-      non-style-conforming field names.
-    * Fixed JsonFormat to parse empty Any message correctly.
-    * Added an option to JsonFormat.Parser to ignore unknown fields.
-  * Experimental API
-    * Added UnsafeByteOperations.unsafeWrap(byte[]) to wrap a byte array into
-      ByteString without copy.
-
-  Python
-  * JSON support
-    * Fixed some conformance issues.
-
-  PHP (Alpha)
-  * We have added the proto3 support for PHP via both a pure PHP package and a
-    native c extension. The pure PHP package is intended to provide usability
-    to wider range of PHP platforms, while the c extension is intended to
-    provide higher performance. Both implementations provide the same runtime
-    APIs and share the same generated code. Users don’t need to re-generate
-    code for the same proto definition when they want to switch the
-    implementation later. The pure PHP package is included in the php/src
-    directory, and the c extension is included in the php/ext directory.
-
-    Both implementations provide idiomatic PHP APIs:
-    * All messages and enums are defined as PHP classes.
-    * All message fields can only be accessed via getter/setter.
-    * Both repeated field elements and map elements are stored in containers
-      that act like a normal PHP array.
-
-    Unlike several existing third-party PHP implementations for protobuf, our
-    implementations are built on a "strongly-typed" philosophy: message fields
-    and array/map containers will throw exceptions eagerly when values of the
-    incorrect type (not including those that can be type converted, e.g.,
-    double <-> integer <-> numeric string) are inserted.
-
-    Currently, pure PHP runtime supports php5.5, 5.6 and 7 on linux. C
-    extension runtime supports php5.5 and 5.6 on linux.
-
-    See php/README.md for more details about installment. See
-    https://developers.google.com/protocol-buffers/docs/phptutorial for more
-    details about APIs.
-
-  Objective-C
-  * Helpers are now provided for working the the Any well known type (see
-    GPBWellKnownTypes.h for the api additions).
-  * Some improvements in startup code (especially when extensions aren’t used).
-
-  Javascript
-  * Fixed missing import of jspb.Map
-  * Fixed valueWriterFn variable name
-
-  Ruby
-  * Fixed hash computation for JRuby's RubyMessage
-  * Make sure map parsing frames are GC-rooted.
-  * Added API support for well-known types.
-
-  C#
-  * Removed check on dependency in the C# reflection API.
-
-2016-09-06 version 3.0.2 (C++/Java/Python/Ruby/Objective-C/C#/JavaScript/Lite)
-  General
-  * Various bug fixes.
-
-  Objective C
-  * Fix for oneofs in proto3 syntax files where fields were set to the zero
-    value.
-  * Fix for embedded null character in strings.
-  * CocoaDocs support
-
-  Ruby
-  * Fixed memory corruption bug in parsing that could occur under GC pressure.
-
-  Javascript
-  * jspb.Map is now properly exported to CommonJS modules.
-
-  C#
-  * Removed legacy_enum_values flag.
-
-
-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
-    serialization guarantees that given a binary, equal messages will be
-    serialized to the same bytes. This allows applications like MapReduce to
-    group equal messages based on the serialized bytes. The deterministic
-    serialization is, however, NOT canonical across languages; it is also
-    unstable across different builds with schema changes due to unknown fields.
-    Users who need canonical serialization, e.g. persistent storage in a
-    canonical form, fingerprinting, etc, should define their own
-    canonicalization specification and implement the serializer using reflection
-    APIs rather than relying on this API.
-  * Added OneofOptions. You can now define custom options for oneof groups.
-      import "google/protobuf/descriptor.proto";
-      extend google.protobuf.OneofOptions {
-        optional int32 my_oneof_extension = 12345;
-      }
-      message Foo {
-        oneof oneof_group {
-          (my_oneof_extension) = 54321;
-          ...
-        }
-      }
-
-  C++ (beta)
-  * Introduced a deterministic serialization API in
-    CodedOutputStream::SetSerializationDeterministic(bool). See the notes about
-    deterministic serialization in the General section.
-  * Added google::protobuf::Map::swap() to swap two map fields.
-  * Fixed a memory leak when calling Reflection::ReleaseMessage() on a message
-    allocated on arena.
-  * Improved error reporting when parsing text format protos.
-  * JSON
-      - Added a new parser option to ignore unknown fields when parsing JSON.
-      - Added convenient methods for message to/from JSON conversion.
-  * Various performance optimizations.
-
-  Java (beta)
-  * File option "java_generate_equals_and_hash" is now deprecated. equals() and
-    hashCode() methods are generated by default.
-  * Added a new JSON printer option "omittingInsignificantWhitespace" to produce
-    a more compact JSON output. The printer will pretty-print by default.
-  * Updated Java runtime to be compatible with 2.5.0/2.6.1 generated protos.
-
-  Python (beta)
-  * Added support to pretty print Any messages in text format.
-  * Added a flag to ignore unknown fields when parsing JSON.
-  * Bugfix: "@type" field of a JSON Any message is now correctly put before
-    other fields.
-
-  Objective-C (beta)
-  * Updated the code to support compiling with more compiler warnings
-    enabled. (Issue 1616)
-  * Exposing more detailed errors for parsing failures. (PR 1623)
-  * Small (breaking) change to the naming of some methods on the support classes
-    for map<>. There were collisions with the system provided KVO support, so
-    the names were changed to avoid those issues.  (PR 1699)
-  * Fixed for proper Swift bridging of error handling during parsing. (PR 1712)
-  * Complete support for generating sources that will go into a Framework and
-    depend on generated sources from other Frameworks. (Issue 1457)
-
-  C# (beta)
-  * RepeatedField optimizations.
-  * Support for .NET Core.
-  * Minor bug fixes.
-  * Ability to format a single value in JsonFormatter (advanced usage only).
-  * Modifications to attributes applied to generated code.
-
-  Javascript (alpha)
-  * Maps now have a real map API instead of being treated as repeated fields.
-  * Well-known types are now provided in the google-protobuf package, and the
-    code generator knows to require() them from that package.
-  * Bugfix: non-canonical varints are correctly decoded.
-
-  Ruby (alpha)
-  * Accessors for oneof fields now return default values instead of nil.
-
-  Java Lite
-  * Java lite support is removed from protocol compiler. It will be supported
-    as a protocol compiler plugin in a separate code branch.
-
 2016-05-16 version 3.0.0-beta-3 (C++/Java/Python/Ruby/Nano/Objective-C/C#/JavaScript)
   General
   * Supported Proto3 lite-runtime in C++/Java for mobile platforms.
@@ -1728,7 +1077,7 @@
 2008-09-29 version 2.0.2:
 
   General
-  * License changed from Apache 2.0 to 3-Clause BSD.
+  * License changed from Apache 2.0 to New BSD.
   * It is now possible to define custom "options", which are basically
     annotations which may be placed on definitions in a .proto file.
     For example, you might define a field option called "foo" like so:
diff --git a/Makefile.am b/Makefile.am
index 19a1607..3e98881 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -51,43 +51,37 @@
 csharp_EXTRA_DIST=                                                           \
   csharp/.gitignore                                                          \
   csharp/CHANGES.txt                                                         \
-  csharp/Google.Protobuf.Tools.nuspec                                        \
   csharp/README.md                                                           \
   csharp/build_packages.bat                                                  \
-  csharp/build_tools.sh                                                      \
   csharp/buildall.sh                                                         \
   csharp/generate_protos.sh                                                  \
-  csharp/global.json                                                         \
   csharp/keys/Google.Protobuf.public.snk                                     \
-  csharp/keys/Google.Protobuf.snk                                            \
   csharp/keys/README.md                                                      \
-  csharp/protos/README.md                                                    \
-  csharp/protos/map_unittest_proto3.proto                                    \
-  csharp/protos/unittest_custom_options_proto3.proto                         \
-  csharp/protos/unittest_import_public_proto3.proto                          \
-  csharp/protos/unittest_import_proto3.proto                                 \
   csharp/protos/unittest_issues.proto                                        \
-  csharp/protos/unittest_proto3.proto                                        \
   csharp/src/AddressBook/AddPerson.cs                                        \
-  csharp/src/AddressBook/Addressbook.cs                                      \
   csharp/src/AddressBook/AddressBook.csproj                                  \
+  csharp/src/AddressBook/Addressbook.cs                                      \
   csharp/src/AddressBook/ListPeople.cs                                       \
   csharp/src/AddressBook/Program.cs                                          \
+  csharp/src/AddressBook/Properties/AssemblyInfo.cs                          \
   csharp/src/AddressBook/SampleUsage.cs                                      \
+  csharp/src/AddressBook/app.config                                          \
+  csharp/src/Google.Protobuf.Conformance/App.config                          \
   csharp/src/Google.Protobuf.Conformance/Conformance.cs                      \
   csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj  \
   csharp/src/Google.Protobuf.Conformance/Program.cs                          \
+  csharp/src/Google.Protobuf.Conformance/Properties/AssemblyInfo.cs          \
   csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj        \
   csharp/src/Google.Protobuf.JsonDump/Program.cs                             \
+  csharp/src/Google.Protobuf.JsonDump/Properties/AssemblyInfo.cs             \
+  csharp/src/Google.Protobuf.JsonDump/app.config                             \
   csharp/src/Google.Protobuf.Test/ByteStringTest.cs                          \
   csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs              \
   csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs                    \
   csharp/src/Google.Protobuf.Test/CodedOutputStreamTest.cs                   \
   csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs                \
-  csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs \
   csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs           \
   csharp/src/Google.Protobuf.Test/Compatibility/PropertyInfoExtensionsTest.cs \
-  csharp/src/Google.Protobuf.Test/Compatibility/StreamExtensionsTest.cs      \
   csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs        \
   csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs                    \
   csharp/src/Google.Protobuf.Test/EqualityTester.cs                          \
@@ -98,19 +92,15 @@
   csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs                       \
   csharp/src/Google.Protobuf.Test/JsonParserTest.cs                          \
   csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs                       \
-  csharp/src/Google.Protobuf.Test/Program.cs                                 \
-  csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs            \
+  csharp/src/Google.Protobuf.Test/Properties/AppManifest.xml                 \
+  csharp/src/Google.Protobuf.Test/Properties/AssemblyInfo.cs                 \
   csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs              \
   csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs              \
   csharp/src/Google.Protobuf.Test/Reflection/TypeRegistryTest.cs             \
   csharp/src/Google.Protobuf.Test/SampleEnum.cs                              \
   csharp/src/Google.Protobuf.Test/SampleMessages.cs                          \
-  csharp/src/Google.Protobuf.Test/SampleNaNs.cs                              \
   csharp/src/Google.Protobuf.Test/TestCornerCases.cs                         \
-  csharp/src/Google.Protobuf.Test/TestProtos/ForeignMessagePartial.cs        \
   csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs            \
-  csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs           \
-  csharp/src/Google.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs  \
   csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs         \
   csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs   \
   csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs               \
@@ -118,28 +108,24 @@
   csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs       \
   csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs                  \
   csharp/src/Google.Protobuf.Test/WellKnownTypes/DurationTest.cs             \
-  csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs            \
   csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs            \
   csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs             \
-  csharp/src/Google.Protobuf.Test/UnknownFieldSetTest.cs                     \
+  csharp/src/Google.Protobuf.Test/packages.config                            \
   csharp/src/Google.Protobuf.sln                                             \
   csharp/src/Google.Protobuf/ByteArray.cs                                    \
   csharp/src/Google.Protobuf/ByteString.cs                                   \
   csharp/src/Google.Protobuf/CodedInputStream.cs                             \
   csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs                \
   csharp/src/Google.Protobuf/CodedOutputStream.cs                            \
-  csharp/src/Google.Protobuf/Collections/Lists.cs                            \
   csharp/src/Google.Protobuf/Collections/MapField.cs                         \
-  csharp/src/Google.Protobuf/Collections/ProtobufEqualityComparers.cs        \
   csharp/src/Google.Protobuf/Collections/ReadOnlyDictionary.cs               \
   csharp/src/Google.Protobuf/Collections/RepeatedField.cs                    \
   csharp/src/Google.Protobuf/Compatibility/PropertyInfoExtensions.cs         \
-  csharp/src/Google.Protobuf/Compatibility/StreamExtensions.cs               \
   csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs                 \
   csharp/src/Google.Protobuf/FieldCodec.cs                                   \
   csharp/src/Google.Protobuf/FrameworkPortability.cs                         \
   csharp/src/Google.Protobuf/Google.Protobuf.csproj                          \
-  csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs                     \
+  csharp/src/Google.Protobuf/Google.Protobuf.nuspec                          \
   csharp/src/Google.Protobuf/IDeepCloneable.cs                               \
   csharp/src/Google.Protobuf/IMessage.cs                                     \
   csharp/src/Google.Protobuf/InvalidJsonException.cs                         \
@@ -153,7 +139,6 @@
   csharp/src/Google.Protobuf/MessageParser.cs                                \
   csharp/src/Google.Protobuf/ProtoPreconditions.cs                           \
   csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs                      \
-  csharp/src/Google.Protobuf/Reflection/CustomOptions.cs                     \
   csharp/src/Google.Protobuf/Reflection/Descriptor.cs                        \
   csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs                    \
   csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs                    \
@@ -188,7 +173,6 @@
   csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs               \
   csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs                         \
   csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs                     \
-  csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs              \
   csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs                 \
   csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs                        \
   csharp/src/Google.Protobuf/WellKnownTypes/TimeExtensions.cs                \
@@ -199,8 +183,8 @@
   csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs                      \
   csharp/src/Google.Protobuf/WellKnownTypes/WrappersPartial.cs               \
   csharp/src/Google.Protobuf/WireFormat.cs                                   \
-  csharp/src/Google.Protobuf/UnknownField.cs                                 \
-  csharp/src/Google.Protobuf/UnknownFieldSet.cs
+  csharp/src/Google.Protobuf/packages.config                                 \
+  csharp/src/packages/repositories.config
 
 java_EXTRA_DIST=                                                                   \
   java/README.md                                                                   \
@@ -219,25 +203,20 @@
   java/core/src/main/java/com/google/protobuf/ByteString.java                      \
   java/core/src/main/java/com/google/protobuf/CodedInputStream.java                \
   java/core/src/main/java/com/google/protobuf/CodedOutputStream.java               \
-  java/core/src/main/java/com/google/protobuf/DiscardUnknownFieldsParser.java      \
   java/core/src/main/java/com/google/protobuf/Descriptors.java                     \
   java/core/src/main/java/com/google/protobuf/DoubleArrayList.java                 \
   java/core/src/main/java/com/google/protobuf/DynamicMessage.java                  \
-  java/core/src/main/java/com/google/protobuf/ExperimentalApi.java                 \
   java/core/src/main/java/com/google/protobuf/Extension.java                       \
   java/core/src/main/java/com/google/protobuf/ExtensionLite.java                   \
   java/core/src/main/java/com/google/protobuf/ExtensionRegistry.java               \
-  java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java        \
   java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java           \
   java/core/src/main/java/com/google/protobuf/FieldSet.java                        \
   java/core/src/main/java/com/google/protobuf/FloatArrayList.java                  \
   java/core/src/main/java/com/google/protobuf/GeneratedMessage.java                \
   java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java            \
-  java/core/src/main/java/com/google/protobuf/GeneratedMessageV3.java              \
   java/core/src/main/java/com/google/protobuf/IntArrayList.java                    \
   java/core/src/main/java/com/google/protobuf/Internal.java                        \
   java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java  \
-  java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java   \
   java/core/src/main/java/com/google/protobuf/LazyField.java                       \
   java/core/src/main/java/com/google/protobuf/LazyFieldLite.java                   \
   java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java             \
@@ -256,12 +235,10 @@
   java/core/src/main/java/com/google/protobuf/MutabilityOracle.java                \
   java/core/src/main/java/com/google/protobuf/NioByteString.java                   \
   java/core/src/main/java/com/google/protobuf/Parser.java                          \
-  java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java    \
   java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java               \
   java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java             \
   java/core/src/main/java/com/google/protobuf/ProtocolStringList.java              \
   java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilder.java            \
-  java/core/src/main/java/com/google/protobuf/RepeatedFieldBuilderV3.java          \
   java/core/src/main/java/com/google/protobuf/RopeByteString.java                  \
   java/core/src/main/java/com/google/protobuf/RpcCallback.java                     \
   java/core/src/main/java/com/google/protobuf/RpcChannel.java                      \
@@ -270,7 +247,6 @@
   java/core/src/main/java/com/google/protobuf/Service.java                         \
   java/core/src/main/java/com/google/protobuf/ServiceException.java                \
   java/core/src/main/java/com/google/protobuf/SingleFieldBuilder.java              \
-  java/core/src/main/java/com/google/protobuf/SingleFieldBuilderV3.java            \
   java/core/src/main/java/com/google/protobuf/SmallSortedMap.java                  \
   java/core/src/main/java/com/google/protobuf/TextFormat.java                      \
   java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java               \
@@ -281,7 +257,6 @@
   java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java             \
   java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java      \
   java/core/src/main/java/com/google/protobuf/UnsafeByteOperations.java            \
-  java/core/src/main/java/com/google/protobuf/UnsafeUtil.java                      \
   java/core/src/main/java/com/google/protobuf/Utf8.java                            \
   java/core/src/main/java/com/google/protobuf/WireFormat.java                      \
   java/core/src/test/java/com/google/protobuf/AbstractMessageTest.java             \
@@ -295,11 +270,9 @@
   java/core/src/test/java/com/google/protobuf/CodedOutputStreamTest.java           \
   java/core/src/test/java/com/google/protobuf/DeprecatedFieldTest.java             \
   java/core/src/test/java/com/google/protobuf/DescriptorsTest.java                 \
-  java/core/src/test/java/com/google/protobuf/DiscardUnknownFieldsTest.java        \
   java/core/src/test/java/com/google/protobuf/DoubleArrayListTest.java             \
   java/core/src/test/java/com/google/protobuf/DynamicMessageTest.java              \
   java/core/src/test/java/com/google/protobuf/EnumTest.java                        \
-  java/core/src/test/java/com/google/protobuf/ExtensionRegistryFactoryTest.java    \
   java/core/src/test/java/com/google/protobuf/FieldPresenceTest.java               \
   java/core/src/test/java/com/google/protobuf/FloatArrayListTest.java              \
   java/core/src/test/java/com/google/protobuf/ForceFieldBuildersPreRun.java        \
@@ -322,19 +295,16 @@
   java/core/src/test/java/com/google/protobuf/MessageTest.java                     \
   java/core/src/test/java/com/google/protobuf/NestedBuildersTest.java              \
   java/core/src/test/java/com/google/protobuf/NioByteStringTest.java               \
-  java/core/src/test/java/com/google/protobuf/ParseExceptionsTest.java             \
   java/core/src/test/java/com/google/protobuf/ParserTest.java                      \
   java/core/src/test/java/com/google/protobuf/ProtobufArrayListTest.java           \
-  java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderV3Test.java      \
+  java/core/src/test/java/com/google/protobuf/RepeatedFieldBuilderTest.java        \
   java/core/src/test/java/com/google/protobuf/RopeByteStringSubstringTest.java     \
   java/core/src/test/java/com/google/protobuf/RopeByteStringTest.java              \
   java/core/src/test/java/com/google/protobuf/ServiceTest.java                     \
-  java/core/src/test/java/com/google/protobuf/SingleFieldBuilderV3Test.java        \
+  java/core/src/test/java/com/google/protobuf/SingleFieldBuilderTest.java          \
   java/core/src/test/java/com/google/protobuf/SmallSortedMapTest.java              \
   java/core/src/test/java/com/google/protobuf/TestBadIdentifiers.java              \
-  java/core/src/test/java/com/google/protobuf/TestBadIdentifiersLite.java          \
   java/core/src/test/java/com/google/protobuf/TestUtil.java                        \
-  java/core/src/test/java/com/google/protobuf/TestUtilLite.java                    \
   java/core/src/test/java/com/google/protobuf/TextFormatParseInfoTreeTest.java     \
   java/core/src/test/java/com/google/protobuf/TextFormatParseLocationTest.java     \
   java/core/src/test/java/com/google/protobuf/TextFormatTest.java                  \
@@ -345,7 +315,6 @@
   java/core/src/test/java/com/google/protobuf/WellKnownTypesTest.java              \
   java/core/src/test/java/com/google/protobuf/WireFormatTest.java                  \
   java/core/src/test/proto/com/google/protobuf/any_test.proto                      \
-  java/core/src/test/proto/com/google/protobuf/deprecated_file.proto               \
   java/core/src/test/proto/com/google/protobuf/field_presence_test.proto           \
   java/core/src/test/proto/com/google/protobuf/lazy_fields_lite.proto              \
   java/core/src/test/proto/com/google/protobuf/lite_equals_and_hash.proto          \
@@ -367,17 +336,13 @@
   java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto          \
   java/core/src/test/proto/com/google/protobuf/test_custom_options.proto           \
   java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto         \
-  java/lite/generate-sources-build.xml                                             \
-  java/lite/generate-test-sources-build.xml                                        \
   java/lite/pom.xml                                                                \
   java/pom.xml                                                                     \
   java/util/pom.xml                                                                \
-  java/util/src/main/java/com/google/protobuf/util/Durations.java                  \
   java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java              \
   java/util/src/main/java/com/google/protobuf/util/FieldMaskUtil.java              \
   java/util/src/main/java/com/google/protobuf/util/JsonFormat.java                 \
   java/util/src/main/java/com/google/protobuf/util/TimeUtil.java                   \
-  java/util/src/main/java/com/google/protobuf/util/Timestamps.java                 \
   java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java          \
   java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java          \
   java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java             \
@@ -496,6 +461,8 @@
   objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj                   \
   objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \
   objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings \
+  objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcbaselines/8BBEA4A5147C727100C4ADB7.xcbaseline/FFE465CA-0E74-40E8-9F09-500B66B7DCB2.plist \
+  objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcbaselines/8BBEA4A5147C727100C4ADB7.xcbaseline/Info.plist \
   objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \
   objectivec/ProtocolBuffers_iOS.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \
   objectivec/ProtocolBuffers_OSX.xcodeproj/project.pbxproj                   \
@@ -504,33 +471,6 @@
   objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/PerformanceTests.xcscheme \
   objectivec/ProtocolBuffers_OSX.xcodeproj/xcshareddata/xcschemes/ProtocolBuffers.xcscheme \
   objectivec/README.md                                                       \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/project.pbxproj \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/project.xcworkspace/contents.xcworkspacedata \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester.xcodeproj/xcshareddata/xcschemes/OSXCocoaPodsTester.xcscheme \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/AppDelegate.h \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/AppDelegate.m \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Assets.xcassets/AppIcon.appiconset/Contents.json \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Base.lproj/MainMenu.xib \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/Info.plist \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/OSXCocoaPodsTester/main.m    \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/Podfile-framework            \
-  objectivec/Tests/CocoaPods/OSXCocoaPodsTester/Podfile-static               \
-  objectivec/Tests/CocoaPods/README.md                                       \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-framework            \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/Podfile-static               \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/project.pbxproj \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/project.xcworkspace/contents.xcworkspacedata \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester.xcodeproj/xcshareddata/xcschemes/iOSCocoaPodsTester.xcscheme \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/AppDelegate.h \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/AppDelegate.m \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Assets.xcassets/AppIcon.appiconset/Contents.json \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Base.lproj/LaunchScreen.storyboard \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Base.lproj/Main.storyboard \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/Info.plist \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/ViewController.h \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/ViewController.m \
-  objectivec/Tests/CocoaPods/iOSCocoaPodsTester/iOSCocoaPodsTester/main.m    \
-  objectivec/Tests/CocoaPods/run_tests.sh                                    \
   objectivec/Tests/golden_message                                            \
   objectivec/Tests/golden_packed_fields_message                              \
   objectivec/Tests/GPBARCUnittestProtos.m                                    \
@@ -545,9 +485,7 @@
   objectivec/Tests/GPBDictionaryTests+String.m                               \
   objectivec/Tests/GPBDictionaryTests+UInt32.m                               \
   objectivec/Tests/GPBDictionaryTests+UInt64.m                               \
-  objectivec/Tests/GPBDictionaryTests.m                                      \
   objectivec/Tests/GPBDictionaryTests.pddm                                   \
-  objectivec/Tests/GPBExtensionRegistryTest.m                                \
   objectivec/Tests/GPBMessageTests+Merge.m                                   \
   objectivec/Tests/GPBMessageTests+Runtime.m                                 \
   objectivec/Tests/GPBMessageTests+Serialization.m                           \
@@ -558,7 +496,6 @@
   objectivec/Tests/GPBTestUtilities.h                                        \
   objectivec/Tests/GPBTestUtilities.m                                        \
   objectivec/Tests/GPBUnittestProtos.m                                       \
-  objectivec/Tests/GPBUnittestProtos2.m                                      \
   objectivec/Tests/GPBUnknownFieldSetTest.m                                  \
   objectivec/Tests/GPBUtilitiesTests.m                                       \
   objectivec/Tests/GPBWellKnownTypesTest.m                                   \
@@ -580,15 +517,6 @@
   objectivec/Tests/text_format_map_unittest_data.txt                          \
   objectivec/Tests/text_format_unittest_data.txt                              \
   objectivec/Tests/unittest_cycle.proto                                       \
-  objectivec/Tests/unittest_deprecated.proto                                  \
-  objectivec/Tests/unittest_deprecated_file.proto                             \
-  objectivec/Tests/unittest_extension_chain_a.proto                           \
-  objectivec/Tests/unittest_extension_chain_b.proto                           \
-  objectivec/Tests/unittest_extension_chain_c.proto                           \
-  objectivec/Tests/unittest_extension_chain_d.proto                           \
-  objectivec/Tests/unittest_extension_chain_e.proto                           \
-  objectivec/Tests/unittest_extension_chain_f.proto                           \
-  objectivec/Tests/unittest_extension_chain_g.proto                           \
   objectivec/Tests/unittest_objc.proto                                        \
   objectivec/Tests/unittest_objc_startup.proto                                \
   objectivec/Tests/unittest_runtime_proto2.proto                              \
@@ -597,172 +525,6 @@
   objectivec/Tests/UnitTests-Info.plist                                       \
   Protobuf.podspec
 
-php_EXTRA_DIST=                                                       \
-  composer.json                                                       \
-  php/README.md                                                       \
-  php/composer.json                                                   \
-  php/ext/google/protobuf/array.c                                     \
-  php/ext/google/protobuf/config.m4                                   \
-  php/ext/google/protobuf/def.c                                       \
-  php/ext/google/protobuf/encode_decode.c                             \
-  php/ext/google/protobuf/map.c                                       \
-  php/ext/google/protobuf/message.c                                   \
-  php/ext/google/protobuf/package.xml                                 \
-  php/ext/google/protobuf/protobuf.c                                  \
-  php/ext/google/protobuf/protobuf.h                                  \
-  php/ext/google/protobuf/storage.c                                   \
-  php/ext/google/protobuf/type_check.c                                \
-  php/ext/google/protobuf/upb.c                                       \
-  php/ext/google/protobuf/upb.h                                       \
-  php/ext/google/protobuf/utf8.c                                      \
-  php/ext/google/protobuf/utf8.h                                      \
-  php/generate_descriptor_protos.sh                                   \
-  php/phpunit.xml                                                     \
-  php/src/GPBMetadata/Google/Protobuf/Any.php                         \
-  php/src/GPBMetadata/Google/Protobuf/Api.php                         \
-  php/src/GPBMetadata/Google/Protobuf/Duration.php                    \
-  php/src/GPBMetadata/Google/Protobuf/FieldMask.php                   \
-  php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php                    \
-  php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php         \
-  php/src/GPBMetadata/Google/Protobuf/SourceContext.php               \
-  php/src/GPBMetadata/Google/Protobuf/Struct.php                      \
-  php/src/GPBMetadata/Google/Protobuf/Timestamp.php                   \
-  php/src/GPBMetadata/Google/Protobuf/Type.php                        \
-  php/src/GPBMetadata/Google/Protobuf/Wrappers.php                    \
-  php/src/Google/Protobuf/Any.php                                     \
-  php/src/Google/Protobuf/Api.php                                     \
-  php/src/Google/Protobuf/BoolValue.php                               \
-  php/src/Google/Protobuf/BytesValue.php                              \
-  php/src/Google/Protobuf/Descriptor.php                              \
-  php/src/Google/Protobuf/DescriptorPool.php                          \
-  php/src/Google/Protobuf/DoubleValue.php                             \
-  php/src/Google/Protobuf/Duration.php                                \
-  php/src/Google/Protobuf/Enum.php                                    \
-  php/src/Google/Protobuf/EnumDescriptor.php                          \
-  php/src/Google/Protobuf/EnumValue.php                               \
-  php/src/Google/Protobuf/EnumValueDescriptor.php                     \
-  php/src/Google/Protobuf/Field.php                                   \
-  php/src/Google/Protobuf/FieldDescriptor.php                         \
-  php/src/Google/Protobuf/FieldMask.php                               \
-  php/src/Google/Protobuf/Field_Cardinality.php                       \
-  php/src/Google/Protobuf/Field_Kind.php                              \
-  php/src/Google/Protobuf/FloatValue.php                              \
-  php/src/Google/Protobuf/GPBEmpty.php                                \
-  php/src/Google/Protobuf/Int32Value.php                              \
-  php/src/Google/Protobuf/Int64Value.php                              \
-  php/src/Google/Protobuf/Internal/CodedInputStream.php               \
-  php/src/Google/Protobuf/Internal/CodedOutputStream.php              \
-  php/src/Google/Protobuf/Internal/Descriptor.php                     \
-  php/src/Google/Protobuf/Internal/DescriptorPool.php                 \
-  php/src/Google/Protobuf/Internal/DescriptorProto.php                \
-  php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \
-  php/src/Google/Protobuf/Internal/DescriptorProto_ReservedRange.php  \
-  php/src/Google/Protobuf/Internal/EnumBuilderContext.php             \
-  php/src/Google/Protobuf/Internal/EnumDescriptor.php                 \
-  php/src/Google/Protobuf/Internal/EnumDescriptorProto.php            \
-  php/src/Google/Protobuf/Internal/EnumDescriptorProto_EnumReservedRange.php \
-  php/src/Google/Protobuf/Internal/EnumOptions.php                    \
-  php/src/Google/Protobuf/Internal/EnumValueDescriptorProto.php       \
-  php/src/Google/Protobuf/Internal/EnumValueOptions.php               \
-  php/src/Google/Protobuf/Internal/ExtensionRangeOptions.php          \
-  php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php     \
-  php/src/Google/Protobuf/Internal/FieldDescriptorProto.php           \
-  php/src/Google/Protobuf/Internal/FieldDescriptor.php                \
-  php/src/Google/Protobuf/Internal/FieldDescriptorProto.php           \
-  php/src/Google/Protobuf/Internal/FieldDescriptorProto_Label.php     \
-  php/src/Google/Protobuf/Internal/FieldDescriptorProto_Type.php      \
-  php/src/Google/Protobuf/Internal/FieldOptions.php                   \
-  php/src/Google/Protobuf/Internal/FieldOptions_CType.php             \
-  php/src/Google/Protobuf/Internal/FieldOptions_JSType.php            \
-  php/src/Google/Protobuf/Internal/FileDescriptor.php                 \
-  php/src/Google/Protobuf/Internal/FileDescriptorProto.php            \
-  php/src/Google/Protobuf/Internal/FileDescriptorSet.php              \
-  php/src/Google/Protobuf/Internal/FileOptions.php                    \
-  php/src/Google/Protobuf/Internal/FileOptions_OptimizeMode.php       \
-  php/src/Google/Protobuf/Internal/GPBDecodeException.php             \
-  php/src/Google/Protobuf/Internal/GPBJsonWire.php                    \
-  php/src/Google/Protobuf/Internal/GPBLabel.php                       \
-  php/src/Google/Protobuf/Internal/GPBType.php                        \
-  php/src/Google/Protobuf/Internal/GPBUtil.php                        \
-  php/src/Google/Protobuf/Internal/GPBWire.php                        \
-  php/src/Google/Protobuf/Internal/GPBWireType.php                    \
-  php/src/Google/Protobuf/Internal/GeneratedCodeInfo.php              \
-  php/src/Google/Protobuf/Internal/GeneratedCodeInfo_Annotation.php   \
-  php/src/Google/Protobuf/Internal/GetPublicDescriptorTrait.php       \
-  php/src/Google/Protobuf/Internal/HasPublicDescriptorTrait.php       \
-  php/src/Google/Protobuf/Internal/MapEntry.php                       \
-  php/src/Google/Protobuf/Internal/MapField.php                       \
-  php/src/Google/Protobuf/Internal/MapFieldIter.php                   \
-  php/src/Google/Protobuf/Internal/Message.php                        \
-  php/src/Google/Protobuf/Internal/MessageBuilderContext.php          \
-  php/src/Google/Protobuf/Internal/MessageOptions.php                 \
-  php/src/Google/Protobuf/Internal/MethodDescriptorProto.php          \
-  php/src/Google/Protobuf/Internal/MethodOptions.php                  \
-  php/src/Google/Protobuf/Internal/MethodOptions_IdempotencyLevel.php \
-  php/src/Google/Protobuf/Internal/OneofDescriptor.php                \
-  php/src/Google/Protobuf/Internal/OneofDescriptorProto.php           \
-  php/src/Google/Protobuf/Internal/OneofField.php                     \
-  php/src/Google/Protobuf/Internal/OneofOptions.php                   \
-  php/src/Google/Protobuf/Internal/RawInputStream.php                 \
-  php/src/Google/Protobuf/Internal/RepeatedField.php                  \
-  php/src/Google/Protobuf/Internal/RepeatedFieldIter.php              \
-  php/src/Google/Protobuf/Internal/ServiceDescriptorProto.php         \
-  php/src/Google/Protobuf/Internal/ServiceOptions.php                 \
-  php/src/Google/Protobuf/Internal/SourceCodeInfo.php                 \
-  php/src/Google/Protobuf/Internal/SourceCodeInfo_Location.php        \
-  php/src/Google/Protobuf/Internal/UninterpretedOption.php            \
-  php/src/Google/Protobuf/Internal/UninterpretedOption_NamePart.php   \
-  php/src/Google/Protobuf/ListValue.php                               \
-  php/src/Google/Protobuf/Method.php                                  \
-  php/src/Google/Protobuf/Mixin.php                                   \
-  php/src/Google/Protobuf/NullValue.php                               \
-  php/src/Google/Protobuf/OneofDescriptor.php                         \
-  php/src/Google/Protobuf/Option.php                                  \
-  php/src/Google/Protobuf/SourceContext.php                           \
-  php/src/Google/Protobuf/StringValue.php                             \
-  php/src/Google/Protobuf/Struct.php                                  \
-  php/src/Google/Protobuf/Syntax.php                                  \
-  php/src/Google/Protobuf/Timestamp.php                               \
-  php/src/Google/Protobuf/Type.php                                    \
-  php/src/Google/Protobuf/UInt32Value.php                             \
-  php/src/Google/Protobuf/UInt64Value.php                             \
-  php/src/Google/Protobuf/Value.php                                   \
-  php/src/phpdoc.dist.xml                                             \
-  php/tests/array_test.php                                            \
-  php/tests/autoload.php                                              \
-  php/tests/bootstrap_phpunit.php                                     \
-  php/tests/compatibility_test.sh                                     \
-  php/tests/descriptors_test.php                                      \
-  php/tests/encode_decode_test.php                                    \
-  php/tests/gdb_test.sh                                               \
-  php/tests/generated_class_test.php                                  \
-  php/tests/generated_phpdoc_test.php                                 \
-  php/tests/generated_service_test.php                                \
-  php/tests/map_field_test.php                                        \
-  php/tests/memory_leak_test.php                                      \
-  php/tests/php_implementation_test.php                               \
-  php/tests/proto/test.proto                                          \
-  php/tests/proto/test_descriptors.proto                              \
-  php/tests/proto/test_empty_php_namespace.proto                      \
-  php/tests/proto/test_import_descriptor_proto.proto                  \
-  php/tests/proto/test_include.proto                                  \
-  php/tests/proto/test_no_namespace.proto                             \
-  php/tests/proto/test_php_namespace.proto                            \
-  php/tests/proto/test_prefix.proto                                   \
-  php/tests/proto/test_reserved_enum_lower.proto                      \
-  php/tests/proto/test_reserved_enum_upper.proto                      \
-  php/tests/proto/test_reserved_enum_value_lower.proto                \
-  php/tests/proto/test_reserved_enum_value_upper.proto                \
-  php/tests/proto/test_reserved_message_lower.proto                   \
-  php/tests/proto/test_reserved_message_upper.proto                   \
-  php/tests/proto/test_service.proto                                  \
-  php/tests/proto/test_service_namespace.proto                        \
-  php/tests/test.sh                                                   \
-  php/tests/test_base.php                                             \
-  php/tests/test_util.php                                             \
-  php/tests/undefined_test.php                                        \
-  php/tests/well_known_test.php
-
 python_EXTRA_DIST=                                                           \
   python/MANIFEST.in                                                         \
   python/google/__init__.py                                                  \
@@ -787,7 +549,6 @@
   python/google/protobuf/internal/enum_type_wrapper.py                       \
   python/google/protobuf/internal/factory_test1.proto                        \
   python/google/protobuf/internal/factory_test2.proto                        \
-  python/google/protobuf/internal/file_options_test.proto                    \
   python/google/protobuf/internal/generator_test.py                          \
   python/google/protobuf/internal/import_test_package/__init__.py            \
   python/google/protobuf/internal/import_test_package/inner.proto            \
@@ -804,13 +565,11 @@
   python/google/protobuf/internal/packed_field_test.proto                    \
   python/google/protobuf/internal/proto_builder_test.py                      \
   python/google/protobuf/internal/python_message.py                          \
-  python/google/protobuf/internal/python_protobuf.cc                         \
   python/google/protobuf/internal/reflection_test.py                         \
   python/google/protobuf/internal/service_reflection_test.py                 \
   python/google/protobuf/internal/symbol_database_test.py                    \
   python/google/protobuf/internal/test_bad_identifiers.proto                 \
   python/google/protobuf/internal/test_util.py                               \
-  python/google/protobuf/internal/testing_refleaks.py                        \
   python/google/protobuf/internal/text_encoding_test.py                      \
   python/google/protobuf/internal/text_format_test.py                        \
   python/google/protobuf/internal/type_checkers.py                           \
@@ -824,7 +583,6 @@
   python/google/protobuf/json_format.py                                      \
   python/google/protobuf/message.py                                          \
   python/google/protobuf/message_factory.py                                  \
-  python/google/protobuf/python_protobuf.h                                   \
   python/google/protobuf/proto_builder.py                                    \
   python/google/protobuf/pyext/README                                        \
   python/google/protobuf/pyext/__init__.py                                   \
@@ -843,16 +601,13 @@
   python/google/protobuf/pyext/map_container.h                               \
   python/google/protobuf/pyext/message.cc                                    \
   python/google/protobuf/pyext/message.h                                     \
-  python/google/protobuf/pyext/message_factory.cc                            \
-  python/google/protobuf/pyext/message_factory.h                             \
-  python/google/protobuf/pyext/message_module.cc                             \
   python/google/protobuf/pyext/proto2_api_test.proto                         \
   python/google/protobuf/pyext/python.proto                                  \
+  python/google/protobuf/pyext/python_protobuf.h                             \
   python/google/protobuf/pyext/repeated_composite_container.cc               \
   python/google/protobuf/pyext/repeated_composite_container.h                \
   python/google/protobuf/pyext/repeated_scalar_container.cc                  \
   python/google/protobuf/pyext/repeated_scalar_container.h                   \
-  python/google/protobuf/pyext/safe_numerics.h                               \
   python/google/protobuf/pyext/scoped_pyobject_ptr.h                         \
   python/google/protobuf/reflection.py                                       \
   python/google/protobuf/service.py                                          \
@@ -860,9 +615,7 @@
   python/google/protobuf/symbol_database.py                                  \
   python/google/protobuf/text_encoding.py                                    \
   python/google/protobuf/text_format.py                                      \
-  python/release.sh                                                          \
   python/mox.py                                                              \
-  python/setup.cfg                                                           \
   python/setup.py                                                            \
   python/stubout.py                                                          \
   python/tox.ini                                                             \
@@ -870,18 +623,10 @@
 
 ruby_EXTRA_DIST=                                                             \
   ruby/Gemfile                                                               \
+  ruby/Gemfile.lock                                                          \
   ruby/.gitignore                                                            \
   ruby/README.md                                                             \
   ruby/Rakefile                                                              \
-  ruby/compatibility_tests/v3.0.0/tests/test_import.proto                    \
-  ruby/compatibility_tests/v3.0.0/tests/stress.rb                            \
-  ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb               \
-  ruby/compatibility_tests/v3.0.0/tests/generated_code_test.rb               \
-  ruby/compatibility_tests/v3.0.0/tests/generated_code.proto                 \
-  ruby/compatibility_tests/v3.0.0/tests/basic.rb                             \
-  ruby/compatibility_tests/v3.0.0/test.sh                                    \
-  ruby/compatibility_tests/v3.0.0/Rakefile                                   \
-  ruby/compatibility_tests/v3.0.0/README.md                                  \
   ruby/ext/google/protobuf_c/defs.c                                          \
   ruby/ext/google/protobuf_c/encode_decode.c                                 \
   ruby/ext/google/protobuf_c/extconf.rb                                      \
@@ -893,11 +638,9 @@
   ruby/ext/google/protobuf_c/storage.c                                       \
   ruby/ext/google/protobuf_c/upb.c                                           \
   ruby/ext/google/protobuf_c/upb.h                                           \
-  ruby/ext/google/protobuf_c/wrap_memcpy.c                                   \
   ruby/google-protobuf.gemspec                                               \
   ruby/lib/google/protobuf/message_exts.rb                                   \
   ruby/lib/google/protobuf/repeated_field.rb                                 \
-  ruby/lib/google/protobuf/well_known_types.rb                               \
   ruby/lib/google/protobuf.rb                                                \
   ruby/pom.xml                                                               \
   ruby/src/main/java/com/google/protobuf/jruby/RubyBuilder.java              \
@@ -919,114 +662,47 @@
   ruby/src/main/java/google/ProtobufJavaService.java                         \
   ruby/src/main/sentinel.proto                                               \
   ruby/tests/basic.rb                                                        \
-  ruby/tests/encode_decode_test.rb                                           \
-  ruby/tests/gc_test.rb                                                      \
   ruby/tests/repeated_field_test.rb                                          \
   ruby/tests/stress.rb                                                       \
   ruby/tests/generated_code.proto                                            \
-  ruby/tests/test_import.proto                                               \
   ruby/tests/generated_code_test.rb                                          \
-  ruby/tests/well_known_types_test.rb                                        \
   ruby/travis-test.sh
 
-js_EXTRA_DIST=                                                         \
-  js/README.md                                                         \
-  js/binary/arith.js                                                   \
-  js/binary/arith_test.js                                              \
-  js/binary/constants.js                                               \
-  js/binary/decoder.js                                                 \
-  js/binary/decoder_test.js                                            \
-  js/binary/encoder.js                                                 \
-  js/binary/message_test.js                                            \
-  js/binary/proto_test.js                                              \
-  js/binary/reader.js                                                  \
-  js/binary/reader_test.js                                             \
-  js/binary/utils.js                                                   \
-  js/binary/utils_test.js                                              \
-  js/binary/writer.js                                                  \
-  js/binary/writer_test.js                                             \
-  js/commonjs/export.js                                                \
-  js/commonjs/export_asserts.js                                        \
-  js/commonjs/export_testdeps.js                                       \
-  js/commonjs/import_test.js                                           \
-  js/commonjs/jasmine.json                                             \
-  js/commonjs/rewrite_tests_for_commonjs.js                            \
-  js/commonjs/test6/test6.proto                                        \
-  js/commonjs/test7/test7.proto                                        \
-  js/compatibility_tests/v3.0.0/binary/arith_test.js                   \
-  js/compatibility_tests/v3.0.0/binary/decoder_test.js                 \
-  js/compatibility_tests/v3.0.0/binary/proto_test.js                   \
-  js/compatibility_tests/v3.0.0/binary/reader_test.js                  \
-  js/compatibility_tests/v3.0.0/binary/utils_test.js                   \
-  js/compatibility_tests/v3.0.0/binary/writer_test.js                  \
-  js/compatibility_tests/v3.0.0/commonjs/export_asserts.js             \
-  js/compatibility_tests/v3.0.0/commonjs/export_testdeps.js            \
-  js/compatibility_tests/v3.0.0/commonjs/import_test.js                \
-  js/compatibility_tests/v3.0.0/commonjs/jasmine.json                  \
-  js/compatibility_tests/v3.0.0/commonjs/rewrite_tests_for_commonjs.js \
-  js/compatibility_tests/v3.0.0/commonjs/test6/test6.proto             \
-  js/compatibility_tests/v3.0.0/commonjs/test7/test7.proto             \
-  js/compatibility_tests/v3.0.0/data.proto                             \
-  js/compatibility_tests/v3.0.0/debug_test.js                          \
-  js/compatibility_tests/v3.0.0/jasmine1.json                          \
-  js/compatibility_tests/v3.0.0/jasmine2.json                          \
-  js/compatibility_tests/v3.0.0/jasmine3.json                          \
-  js/compatibility_tests/v3.0.0/message_test.js                        \
-  js/compatibility_tests/v3.0.0/proto3_test.js                         \
-  js/compatibility_tests/v3.0.0/proto3_test.proto                      \
-  js/compatibility_tests/v3.0.0/test2.proto                            \
-  js/compatibility_tests/v3.0.0/test3.proto                            \
-  js/compatibility_tests/v3.0.0/test4.proto                            \
-  js/compatibility_tests/v3.0.0/test5.proto                            \
-  js/compatibility_tests/v3.0.0/testbinary.proto                       \
-  js/compatibility_tests/v3.0.0/testempty.proto                        \
-  js/compatibility_tests/v3.0.0/test.proto                             \
-  js/compatibility_tests/v3.0.0/test.sh                                \
-  js/compatibility_tests/v3.1.0/testempty.proto                        \
-  js/compatibility_tests/v3.1.0/testbinary.proto                       \
-  js/compatibility_tests/v3.1.0/test5.proto                            \
-  js/compatibility_tests/v3.1.0/test4.proto                            \
-  js/compatibility_tests/v3.1.0/test3.proto                            \
-  js/compatibility_tests/v3.1.0/test2.proto                            \
-  js/compatibility_tests/v3.1.0/test.proto                             \
-  js/compatibility_tests/v3.1.0/proto3_test.proto                      \
-  js/compatibility_tests/v3.1.0/proto3_test.js                         \
-  js/compatibility_tests/v3.1.0/message_test.js                        \
-  js/compatibility_tests/v3.1.0/maps_test.js                           \
-  js/compatibility_tests/v3.1.0/debug_test.js                          \
-  js/compatibility_tests/v3.1.0/data.proto                             \
-  js/compatibility_tests/v3.1.0/commonjs/test7/test7.proto             \
-  js/compatibility_tests/v3.1.0/commonjs/test6/test6.proto             \
-  js/compatibility_tests/v3.1.0/binary/writer_test.js                  \
-  js/compatibility_tests/v3.1.0/binary/utils_test.js                   \
-  js/compatibility_tests/v3.1.0/binary/reader_test.js                  \
-  js/compatibility_tests/v3.1.0/binary/proto_test.js                   \
-  js/compatibility_tests/v3.1.0/binary/decoder_test.js                 \
-  js/compatibility_tests/v3.1.0/binary/arith_test.js                   \
-  js/data.proto                                                        \
-  js/debug.js                                                          \
-  js/debug_test.js                                                     \
-  js/gulpfile.js                                                       \
-  js/jasmine.json                                                      \
-  js/map.js                                                            \
-  js/maps_test.js                                                      \
-  js/message.js                                                        \
-  js/message_test.js                                                   \
-  js/node_loader.js                                                    \
-  js/package.json                                                      \
-  js/proto3_test.js                                                    \
-  js/proto3_test.proto                                                 \
-  js/test.proto                                                        \
-  js/test2.proto                                                       \
-  js/test3.proto                                                       \
-  js/test4.proto                                                       \
-  js/test5.proto                                                       \
-  js/test8.proto                                                       \
-  js/test_bootstrap.js                                                 \
-  js/testbinary.proto                                                  \
+js_EXTRA_DIST=              \
+  js/README.md              \
+  js/binary/arith.js        \
+  js/binary/arith_test.js   \
+  js/binary/constants.js    \
+  js/binary/decoder.js      \
+  js/binary/decoder_test.js \
+  js/binary/proto_test.js   \
+  js/binary/reader.js       \
+  js/binary/reader_test.js  \
+  js/binary/utils.js        \
+  js/binary/utils_test.js   \
+  js/binary/writer.js       \
+  js/binary/writer_test.js  \
+  js/data.proto             \
+  js/debug.js               \
+  js/debug_test.js          \
+  js/gulpfile.js            \
+  js/jasmine.json           \
+  js/message.js             \
+  js/message_test.js        \
+  js/node_loader.js         \
+  js/package.json           \
+  js/proto3_test.js         \
+  js/proto3_test.proto      \
+  js/test.proto             \
+  js/test2.proto            \
+  js/test3.proto            \
+  js/test4.proto            \
+  js/test5.proto            \
+  js/test_bootstrap.js      \
+  js/testbinary.proto       \
   js/testempty.proto
 
-all_EXTRA_DIST=$(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(javanano_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(php_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) $(js_EXTRA_DIST)
+all_EXTRA_DIST=$(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(javanano_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) $(js_EXTRA_DIST)
 
 EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST)   \
   autogen.sh                             \
@@ -1041,7 +717,6 @@
   WORKSPACE                              \
   cmake/CMakeLists.txt                   \
   cmake/README.md                        \
-  cmake/examples.cmake                   \
   cmake/extract_includes.bat.in          \
   cmake/install.cmake                    \
   cmake/libprotobuf.cmake                \
@@ -1049,40 +724,29 @@
   cmake/libprotoc.cmake                  \
   cmake/protobuf-config-version.cmake.in \
   cmake/protobuf-config.cmake.in         \
-  cmake/protobuf-lite.pc.cmake           \
   cmake/protobuf-module.cmake.in         \
-  cmake/protobuf-options.cmake           \
-  cmake/protobuf.pc.cmake                \
   cmake/protoc.cmake                     \
   cmake/tests.cmake                      \
   editors/README.txt                     \
   editors/proto.vim                      \
   editors/protobuf-mode.el               \
-  examples/AddPerson.java                \
-  examples/BUILD                         \
-  examples/CMakeLists.txt                \
-  examples/ListPeople.java               \
+  examples/README.txt                    \
   examples/Makefile                      \
-  examples/README.md                     \
-  examples/WORKSPACE                     \
+  examples/addressbook.proto             \
   examples/add_person.cc                 \
   examples/add_person.go                 \
-  examples/add_person.py                 \
   examples/add_person_test.go            \
-  examples/addressbook.proto             \
   examples/list_people.cc                \
   examples/list_people.go                \
+  examples/AddPerson.java                \
+  examples/ListPeople.java               \
+  examples/add_person.py                 \
   examples/list_people.py                \
   examples/list_people_test.go           \
   protobuf.bzl                           \
-  python/release/wheel/build_wheel_manylinux.sh  \
-  python/release/wheel/Dockerfile                \
-  python/release/wheel/protobuf_optimized_pip.sh \
-  python/release/wheel/README.md         \
   six.BUILD                              \
   util/python/BUILD
 
-
 # Deletes all the files generated by autogen.sh.
 MAINTAINERCLEANFILES =   \
   aclocal.m4             \
diff --git a/Protobuf.podspec b/Protobuf.podspec
index 24498a2..0bbd06d 100644
--- a/Protobuf.podspec
+++ b/Protobuf.podspec
@@ -5,12 +5,11 @@
 # dependent projects use the :git notation to refer to the library.
 Pod::Spec.new do |s|
   s.name     = 'Protobuf'
-  s.version  = '3.5.2'
+  s.version  = '3.0.0-beta-2'
   s.summary  = 'Protocol Buffers v.3 runtime library for Objective-C.'
   s.homepage = 'https://github.com/google/protobuf'
-  s.license  = '3-Clause BSD License'
+  s.license  = 'New BSD'
   s.authors  = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
-  s.cocoapods_version = '>= 1.0'
 
   s.source = { :git => 'https://github.com/google/protobuf.git',
                :tag => "v#{s.version}" }
@@ -18,25 +17,24 @@
   s.source_files = 'objectivec/*.{h,m}',
                    'objectivec/google/protobuf/Any.pbobjc.{h,m}',
                    'objectivec/google/protobuf/Api.pbobjc.{h,m}',
-                   'objectivec/google/protobuf/Duration.pbobjc.{h,m}',
+                   'objectivec/google/protobuf/Duration.pbobjc.h',
                    'objectivec/google/protobuf/Empty.pbobjc.{h,m}',
                    'objectivec/google/protobuf/FieldMask.pbobjc.{h,m}',
                    'objectivec/google/protobuf/SourceContext.pbobjc.{h,m}',
                    'objectivec/google/protobuf/Struct.pbobjc.{h,m}',
-                   'objectivec/google/protobuf/Timestamp.pbobjc.{h,m}',
+                   'objectivec/google/protobuf/Timestamp.pbobjc.h',
                    'objectivec/google/protobuf/Type.pbobjc.{h,m}',
                    'objectivec/google/protobuf/Wrappers.pbobjc.{h,m}'
+  # Timestamp.pbobjc.m and Duration.pbobjc.m are #imported by GPBWellKnownTypes.m. So we can't
+  # compile them (duplicate symbols), but we need them available for the importing:
+  s.preserve_paths = 'objectivec/google/protobuf/Duration.pbobjc.m',
+                     'objectivec/google/protobuf/Timestamp.pbobjc.m'
   # The following would cause duplicate symbol definitions. GPBProtocolBuffers is expected to be
   # left out, as it's an umbrella implementation file.
   s.exclude_files = 'objectivec/GPBProtocolBuffers.m'
+  s.header_mappings_dir = 'objectivec'
 
-  # Set a CPP symbol so the code knows to use framework imports.
-  s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
-  s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
-
-  s.ios.deployment_target = '7.0'
+  s.ios.deployment_target = '7.1'
   s.osx.deployment_target = '10.9'
-  s.tvos.deployment_target = '9.0'
-  s.watchos.deployment_target = '2.0'
   s.requires_arc = false
 end
diff --git a/README.android b/README.android
index f1e97d9..0f7d5e1 100644
--- a/README.android
+++ b/README.android
@@ -9,6 +9,7 @@
  - Initial changes include support for the micro protobuf compiler and the
    assoicated runtime.
  - https://github.com/google/protobuf/pull/2732: const FieldDescriptorCompare
+ - Add NOLINT to "return *default_instance_;" in cpp_message.cc.
 
 Protocol Buffers are a way of encoding structured data in an efficient
 yet extensible format. Google uses Protocol Buffers for almost all
diff --git a/README.md b/README.md
index 3a4e6ed..ba9c589 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 Protocol Buffers - Google's data interchange format
 ===================================================
 
-[![Build Status](https://travis-ci.org/google/protobuf.svg?branch=master)](https://travis-ci.org/google/protobuf) [![Build status](https://ci.appveyor.com/api/projects/status/73ctee6ua4w2ruin?svg=true)](https://ci.appveyor.com/project/protobuf/protobuf) [![Build Status](https://grpc-testing.appspot.com/buildStatus/icon?job=protobuf_branch)](https://grpc-testing.appspot.com/job/protobuf_branch) [![Build Status](https://grpc-testing.appspot.com/job/protobuf_branch_32/badge/icon)](https://grpc-testing.appspot.com/job/protobuf_branch_32) [![Build Status](http://ci.bazel.io/buildStatus/icon?job=protobuf)](http://ci.bazel.io/job/protobuf/)
+[![Build Status](https://travis-ci.org/google/protobuf.svg?branch=master)](https://travis-ci.org/google/protobuf) [![Build status](https://ci.appveyor.com/api/projects/status/73ctee6ua4w2ruin?svg=true)](https://ci.appveyor.com/project/protobuf/protobuf)
 
 Copyright 2008 Google Inc.
 
@@ -37,7 +37,7 @@
 If you are looking for an old version that is not available in the release
 page, check out the maven repo here:
 
-  [https://repo1.maven.org/maven2/com/google/protobuf/protoc/](https://repo1.maven.org/maven2/com/google/protobuf/protoc/)
+  [http://repo1.maven.org/maven2/com/google/protobuf/protoc/](http://repo1.maven.org/maven2/com/google/protobuf/protoc/)
 
 These pre-built binaries are only provided for released versions. If you want
 to use the github master version at HEAD, or you need to modify protobuf code,
@@ -54,35 +54,24 @@
 language, you can find instructions in the corresponding source directory about
 how to install protobuf runtime for that specific language:
 
-| Language                             | Source                                                      |
-|--------------------------------------|-------------------------------------------------------------|
-| C++ (include C++ runtime and protoc) | [src](src)                                                  |
-| Java                                 | [java](java)                                                |
-| Python                               | [python](python)                                            |
-| Objective-C                          | [objectivec](objectivec)                                    |
-| C#                                   | [csharp](csharp)                                            |
-| JavaNano                             | [javanano](javanano)                                        |
-| JavaScript                           | [js](js)                                                    |
-| Ruby                                 | [ruby](ruby)                                                |
-| Go                                   | [golang/protobuf](https://github.com/golang/protobuf)       |
-| PHP                                  | [php](php)                                                  |
-| Dart                                 | [dart-lang/protobuf](https://github.com/dart-lang/protobuf) |
+| Language                             | Source                                                |
+|--------------------------------------|-------------------------------------------------------|
+| C++ (include C++ runtime and protoc) | [src](src)                                            |
+| Java                                 | [java](java)                                          |
+| Python                               | [python](python)                                      |
+| Objective-C                          | [objectivec](objectivec)                              |
+| C#                                   | [csharp](csharp)                                      |
+| JavaNano                             | [javanano](javanano)                                  |
+| JavaScript                           | [js](js)                                              |
+| Ruby                                 | [ruby](ruby)                                          |
+| Go                                   | [golang/protobuf](https://github.com/golang/protobuf) |
+| PHP                                  | TBD                                                   |
 
-Quick Start
------------
 
-The best way to learn how to use protobuf is to follow the tutorials in our
-developer guide:
-
-https://developers.google.com/protocol-buffers/docs/tutorials
-
-If you want to learn from code examples, take a look at the examples in the
-[examples](examples) directory.
-
-Documentation
--------------
+Usage
+-----
 
 The complete documentation for Protocol Buffers is available via the
 web at:
 
-https://developers.google.com/protocol-buffers/
+    https://developers.google.com/protocol-buffers/
diff --git a/WORKSPACE b/WORKSPACE
index 1066a0e..065dc81 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,17 +1,15 @@
-workspace(name = "com_google_protobuf")
-
-new_git_repository(
-    name = "googletest",
+new_http_archive(
+    name = "gmock_archive",
+    url = "https://googlemock.googlecode.com/files/gmock-1.7.0.zip",
+    sha256 = "26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b",
     build_file = "gmock.BUILD",
-    remote = "https://github.com/google/googletest",
-    tag = "release-1.8.0",
 )
 
 new_http_archive(
     name = "six_archive",
-    build_file = "six.BUILD",
-    sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
     url = "https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55",
+    sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
+    build_file = "six.BUILD",
 )
 
 bind(
@@ -21,12 +19,12 @@
 
 bind(
     name = "gtest",
-    actual = "@googletest//:gtest",
+    actual = "@gmock_archive//:gtest",
 )
 
 bind(
     name = "gtest_main",
-    actual = "@googletest//:gtest_main",
+    actual = "@gmock_archive//:gtest_main",
 )
 
 bind(
@@ -35,8 +33,8 @@
 )
 
 maven_jar(
-    name = "guava_maven",
-    artifact = "com.google.guava:guava:18.0",
+  name = "guava_maven",
+  artifact = "com.google.guava:guava:18.0",
 )
 
 bind(
@@ -45,8 +43,8 @@
 )
 
 maven_jar(
-    name = "gson_maven",
-    artifact = "com.google.code.gson:gson:2.7",
+  name = "gson_maven",
+  artifact = "com.google.code.gson:gson:2.3",
 )
 
 bind(
diff --git a/android/config.h b/android/config.h
index 0f2d562..180a577 100644
--- a/android/config.h
+++ b/android/config.h
@@ -1,10 +1,10 @@
 /* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
-/* the name of <hash_map> */
+/* the name of <hash_set> */
 #define HASH_MAP_CLASS unordered_map
 
-/* the location of <unordered_map> or <hash_map> */
+/* the location of <hash_map> */
 #define HASH_MAP_H <unordered_map>
 
 /* the namespace of hash_map/hash_set */
@@ -13,12 +13,9 @@
 /* the name of <hash_set> */
 #define HASH_SET_CLASS unordered_set
 
-/* the location of <unordered_set> or <hash_set> */
+/* the location of <hash_set> */
 #define HASH_SET_H <unordered_set>
 
-/* define if the compiler supports basic C++11 syntax */
-#define HAVE_CXX11 1
-
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #define HAVE_DLFCN_H 1
 
@@ -28,11 +25,26 @@
 /* Define to 1 if you have the `ftruncate' function. */
 #define HAVE_FTRUNCATE 1
 
+#if defined(ANDROID)
+/*
+ * TODO: Figure out how to use stlport unordered_map and set.
+ * For some reason they don't work when I try to point the
+ * HASH_MAP_H and HASH_SET_H to the stlport files, I get
+ * compile timer errors.
+ */
+
+/* define if the compiler has hash_map */
+#undef HAVE_HASH_MAP
+
+/* define if the compiler has hash_set */
+#undef HAVE_HASH_SET
+#else
 /* define if the compiler has hash_map */
 #define HAVE_HASH_MAP 1
 
 /* define if the compiler has hash_set */
 #define HAVE_HASH_SET 1
+#endif
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
@@ -85,7 +97,8 @@
 /* Enable classes using zlib compression. */
 #define HAVE_ZLIB 1
 
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
 #define LT_OBJDIR ".libs/"
 
 /* Name of package */
@@ -98,16 +111,13 @@
 #define PACKAGE_NAME "Protocol Buffers"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "Protocol Buffers 3.5.2"
+#define PACKAGE_STRING "Protocol Buffers 2.3.0"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "protobuf"
 
-/* Define to the home page for this package. */
-#define PACKAGE_URL ""
-
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "3.5.2"
+#define PACKAGE_VERSION "2.3.0"
 
 /* Define to necessary symbol if this constant uses a non-standard name on
    your system. */
@@ -116,30 +126,20 @@
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
-/* Enable extensions on AIX 3, Interix.  */
+/* Version number of package */
+#define VERSION "2.3.0"
+
+/* Define to 1 if on AIX 3.
+   System headers sometimes define this.
+   We just want to avoid a redefinition error message.  */
 #ifndef _ALL_SOURCE
-# define _ALL_SOURCE 1
+/* # undef _ALL_SOURCE */
 #endif
+
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE 1
 #endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# define _POSIX_PTHREAD_SEMANTICS 1
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# define _TANDEM_SOURCE 1
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# define __EXTENSIONS__ 1
-#endif
-
-
-/* Version number of package */
-#define VERSION "3.5.2"
 
 /* Define to 1 if on MINIX. */
 /* #undef _MINIX */
@@ -150,3 +150,14 @@
 
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 /* #undef _POSIX_SOURCE */
+
+/* Enable extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
diff --git a/appveyor.bat b/appveyor.bat
index ca88b25..9a46b92 100644
--- a/appveyor.bat
+++ b/appveyor.bat
@@ -10,7 +10,7 @@
 echo Building C++
 mkdir build_msvc
 cd build_msvc
-cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% ../cmake
+cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% ../cmake
 msbuild protobuf.sln /p:Platform=%vcplatform% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
 cd %configuration%
 tests.exe || goto error
@@ -19,16 +19,9 @@
 :build_csharp
 echo Building C#
 cd csharp\src
-REM The platform environment variable is implicitly used by msbuild;
-REM we don't want it.
-set platform=
-dotnet restore
-dotnet build -c %configuration% || goto error
-
-echo Testing C#
-dotnet run -c %configuration% -f netcoreapp1.0 -p Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
-dotnet run -c %configuration% -f net451 -p Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
-
+nuget restore
+msbuild Google.Protobuf.sln /p:Platform="Any CPU" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" || goto error
+nunit-console Google.Protobuf.Test\bin\%configuration%\Google.Protobuf.Test.dll || goto error
 goto :EOF
 
 :error
diff --git a/appveyor.yml b/appveyor.yml
index 8b440b6..c84ecae 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -11,25 +11,13 @@
   matrix:
     - language: cpp
       BUILD_DLL: ON
-      UNICODE: ON
 
     - language: csharp
-      image: Visual Studio 2017
-
-# Our build scripts run tests automatically; we don't want AppVeyor
-# to try to detect them itself.
-test: off
 
 install:
-  - curl -L -o release-1.7.0.zip https://github.com/google/googlemock/archive/release-1.7.0.zip
-  - 7z x release-1.7.0.zip
-  - del /Q release-1.7.0.zip
-  - rename googlemock-release-1.7.0 gmock
-  - curl -L -o release-1.7.0.zip "https://github.com/google/googletest/archive/release-1.7.0.zip"
-  - 7z x release-1.7.0.zip
-  - del /Q release-1.7.0.zip
-  - rename googletest-release-1.7.0 gtest
-  - move gtest gmock
+  - ps: Start-FileDownload https://googlemock.googlecode.com/files/gmock-1.7.0.zip
+  - 7z x gmock-1.7.0.zip
+  - rename gmock-1.7.0 gmock
 
 before_build:
   - if %platform%==Win32 set generator=Visual Studio 12
diff --git a/autogen.sh b/autogen.sh
index 9560aaf..5b4c29f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -31,17 +31,10 @@
 # directory is set up as an SVN external.
 if test ! -e gmock; then
   echo "Google Mock not present.  Fetching gmock-1.7.0 from the web..."
-  curl $curlopts -L -O https://github.com/google/googlemock/archive/release-1.7.0.zip
-  unzip -q release-1.7.0.zip
-  rm release-1.7.0.zip
-  mv googlemock-release-1.7.0 gmock
-fi
-
-if test ! -e gmock/gtest; then
-  curl $curlopts -L -O https://github.com/google/googletest/archive/release-1.7.0.zip
-  unzip -q release-1.7.0.zip
-  rm release-1.7.0.zip
-  mv googletest-release-1.7.0 gmock/gtest
+  curl $curlopts -O https://googlemock.googlecode.com/files/gmock-1.7.0.zip
+  unzip -q gmock-1.7.0.zip
+  rm gmock-1.7.0.zip
+  mv gmock-1.7.0 gmock
 fi
 
 set -ex
diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am
index d98eae5..f730afe 100644
--- a/benchmarks/Makefile.am
+++ b/benchmarks/Makefile.am
@@ -16,9 +16,7 @@
   benchmark_messages_proto2.pb.cc                              \
   benchmark_messages_proto2.pb.h
 
-AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
-
-bin_PROGRAMS = generate-datasets cpp-benchmark
+bin_PROGRAMS = generate-datasets
 
 generate_datasets_LDADD = $(top_srcdir)/src/libprotobuf.la
 generate_datasets_SOURCES = generate_datasets.cc
@@ -32,13 +30,6 @@
 # See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually
 generate_datasets-generate_datasets.$(OBJEXT): benchmarks.pb.h
 
-cpp_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
-cpp_benchmark_SOURCES = cpp_benchmark.cc
-cpp_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) -I$(top_srcdir)/third_party/benchmark/include
-nodist_cpp_benchmark_SOURCES =                             \
-  $(benchmarks_protoc_outputs)                                 \
-  $(benchmarks_protoc_outputs_proto2)
-
 $(benchmarks_protoc_outputs): protoc_middleman
 $(benchmarks_protoc_outputs_proto2): protoc_middleman2
 
diff --git a/benchmarks/benchmark_messages_proto2.proto b/benchmarks/benchmark_messages_proto2.proto
index 5908550..01f67a1 100644
--- a/benchmarks/benchmark_messages_proto2.proto
+++ b/benchmarks/benchmark_messages_proto2.proto
@@ -8,8 +8,6 @@
 // This is the default, but we specify it here explicitly.
 option optimize_for = SPEED;
 
-option cc_enable_arenas = true;
-
 message GoogleMessage1 {
   required string field1 = 1;
   optional string field9 = 9;
diff --git a/benchmarks/benchmark_messages_proto3.proto b/benchmarks/benchmark_messages_proto3.proto
index 090b554..32f5869 100644
--- a/benchmarks/benchmark_messages_proto3.proto
+++ b/benchmarks/benchmark_messages_proto3.proto
@@ -8,8 +8,6 @@
 // This is the default, but we specify it here explicitly.
 option optimize_for = SPEED;
 
-option cc_enable_arenas = true;
-
 message GoogleMessage1 {
   string field1 = 1;
   string field9 = 9;
diff --git a/benchmarks/cpp_benchmark.cc b/benchmarks/cpp_benchmark.cc
deleted file mode 100644
index 0e6febc..0000000
--- a/benchmarks/cpp_benchmark.cc
+++ /dev/null
@@ -1,242 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <glob.h>
-#include <iostream>
-#include <fstream>
-#include "benchmark/benchmark_api.h"
-#include "benchmarks.pb.h"
-#include "benchmark_messages_proto2.pb.h"
-#include "benchmark_messages_proto3.pb.h"
-
-#define PREFIX "dataset."
-#define SUFFIX ".pb"
-
-using benchmarks::BenchmarkDataset;
-using google::protobuf::Arena;
-using google::protobuf::Descriptor;
-using google::protobuf::DescriptorPool;
-using google::protobuf::Message;
-using google::protobuf::MessageFactory;
-
-class Fixture : public benchmark::Fixture {
- public:
-  Fixture(const BenchmarkDataset& dataset, const std::string& suffix) {
-    for (int i = 0; i < dataset.payload_size(); i++) {
-      payloads_.push_back(dataset.payload(i));
-    }
-
-    const Descriptor* d =
-        DescriptorPool::generated_pool()->FindMessageTypeByName(
-            dataset.message_name());
-
-    if (!d) {
-      std::cerr << "Couldn't find message named '" << dataset.message_name()
-                << "\n";
-    }
-
-    prototype_ = MessageFactory::generated_factory()->GetPrototype(d);
-    SetName((dataset.name() + suffix).c_str());
-  }
-
- protected:
-  std::vector<std::string> payloads_;
-  const Message* prototype_;
-};
-
-class WrappingCounter {
- public:
-  WrappingCounter(size_t limit) : value_(0), limit_(limit) {}
-
-  size_t Next() {
-    size_t ret = value_;
-    if (++value_ == limit_) {
-      value_ = 0;
-    }
-    return ret;
-  }
-
- private:
-  size_t value_;
-  size_t limit_;
-};
-
-template <class T>
-class ParseNewFixture : public Fixture {
- public:
-  ParseNewFixture(const BenchmarkDataset& dataset)
-      : Fixture(dataset, "_parse_new") {}
-
-  virtual void BenchmarkCase(benchmark::State& state) {
-    WrappingCounter i(payloads_.size());
-    size_t total = 0;
-
-    while (state.KeepRunning()) {
-      T m;
-      const std::string& payload = payloads_[i.Next()];
-      total += payload.size();
-      m.ParseFromString(payload);
-    }
-
-    state.SetBytesProcessed(total);
-  }
-};
-
-template <class T>
-class ParseNewArenaFixture : public Fixture {
- public:
-  ParseNewArenaFixture(const BenchmarkDataset& dataset)
-      : Fixture(dataset, "_parse_newarena") {}
-
-  virtual void BenchmarkCase(benchmark::State& state) {
-    WrappingCounter i(payloads_.size());
-    size_t total = 0;
-
-    while (state.KeepRunning()) {
-      Arena arena;
-      Message* m = Arena::CreateMessage<T>(&arena);
-      const std::string& payload = payloads_[i.Next()];
-      total += payload.size();
-      m->ParseFromString(payload);
-    }
-
-    state.SetBytesProcessed(total);
-  }
-};
-
-template <class T>
-class ParseReuseFixture : public Fixture {
- public:
-  ParseReuseFixture(const BenchmarkDataset& dataset)
-      : Fixture(dataset, "_parse_reuse") {}
-
-  virtual void BenchmarkCase(benchmark::State& state) {
-    T m;
-    WrappingCounter i(payloads_.size());
-    size_t total = 0;
-
-    while (state.KeepRunning()) {
-      const std::string& payload = payloads_[i.Next()];
-      total += payload.size();
-      m.ParseFromString(payload);
-    }
-
-    state.SetBytesProcessed(total);
-  }
-};
-
-template <class T>
-class SerializeFixture : public Fixture {
- public:
-  SerializeFixture(const BenchmarkDataset& dataset)
-      : Fixture(dataset, "_serialize") {
-    for (size_t i = 0; i < payloads_.size(); i++) {
-      message_.push_back(new T);
-      message_.back()->ParseFromString(payloads_[i]);
-    }
-  }
-
-  ~SerializeFixture() {
-    for (size_t i = 0; i < message_.size(); i++) {
-      delete message_[i];
-    }
-  }
-
-  virtual void BenchmarkCase(benchmark::State& state) {
-    size_t total = 0;
-    std::string str;
-    WrappingCounter i(payloads_.size());
-
-    while (state.KeepRunning()) {
-      str.clear();
-      message_[i.Next()]->SerializeToString(&str);
-      total += str.size();
-    }
-
-    state.SetBytesProcessed(total);
-  }
-
- private:
-  std::vector<T*> message_;
-};
-
-std::string ReadFile(const std::string& name) {
-  std::ifstream file(name.c_str());
-  GOOGLE_CHECK(file.is_open()) << "Couldn't find file '" << name <<
-                                  "', please make sure you are running "
-                                  "this command from the benchmarks/ "
-                                  "directory.\n";
-  return std::string((std::istreambuf_iterator<char>(file)),
-                     std::istreambuf_iterator<char>());
-}
-
-template <class T>
-void RegisterBenchmarksForType(const BenchmarkDataset& dataset) {
-  ::benchmark::internal::RegisterBenchmarkInternal(
-      new ParseNewFixture<T>(dataset));
-  ::benchmark::internal::RegisterBenchmarkInternal(
-      new ParseReuseFixture<T>(dataset));
-  ::benchmark::internal::RegisterBenchmarkInternal(
-      new ParseNewArenaFixture<T>(dataset));
-  ::benchmark::internal::RegisterBenchmarkInternal(
-      new SerializeFixture<T>(dataset));
-}
-
-void RegisterBenchmarks(const std::string& dataset_bytes) {
-  BenchmarkDataset dataset;
-  GOOGLE_CHECK(dataset.ParseFromString(dataset_bytes));
-
-  if (dataset.message_name() == "benchmarks.proto3.GoogleMessage1") {
-    RegisterBenchmarksForType<benchmarks::proto3::GoogleMessage1>(dataset);
-  } else if (dataset.message_name() == "benchmarks.proto2.GoogleMessage1") {
-    RegisterBenchmarksForType<benchmarks::proto2::GoogleMessage1>(dataset);
-  } else if (dataset.message_name() == "benchmarks.proto2.GoogleMessage2") {
-    RegisterBenchmarksForType<benchmarks::proto2::GoogleMessage2>(dataset);
-  } else {
-    std::cerr << "Unknown message type: " << dataset.message_name();
-    exit(1);
-  }
-}
-
-int main(int argc, char *argv[]) {
-  glob_t glob_result;
-  if (glob("dataset.*.pb", 0, NULL, &glob_result) != 0) {
-    fprintf(stderr, "No dataset files found.\n");
-    return 1;
-  }
-
-  for (size_t i = 0; i < glob_result.gl_pathc; i++) {
-    fprintf(stderr, "Found input dataset: %s\n", glob_result.gl_pathv[i]);
-    RegisterBenchmarks(ReadFile(glob_result.gl_pathv[i]));
-  }
-
-  ::benchmark::Initialize(&argc, argv);
-  ::benchmark::RunSpecifiedBenchmarks();
-}
diff --git a/benchmarks/readme.txt b/benchmarks/readme.txt
index b08b8bc..2c836d0 100644
--- a/benchmarks/readme.txt
+++ b/benchmarks/readme.txt
@@ -22,25 +22,29 @@
    $ javac -d tmp -cp protobuf.jar ProtoBench.java
    
 3) Generate code for the relevant benchmark protocol buffer, e.g.
-   $ protoc --java_out=tmp google_size.proto
+   $ protoc --java_out=tmp google_size.proto google_speed.proto
    
 4) Build the generated code, e.g.
-   $ javac -d tmp -cp protobuf.jar tmp/benchmarks/*.java
+   $ cd tmp
+   $ javac -d . -cp ../protobuf.jar benchmarks/*.java
            
 5) Run the test. Arguments are given in pairs - the first argument
    is the descriptor type; the second is the filename. For example:
-   $ java -cp tmp:protobuf.jar com.google.protocolbuffers.ProtoBench \
-       'benchmarks.GoogleSize$SizeMessage1' google_message1.dat \
-       'benchmarks.GoogleSize$SizeMessage2' google_message2.dat
+   $ java -cp .;../protobuf.jar com.google.protocolbuffers.ProtoBench
+          benchmarks.GoogleSize$SizeMessage1 ../google_message1.dat
+          benchmarks.GoogleSpeed$SpeedMessage1 ../google_message1.dat
+          benchmarks.GoogleSize$SizeMessage2 ../google_message2.dat
+          benchmarks.GoogleSpeed$SpeedMessage2 ../google_message2.dat
           
-6) Wait! Each test runs for around 30 seconds, and there are 8 tests
+6) Wait! Each test runs for around 30 seconds, and there are 6 tests
    per class/data combination. The above command would therefore take
-   about 8 minutes to run.
+   about 12 minutes to run.
 
    
 Benchmarks available
 --------------------
 
 From Google:
-google_size.proto,
-messages google_message1.dat and google_message2.dat.
+google_size.proto and google_speed.proto, messages
+google_message1.dat and google_message2.dat. The proto files are
+equivalent, but optimized differently.
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index f159f60..f32a0e4 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -1,28 +1,22 @@
 # Minimum CMake required
-cmake_minimum_required(VERSION 2.8.12)
-
-if(protobuf_VERBOSE)
-  message(STATUS "Protocol Buffers Configuring...")
-endif()
-
-# CMake policies
-cmake_policy(SET CMP0022 NEW)
+cmake_minimum_required(VERSION 2.8)
 
 # Project
 project(protobuf C CXX)
 
+# CMake policies
+cmake_policy(SET CMP0022 NEW)
+
 # Options
+option(protobuf_VERBOSE "Enable for verbose output" OFF)
 option(protobuf_BUILD_TESTS "Build tests" ON)
-option(protobuf_BUILD_EXAMPLES "Build examples" OFF)
 if (BUILD_SHARED_LIBS)
   set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON)
 else (BUILD_SHARED_LIBS)
   set(protobuf_BUILD_SHARED_LIBS_DEFAULT OFF)
 endif (BUILD_SHARED_LIBS)
 option(protobuf_BUILD_SHARED_LIBS "Build Shared Libraries" ${protobuf_BUILD_SHARED_LIBS_DEFAULT})
-include(CMakeDependentOption)
-cmake_dependent_option(protobuf_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON
-  "NOT protobuf_BUILD_SHARED_LIBS" OFF)
+option(protobuf_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON)
 if (MSVC)
   set(protobuf_WITH_ZLIB_DEFAULT OFF)
 else (MSVC)
@@ -31,9 +25,6 @@
 option(protobuf_WITH_ZLIB "Build with zlib support" ${protobuf_WITH_ZLIB_DEFAULT})
 set(protobuf_DEBUG_POSTFIX "d"
   CACHE STRING "Default debug postfix")
-mark_as_advanced(protobuf_DEBUG_POSTFIX)
-# User options
-include(protobuf-options.cmake)
 
 # Path to main configure script
 set(protobuf_CONFIGURE_SCRIPT "../configure.ac")
@@ -53,24 +44,17 @@
 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]+).*$")
 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"
-  protobuf_VERSION_PRERELEASE "${protobuf_VERSION_STRING}")
-
 # 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}")
-endif()
-
 if(protobuf_VERBOSE)
   message(STATUS "Configuration script parsing status [")
   message(STATUS "  Description : ${protobuf_DESCRIPTION}")
@@ -86,7 +70,6 @@
   add_definitions(-DHAVE_PTHREAD)
 endif (CMAKE_USE_PTHREADS_INIT)
 
-set(_protobuf_FIND_ZLIB)
 if (protobuf_WITH_ZLIB)
   find_package(ZLIB)
   if (ZLIB_FOUND)
@@ -97,7 +80,6 @@
     # Using imported target if exists
     if (TARGET ZLIB::ZLIB)
       set(ZLIB_LIBRARIES ZLIB::ZLIB)
-      set(_protobuf_FIND_ZLIB "if(NOT ZLIB_FOUND)\n  find_package(ZLIB)\nendif()")
     endif (TARGET ZLIB::ZLIB)
   else (ZLIB_FOUND)
     set(HAVE_ZLIB 0)
@@ -135,31 +117,12 @@
 if (MSVC)
   # Build with multiple processes
   add_definitions(/MP)
-  # MSVC warning suppressions
-  add_definitions(
-    /wd4018 # 'expression' : signed/unsigned mismatch
-    /wd4065 # switch statement contains 'default' but no 'case' labels
-    /wd4146 # unary minus operator applied to unsigned type, result still unsigned
-    /wd4244 # 'conversion' conversion from 'type1' to 'type2', possible loss of data
-    /wd4251 # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
-    /wd4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
-    /wd4305 # 'identifier' : truncation from 'type1' to 'type2'
-    /wd4307 # 'operator' : integral constant overflow
-    /wd4309 # 'conversion' : truncation of constant value
-    /wd4334 # 'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
-    /wd4355 # 'this' : used in base member initializer list
-    /wd4506 # no definition for inline function 'function'
-    /wd4800 # 'type' : forcing value to bool 'true' or 'false' (performance warning)
-    /wd4996 # The compiler encountered a deprecated declaration.
-  )
+  add_definitions(/wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146 /wd4305)
   # Allow big object
   add_definitions(/bigobj)
   string(REPLACE "/" "\\" PROTOBUF_SOURCE_WIN32_PATH ${protobuf_SOURCE_DIR})
   string(REPLACE "/" "\\" PROTOBUF_BINARY_WIN32_PATH ${protobuf_BINARY_DIR})
   configure_file(extract_includes.bat.in extract_includes.bat)
-  
-  # Suppress linker warnings about files with no symbols defined.
-  set(CMAKE_STATIC_LINKER_FLAGS /ignore:4221)
 endif (MSVC)
 
 get_filename_component(protobuf_source_dir ${protobuf_SOURCE_DIR} PATH)
@@ -178,10 +141,6 @@
   set(LIB_PREFIX)
 endif (MSVC)
 
-if (protobuf_UNICODE)
-  add_definitions(-DUNICODE -D_UNICODE)
-endif (protobuf_UNICODE)
-
 include(libprotobuf-lite.cmake)
 include(libprotobuf.cmake)
 include(libprotoc.cmake)
@@ -192,11 +151,3 @@
 endif (protobuf_BUILD_TESTS)
 
 include(install.cmake)
-
-if (protobuf_BUILD_EXAMPLES)
-  include(examples.cmake)
-endif (protobuf_BUILD_EXAMPLES)
-
-if(protobuf_VERBOSE)
-    message(STATUS "Protocol Buffers Configuring done")
-endif()
diff --git a/cmake/examples.cmake b/cmake/examples.cmake
deleted file mode 100644
index e5cad63..0000000
--- a/cmake/examples.cmake
+++ /dev/null
@@ -1,57 +0,0 @@
-if(protobuf_VERBOSE)
-  message(STATUS "Protocol Buffers Examples Configuring...")
-endif()
-
-get_filename_component(examples_dir "../examples" ABSOLUTE)
-
-if(protobuf_VERBOSE)
-  message(STATUS "Protocol Buffers Examples Configuring done")
-endif()
-include(ExternalProject)
-
-# Internal utility function: Create a custom target representing a build of examples with custom options.
-function(add_examples_build NAME)
-
-  ExternalProject_Add(${NAME}
-    PREFIX ${NAME}
-    SOURCE_DIR "${examples_dir}"
-    BINARY_DIR ${NAME}
-    STAMP_DIR ${NAME}/logs
-    INSTALL_COMMAND "" #Skip
-    LOG_CONFIGURE 1
-    CMAKE_CACHE_ARGS "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
-                     "-Dprotobuf_VERBOSE:BOOL=${protobuf_VERBOSE}"
-                     ${ARGN}
-  )
-  set_property(TARGET ${NAME} PROPERTY FOLDER "Examples")
-  set_property(TARGET ${NAME} PROPERTY EXCLUDE_FROM_ALL TRUE)
-endfunction()
-
-# Add examples as an external project.
-# sub_directory cannot be used because the find_package(protobuf) call would cause failures with redefined targets.
-add_examples_build(examples "-Dprotobuf_DIR:PATH=${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}")
-add_dependencies(examples libprotobuf protoc)
-
-option(protobuf_BUILD_EXAMPLES_MULTITEST "Build Examples in multiple configurations. Useful for testing." OFF)
-mark_as_advanced(protobuf_BUILD_EXAMPLES_MULTITEST)
-if(protobuf_BUILD_EXAMPLES_MULTITEST)
-  set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-
-  #Build using the legacy compatibility module.
-  add_examples_build(examples-legacy
-    "-Dprotobuf_DIR:PATH=${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}"
-    "-Dprotobuf_MODULE_COMPATIBLE:BOOL=TRUE"
-  )
-  add_dependencies(examples-legacy libprotobuf protoc)
-
-  #Build using the installed library.
-  add_examples_build(examples-installed
-    "-Dprotobuf_DIR:PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}"
-  )
-
-  #Build using the installed library in legacy compatibility mode.
-  add_examples_build(examples-installed-legacy
-    "-Dprotobuf_DIR:PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}"
-    "-Dprotobuf_MODULE_COMPATIBLE:BOOL=TRUE"
-  )
-endif()
diff --git a/cmake/extract_includes.bat.in b/cmake/extract_includes.bat.in
index 5212d00..b593e0c 100644
--- a/cmake/extract_includes.bat.in
+++ b/cmake/extract_includes.bat.in
@@ -8,123 +8,117 @@
 mkdir include\google\protobuf\compiler\javanano
 mkdir include\google\protobuf\compiler\js
 mkdir include\google\protobuf\compiler\objectivec
-mkdir include\google\protobuf\compiler\php
 mkdir include\google\protobuf\compiler\python
 mkdir include\google\protobuf\compiler\ruby
 mkdir include\google\protobuf\io
 mkdir include\google\protobuf\stubs
 mkdir include\google\protobuf\util
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.h" include\google\protobuf\any.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.pb.h" include\google\protobuf\any.pb.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\api.pb.h" include\google\protobuf\api.pb.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arena.h" include\google\protobuf\arena.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arena_impl.h" include\google\protobuf\arena_impl.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arenastring.h" include\google\protobuf\arenastring.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\code_generator.h" include\google\protobuf\compiler\code_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\command_line_interface.h" include\google\protobuf\compiler\command_line_interface.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\cpp_generator.h" include\google\protobuf\compiler\cpp\cpp_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_generator.h" include\google\protobuf\compiler\csharp\csharp_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_names.h" include\google\protobuf\compiler\csharp\csharp_names.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\importer.h" include\google\protobuf\compiler\importer.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_generator.h" include\google\protobuf\compiler\java\java_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_names.h" include\google\protobuf\compiler\java\java_names.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\javanano\javanano_generator.h" include\google\protobuf\compiler\javanano\javanano_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\js\js_generator.h" include\google\protobuf\compiler\js\js_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\js\well_known_types_embed.h" include\google\protobuf\compiler\js\well_known_types_embed.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\objectivec\objectivec_generator.h" include\google\protobuf\compiler\objectivec\objectivec_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\objectivec\objectivec_helpers.h" include\google\protobuf\compiler\objectivec\objectivec_helpers.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\parser.h" include\google\protobuf\compiler\parser.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\php\php_generator.h" include\google\protobuf\compiler\php\php_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.h" include\google\protobuf\compiler\plugin.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.pb.h" include\google\protobuf\compiler\plugin.pb.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\python\python_generator.h" include\google\protobuf\compiler\python\python_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\ruby\ruby_generator.h" include\google\protobuf\compiler\ruby\ruby_generator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.h" include\google\protobuf\descriptor.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.pb.h" include\google\protobuf\descriptor.pb.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor_database.h" include\google\protobuf\descriptor_database.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\duration.pb.h" include\google\protobuf\duration.pb.h
-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\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
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_reflection.h" include\google\protobuf\generated_message_reflection.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_table_driven.h" include\google\protobuf\generated_message_table_driven.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_util.h" include\google\protobuf\generated_message_util.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\has_bits.h" include\google\protobuf\has_bits.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\coded_stream.h" include\google\protobuf\io\coded_stream.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\gzip_stream.h" include\google\protobuf\io\gzip_stream.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\printer.h" include\google\protobuf\io\printer.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\strtod.h" include\google\protobuf\io\strtod.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\tokenizer.h" include\google\protobuf\io\tokenizer.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream.h" include\google\protobuf\io\zero_copy_stream.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream_impl.h" include\google\protobuf\io\zero_copy_stream_impl.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream_impl_lite.h" include\google\protobuf\io\zero_copy_stream_impl_lite.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map.h" include\google\protobuf\map.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_entry.h" include\google\protobuf\map_entry.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_entry_lite.h" include\google\protobuf\map_entry_lite.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field.h" include\google\protobuf\map_field.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field_inl.h" include\google\protobuf\map_field_inl.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field_lite.h" include\google\protobuf\map_field_lite.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_type_handler.h" include\google\protobuf\map_type_handler.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message.h" include\google\protobuf\message.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message_lite.h" include\google\protobuf\message_lite.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata.h" include\google\protobuf\metadata.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata_lite.h" include\google\protobuf\metadata_lite.h
-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\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
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomic_sequence_num.h" include\google\protobuf\stubs\atomic_sequence_num.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops.h" include\google\protobuf\stubs\atomicops.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm64_gcc.h" include\google\protobuf\stubs\atomicops_internals_arm64_gcc.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_gcc.h" include\google\protobuf\stubs\atomicops_internals_arm_gcc.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_qnx.h" include\google\protobuf\stubs\atomicops_internals_arm_qnx.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_generic_c11_atomic.h" include\google\protobuf\stubs\atomicops_internals_generic_c11_atomic.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_generic_gcc.h" include\google\protobuf\stubs\atomicops_internals_generic_gcc.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_mips_gcc.h" include\google\protobuf\stubs\atomicops_internals_mips_gcc.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_power.h" include\google\protobuf\stubs\atomicops_internals_power.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_ppc_gcc.h" include\google\protobuf\stubs\atomicops_internals_ppc_gcc.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_solaris.h" include\google\protobuf\stubs\atomicops_internals_solaris.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_tsan.h" include\google\protobuf\stubs\atomicops_internals_tsan.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_x86_gcc.h" include\google\protobuf\stubs\atomicops_internals_x86_gcc.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_x86_msvc.h" include\google\protobuf\stubs\atomicops_internals_x86_msvc.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\bytestream.h" include\google\protobuf\stubs\bytestream.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\callback.h" include\google\protobuf\stubs\callback.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" include\google\protobuf\stubs\casts.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\fastmem.h" include\google\protobuf\stubs\fastmem.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\mutex.h" include\google\protobuf\stubs\mutex.h
-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\scoped_ptr.h" include\google\protobuf\stubs\scoped_ptr.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\shared_ptr.h" include\google\protobuf\stubs\shared_ptr.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\stringpiece.h" include\google\protobuf\stubs\stringpiece.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\template_util.h" include\google\protobuf\stubs\template_util.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\type_traits.h" include\google\protobuf\stubs\type_traits.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\text_format.h" include\google\protobuf\text_format.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\timestamp.pb.h" include\google\protobuf\timestamp.pb.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\type.pb.h" include\google\protobuf\type.pb.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\unknown_field_set.h" include\google\protobuf\unknown_field_set.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\delimited_message_util.h" include\google\protobuf\util\delimited_message_util.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\field_comparator.h" include\google\protobuf\util\field_comparator.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\field_mask_util.h" include\google\protobuf\util\field_mask_util.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\json_util.h" include\google\protobuf\util\json_util.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\message_differencer.h" include\google\protobuf\util\message_differencer.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\time_util.h" include\google\protobuf\util\time_util.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\type_resolver.h" include\google\protobuf\util\type_resolver.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\type_resolver_util.h" include\google\protobuf\util\type_resolver_util.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format.h" include\google\protobuf\wire_format.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format_lite.h" include\google\protobuf\wire_format_lite.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format_lite_inl.h" include\google\protobuf\wire_format_lite_inl.h
-copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wrappers.pb.h" include\google\protobuf\wrappers.pb.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.h include\google\protobuf\any.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.pb.h include\google\protobuf\any.pb.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\api.pb.h include\google\protobuf\api.pb.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arena.h include\google\protobuf\arena.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arenastring.h include\google\protobuf\arenastring.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\code_generator.h include\google\protobuf\compiler\code_generator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\command_line_interface.h include\google\protobuf\compiler\command_line_interface.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\cpp_generator.h include\google\protobuf\compiler\cpp\cpp_generator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_generator.h include\google\protobuf\compiler\csharp\csharp_generator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_names.h include\google\protobuf\compiler\csharp\csharp_names.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\importer.h include\google\protobuf\compiler\importer.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_generator.h include\google\protobuf\compiler\java\java_generator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\java_names.h include\google\protobuf\compiler\java\java_names.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\javanano\javanano_generator.h include\google\protobuf\compiler\javanano\javanano_generator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\js\js_generator.h include\google\protobuf\compiler\js\js_generator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\objectivec\objectivec_generator.h include\google\protobuf\compiler\objectivec\objectivec_generator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\objectivec\objectivec_helpers.h include\google\protobuf\compiler\objectivec\objectivec_helpers.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\parser.h include\google\protobuf\compiler\parser.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.h include\google\protobuf\compiler\plugin.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.pb.h include\google\protobuf\compiler\plugin.pb.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\python\python_generator.h include\google\protobuf\compiler\python\python_generator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\ruby\ruby_generator.h include\google\protobuf\compiler\ruby\ruby_generator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.h include\google\protobuf\descriptor.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.pb.h include\google\protobuf\descriptor.pb.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor_database.h include\google\protobuf\descriptor_database.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\duration.pb.h include\google\protobuf\duration.pb.h
+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\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
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_reflection.h include\google\protobuf\generated_message_reflection.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_util.h include\google\protobuf\generated_message_util.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\coded_stream.h include\google\protobuf\io\coded_stream.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\gzip_stream.h include\google\protobuf\io\gzip_stream.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\printer.h include\google\protobuf\io\printer.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\strtod.h include\google\protobuf\io\strtod.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\tokenizer.h include\google\protobuf\io\tokenizer.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream.h include\google\protobuf\io\zero_copy_stream.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream_impl.h include\google\protobuf\io\zero_copy_stream_impl.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream_impl_lite.h include\google\protobuf\io\zero_copy_stream_impl_lite.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map.h include\google\protobuf\map.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_entry.h include\google\protobuf\map_entry.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_entry_lite.h include\google\protobuf\map_entry_lite.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field.h include\google\protobuf\map_field.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field_inl.h include\google\protobuf\map_field_inl.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field_lite.h include\google\protobuf\map_field_lite.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_type_handler.h include\google\protobuf\map_type_handler.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message.h include\google\protobuf\message.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message_lite.h include\google\protobuf\message_lite.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata.h include\google\protobuf\metadata.h
+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
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomic_sequence_num.h include\google\protobuf\stubs\atomic_sequence_num.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops.h include\google\protobuf\stubs\atomicops.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm64_gcc.h include\google\protobuf\stubs\atomicops_internals_arm64_gcc.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_gcc.h include\google\protobuf\stubs\atomicops_internals_arm_gcc.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_arm_qnx.h include\google\protobuf\stubs\atomicops_internals_arm_qnx.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_atomicword_compat.h include\google\protobuf\stubs\atomicops_internals_atomicword_compat.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_generic_gcc.h include\google\protobuf\stubs\atomicops_internals_generic_gcc.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_macosx.h include\google\protobuf\stubs\atomicops_internals_macosx.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_mips_gcc.h include\google\protobuf\stubs\atomicops_internals_mips_gcc.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_pnacl.h include\google\protobuf\stubs\atomicops_internals_pnacl.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_power.h include\google\protobuf\stubs\atomicops_internals_power.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_solaris.h include\google\protobuf\stubs\atomicops_internals_solaris.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_tsan.h include\google\protobuf\stubs\atomicops_internals_tsan.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_x86_gcc.h include\google\protobuf\stubs\atomicops_internals_x86_gcc.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\atomicops_internals_x86_msvc.h include\google\protobuf\stubs\atomicops_internals_x86_msvc.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\bytestream.h include\google\protobuf\stubs\bytestream.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\callback.h include\google\protobuf\stubs\callback.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h include\google\protobuf\stubs\casts.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h include\google\protobuf\stubs\common.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\fastmem.h include\google\protobuf\stubs\fastmem.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h include\google\protobuf\stubs\hash.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h include\google\protobuf\stubs\logging.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h include\google\protobuf\stubs\macros.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\mutex.h include\google\protobuf\stubs\mutex.h
+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\scoped_ptr.h include\google\protobuf\stubs\scoped_ptr.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\shared_ptr.h include\google\protobuf\stubs\shared_ptr.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\stringpiece.h include\google\protobuf\stubs\stringpiece.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\template_util.h include\google\protobuf\stubs\template_util.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\type_traits.h include\google\protobuf\stubs\type_traits.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\text_format.h include\google\protobuf\text_format.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\timestamp.pb.h include\google\protobuf\timestamp.pb.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\type.pb.h include\google\protobuf\type.pb.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\unknown_field_set.h include\google\protobuf\unknown_field_set.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\field_comparator.h include\google\protobuf\util\field_comparator.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\field_mask_util.h include\google\protobuf\util\field_mask_util.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\json_util.h include\google\protobuf\util\json_util.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\message_differencer.h include\google\protobuf\util\message_differencer.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\time_util.h include\google\protobuf\util\time_util.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\type_resolver.h include\google\protobuf\util\type_resolver.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\type_resolver_util.h include\google\protobuf\util\type_resolver_util.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format.h include\google\protobuf\wire_format.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format_lite.h include\google\protobuf\wire_format_lite.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format_lite_inl.h include\google\protobuf\wire_format_lite_inl.h
+copy ${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wrappers.pb.h include\google\protobuf\wrappers.pb.h
diff --git a/cmake/install.cmake b/cmake/install.cmake
index 441bf55..dbb4265 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -1,17 +1,11 @@
 include(GNUInstallDirs)
 
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf.pc.cmake
-               ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake
-               ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
-
 foreach(_library
   libprotobuf-lite
   libprotobuf
   libprotoc)
   set_property(TARGET ${_library}
     PROPERTY INTERFACE_INCLUDE_DIRECTORIES
-    $<BUILD_INTERFACE:${protobuf_source_dir}/src>
     $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
   install(TARGETS ${_library} EXPORT protobuf-targets
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT ${_library}
@@ -22,28 +16,34 @@
 install(TARGETS protoc EXPORT protobuf-targets
   RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
 
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
-
-file(STRINGS extract_includes.bat.in _extract_strings
-  REGEX "^copy")
-foreach(_extract_string ${_extract_strings})
-  string(REGEX REPLACE "^.* .+ include\\\\(.+)$" "\\1"
-    _header ${_extract_string})
-  string(REPLACE "\\" "/" _header ${_header})
-  get_filename_component(_extract_from "${protobuf_SOURCE_DIR}/../src/${_header}" ABSOLUTE)
-  get_filename_component(_extract_name ${_header} NAME)
-  get_filename_component(_extract_to "${CMAKE_INSTALL_INCLUDEDIR}/${_header}" PATH)
-  if(EXISTS "${_extract_from}")
-    install(FILES "${_extract_from}"
-      DESTINATION "${_extract_to}"
-      COMPONENT protobuf-headers
-      RENAME "${_extract_name}")
-  else()
-    message(AUTHOR_WARNING "The file \"${_extract_from}\" is listed in "
-      "\"${protobuf_SOURCE_DIR}/cmake/extract_includes.bat.in\" "
-      "but there not exists. The file will not be installed.")
-  endif()
-endforeach()
+if(TRUE)
+  file(STRINGS extract_includes.bat.in _extract_strings
+    REGEX "^copy")
+  foreach(_extract_string ${_extract_strings})
+    string(REPLACE "copy \${PROTOBUF_SOURCE_WIN32_PATH}\\" ""
+      _extract_string ${_extract_string})
+    string(REPLACE "\\" "/" _extract_string ${_extract_string})
+    string(REGEX MATCH "^[^ ]+"
+      _extract_from ${_extract_string})
+    string(REGEX REPLACE "^${_extract_from} ([^$]+)" "\\1"
+      _extract_to ${_extract_string})
+    get_filename_component(_extract_from "${protobuf_SOURCE_DIR}/${_extract_from}" ABSOLUTE)
+    get_filename_component(_extract_name ${_extract_to} NAME)
+    get_filename_component(_extract_to ${_extract_to} PATH)
+    string(REPLACE "include/" "${CMAKE_INSTALL_INCLUDEDIR}/"
+      _extract_to "${_extract_to}")
+    if(EXISTS "${_extract_from}")
+      install(FILES "${_extract_from}"
+        DESTINATION "${_extract_to}"
+        COMPONENT protobuf-headers
+        RENAME "${_extract_name}")
+    else()
+      message(AUTHOR_WARNING "The file \"${_extract_from}\" is listed in "
+        "\"${protobuf_SOURCE_DIR}/cmake/extract_includes.bat.in\" "
+        "but there not exists. The file will not be installed.")
+    endif()
+  endforeach()
+endif()
 
 # Internal function for parsing auto tools scripts
 function(_protobuf_auto_list FILE_NAME VARIABLE)
@@ -82,43 +82,22 @@
   endif()
 endforeach()
 
-# Install configuration
-set(_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the cmake configuration files")
-if(NOT MSVC)
-  set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/protobuf" CACHE STRING "${_cmakedir_desc}")
-else()
-  set(CMAKE_INSTALL_CMAKEDIR "cmake" CACHE STRING "${_cmakedir_desc}")
-endif()
-mark_as_advanced(CMAKE_INSTALL_CMAKEDIR)
-
-configure_file(protobuf-config.cmake.in
-  ${CMAKE_INSTALL_CMAKEDIR}/protobuf-config.cmake @ONLY)
-configure_file(protobuf-config-version.cmake.in
-  ${CMAKE_INSTALL_CMAKEDIR}/protobuf-config-version.cmake @ONLY)
-configure_file(protobuf-module.cmake.in
-  ${CMAKE_INSTALL_CMAKEDIR}/protobuf-module.cmake @ONLY)
-configure_file(protobuf-options.cmake
-  ${CMAKE_INSTALL_CMAKEDIR}/protobuf-options.cmake @ONLY)
-
-# Allows the build directory to be used as a find directory.
-export(TARGETS libprotobuf-lite libprotobuf libprotoc protoc
-  NAMESPACE protobuf::
-  FILE ${CMAKE_INSTALL_CMAKEDIR}/protobuf-targets.cmake
-)
+# Export configuration
 
 install(EXPORT protobuf-targets
-  DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
-  NAMESPACE protobuf::
+  DESTINATION "lib/cmake/protobuf"
   COMPONENT protobuf-export)
 
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}/
-  DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
-  COMPONENT protobuf-export
-  PATTERN protobuf-targets.cmake EXCLUDE
-)
+configure_file(protobuf-config.cmake.in
+  protobuf-config.cmake @ONLY)
+configure_file(protobuf-config-version.cmake.in
+  protobuf-config-version.cmake @ONLY)
+configure_file(protobuf-module.cmake.in
+  protobuf-module.cmake @ONLY)
 
-option(protobuf_INSTALL_EXAMPLES "Install the examples folder" OFF)
-if(protobuf_INSTALL_EXAMPLES)
-  install(DIRECTORY ../examples/ DESTINATION examples
-    COMPONENT protobuf-examples)
-endif()
+install(FILES
+  "${protobuf_BINARY_DIR}/protobuf-config.cmake"
+  "${protobuf_BINARY_DIR}/protobuf-config-version.cmake"
+  "${protobuf_BINARY_DIR}/protobuf-module.cmake"
+  DESTINATION "lib/cmake/protobuf"
+  COMPONENT protobuf-export)
diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake
index 9e1fab0..036b051 100644
--- a/cmake/libprotobuf-lite.cmake
+++ b/cmake/libprotobuf-lite.cmake
@@ -2,7 +2,6 @@
   ${protobuf_source_dir}/src/google/protobuf/arena.cc
   ${protobuf_source_dir}/src/google/protobuf/arenastring.cc
   ${protobuf_source_dir}/src/google/protobuf/extension_set.cc
-  ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.cc
   ${protobuf_source_dir}/src/google/protobuf/generated_message_util.cc
   ${protobuf_source_dir}/src/google/protobuf/io/coded_stream.cc
   ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.cc
@@ -14,7 +13,6 @@
   ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/common.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/int128.cc
-  ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/once.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/status.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/statusor.cc
@@ -26,32 +24,8 @@
   ${protobuf_source_dir}/src/google/protobuf/wire_format_lite.cc
 )
 
-set(libprotobuf_lite_includes
-  ${protobuf_source_dir}/src/google/protobuf/arena.h
-  ${protobuf_source_dir}/src/google/protobuf/arenastring.h
-  ${protobuf_source_dir}/src/google/protobuf/extension_set.h
-  ${protobuf_source_dir}/src/google/protobuf/generated_message_util.h
-  ${protobuf_source_dir}/src/google/protobuf/io/coded_stream.h
-  ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.h
-  ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/message_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/repeated_field.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/atomicops_internals_x86_msvc.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/common.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/int128.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/once.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/status.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/statusor.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/stringpiece.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/stringprintf.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/strutil.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/time.h
-  ${protobuf_source_dir}/src/google/protobuf/wire_format_lite.h
-)
-
 add_library(libprotobuf-lite ${protobuf_SHARED_OR_STATIC}
-  ${libprotobuf_lite_files} ${libprotobuf_lite_includes})
+  ${libprotobuf_lite_files})
 target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT})
 target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src)
 if(MSVC AND protobuf_BUILD_SHARED_LIBS)
diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake
index 72db915..8930c1c 100644
--- a/cmake/libprotobuf.cmake
+++ b/cmake/libprotobuf.cmake
@@ -13,7 +13,6 @@
   ${protobuf_source_dir}/src/google/protobuf/extension_set_heavy.cc
   ${protobuf_source_dir}/src/google/protobuf/field_mask.pb.cc
   ${protobuf_source_dir}/src/google/protobuf/generated_message_reflection.cc
-  ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven.cc
   ${protobuf_source_dir}/src/google/protobuf/io/gzip_stream.cc
   ${protobuf_source_dir}/src/google/protobuf/io/printer.cc
   ${protobuf_source_dir}/src/google/protobuf/io/strtod.cc
@@ -31,7 +30,6 @@
   ${protobuf_source_dir}/src/google/protobuf/timestamp.pb.cc
   ${protobuf_source_dir}/src/google/protobuf/type.pb.cc
   ${protobuf_source_dir}/src/google/protobuf/unknown_field_set.cc
-  ${protobuf_source_dir}/src/google/protobuf/util/delimited_message_util.cc
   ${protobuf_source_dir}/src/google/protobuf/util/field_comparator.cc
   ${protobuf_source_dir}/src/google/protobuf/util/field_mask_util.cc
   ${protobuf_source_dir}/src/google/protobuf/util/internal/datapiece.cc
@@ -56,68 +54,9 @@
   ${protobuf_source_dir}/src/google/protobuf/wrappers.pb.cc
 )
 
-set(libprotobuf_includes
-  ${protobuf_source_dir}/src/google/protobuf/any.h
-  ${protobuf_source_dir}/src/google/protobuf/any.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/api.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/importer.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/parser.h
-  ${protobuf_source_dir}/src/google/protobuf/descriptor.h
-  ${protobuf_source_dir}/src/google/protobuf/descriptor.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/descriptor_database.h
-  ${protobuf_source_dir}/src/google/protobuf/duration.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/dynamic_message.h
-  ${protobuf_source_dir}/src/google/protobuf/empty.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/field_mask.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/generated_message_reflection.h
-  ${protobuf_source_dir}/src/google/protobuf/io/gzip_stream.h
-  ${protobuf_source_dir}/src/google/protobuf/io/printer.h
-  ${protobuf_source_dir}/src/google/protobuf/io/strtod.h
-  ${protobuf_source_dir}/src/google/protobuf/io/tokenizer.h
-  ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl.h
-  ${protobuf_source_dir}/src/google/protobuf/map_field.h
-  ${protobuf_source_dir}/src/google/protobuf/message.h
-  ${protobuf_source_dir}/src/google/protobuf/reflection_ops.h
-  ${protobuf_source_dir}/src/google/protobuf/service.h
-  ${protobuf_source_dir}/src/google/protobuf/source_context.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/struct.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/mathlimits.h
-  ${protobuf_source_dir}/src/google/protobuf/stubs/substitute.h
-  ${protobuf_source_dir}/src/google/protobuf/text_format.h
-  ${protobuf_source_dir}/src/google/protobuf/timestamp.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/type.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/unknown_field_set.h
-  ${protobuf_source_dir}/src/google/protobuf/util/delimited_message_util.h
-  ${protobuf_source_dir}/src/google/protobuf/util/field_comparator.h
-  ${protobuf_source_dir}/src/google/protobuf/util/field_mask_util.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/datapiece.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/default_value_objectwriter.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/error_listener.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/field_mask_utility.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/json_escaping.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/json_objectwriter.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/json_stream_parser.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/object_writer.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/proto_writer.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectsource.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/protostream_objectwriter.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/type_info.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/type_info_test_helper.h
-  ${protobuf_source_dir}/src/google/protobuf/util/internal/utility.h
-  ${protobuf_source_dir}/src/google/protobuf/util/json_util.h
-  ${protobuf_source_dir}/src/google/protobuf/util/message_differencer.h
-  ${protobuf_source_dir}/src/google/protobuf/util/time_util.h
-  ${protobuf_source_dir}/src/google/protobuf/util/type_resolver_util.h
-  ${protobuf_source_dir}/src/google/protobuf/wire_format.h
-  ${protobuf_source_dir}/src/google/protobuf/wrappers.pb.h
-)
-
 add_library(libprotobuf ${protobuf_SHARED_OR_STATIC}
-  ${libprotobuf_lite_files} ${libprotobuf_files} ${libprotobuf_includes})
-target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT})
-if(protobuf_WITH_ZLIB)
-    target_link_libraries(libprotobuf ${ZLIB_LIBRARIES})
-endif()
+  ${libprotobuf_lite_files} ${libprotobuf_files})
+target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES})
 target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src)
 if(MSVC AND protobuf_BUILD_SHARED_LIBS)
   target_compile_definitions(libprotobuf
diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake
index 107c1c5..8df8986 100644
--- a/cmake/libprotoc.cmake
+++ b/cmake/libprotoc.cmake
@@ -11,7 +11,6 @@
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_map_field.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message_field.cc
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.cc
@@ -73,7 +72,6 @@
   ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_message_field.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/js/js_generator.cc
-  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_extension.cc
@@ -86,7 +84,6 @@
   ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
-  ${protobuf_source_dir}/src/google/protobuf/compiler/php/php_generator.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.pb.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/python/python_generator.cc
@@ -95,128 +92,8 @@
   ${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.cc
 )
 
-set(libprotoc_headers
-  ${protobuf_source_dir}/src/google/protobuf/compiler/code_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/command_line_interface.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/importer.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/mock_code_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/package_info.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/parser.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.pb.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/subprocess.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/zip_writer.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_enum.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_enum_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_extension.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_file.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_helpers.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_map_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_message_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_options.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_primitive_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_service.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_string_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_unittest.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_doc_comment.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_enum_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_field_base.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_helpers.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_map_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_message.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_message_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_names.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_options.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_primitive_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_reflection_class.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_wrapper_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_context.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_doc_comment.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_field_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_enum_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_extension.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_extension_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_file.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_generator_factory.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_helpers.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_lazy_message_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_lazy_message_field_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_map_field_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_builder.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_builder_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_field_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_message_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_names.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_name_resolver.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_options.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_primitive_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_primitive_field_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_service.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_shared_code_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_string_field_lite.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_enum.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_enum_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_extension.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_file.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_helpers.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_map_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_message.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_message_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_params.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_primitive_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/js/js_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_extension.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_file.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_helpers.h
-  ${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_oneof.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/php/php_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/python/python_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator.h
-  ${protobuf_source_dir}/src/google/protobuf/compiler/plugin.pb.h
-)
-
-set(js_well_known_types_sources
-  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/any.js
-  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/struct.js
-  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types/timestamp.js
-)
-add_executable(js_embed ${protobuf_source_dir}/src/google/protobuf/compiler/js/embed.cc)
-add_custom_command(
-  OUTPUT ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
-  DEPENDS js_embed ${js_well_known_types_sources}
-  COMMAND js_embed ${js_well_known_types_sources} > ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
-)
-
 add_library(libprotoc ${protobuf_SHARED_OR_STATIC}
-  ${libprotoc_files} ${libprotoc_headers})
+  ${libprotoc_files})
 target_link_libraries(libprotoc libprotobuf)
 if(MSVC AND protobuf_BUILD_SHARED_LIBS)
   target_compile_definitions(libprotoc
diff --git a/cmake/protobuf-config-version.cmake.in b/cmake/protobuf-config-version.cmake.in
index 3fa0176..1f171c6 100644
--- a/cmake/protobuf-config-version.cmake.in
+++ b/cmake/protobuf-config-version.cmake.in
@@ -1,60 +1 @@
-set(PACKAGE_VERSION "@protobuf_VERSION@")
-set(${PACKAGE_FIND_NAME}_VERSION_PRERELEASE "@protobuf_VERSION_PRERELEASE@" PARENT_SCOPE)
-
-# Prerelease versions cannot be passed in directly via the find_package command,
-# so we allow users to specify it in a variable
-if(NOT DEFINED "${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE")
-  set("${${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE}" "")
-else()
-  set(PACKAGE_FIND_VERSION ${PACKAGE_FIND_VERSION}-${${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE})
-endif()
-set(PACKAGE_FIND_VERSION_PRERELEASE "${${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE}")
-
-# VERSION_EQUAL ignores the prerelease strings, so we use STREQUAL.
-if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
-  set(PACKAGE_VERSION_EXACT TRUE)
-endif()
-
-set(PACKAGE_VERSION_COMPATIBLE TRUE) #Assume true until shown otherwise
-
-if(PACKAGE_FIND_VERSION) #Only perform version checks if one is given
-  if(NOT PACKAGE_FIND_VERSION_MAJOR EQUAL "@protobuf_VERSION_MAJOR@")
-    set(PACKAGE_VERSION_COMPATIBLE FALSE)
-  elseif(PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
-    set(PACKAGE_VERSION_COMPATIBLE FALSE)
-  elseif(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
-    # Do not match prerelease versions to non-prerelease version requests.
-      if(NOT "@protobuf_VERSION_PRERELEASE@" STREQUAL "" AND PACKAGE_FIND_VERSION_PRERELEASE STREQUAL "")
-      message(AUTHOR_WARNING "To use this prerelease version of ${PACKAGE_FIND_NAME}, set ${PACKAGE_FIND_NAME}_FIND_VERSION_PRERELEASE to '@protobuf_VERSION_PRERELEASE@' or greater.")
-      set(PACKAGE_VERSION_COMPATIBLE FALSE)
-    endif()
-
-    # Not robustly SemVer compliant, but protobuf never uses '.' separated prerelease identifiers.
-    if(PACKAGE_FIND_VERSION_PRERELEASE STRGREATER "@protobuf_VERSION_PRERELEASE@")
-      set(PACKAGE_VERSION_COMPATIBLE FALSE)
-    endif()
-  endif()
-endif()
-
-# Check and save build options used to create this package
-macro(_check_and_save_build_option OPTION VALUE)
-  if(DEFINED ${PACKAGE_FIND_NAME}_${OPTION} AND
-    NOT ${PACKAGE_FIND_NAME}_${OPTION} STREQUAL ${VALUE})
-    set(PACKAGE_VERSION_UNSUITABLE TRUE)
-  endif()
-  set(${PACKAGE_FIND_NAME}_${OPTION} ${VALUE} PARENT_SCOPE)
-endmacro()
-_check_and_save_build_option(WITH_ZLIB @protobuf_WITH_ZLIB@)
-_check_and_save_build_option(MSVC_STATIC_RUNTIME @protobuf_MSVC_STATIC_RUNTIME@)
-_check_and_save_build_option(BUILD_SHARED_LIBS @protobuf_BUILD_SHARED_LIBS@)
-
-# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
-if(CMAKE_SIZEOF_VOID_P AND "@CMAKE_SIZEOF_VOID_P@")
-  # check that the installed version has the same 32/64bit-ness as the one which is currently searching:
-  if(NOT CMAKE_SIZEOF_VOID_P EQUAL "@CMAKE_SIZEOF_VOID_P@")
-    math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
-    set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
-    set(PACKAGE_VERSION_UNSUITABLE TRUE)
-  endif()
-endif()
-
+set(PACKAGE_VERSION @protobuf_VERSION@)
diff --git a/cmake/protobuf-config.cmake.in b/cmake/protobuf-config.cmake.in
index fd67edc..bb0997b 100644
--- a/cmake/protobuf-config.cmake.in
+++ b/cmake/protobuf-config.cmake.in
@@ -1,121 +1,27 @@
-# User options
-include("${CMAKE_CURRENT_LIST_DIR}/protobuf-options.cmake")
+# Version info variables
+set(PROTOBUF_VERSION        "@protobuf_VERSION@")
+set(PROTOBUF_VERSION_STRING "@protobuf_VERSION_STRING@")
 
-# Depend packages
-@_protobuf_FIND_ZLIB@
+# Current dir
+get_filename_component(_PROTOBUF_PACKAGE_PREFIX
+  "${CMAKE_CURRENT_LIST_FILE}" PATH)
 
 # Imported targets
-include("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake")
+include("${_PROTOBUF_PACKAGE_PREFIX}/protobuf-targets.cmake")
 
-function(protobuf_generate)
-  include(CMakeParseArguments)
-
-  set(_options APPEND_PATH)
-  set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO)
-  if(COMMAND target_sources)
-    list(APPEND _singleargs TARGET)
-  endif()
-  set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS)
-
-  cmake_parse_arguments(protobuf_generate "${_options}" "${_singleargs}" "${_multiargs}" "${ARGN}")
-
-  if(NOT protobuf_generate_PROTOS AND NOT protobuf_generate_TARGET)
-    message(SEND_ERROR "Error: protobuf_generate called without any targets or source files")
-    return()
-  endif()
-
-  if(NOT protobuf_generate_OUT_VAR AND NOT protobuf_generate_TARGET)
-    message(SEND_ERROR "Error: protobuf_generate called without a target or output variable")
-    return()
-  endif()
-
-  if(NOT protobuf_generate_LANGUAGE)
-    set(protobuf_generate_LANGUAGE cpp)
-  endif()
-  string(TOLOWER ${protobuf_generate_LANGUAGE} protobuf_generate_LANGUAGE)
-
-  if(protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp)
-    set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}:")
-  endif()
-
-  if(NOT protobuf_GENERATE_EXTENSIONS)
-    if(protobuf_generate_LANGUAGE STREQUAL cpp)
-      set(protobuf_GENERATE_EXTENSIONS .pb.h .pb.cc)
-    elseif(protobuf_generate_LANGUAGE STREQUAL python)
-      set(protobuf_GENERATE_EXTENSIONS _pb2.py)
-    else()
-      message(SEND_ERROR "Error: protobuf_generate given unknown Language ${LANGUAGE}, please provide a value for GENERATE_EXTENSIONS")
-      return()
-    endif()
-  endif()
-
-  if(protobuf_generate_TARGET)
-    get_target_property(_source_list ${protobuf_generate_TARGET} SOURCES)
-    foreach(_file ${_source_list})
-      if(_file MATCHES "proto$")
-        list(APPEND protobuf_generate_PROTOS ${_file})
-      endif()
-    endforeach()
-  endif()
-
-  if(NOT protobuf_generate_PROTOS)
-    message(SEND_ERROR "Error: protobuf_generate could not find any .proto files")
-    return()
-  endif()
-
-  if(protobuf_generate_APPEND_PATH)
-    # Create an include path for each file specified
-    foreach(_file ${protobuf_generate_PROTOS})
-      get_filename_component(_abs_file ${_file} ABSOLUTE)
-      get_filename_component(_abs_path ${_abs_file} PATH)
-      list(FIND _protobuf_include_path ${_abs_path} _contains_already)
-      if(${_contains_already} EQUAL -1)
-          list(APPEND _protobuf_include_path -I ${_abs_path})
-      endif()
-    endforeach()
-  else()
-    set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
-  endif()
-
-  foreach(DIR ${protobuf_generate_IMPORT_DIRS})
-    get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
-    list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
-    if(${_contains_already} EQUAL -1)
-        list(APPEND _protobuf_include_path -I ${ABS_PATH})
-    endif()
-  endforeach()
-
-  set(_generated_srcs_all)
-  foreach(_proto ${protobuf_generate_PROTOS})
-    get_filename_component(_abs_file ${_proto} ABSOLUTE)
-    get_filename_component(_basename ${_proto} NAME_WE)
-
-    set(_generated_srcs)
-    foreach(_ext ${protobuf_GENERATE_EXTENSIONS})
-      list(APPEND _generated_srcs "${CMAKE_CURRENT_BINARY_DIR}/${_basename}${_ext}")
-    endforeach()
-    list(APPEND _generated_srcs_all ${_generated_srcs})
-
-    add_custom_command(
-      OUTPUT ${_generated_srcs}
-      COMMAND  protobuf::protoc
-      ARGS --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${_abs_file}
-      DEPENDS ${ABS_FIL} protobuf::protoc
-      COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}"
-      VERBATIM )
-  endforeach()
-
-  set_source_files_properties(${_generated_srcs_all} PROPERTIES GENERATED TRUE)
-  if(protobuf_generate_OUT_VAR)
-    set(${protobuf_generate_OUT_VAR} ${_generated_srcs_all} PARENT_SCOPE)
-  endif()
-  if(protobuf_generate_TARGET)
-    target_sources(${protobuf_generate_TARGET} PUBLIC ${_generated_srcs_all})
-  endif()
-
-endfunction()
+# Compute the installation prefix relative to this file.
+get_filename_component(_PROTOBUF_IMPORT_PREFIX
+  "${_PROTOBUF_PACKAGE_PREFIX}" PATH)
+get_filename_component(_PROTOBUF_IMPORT_PREFIX
+  "${_PROTOBUF_IMPORT_PREFIX}" PATH)
+get_filename_component(_PROTOBUF_IMPORT_PREFIX
+  "${_PROTOBUF_IMPORT_PREFIX}" PATH)
 
 # CMake FindProtobuf module compatible file
-if(protobuf_MODULE_COMPATIBLE)
-  include("${CMAKE_CURRENT_LIST_DIR}/protobuf-module.cmake")
+if(NOT DEFINED PROTOBUF_MODULE_COMPATIBLE OR "${PROTOBUF_MODULE_COMPATIBLE}")
+  include("${_PROTOBUF_PACKAGE_PREFIX}/protobuf-module.cmake")
 endif()
+
+# Cleanup temporary variables.
+set(_PROTOBUF_PACKAGE_PREFIX)
+set(_PROTOBUF_IMPORT_PREFIX)
diff --git a/cmake/protobuf-lite.pc.cmake b/cmake/protobuf-lite.pc.cmake
deleted file mode 100644
index cbe5426..0000000
--- a/cmake/protobuf-lite.pc.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
-
-Name: Protocol Buffers
-Description: Google's Data Interchange Format
-Version: @protobuf_VERSION@
-Libs: -L${libdir} -lprotobuf-lite @CMAKE_THREAD_LIBS_INIT@
-Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@
-Conflicts: protobuf
diff --git a/cmake/protobuf-module.cmake.in b/cmake/protobuf-module.cmake.in
index 74c5488..d81dc45 100644
--- a/cmake/protobuf-module.cmake.in
+++ b/cmake/protobuf-module.cmake.in
@@ -1,109 +1,89 @@
-# This file contains backwards compatibility patches for various legacy functions and variables
-# Functions
+if(PROTOBUF_SRC_ROOT_FOLDER)
+  message(AUTHOR_WARNING "Variable PROTOBUF_SRC_ROOT_FOLDER defined, but not"
+    " used in CONFIG mode")
+endif()
 
 function(PROTOBUF_GENERATE_CPP SRCS HDRS)
-  cmake_parse_arguments(protobuf_generate_cpp "" "EXPORT_MACRO" "" ${ARGN})
-
-  set(_proto_files "${protobuf_generate_cpp_UNPARSED_ARGUMENTS}")
-  if(NOT _proto_files)
+  if(NOT ARGN)
     message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files")
     return()
   endif()
 
   if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
-    set(_append_arg APPEND_PATH)
+    # Create an include path for each file specified
+    foreach(FIL ${ARGN})
+      get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
+      get_filename_component(ABS_PATH ${ABS_FIL} PATH)
+      list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
+      if(${_contains_already} EQUAL -1)
+          list(APPEND _protobuf_include_path -I ${ABS_PATH})
+      endif()
+    endforeach()
+  else()
+    set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
   endif()
 
-  if(DEFINED Protobuf_IMPORT_DIRS)
-    set(_import_arg IMPORT_DIRS ${Protobuf_IMPORT_DIRS})
-  endif()
+  # Add well-known type protos include path
+  list(APPEND _protobuf_include_path
+    -I "${_PROTOBUF_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@")
 
-  set(_outvar)
-  protobuf_generate(${_append_arg} LANGUAGE cpp EXPORT_MACRO ${protobuf_generate_cpp_EXPORT_MACRO} OUT_VAR _outvar ${_import_arg} PROTOS ${_proto_files})
+  if(DEFINED PROTOBUF_IMPORT_DIRS)
+    foreach(DIR ${PROTOBUF_IMPORT_DIRS})
+      get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
+      list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
+      if(${_contains_already} EQUAL -1)
+          list(APPEND _protobuf_include_path -I ${ABS_PATH})
+      endif()
+    endforeach()
+  endif()
 
   set(${SRCS})
   set(${HDRS})
-  foreach(_file ${_outvar})
-    if(_file MATCHES "cc$")
-      list(APPEND ${SRCS} ${_file})
-    else()
-      list(APPEND ${HDRS} ${_file})
-    endif()
+  foreach(FIL ${ARGN})
+    get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
+    get_filename_component(FIL_WE ${FIL} NAME_WE)
+
+    list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
+    list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
+
+    add_custom_command(
+      OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
+             "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
+      COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
+      ARGS --cpp_out  ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
+      DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
+      COMMENT "Running C++ protocol buffer compiler on ${FIL}"
+      VERBATIM)
   endforeach()
+
+  set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
   set(${SRCS} ${${SRCS}} PARENT_SCOPE)
   set(${HDRS} ${${HDRS}} PARENT_SCOPE)
 endfunction()
 
-function(PROTOBUF_GENERATE_PYTHON SRCS)
-  if(NOT ARGN)
-    message(SEND_ERROR "Error: PROTOBUF_GENERATE_PYTHON() called without any proto files")
-    return()
-  endif()
-
-  if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
-    set(_append_arg APPEND_PATH)
-  endif()
-
-  if(DEFINED Protobuf_IMPORT_DIRS)
-    set(_import_arg IMPORT_DIRS ${Protobuf_IMPORT_DIRS})
-  endif()
-
-  set(_outvar)
-  protobuf_generate(${_append_arg} LANGUAGE python OUT_VAR _outvar ${_import_arg} PROTOS ${ARGN})
-  set(${SRCS} ${_outvar} PARENT_SCOPE)
-endfunction()
-
-# Environment
-
-# Backwards compatibility
-# Define camel case versions of input variables
-foreach(UPPER
-    PROTOBUF_SRC_ROOT_FOLDER
-    PROTOBUF_IMPORT_DIRS
-    PROTOBUF_DEBUG
-    PROTOBUF_LIBRARY
-    PROTOBUF_PROTOC_LIBRARY
-    PROTOBUF_INCLUDE_DIR
-    PROTOBUF_PROTOC_EXECUTABLE
-    PROTOBUF_LIBRARY_DEBUG
-    PROTOBUF_PROTOC_LIBRARY_DEBUG
-    PROTOBUF_LITE_LIBRARY
-    PROTOBUF_LITE_LIBRARY_DEBUG
-    )
-    if (DEFINED ${UPPER})
-        string(REPLACE "PROTOBUF_" "Protobuf_" Camel ${UPPER})
-        if (NOT DEFINED ${Camel})
-            set(${Camel} ${${UPPER}})
-        endif()
-    endif()
-endforeach()
-
-if(DEFINED Protobuf_SRC_ROOT_FOLDER)
-  message(AUTHOR_WARNING "Variable Protobuf_SRC_ROOT_FOLDER defined, but not"
-    " used in CONFIG mode")
-endif()
-
-include(SelectLibraryConfigurations)
-
 # Internal function: search for normal library as well as a debug one
 #    if the debug one is specified also include debug/optimized keywords
 #    in *_LIBRARIES variable
 function(_protobuf_find_libraries name filename)
-  if(${name}_LIBRARIES)
-    # Use result recorded by a previous call.
-  elseif(${name}_LIBRARY)
-    # Honor cache entry used by CMake 3.5 and lower.
-    set(${name}_LIBRARIES "${${name}_LIBRARY}" PARENT_SCOPE)
-  else()
-    get_target_property(${name}_LIBRARY_RELEASE protobuf::lib${filename}
-      LOCATION_RELEASE)
-    get_target_property(${name}_LIBRARY_DEBUG protobuf::lib${filename}
-      LOCATION_DEBUG)
+   get_target_property(${name}_LIBRARY lib${filename}
+     IMPORTED_LOCATION_RELEASE)
+   set(${name}_LIBRARY "${${name}_LIBRARY}" PARENT_SCOPE)
+   get_target_property(${name}_LIBRARY_DEBUG lib${filename}
+     IMPORTED_LOCATION_DEBUG)
+   set(${name}_LIBRARY_DEBUG "${${name}_LIBRARY_DEBUG}" PARENT_SCOPE)
 
-    select_library_configurations(${name})
-    set(${name}_LIBRARY ${${name}_LIBRARY} PARENT_SCOPE)
-    set(${name}_LIBRARIES ${${name}_LIBRARIES} PARENT_SCOPE)
-  endif()
+   if(NOT ${name}_LIBRARY_DEBUG)
+      # There is no debug library
+      set(${name}_LIBRARY_DEBUG ${${name}_LIBRARY} PARENT_SCOPE)
+      set(${name}_LIBRARIES     ${${name}_LIBRARY} PARENT_SCOPE)
+   else()
+      # There IS a debug library
+      set(${name}_LIBRARIES
+          optimized ${${name}_LIBRARY}
+          debug     ${${name}_LIBRARY_DEBUG}
+          PARENT_SCOPE
+      )
+   endif()
 endfunction()
 
 # Internal function: find threads library
@@ -127,63 +107,33 @@
 endif()
 
 # The Protobuf library
-_protobuf_find_libraries(Protobuf protobuf)
+_protobuf_find_libraries(PROTOBUF protobuf)
 
 # The Protobuf Lite library
-_protobuf_find_libraries(Protobuf_LITE protobuf-lite)
+_protobuf_find_libraries(PROTOBUF_LITE protobuf-lite)
 
 # The Protobuf Protoc Library
-_protobuf_find_libraries(Protobuf_PROTOC protoc)
+_protobuf_find_libraries(PROTOBUF_PROTOC protoc)
 
 if(UNIX)
   _protobuf_find_threads()
 endif()
 
 # Set the include directory
-get_target_property(Protobuf_INCLUDE_DIRS protobuf::libprotobuf
-  INTERFACE_INCLUDE_DIRECTORIES)
+set(PROTOBUF_INCLUDE_DIR "${_PROTOBUF_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@")
 
 # Set the protoc Executable
-get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
+get_target_property(PROTOBUF_PROTOC_EXECUTABLE protoc
   IMPORTED_LOCATION_RELEASE)
-if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
-  get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
+if(NOT PROTOBUF_PROTOC_EXECUTABLE)
+  get_target_property(PROTOBUF_PROTOC_EXECUTABLE protoc
     IMPORTED_LOCATION_DEBUG)
 endif()
-if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
-  get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
-    IMPORTED_LOCATION_NOCONFIG)
-endif()
-
-# Version info variable
-set(Protobuf_VERSION "@protobuf_VERSION@")
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf
-    REQUIRED_VARS Protobuf_PROTOC_EXECUTABLE Protobuf_LIBRARIES Protobuf_INCLUDE_DIRS
-    VERSION_VAR Protobuf_VERSION
-)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROTOBUF DEFAULT_MSG
+    PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
 
-# Backwards compatibility
-# Define upper case versions of output variables
-foreach(Camel
-    Protobuf_VERSION
-    Protobuf_SRC_ROOT_FOLDER
-    Protobuf_IMPORT_DIRS
-    Protobuf_DEBUG
-    Protobuf_INCLUDE_DIRS
-    Protobuf_LIBRARIES
-    Protobuf_PROTOC_LIBRARIES
-    Protobuf_LITE_LIBRARIES
-    Protobuf_LIBRARY
-    Protobuf_PROTOC_LIBRARY
-    Protobuf_INCLUDE_DIR
-    Protobuf_PROTOC_EXECUTABLE
-    Protobuf_LIBRARY_DEBUG
-    Protobuf_PROTOC_LIBRARY_DEBUG
-    Protobuf_LITE_LIBRARY
-    Protobuf_LITE_LIBRARY_DEBUG
-    )
-    string(TOUPPER ${Camel} UPPER)
-    set(${UPPER} ${${Camel}})
-endforeach()
+if(PROTOBUF_FOUND)
+    set(PROTOBUF_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIR})
+endif()
diff --git a/cmake/protobuf-options.cmake b/cmake/protobuf-options.cmake
deleted file mode 100644
index 47fb158..0000000
--- a/cmake/protobuf-options.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-# Verbose output
-option(protobuf_VERBOSE "Enable for verbose output" OFF)
-mark_as_advanced(protobuf_VERBOSE)
-
-# FindProtobuf module compatibel
-option(protobuf_MODULE_COMPATIBLE "CMake build-in FindProtobuf.cmake module compatible" OFF)
-mark_as_advanced(protobuf_MODULE_COMPATIBLE)
diff --git a/cmake/protobuf.pc.cmake b/cmake/protobuf.pc.cmake
deleted file mode 100644
index d33e98c..0000000
--- a/cmake/protobuf.pc.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
-
-Name: Protocol Buffers
-Description: Google's Data Interchange Format
-Version: @protobuf_VERSION@
-Libs: -L${libdir} -lprotobuf @CMAKE_THREAD_LIBS_INIT@
-Cflags: -I${includedir} @CMAKE_THREAD_LIBS_INIT@
-Conflicts: protobuf-lite
diff --git a/cmake/tests.cmake b/cmake/tests.cmake
index d4622c6..76fdf8e 100644
--- a/cmake/tests.cmake
+++ b/cmake/tests.cmake
@@ -4,7 +4,6 @@
 
 option(protobuf_ABSOLUTE_TEST_PLUGIN_PATH
   "Using absolute test_plugin path in tests" ON)
-mark_as_advanced(protobuf_ABSOLUTE_TEST_PLUGIN_PATH)
 
 include_directories(
   ${protobuf_source_dir}/gmock
@@ -17,7 +16,6 @@
   ${protobuf_source_dir}/gmock/src/gmock-all.cc
   ${protobuf_source_dir}/gmock/gtest/src/gtest-all.cc
 )
-target_link_libraries(gmock ${CMAKE_THREAD_LIBS_INIT})
 add_library(gmock_main STATIC ${protobuf_source_dir}/gmock/src/gmock_main.cc)
 target_link_libraries(gmock_main gmock)
 
@@ -43,9 +41,6 @@
   google/protobuf/unittest_empty.proto
   google/protobuf/unittest_import.proto
   google/protobuf/unittest_import_public.proto
-  google/protobuf/unittest_lazy_dependencies.proto
-  google/protobuf/unittest_lazy_dependencies_custom_option.proto
-  google/protobuf/unittest_lazy_dependencies_enum.proto
   google/protobuf/unittest_lite_imports_nonlite.proto
   google/protobuf/unittest_mset.proto
   google/protobuf/unittest_mset_wire_format.proto
@@ -67,10 +62,8 @@
   google/protobuf/util/internal/testdata/field_mask.proto
   google/protobuf/util/internal/testdata/maps.proto
   google/protobuf/util/internal/testdata/oneofs.proto
-  google/protobuf/util/internal/testdata/proto3.proto
   google/protobuf/util/internal/testdata/struct.proto
   google/protobuf/util/internal/testdata/timestamp_duration.proto
-  google/protobuf/util/internal/testdata/wrappers.proto
   google/protobuf/util/json_format_proto3.proto
   google/protobuf/util/message_differencer_unittest.proto
 )
@@ -121,14 +114,11 @@
   ${protobuf_source_dir}/src/google/protobuf/any_test.cc
   ${protobuf_source_dir}/src/google/protobuf/arena_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/arenastring_unittest.cc
-  ${protobuf_source_dir}/src/google/protobuf/compiler/annotation_test_util.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/command_line_interface_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc
-  ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_move_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_plugin_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/cpp_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/cpp/metadata_test.cc
-  ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/importer_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/java/java_doc_comment_unittest.cc
@@ -162,7 +152,6 @@
   ${protobuf_source_dir}/src/google/protobuf/stubs/bytestream_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/common_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/int128_unittest.cc
-  ${protobuf_source_dir}/src/google/protobuf/stubs/io_win32_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/once_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/status_test.cc
   ${protobuf_source_dir}/src/google/protobuf/stubs/statusor_test.cc
@@ -175,7 +164,6 @@
   ${protobuf_source_dir}/src/google/protobuf/stubs/type_traits_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/text_format_unittest.cc
   ${protobuf_source_dir}/src/google/protobuf/unknown_field_set_unittest.cc
-  ${protobuf_source_dir}/src/google/protobuf/util/delimited_message_util_test.cc
   ${protobuf_source_dir}/src/google/protobuf/util/field_comparator_test.cc
   ${protobuf_source_dir}/src/google/protobuf/util/field_mask_util_test.cc
   ${protobuf_source_dir}/src/google/protobuf/util/internal/default_value_objectwriter_test.cc
@@ -213,7 +201,7 @@
   ${protobuf_source_dir}/src/google/protobuf/lite_unittest.cc
 )
 add_executable(lite-test ${lite_test_files} ${common_lite_test_files} ${lite_test_proto_files})
-target_link_libraries(lite-test libprotobuf-lite gmock_main)
+target_link_libraries(lite-test libprotobuf-lite)
 
 set(lite_arena_test_files
   ${protobuf_source_dir}/src/google/protobuf/lite_arena_unittest.cc
@@ -223,5 +211,4 @@
 
 add_custom_target(check
   COMMAND tests
-  DEPENDS tests test_plugin
   WORKING_DIRECTORY ${protobuf_source_dir})
diff --git a/composer.json b/composer.json
deleted file mode 100644
index 2c64ad2..0000000
--- a/composer.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
-  "name": "google/protobuf",
-  "type": "library",
-  "description": "proto library for PHP",
-  "keywords": ["proto"],
-  "homepage": "https://developers.google.com/protocol-buffers/",
-  "license": "BSD-3-Clause",
-  "require": {
-    "php": ">=5.5.0"
-  },
-  "require-dev": {
-    "phpunit/phpunit": ">=4.8.0"
-  },
-  "suggest": {
-    "ext-bcmath": "Need to support JSON deserialization"
-  },
-  "autoload": {
-    "psr-4": {
-      "Google\\Protobuf\\": "php/src/Google/Protobuf",
-      "GPBMetadata\\Google\\Protobuf\\": "php/src/GPBMetadata/Google/Protobuf"
-    }
-  }
-}
diff --git a/config/config.h b/config/config.h
index 0f2d562..366aa84 100644
--- a/config/config.h
+++ b/config/config.h
@@ -5,19 +5,16 @@
 #define HASH_MAP_CLASS unordered_map
 
 /* the location of <unordered_map> or <hash_map> */
-#define HASH_MAP_H <unordered_map>
+#define HASH_MAP_H <tr1/unordered_map>
 
 /* the namespace of hash_map/hash_set */
-#define HASH_NAMESPACE std
+#define HASH_NAMESPACE std::tr1
 
 /* the name of <hash_set> */
 #define HASH_SET_CLASS unordered_set
 
 /* the location of <unordered_set> or <hash_set> */
-#define HASH_SET_H <unordered_set>
-
-/* define if the compiler supports basic C++11 syntax */
-#define HAVE_CXX11 1
+#define HASH_SET_H <tr1/unordered_set>
 
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #define HAVE_DLFCN_H 1
@@ -85,7 +82,8 @@
 /* Enable classes using zlib compression. */
 #define HAVE_ZLIB 1
 
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
 #define LT_OBJDIR ".libs/"
 
 /* Name of package */
@@ -98,7 +96,7 @@
 #define PACKAGE_NAME "Protocol Buffers"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "Protocol Buffers 3.5.2"
+#define PACKAGE_STRING "Protocol Buffers 2.6.1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "protobuf"
@@ -107,12 +105,15 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "3.5.2"
+#define PACKAGE_VERSION "2.6.1"
 
 /* Define to necessary symbol if this constant uses a non-standard name on
    your system. */
 /* #undef PTHREAD_CREATE_JOINABLE */
 
+/* 64bit enabled */
+/* #undef SOLARIS_64BIT_ENABLED */
+
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
@@ -139,7 +140,7 @@
 
 
 /* Version number of package */
-#define VERSION "3.5.2"
+#define VERSION "2.6.1"
 
 /* Define to 1 if on MINIX. */
 /* #undef _MINIX */
diff --git a/configure.ac b/configure.ac
index 839aa04..bdc72ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,20 +4,15 @@
 AC_PREREQ(2.59)
 
 # Note:  If you change the version, you must also update it in:
-# * Protobuf.podspec
-# * csharp/Google.Protobuf.Tools.nuspec
-# * csharp/src/*/AssemblyInfo.cs
-# * csharp/src/Google.Protobuf/Google.Protobuf.nuspec
-# * java/*/pom.xml
-# * python/google/protobuf/__init__.py
-# * protoc-artifacts/pom.xml
+# * java/pom.xml
+# * python/setup.py
 # * src/google/protobuf/stubs/common.h
 # * src/Makefile.am (Update -version-info for LDFLAGS if needed)
 #
 # 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.5.2],[protobuf@googlegroups.com],[protobuf])
+AC_INIT([Protocol Buffers],[3.0.0-beta-3],[protobuf@googlegroups.com],[protobuf])
 
 AM_MAINTAINER_MODE([enable])
 
@@ -31,7 +26,7 @@
 AC_ARG_VAR(DIST_LANG, [language to include in the distribution package (i.e., make dist)])
 case "$DIST_LANG" in
   "") DIST_LANG=all ;;
-  all | cpp | csharp | java | python | javanano | objectivec | ruby | js | php) ;;
+  all | cpp | csharp | java | python | javanano | objectivec | ruby | js) ;;
   *) AC_MSG_FAILURE([unknown language: $DIST_LANG]) ;;
 esac
 AC_SUBST(DIST_LANG)
@@ -60,7 +55,6 @@
 # Checks for programs.
 AC_PROG_CC
 AC_PROG_CXX
-AC_PROG_CXX_FOR_BUILD
 AC_LANG([C++])
 ACX_USE_SYSTEM_EXTENSIONS
 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
@@ -93,25 +87,6 @@
 # to the link
 AC_PROG_LIBTOOL
 
-# Check whether the linker supports version scripts
-AC_MSG_CHECKING([whether the linker supports version scripts])
-save_LDFLAGS=$LDFLAGS
-LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
-cat > conftest.map <<EOF
-{
-  global:
-    main;
-  local:
-    *;
-};
-EOF
-AC_LINK_IFELSE(
-  [AC_LANG_SOURCE([int main() { return 0; }])],
-  [have_ld_version_script=yes; AC_MSG_RESULT(yes)],
-  [have_ld_version_script=no; AC_MSG_RESULT(no)])
-LDFLAGS=$save_LDFLAGS
-AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], [test "$have_ld_version_script" == "yes"])
-
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h])
@@ -198,8 +173,6 @@
 esac
 AM_CONDITIONAL([OBJC_CONFORMANCE_TEST], [test $OBJC_CONFORMANCE_TEST = 1])
 
-AX_CXX_COMPILE_STDCXX([11], [noext], [optional])
-
 # HACK:  Make gmock's configure script pick up our copy of CFLAGS and CXXFLAGS,
 #   since the flags added by ACX_CHECK_SUNCC must be used when compiling gmock
 #   too.
diff --git a/conformance/ConformanceJava.java b/conformance/ConformanceJava.java
index 596d113..43787ff 100644
--- a/conformance/ConformanceJava.java
+++ b/conformance/ConformanceJava.java
@@ -1,18 +1,8 @@
-import com.google.protobuf.ByteString;
-import com.google.protobuf.AbstractMessage;
-import com.google.protobuf.Parser;
-import com.google.protobuf.CodedInputStream;
+
 import com.google.protobuf.conformance.Conformance;
-import com.google.protobuf.InvalidProtocolBufferException;
-import com.google.protobuf_test_messages.proto3.TestMessagesProto3;
-import com.google.protobuf_test_messages.proto3.TestMessagesProto3.TestAllTypesProto3;
-import com.google.protobuf_test_messages.proto2.TestMessagesProto2;
-import com.google.protobuf_test_messages.proto2.TestMessagesProto2.TestAllTypesProto2;
-import com.google.protobuf.ExtensionRegistry;
 import com.google.protobuf.util.JsonFormat;
 import com.google.protobuf.util.JsonFormat.TypeRegistry;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
+import com.google.protobuf.InvalidProtocolBufferException;
 
 class ConformanceJava {
   private int testCount = 0;
@@ -56,185 +46,22 @@
     buf[3] = (byte)(val >> 24);
     writeToStdout(buf);
   }
-  
-  private enum BinaryDecoderType {
-    BTYE_STRING_DECODER,
-    BYTE_ARRAY_DECODER,
-    ARRAY_BYTE_BUFFER_DECODER,
-    READONLY_ARRAY_BYTE_BUFFER_DECODER,
-    DIRECT_BYTE_BUFFER_DECODER,
-    READONLY_DIRECT_BYTE_BUFFER_DECODER,
-    INPUT_STREAM_DECODER;
-  }
-
-  private static class BinaryDecoder <MessageType extends AbstractMessage> {
-    public MessageType decode (ByteString bytes, BinaryDecoderType type, 
-        Parser <MessageType> parser, ExtensionRegistry extensions)
-      throws InvalidProtocolBufferException {
-      switch (type) {
-        case BTYE_STRING_DECODER: 
-          return parser.parseFrom(bytes, extensions);
-        case BYTE_ARRAY_DECODER:
-          return parser.parseFrom(bytes.toByteArray(), extensions);
-        case ARRAY_BYTE_BUFFER_DECODER: {
-          ByteBuffer buffer = ByteBuffer.allocate(bytes.size());
-          bytes.copyTo(buffer);
-          buffer.flip();
-          try {
-            return parser.parseFrom(CodedInputStream.newInstance(buffer), extensions);
-          } catch (InvalidProtocolBufferException e) {
-            throw e;
-          }
-        }
-        case READONLY_ARRAY_BYTE_BUFFER_DECODER: {
-          try {
-            return parser.parseFrom(
-                CodedInputStream.newInstance(bytes.asReadOnlyByteBuffer()), extensions);
-          } catch (InvalidProtocolBufferException e) {
-            throw e;
-          }
-        } 
-        case DIRECT_BYTE_BUFFER_DECODER: {
-          ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size());
-          bytes.copyTo(buffer);
-          buffer.flip();
-          try {
-            return parser.parseFrom(CodedInputStream.newInstance(buffer), extensions);
-          } catch (InvalidProtocolBufferException e) {
-            throw e;
-          }
-        }
-        case READONLY_DIRECT_BYTE_BUFFER_DECODER: {
-          ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size());
-          bytes.copyTo(buffer);
-          buffer.flip();
-          try {
-            return parser.parseFrom(
-                CodedInputStream.newInstance(buffer.asReadOnlyBuffer()), extensions);
-          } catch (InvalidProtocolBufferException e) {
-            throw e;
-          }
-        }
-        case INPUT_STREAM_DECODER: {
-          try {
-            return parser.parseFrom(bytes.newInput(), extensions);
-          } catch (InvalidProtocolBufferException e) {
-            throw e;
-          }
-        }
-        default :
-          return null;
-      }
-    }
-  }
-
-  private <MessageType extends AbstractMessage> MessageType parseBinary(
-      ByteString bytes, Parser <MessageType> parser, ExtensionRegistry extensions)
-      throws InvalidProtocolBufferException {
-    ArrayList <MessageType> messages = new ArrayList <MessageType> ();
-    ArrayList <InvalidProtocolBufferException> exceptions =
-        new ArrayList <InvalidProtocolBufferException>();
-    
-    for (int i = 0; i < BinaryDecoderType.values().length; i++) {
-      messages.add(null);
-      exceptions.add(null);
-    }
-    BinaryDecoder <MessageType> decoder = new BinaryDecoder <MessageType> ();
-
-    boolean hasMessage = false;
-    boolean hasException = false;
-    for (int i = 0; i < BinaryDecoderType.values().length; ++i) {
-      try {
-        //= BinaryDecoderType.values()[i].parseProto3(bytes);
-        messages.set(i, decoder.decode(bytes, BinaryDecoderType.values()[i], parser, extensions));
-        hasMessage = true;
-      } catch (InvalidProtocolBufferException e) {
-        exceptions.set(i, e);
-        hasException = true;
-      }
-    }
-
-    if (hasMessage && hasException) {
-      StringBuilder sb =
-          new StringBuilder("Binary decoders disagreed on whether the payload was valid.\n");
-      for (int i = 0; i < BinaryDecoderType.values().length; ++i) {
-        sb.append(BinaryDecoderType.values()[i].name());
-        if (messages.get(i) != null) {
-          sb.append(" accepted the payload.\n");
-        } else {
-          sb.append(" rejected the payload.\n");
-        }
-      }
-      throw new RuntimeException(sb.toString());
-    }
-
-    if (hasException) {
-      // We do not check if exceptions are equal. Different implementations may return different
-      // exception messages. Throw an arbitrary one out instead.
-      throw exceptions.get(0);
-    }
-
-    // Fast path comparing all the messages with the first message, assuming equality being
-    // symmetric and transitive.
-    boolean allEqual = true;
-    for (int i = 1; i < messages.size(); ++i) {
-      if (!messages.get(0).equals(messages.get(i))) {
-        allEqual = false;
-        break;
-      }
-    }
-
-    // Slow path: compare and find out all unequal pairs.
-    if (!allEqual) {
-      StringBuilder sb = new StringBuilder();
-      for (int i = 0; i < messages.size() - 1; ++i) {
-        for (int j = i + 1; j < messages.size(); ++j) {
-          if (!messages.get(i).equals(messages.get(j))) {
-            sb.append(BinaryDecoderType.values()[i].name())
-                .append(" and ")
-                .append(BinaryDecoderType.values()[j].name())
-                .append(" parsed the payload differently.\n");
-          }
-        }
-      }
-      throw new RuntimeException(sb.toString());
-    }
-
-    return messages.get(0);
-  }
 
   private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) {
-    com.google.protobuf.AbstractMessage testMessage;
-    boolean isProto3 = request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypesProto3");
-    boolean isProto2 = request.getMessageType().equals("protobuf_test_messages.proto2.TestAllTypesProto2");
+    Conformance.TestAllTypes testMessage;
 
     switch (request.getPayloadCase()) {
       case PROTOBUF_PAYLOAD: {
-        if (isProto3) {
-          try {
-            ExtensionRegistry extensions = ExtensionRegistry.newInstance();
-            TestMessagesProto3.registerAllExtensions(extensions);
-            testMessage = parseBinary(request.getProtobufPayload(), TestAllTypesProto3.parser(), extensions);
-          } catch (InvalidProtocolBufferException e) {
-            return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build();
-          }
-        } else if (isProto2) {
-          try {
-            ExtensionRegistry extensions = ExtensionRegistry.newInstance();
-            TestMessagesProto2.registerAllExtensions(extensions);
-            testMessage = parseBinary(request.getProtobufPayload(), TestAllTypesProto2.parser(), extensions);
-          } catch (InvalidProtocolBufferException e) {
-            return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build();
-          }
-        } else {
-          throw new RuntimeException("Protobuf request doesn't have specific payload type.");
+        try {
+          testMessage = Conformance.TestAllTypes.parseFrom(request.getProtobufPayload());
+        } catch (InvalidProtocolBufferException e) {
+          return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build();
         }
         break;
       }
       case JSON_PAYLOAD: {
         try {
-          TestMessagesProto3.TestAllTypesProto3.Builder builder = 
-              TestMessagesProto3.TestAllTypesProto3.newBuilder();
+          Conformance.TestAllTypes.Builder builder = Conformance.TestAllTypes.newBuilder();
           JsonFormat.parser().usingTypeRegistry(typeRegistry)
               .merge(request.getJsonPayload(), builder);
           testMessage = builder.build();
@@ -256,10 +83,8 @@
       case UNSPECIFIED:
         throw new RuntimeException("Unspecified output format.");
 
-      case PROTOBUF: {
-        ByteString MessageString = testMessage.toByteString(); 
-        return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(MessageString).build();
-      }
+      case PROTOBUF:
+        return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(testMessage.toByteString()).build();
 
       case JSON:
         try {
@@ -302,7 +127,7 @@
 
   public void run() throws Exception {
     typeRegistry = TypeRegistry.newBuilder().add(
-        TestMessagesProto3.TestAllTypesProto3.getDescriptor()).build();
+        Conformance.TestAllTypes.getDescriptor()).build();
     while (doTestIo()) {
       this.testCount++;
     }
diff --git a/conformance/ConformanceJavaLite.java b/conformance/ConformanceJavaLite.java
index 016f793..121dc7d 100644
--- a/conformance/ConformanceJavaLite.java
+++ b/conformance/ConformanceJavaLite.java
@@ -58,7 +58,7 @@
       }
       case JSON_PAYLOAD: {
         return Conformance.ConformanceResponse.newBuilder().setSkipped(
-            "Lite runtime does not support JSON format.").build();
+            "Lite runtime does not suport Json Formant.").build();
       }
       case PAYLOAD_NOT_SET: {
         throw new RuntimeException("Request didn't have payload.");
@@ -78,7 +78,7 @@
 
       case JSON:
         return Conformance.ConformanceResponse.newBuilder().setSkipped(
-            "Lite runtime does not support JSON format.").build();
+            "Lite runtime does not suport Json Formant.").build();
 
       default: {
         throw new RuntimeException("Unexpected request output.");
diff --git a/conformance/Makefile.am b/conformance/Makefile.am
index 765f358..31a9e40 100644
--- a/conformance/Makefile.am
+++ b/conformance/Makefile.am
@@ -1,13 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 conformance_protoc_inputs =                                    \
-  conformance.proto                                            \
-  $(top_srcdir)/src/google/protobuf/test_messages_proto3.proto
-
-# proto2 input files, should be separated with proto3, as we
-# can't generate proto2 files for ruby, php and objc
-conformance_proto2_protoc_inputs =                             \
-  $(top_srcdir)/src/google/protobuf/test_messages_proto2.proto
+  conformance.proto
 
 well_known_type_protoc_inputs =                                \
   $(top_srcdir)/src/google/protobuf/any.proto                  \
@@ -26,8 +20,7 @@
   conformance_pb2.py                                           \
   Conformance.pbobjc.h                                         \
   Conformance.pbobjc.m                                         \
-  conformance_pb.js                                            \
-  conformance_pb.rb                                            \
+  conformance.rb                                               \
   com/google/protobuf/Any.java                                 \
   com/google/protobuf/AnyOrBuilder.java                        \
   com/google/protobuf/AnyProto.java                            \
@@ -68,8 +61,6 @@
   com/google/protobuf/Value.java                               \
   com/google/protobuf/ValueOrBuilder.java                      \
   com/google/protobuf/WrappersProto.java                       \
-  com/google/protobuf_test_messages/proto3/TestMessagesProto3.java \
-  com/google/protobuf_test_messages/proto2/TestMessagesProto2.java \
   google/protobuf/any.pb.cc                                    \
   google/protobuf/any.pb.h                                     \
   google/protobuf/any.rb                                       \
@@ -86,17 +77,6 @@
   google/protobuf/struct.pb.h                                  \
   google/protobuf/struct.rb                                    \
   google/protobuf/struct_pb2.py                                \
-  google/protobuf/TestMessagesProto2.pbobjc.h                  \
-  google/protobuf/TestMessagesProto2.pbobjc.m                  \
-  google/protobuf/TestMessagesProto3.pbobjc.h                  \
-  google/protobuf/TestMessagesProto3.pbobjc.m                  \
-  google/protobuf/test_messages_proto3.pb.cc                   \
-  google/protobuf/test_messages_proto3.pb.h                    \
-  google/protobuf/test_messages_proto2.pb.cc                   \
-  google/protobuf/test_messages_proto2.pb.h                    \
-  google/protobuf/test_messages_proto3_pb.rb                   \
-  google/protobuf/test_messages_proto3_pb2.py                  \
-  google/protobuf/test_messages_proto2_pb2.py                  \
   google/protobuf/timestamp.pb.cc                              \
   google/protobuf/timestamp.pb.h                               \
   google/protobuf/timestamp.rb                                 \
@@ -105,79 +85,46 @@
   google/protobuf/wrappers.pb.h                                \
   google/protobuf/wrappers.rb                                  \
   google/protobuf/wrappers_pb2.py                              \
-  Conformance/ConformanceRequest.php                           \
-  Conformance/ConformanceResponse.php                          \
-  Conformance/WireFormat.php                                   \
-  GPBMetadata/Conformance.php                                  \
-  GPBMetadata/Google/Protobuf/Any.php                          \
-  GPBMetadata/Google/Protobuf/Duration.php                     \
-  GPBMetadata/Google/Protobuf/FieldMask.php                    \
-  GPBMetadata/Google/Protobuf/Struct.php                       \
-  GPBMetadata/Google/Protobuf/TestMessagesProto3.php           \
-  GPBMetadata/Google/Protobuf/Timestamp.php                    \
-  GPBMetadata/Google/Protobuf/Wrappers.php                     \
-  Google/Protobuf/Any.php                                      \
-  Google/Protobuf/BoolValue.php                                \
-  Google/Protobuf/BytesValue.php                               \
-  Google/Protobuf/DoubleValue.php                              \
-  Google/Protobuf/Duration.php                                 \
-  Google/Protobuf/FieldMask.php                                \
-  Google/Protobuf/FloatValue.php                               \
-  Google/Protobuf/Int32Value.php                               \
-  Google/Protobuf/Int64Value.php                               \
-  Google/Protobuf/ListValue.php                                \
-  Google/Protobuf/NullValue.php                                \
-  Google/Protobuf/StringValue.php                              \
-  Google/Protobuf/Struct.php                                   \
-  Google/Protobuf/Timestamp.php                                \
-  Google/Protobuf/UInt32Value.php                              \
-  Google/Protobuf/UInt64Value.php                              \
-  Google/Protobuf/Value.php                                    \
-  Protobuf_test_messages/Proto3/ForeignEnum.php                \
-  Protobuf_test_messages/Proto3/ForeignMessage.php             \
-  Protobuf_test_messages/Proto3/TestAllTypes_NestedEnum.php    \
-  Protobuf_test_messages/Proto3/TestAllTypes_NestedMessage.php \
-  Protobuf_test_messages/Proto3/TestAllTypes.php
-  # lite/com/google/protobuf/Any.java                            \
-  # lite/com/google/protobuf/AnyOrBuilder.java                   \
-  # lite/com/google/protobuf/AnyProto.java                       \
-  # lite/com/google/protobuf/BoolValue.java                      \
-  # lite/com/google/protobuf/BoolValueOrBuilder.java             \
-  # lite/com/google/protobuf/BytesValue.java                     \
-  # lite/com/google/protobuf/BytesValueOrBuilder.java            \
-  # lite/com/google/protobuf/conformance/Conformance.java        \
-  # lite/com/google/protobuf/DoubleValue.java                    \
-  # lite/com/google/protobuf/DoubleValueOrBuilder.java           \
-  # lite/com/google/protobuf/Duration.java                       \
-  # lite/com/google/protobuf/DurationOrBuilder.java              \
-  # lite/com/google/protobuf/DurationProto.java                  \
-  # lite/com/google/protobuf/FieldMask.java                      \
-  # lite/com/google/protobuf/FieldMaskOrBuilder.java             \
-  # lite/com/google/protobuf/FieldMaskProto.java                 \
-  # lite/com/google/protobuf/FloatValue.java                     \
-  # lite/com/google/protobuf/FloatValueOrBuilder.java            \
-  # lite/com/google/protobuf/Int32Value.java                     \
-  # lite/com/google/protobuf/Int32ValueOrBuilder.java            \
-  # lite/com/google/protobuf/Int64Value.java                     \
-  # lite/com/google/protobuf/Int64ValueOrBuilder.java            \
-  # lite/com/google/protobuf/ListValue.java                      \
-  # lite/com/google/protobuf/ListValueOrBuilder.java             \
-  # lite/com/google/protobuf/NullValue.java                      \
-  # lite/com/google/protobuf/StringValue.java                    \
-  # lite/com/google/protobuf/StringValueOrBuilder.java           \
-  # lite/com/google/protobuf/Struct.java                         \
-  # lite/com/google/protobuf/StructOrBuilder.java                \
-  # lite/com/google/protobuf/StructProto.java                    \
-  # lite/com/google/protobuf/Timestamp.java                      \
-  # lite/com/google/protobuf/TimestampOrBuilder.java             \
-  # lite/com/google/protobuf/TimestampProto.java                 \
-  # lite/com/google/protobuf/UInt32Value.java                    \
-  # lite/com/google/protobuf/UInt32ValueOrBuilder.java           \
-  # lite/com/google/protobuf/UInt64Value.java                    \
-  # lite/com/google/protobuf/UInt64ValueOrBuilder.java           \
-  # lite/com/google/protobuf/Value.java                          \
-  # lite/com/google/protobuf/ValueOrBuilder.java                 \
-  # lite/com/google/protobuf/WrappersProto.java
+  lite/com/google/protobuf/Any.java                            \
+  lite/com/google/protobuf/AnyOrBuilder.java                   \
+  lite/com/google/protobuf/AnyProto.java                       \
+  lite/com/google/protobuf/BoolValue.java                      \
+  lite/com/google/protobuf/BoolValueOrBuilder.java             \
+  lite/com/google/protobuf/BytesValue.java                     \
+  lite/com/google/protobuf/BytesValueOrBuilder.java            \
+  lite/com/google/protobuf/conformance/Conformance.java        \
+  lite/com/google/protobuf/DoubleValue.java                    \
+  lite/com/google/protobuf/DoubleValueOrBuilder.java           \
+  lite/com/google/protobuf/Duration.java                       \
+  lite/com/google/protobuf/DurationOrBuilder.java              \
+  lite/com/google/protobuf/DurationProto.java                  \
+  lite/com/google/protobuf/FieldMask.java                      \
+  lite/com/google/protobuf/FieldMaskOrBuilder.java             \
+  lite/com/google/protobuf/FieldMaskProto.java                 \
+  lite/com/google/protobuf/FloatValue.java                     \
+  lite/com/google/protobuf/FloatValueOrBuilder.java            \
+  lite/com/google/protobuf/Int32Value.java                     \
+  lite/com/google/protobuf/Int32ValueOrBuilder.java            \
+  lite/com/google/protobuf/Int64Value.java                     \
+  lite/com/google/protobuf/Int64ValueOrBuilder.java            \
+  lite/com/google/protobuf/ListValue.java                      \
+  lite/com/google/protobuf/ListValueOrBuilder.java             \
+  lite/com/google/protobuf/NullValue.java                      \
+  lite/com/google/protobuf/StringValue.java                    \
+  lite/com/google/protobuf/StringValueOrBuilder.java           \
+  lite/com/google/protobuf/Struct.java                         \
+  lite/com/google/protobuf/StructOrBuilder.java                \
+  lite/com/google/protobuf/StructProto.java                    \
+  lite/com/google/protobuf/Timestamp.java                      \
+  lite/com/google/protobuf/TimestampOrBuilder.java             \
+  lite/com/google/protobuf/TimestampProto.java                 \
+  lite/com/google/protobuf/UInt32Value.java                    \
+  lite/com/google/protobuf/UInt32ValueOrBuilder.java           \
+  lite/com/google/protobuf/UInt64Value.java                    \
+  lite/com/google/protobuf/UInt64ValueOrBuilder.java           \
+  lite/com/google/protobuf/Value.java                          \
+  lite/com/google/protobuf/ValueOrBuilder.java                 \
+  lite/com/google/protobuf/WrappersProto.java
 
 bin_PROGRAMS = conformance-test-runner conformance-cpp
 
@@ -191,25 +138,21 @@
   conformance.proto           \
   conformance_python.py       \
   conformance_ruby.rb         \
-  conformance_php.php         \
   failure_list_cpp.txt        \
   failure_list_csharp.txt     \
   failure_list_java.txt       \
-  failure_list_js.txt         \
   failure_list_objc.txt       \
   failure_list_python.txt     \
   failure_list_python_cpp.txt \
   failure_list_python-post26.txt \
-  failure_list_ruby.txt       \
-  failure_list_php.txt        \
-  failure_list_php_c.txt
+  failure_list_ruby.txt
 
 conformance_test_runner_LDADD = $(top_srcdir)/src/libprotobuf.la
 conformance_test_runner_SOURCES = conformance_test.h conformance_test.cc \
                                   conformance_test_runner.cc             \
                                   third_party/jsoncpp/json.h             \
                                   third_party/jsoncpp/jsoncpp.cpp
-nodist_conformance_test_runner_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc
+nodist_conformance_test_runner_SOURCES = conformance.pb.cc
 conformance_test_runner_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
 conformance_test_runner_CXXFLAGS = -std=c++11
 # Explicit deps beacuse BUILT_SOURCES are only done before a "make all/check"
@@ -219,7 +162,7 @@
 
 conformance_cpp_LDADD = $(top_srcdir)/src/libprotobuf.la
 conformance_cpp_SOURCES = conformance_cpp.cc
-nodist_conformance_cpp_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc
+nodist_conformance_cpp_SOURCES = conformance.pb.cc
 conformance_cpp_CPPFLAGS = -I$(top_srcdir)/src
 # Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check"
 # so a direct "make test_cpp" could fail if parallel enough.
@@ -230,7 +173,7 @@
 bin_PROGRAMS += conformance-objc
 
 conformance_objc_SOURCES = conformance_objc.m ../objectivec/GPBProtocolBuffers.m
-nodist_conformance_objc_SOURCES = Conformance.pbobjc.m google/protobuf/TestMessagesProto2.pbobjc.m google/protobuf/TestMessagesProto3.pbobjc.m
+nodist_conformance_objc_SOURCES = Conformance.pbobjc.m
 # On travis, the build fails without the isysroot because whatever system
 # headers are being found don't include generics support for
 # NSArray/NSDictionary, the only guess is their image at one time had an odd
@@ -239,25 +182,17 @@
 conformance_objc_LDFLAGS = -framework Foundation
 # Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check"
 # so a direct "make test_objc" could fail if parallel enough.
-conformance_objc-conformance_objc.$(OBJEXT): Conformance.pbobjc.h google/protobuf/TestMessagesProto2.pbobjc.h google/protobuf/TestMessagesProto3.pbobjc.h
+conformance_objc-conformance_objc.$(OBJEXT): Conformance.pbobjc.h
 
 endif
 
-# JavaScript well-known types are expected to be in a directory called
-# google-protobuf, because they are usually in the google-protobuf npm
-# package.  But we want to use the sources from our tree, so we recreate
-# that directory structure here.
-google-protobuf:
-	mkdir google-protobuf
-
 if USE_EXTERNAL_PROTOC
 
 # Some implementations include pre-generated versions of well-known types.
-protoc_middleman: $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf
-	$(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. --php_out=. --js_out=import_style=commonjs,binary:. $(conformance_protoc_inputs)
-	$(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --objc_out=. --python_out=. --js_out=import_style=commonjs,binary:. $(conformance_proto2_protoc_inputs)
-	$(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --python_out=. --js_out=import_style=commonjs,binary:google-protobuf $(well_known_type_protoc_inputs)
-	## $(PROTOC) -I$(srcdir) -I$(top_srcdir) --java_out=lite:lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs)
+protoc_middleman: $(conformance_protoc_inputs) $(well_known_type_protoc_inputs)
+	$(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. $(conformance_protoc_inputs)
+	$(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --python_out=. $(well_known_type_protoc_inputs)
+	$(PROTOC) -I$(srcdir) -I$(top_srcdir) --java_out=lite:lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs)
 	touch protoc_middleman
 
 else
@@ -265,12 +200,11 @@
 # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
 # relative to srcdir, which may not be the same as the current directory when
 # building out-of-tree.
-protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf
-	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd --php_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_protoc_inputs) )
-	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --objc_out=. --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_proto2_protoc_inputs) )
-	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd/google-protobuf $(well_known_type_protoc_inputs) )
-	## @mkdir -p lite
-	## oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --java_out=lite:$$oldpwd/lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) )
+protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(well_known_type_protoc_inputs)
+	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd $(conformance_protoc_inputs) )
+	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --python_out=$$oldpwd $(well_known_type_protoc_inputs) )
+	@mkdir -p lite
+	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --java_out=lite:$$oldpwd/lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) )
 	touch protoc_middleman
 
 endif
@@ -281,13 +215,13 @@
 
 BUILT_SOURCES = $(protoc_outputs) $(other_language_protoc_outputs)
 
-CLEANFILES = $(protoc_outputs) protoc_middleman javac_middleman conformance-java javac_middleman_lite conformance-java-lite conformance-csharp conformance-php conformance-php-c $(other_language_protoc_outputs)
+CLEANFILES = $(protoc_outputs) protoc_middleman javac_middleman conformance-java javac_middleman_lite conformance-java-lite conformance-csharp $(other_language_protoc_outputs)
 
 MAINTAINERCLEANFILES =   \
   Makefile.in
 
 javac_middleman: ConformanceJava.java protoc_middleman $(other_language_protoc_outputs)
-	jar=`ls ../java/util/target/*jar-with-dependencies.jar` && javac -classpath ../java/target/classes:$$jar ConformanceJava.java com/google/protobuf/conformance/Conformance.java com/google/protobuf_test_messages/proto3/TestMessagesProto3.java com/google/protobuf_test_messages/proto2/TestMessagesProto2.java
+	jar=`ls ../java/util/target/*jar-with-dependencies.jar` && javac -classpath ../java/target/classes:$$jar ConformanceJava.java com/google/protobuf/conformance/Conformance.java
 	@touch javac_middleman
 
 conformance-java: javac_middleman
@@ -312,60 +246,36 @@
 conformance-csharp: $(other_language_protoc_outputs)
 	@echo "Writing shortcut script conformance-csharp..."
 	@echo '#! /bin/sh' > conformance-csharp
-	@echo 'dotnet ../csharp/src/Google.Protobuf.Conformance/bin/Release/netcoreapp1.0/Google.Protobuf.Conformance.dll "$$@"' >> conformance-csharp
+	@echo 'mono ../csharp/src/Google.Protobuf.Conformance/bin/Release/Google.Protobuf.Conformance.exe "$$@"' >> conformance-csharp
 	@chmod +x conformance-csharp
 
-conformance-php:
-	@echo "Writing shortcut script conformance-php..."
-	@echo '#! /bin/sh' > conformance-php
-	@echo 'php -d auto_prepend_file=autoload.php ./conformance_php.php' >> conformance-php
-	@chmod +x conformance-php
-
-conformance-php-c:
-	@echo "Writing shortcut script conformance-php-c..."
-	@echo '#! /bin/sh' > conformance-php-c
-	@echo 'php -dextension=../php/ext/google/protobuf/modules/protobuf.so ./conformance_php.php' >> conformance-php-c
-	@chmod +x conformance-php-c
-
 # Targets for actually running tests.
 test_cpp: protoc_middleman conformance-test-runner conformance-cpp
-	./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt ./conformance-cpp
+	./conformance-test-runner --failure_list failure_list_cpp.txt ./conformance-cpp
 
 test_java: protoc_middleman conformance-test-runner conformance-java
-	./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt ./conformance-java
+	./conformance-test-runner --failure_list failure_list_java.txt ./conformance-java
 
 test_java_lite: protoc_middleman conformance-test-runner conformance-java-lite
-	./conformance-test-runner --enforce_recommended ./conformance-java-lite
+	./conformance-test-runner ./conformance-java-lite
 
 test_csharp: protoc_middleman conformance-test-runner conformance-csharp
-	./conformance-test-runner --enforce_recommended --failure_list failure_list_csharp.txt ./conformance-csharp
+	./conformance-test-runner --failure_list failure_list_csharp.txt ./conformance-csharp
 
 test_ruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs)
-	RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_ruby.txt ./conformance_ruby.rb
-
-test_php: protoc_middleman conformance-test-runner conformance-php $(other_language_protoc_outputs)
-	./conformance-test-runner --enforce_recommended --failure_list failure_list_php.txt ./conformance-php
-
-test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs)
-	./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt ./conformance-php-c
-
-test_php_zts_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs)
-	./conformance-test-runner --enforce_recommended --failure_list failure_list_php_zts_c.txt ./conformance-php-c
+	RUBYLIB=../ruby/lib:. ./conformance-test-runner --failure_list failure_list_ruby.txt ./conformance_ruby.rb
 
 # These depend on library paths being properly set up.  The easiest way to
 # run them is to just use "tox" from the python dir.
 test_python: protoc_middleman conformance-test-runner
-	./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt ./conformance_python.py
+	./conformance-test-runner --failure_list failure_list_python.txt $(CONFORMANCE_PYTHON_EXTRA_FAILURES) ./conformance_python.py
 
 test_python_cpp: protoc_middleman conformance-test-runner
-	./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt ./conformance_python.py
-
-test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs)
-	NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js
+	./conformance-test-runner --failure_list failure_list_python_cpp.txt $(CONFORMANCE_PYTHON_EXTRA_FAILURES) ./conformance_python.py
 
 if OBJC_CONFORMANCE_TEST
 
 test_objc: protoc_middleman conformance-test-runner conformance-objc
-	./conformance-test-runner --enforce_recommended --failure_list failure_list_objc.txt ./conformance-objc
+	./conformance-test-runner --failure_list failure_list_objc.txt ./conformance-objc
 
 endif
diff --git a/conformance/README.md b/conformance/README.md
index 971fe8f..9388055 100644
--- a/conformance/README.md
+++ b/conformance/README.md
@@ -19,39 +19,11 @@
 
     $ make
 
-Running the tests for C++
--------------------------
-
-To run the tests against the C++ implementation, run:
+Then to run the tests against the C++ implementation, run:
 
     $ cd conformance && make test_cpp
 
-Running the tests for JavaScript (Node.js)
-------------------------------------------
-
-To run the JavaScript tests against Node.js, make sure you have "node"
-on your path and then run:
-
-    $ cd conformance && make test_nodejs
-
-Running the tests for Ruby (MRI)
---------------------------------
-
-To run the Ruby tests against MRI, first build the C extension:
-
-    $ cd ruby && rake
-
-Then run the tests like so:
-
-    $ cd conformance && make test_ruby
-
-Running the tests for other languages
--------------------------------------
-
-Most of the languages in the Protobuf source tree are set up to run
-conformance tests.  However some of them are more tricky to set up
-properly.  See `tests.sh` in the base of the repository to see how
-Travis runs the tests.
+More tests and languages will be added soon!
 
 Testing other Protocol Buffer implementations
 ---------------------------------------------
diff --git a/conformance/autoload.php b/conformance/autoload.php
deleted file mode 100644
index 0f49aec..0000000
--- a/conformance/autoload.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-define("GOOGLE_INTERNAL_NAMESPACE", "Google\\Protobuf\\Internal\\");
-define("GOOGLE_NAMESPACE", "Google\\Protobuf\\");
-define("GOOGLE_GPBMETADATA_NAMESPACE", "GPBMetadata\\Google\\Protobuf\\");
-
-function protobuf_autoloader_impl($class, $prefix) {
-    $length = strlen($prefix);
-    if ((substr($class, 0, $length) === $prefix)) {
-        $path = '../php/src/' . implode('/', array_map('ucwords', explode('\\', $class))) . '.php';
-        include_once $path;
-    }
-}
-
-function protobuf_autoloader($class) {
-    protobuf_autoloader_impl($class, GOOGLE_INTERNAL_NAMESPACE);
-    protobuf_autoloader_impl($class, GOOGLE_NAMESPACE);
-    protobuf_autoloader_impl($class, GOOGLE_GPBMETADATA_NAMESPACE);
-}
-
-spl_autoload_register('protobuf_autoloader');
diff --git a/conformance/conformance.proto b/conformance/conformance.proto
index 525140e..fc96074 100644
--- a/conformance/conformance.proto
+++ b/conformance/conformance.proto
@@ -32,6 +32,13 @@
 package conformance;
 option java_package = "com.google.protobuf.conformance";
 
+import "google/protobuf/any.proto";
+import "google/protobuf/duration.proto";
+import "google/protobuf/field_mask.proto";
+import "google/protobuf/struct.proto";
+import "google/protobuf/timestamp.proto";
+import "google/protobuf/wrappers.proto";
+
 // This defines the conformance testing protocol.  This protocol exists between
 // the conformance test suite itself and the code being tested.  For each test,
 // the suite will send a ConformanceRequest message and expect a
@@ -63,13 +70,8 @@
 //   2. parse the protobuf or JSON payload in "payload" (which may fail)
 //   3. if the parse succeeded, serialize the message in the requested format.
 message ConformanceRequest {
-  // The payload (whether protobuf of JSON) is always for a
-  // protobuf_test_messages.proto3.TestAllTypes proto (as defined in
-  // src/google/protobuf/proto3_test_messages.proto).
-  //
-  // TODO(haberman): if/when we expand the conformance tests to support proto2,
-  // we will want to include a field that lets the payload/response be a
-  // protobuf_test_messages.proto2.TestAllTypes message instead.
+  // The payload (whether protobuf of JSON) is always for a TestAllTypes proto
+  // (see below).
   oneof payload {
     bytes protobuf_payload = 1;
     string json_payload = 2;
@@ -77,11 +79,6 @@
 
   // Which format should the testee serialize its message to?
   WireFormat requested_output_format = 3;
-
-  // The full name for the test message to use; for the moment, either:
-  // protobuf_test_messages.proto3.TestAllTypesProto3 or
-  // protobuf_test_messages.proto2.TestAllTypesProto2.
-  string message_type = 4;
 }
 
 // Represents a single test case's output.
@@ -117,3 +114,160 @@
     string skipped = 5;
   }
 }
+
+// This proto includes every type of field in both singular and repeated
+// forms.
+message TestAllTypes {
+  message NestedMessage {
+    int32 a = 1;
+    TestAllTypes corecursive = 2;
+  }
+
+  enum NestedEnum {
+    FOO = 0;
+    BAR = 1;
+    BAZ = 2;
+    NEG = -1;  // Intentionally negative.
+  }
+
+  // Singular
+  int32 optional_int32    =  1;
+  int64 optional_int64    =  2;
+  uint32 optional_uint32   =  3;
+  uint64 optional_uint64   =  4;
+  sint32 optional_sint32   =  5;
+  sint64 optional_sint64   =  6;
+  fixed32 optional_fixed32  =  7;
+  fixed64 optional_fixed64  =  8;
+  sfixed32 optional_sfixed32 =  9;
+  sfixed64 optional_sfixed64 = 10;
+  float optional_float    = 11;
+  double optional_double   = 12;
+  bool optional_bool     = 13;
+  string optional_string   = 14;
+  bytes optional_bytes    = 15;
+
+  NestedMessage                        optional_nested_message  = 18;
+  ForeignMessage                       optional_foreign_message = 19;
+
+  NestedEnum                           optional_nested_enum     = 21;
+  ForeignEnum                          optional_foreign_enum    = 22;
+
+  string optional_string_piece = 24 [ctype=STRING_PIECE];
+  string optional_cord = 25 [ctype=CORD];
+
+  TestAllTypes recursive_message = 27;
+
+  // Repeated
+  repeated    int32 repeated_int32    = 31;
+  repeated    int64 repeated_int64    = 32;
+  repeated   uint32 repeated_uint32   = 33;
+  repeated   uint64 repeated_uint64   = 34;
+  repeated   sint32 repeated_sint32   = 35;
+  repeated   sint64 repeated_sint64   = 36;
+  repeated  fixed32 repeated_fixed32  = 37;
+  repeated  fixed64 repeated_fixed64  = 38;
+  repeated sfixed32 repeated_sfixed32 = 39;
+  repeated sfixed64 repeated_sfixed64 = 40;
+  repeated    float repeated_float    = 41;
+  repeated   double repeated_double   = 42;
+  repeated     bool repeated_bool     = 43;
+  repeated   string repeated_string   = 44;
+  repeated    bytes repeated_bytes    = 45;
+
+  repeated NestedMessage                        repeated_nested_message  = 48;
+  repeated ForeignMessage                       repeated_foreign_message = 49;
+
+  repeated NestedEnum                           repeated_nested_enum     = 51;
+  repeated ForeignEnum                          repeated_foreign_enum    = 52;
+
+  repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];
+  repeated string repeated_cord = 55 [ctype=CORD];
+
+  // Map
+  map <   int32, int32>    map_int32_int32 = 56;
+  map <   int64, int64>    map_int64_int64 = 57;
+  map <  uint32, uint32>   map_uint32_uint32 = 58;
+  map <  uint64, uint64>   map_uint64_uint64 = 59;
+  map <  sint32, sint32>   map_sint32_sint32 = 60;
+  map <  sint64, sint64>   map_sint64_sint64 = 61;
+  map < fixed32, fixed32>  map_fixed32_fixed32 = 62;
+  map < fixed64, fixed64>  map_fixed64_fixed64 = 63;
+  map <sfixed32, sfixed32> map_sfixed32_sfixed32 = 64;
+  map <sfixed64, sfixed64> map_sfixed64_sfixed64 = 65;
+  map <   int32, float>    map_int32_float = 66;
+  map <   int32, double>   map_int32_double = 67;
+  map <    bool, bool>     map_bool_bool = 68;
+  map <  string, string>   map_string_string = 69;
+  map <  string, bytes>    map_string_bytes = 70;
+  map <  string, NestedMessage>  map_string_nested_message = 71;
+  map <  string, ForeignMessage> map_string_foreign_message = 72;
+  map <  string, NestedEnum>     map_string_nested_enum = 73;
+  map <  string, ForeignEnum>    map_string_foreign_enum = 74;
+
+  oneof oneof_field {
+    uint32 oneof_uint32 = 111;
+    NestedMessage oneof_nested_message = 112;
+    string oneof_string = 113;
+    bytes oneof_bytes = 114;
+  }
+
+  // Well-known types
+  google.protobuf.BoolValue optional_bool_wrapper = 201;
+  google.protobuf.Int32Value optional_int32_wrapper = 202;
+  google.protobuf.Int64Value optional_int64_wrapper = 203;
+  google.protobuf.UInt32Value optional_uint32_wrapper = 204;
+  google.protobuf.UInt64Value optional_uint64_wrapper = 205;
+  google.protobuf.FloatValue optional_float_wrapper = 206;
+  google.protobuf.DoubleValue optional_double_wrapper = 207;
+  google.protobuf.StringValue optional_string_wrapper = 208;
+  google.protobuf.BytesValue optional_bytes_wrapper = 209;
+
+  repeated google.protobuf.BoolValue repeated_bool_wrapper = 211;
+  repeated google.protobuf.Int32Value repeated_int32_wrapper = 212;
+  repeated google.protobuf.Int64Value repeated_int64_wrapper = 213;
+  repeated google.protobuf.UInt32Value repeated_uint32_wrapper = 214;
+  repeated google.protobuf.UInt64Value repeated_uint64_wrapper = 215;
+  repeated google.protobuf.FloatValue repeated_float_wrapper = 216;
+  repeated google.protobuf.DoubleValue repeated_double_wrapper = 217;
+  repeated google.protobuf.StringValue repeated_string_wrapper = 218;
+  repeated google.protobuf.BytesValue repeated_bytes_wrapper = 219;
+
+  google.protobuf.Duration optional_duration = 301;
+  google.protobuf.Timestamp optional_timestamp = 302;
+  google.protobuf.FieldMask optional_field_mask = 303;
+  google.protobuf.Struct optional_struct = 304;
+  google.protobuf.Any optional_any = 305;
+  google.protobuf.Value optional_value = 306;
+
+  repeated google.protobuf.Duration repeated_duration = 311;
+  repeated google.protobuf.Timestamp repeated_timestamp = 312;
+  repeated google.protobuf.FieldMask repeated_fieldmask = 313;
+  repeated google.protobuf.Struct repeated_struct = 324;
+  repeated google.protobuf.Any repeated_any = 315;
+  repeated google.protobuf.Value repeated_value = 316;
+
+  // Test field-name-to-JSON-name convention.
+  int32 fieldname1 = 401;
+  int32 field_name2 = 402;
+  int32 _field_name3 = 403;
+  int32 field__name4_ = 404;
+  int32 field0name5 = 405;
+  int32 field_0_name6 = 406;
+  int32 fieldName7 = 407;
+  int32 FieldName8 = 408;
+  int32 field_Name9 = 409;
+  int32 Field_Name10 = 410;
+  int32 FIELD_NAME11 = 411;
+  int32 FIELD_name12 = 412;
+}
+
+message ForeignMessage {
+  int32 c = 1;
+}
+
+enum ForeignEnum {
+  FOREIGN_FOO = 0;
+  FOREIGN_BAR = 1;
+  FOREIGN_BAZ = 2;
+}
diff --git a/conformance/conformance_cpp.cc b/conformance/conformance_cpp.cc
index 9540b50..1a26549 100644
--- a/conformance/conformance_cpp.cc
+++ b/conformance/conformance_cpp.cc
@@ -33,26 +33,20 @@
 #include <unistd.h>
 
 #include "conformance.pb.h"
-#include <google/protobuf/test_messages_proto3.pb.h>
-#include <google/protobuf/test_messages_proto2.pb.h>
-#include <google/protobuf/message.h>
 #include <google/protobuf/util/json_util.h>
 #include <google/protobuf/util/type_resolver_util.h>
 
 using conformance::ConformanceRequest;
 using conformance::ConformanceResponse;
+using conformance::TestAllTypes;
 using google::protobuf::Descriptor;
 using google::protobuf::DescriptorPool;
-using google::protobuf::Message;
-using google::protobuf::MessageFactory;
 using google::protobuf::internal::scoped_ptr;
 using google::protobuf::util::BinaryToJsonString;
 using google::protobuf::util::JsonToBinaryString;
 using google::protobuf::util::NewTypeResolverForDescriptorPool;
 using google::protobuf::util::Status;
 using google::protobuf::util::TypeResolver;
-using protobuf_test_messages::proto3::TestAllTypesProto3;
-using protobuf_test_messages::proto2::TestAllTypesProto2;
 using std::string;
 
 static const char kTypeUrlPrefix[] = "type.googleapis.com";
@@ -92,24 +86,17 @@
 }
 
 void DoTest(const ConformanceRequest& request, ConformanceResponse* response) {
-  Message *test_message;
-  const Descriptor *descriptor = DescriptorPool::generated_pool()->FindMessageTypeByName(
-      request.message_type());
-  if (!descriptor) {
-    GOOGLE_LOG(FATAL) << "No such message type: " << request.message_type();
-  }
-  test_message = MessageFactory::generated_factory()->GetPrototype(descriptor)->New();
+  TestAllTypes test_message;
 
   switch (request.payload_case()) {
-    case ConformanceRequest::kProtobufPayload: {
-      if (!test_message->ParseFromString(request.protobuf_payload())) {
+    case ConformanceRequest::kProtobufPayload:
+      if (!test_message.ParseFromString(request.protobuf_payload())) {
         // Getting parse details would involve something like:
         //   http://stackoverflow.com/questions/22121922/how-can-i-get-more-details-about-errors-generated-during-protobuf-parsing-c
         response->set_parse_error("Parse error (no more details available).");
         return;
       }
       break;
-    }
 
     case ConformanceRequest::kJsonPayload: {
       string proto_binary;
@@ -121,7 +108,7 @@
         return;
       }
 
-      if (!test_message->ParseFromString(proto_binary)) {
+      if (!test_message.ParseFromString(proto_binary)) {
         response->set_runtime_error(
             "Parsing JSON generates invalid proto output.");
         return;
@@ -139,14 +126,14 @@
       GOOGLE_LOG(FATAL) << "Unspecified output format";
       break;
 
-    case conformance::PROTOBUF: {
-      GOOGLE_CHECK(test_message->SerializeToString(response->mutable_protobuf_payload()));
+    case conformance::PROTOBUF:
+      GOOGLE_CHECK(
+          test_message.SerializeToString(response->mutable_protobuf_payload()));
       break;
-    }
 
     case conformance::JSON: {
       string proto_binary;
-      GOOGLE_CHECK(test_message->SerializeToString(&proto_binary));
+      GOOGLE_CHECK(test_message.SerializeToString(&proto_binary));
       Status status = BinaryToJsonString(type_resolver, *type_url, proto_binary,
                                          response->mutable_json_payload());
       if (!status.ok()) {
@@ -209,7 +196,7 @@
 int main() {
   type_resolver = NewTypeResolverForDescriptorPool(
       kTypeUrlPrefix, DescriptorPool::generated_pool());
-  type_url = new string(GetTypeUrl(TestAllTypesProto3::descriptor()));
+  type_url = new string(GetTypeUrl(TestAllTypes::descriptor()));
   while (1) {
     if (!DoTestIo()) {
       fprintf(stderr, "conformance-cpp: received EOF from test runner "
diff --git a/conformance/conformance_nodejs.js b/conformance/conformance_nodejs.js
deleted file mode 100755
index 5d3955f..0000000
--- a/conformance/conformance_nodejs.js
+++ /dev/null
@@ -1,182 +0,0 @@
-#!/usr/bin/env node
-
-/*
- * Protocol Buffers - Google's data interchange format
- * Copyright 2008 Google Inc.  All rights reserved.
- * https://developers.google.com/protocol-buffers/
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-var conformance = require('conformance_pb');
-var test_messages_proto3 = require('google/protobuf/test_messages_proto3_pb');
-var test_messages_proto2 = require('google/protobuf/test_messages_proto2_pb');
-var fs = require('fs');
-
-var testCount = 0;
-
-function doTest(request) {
-  var testMessage;
-  var response = new conformance.ConformanceResponse();
-
-  try {
-    if (request.getRequestedOutputFormat() === conformance.WireFormat.JSON) {
-      response.setSkipped("JSON not supported.");
-      return response;
-    }
-
-    switch (request.getPayloadCase()) {
-      case conformance.ConformanceRequest.PayloadCase.PROTOBUF_PAYLOAD: {
-        if (request.getMessageType() == "protobuf_test_messages.proto3.TestAllTypesProto3") {
-          try {
-            testMessage = test_messages_proto3.TestAllTypesProto3.deserializeBinary(
-                request.getProtobufPayload());
-          } catch (err) {
-            response.setParseError(err.toString());
-            return response;
-          }
-        } else if (request.getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2"){
-          try {
-            testMessage = test_messages_proto2.TestAllTypesProto2.deserializeBinary(
-                request.getProtobufPayload());
-          } catch (err) {
-            response.setParseError(err.toString());
-            return response;
-          }
-        } else {
-          throw "Protobuf request doesn\'t have specific payload type";
-        }
-      }
-
-      case conformance.ConformanceRequest.PayloadCase.JSON_PAYLOAD:
-        response.setSkipped("JSON not supported.");
-        return response;
-
-      case conformance.ConformanceRequest.PayloadCase.PAYLOAD_NOT_SET:
-        response.setRuntimeError("Request didn't have payload");
-        return response;
-    }
-
-    switch (request.getRequestedOutputFormat()) {
-      case conformance.WireFormat.UNSPECIFIED:
-        response.setRuntimeError("Unspecified output format");
-        return response;
-
-      case conformance.WireFormat.PROTOBUF:
-        response.setProtobufPayload(testMessage.serializeBinary());
-
-      case conformance.WireFormat.JSON:
-        response.setSkipped("JSON not supported.");
-        return response;
-
-      default:
-        throw "Request didn't have requested output format";
-    }
-  } catch (err) {
-    response.setRuntimeError(err.toString());
-  }
-
-  return response;
-}
-
-function onEof(totalRead) {
-  if (totalRead == 0) {
-    return undefined;
-  } else {
-    throw "conformance_nodejs: premature EOF on stdin.";
-  }
-}
-
-// Utility function to read a buffer of N bytes.
-function readBuffer(bytes) {
-  var buf = new Buffer(bytes);
-  var totalRead = 0;
-  while (totalRead < bytes) {
-    var read = 0;
-    try {
-      read = fs.readSync(process.stdin.fd, buf, totalRead, bytes - totalRead);
-    } catch (e) {
-      if (e.code == 'EOF') {
-        return onEof(totalRead)
-      } else if (e.code == 'EAGAIN') {
-      } else {
-        throw "conformance_nodejs: Error reading from stdin." + e;
-      }
-    }
-
-    totalRead += read;
-  }
-
-  return buf;
-}
-
-function writeBuffer(buffer) {
-  var totalWritten = 0;
-  while (totalWritten < buffer.length) {
-    totalWritten += fs.writeSync(
-        process.stdout.fd, buffer, totalWritten, buffer.length - totalWritten);
-  }
-}
-
-// Returns true if the test ran successfully, false on legitimate EOF.
-// If EOF is encountered in an unexpected place, raises IOError.
-function doTestIo() {
-  var lengthBuf = readBuffer(4);
-  if (!lengthBuf) {
-    return false;
-  }
-
-  var length = lengthBuf.readInt32LE(0);
-  var serializedRequest = readBuffer(length);
-  if (!serializedRequest) {
-    throw "conformance_nodejs: Failed to read request.";
-  }
-
-  serializedRequest = new Uint8Array(serializedRequest);
-  var request =
-      conformance.ConformanceRequest.deserializeBinary(serializedRequest);
-  var response = doTest(request);
-
-  var serializedResponse = response.serializeBinary();
-
-  lengthBuf = new Buffer(4);
-  lengthBuf.writeInt32LE(serializedResponse.length, 0);
-  writeBuffer(lengthBuf);
-  writeBuffer(new Buffer(serializedResponse));
-
-  testCount += 1
-
-  return true;
-}
-
-while (true) {
-  if (!doTestIo()) {
-    console.error('conformance_nodejs: received EOF from test runner ' +
-                  "after " + testCount + " tests, exiting")
-    break;
-  }
-}
diff --git a/conformance/conformance_objc.m b/conformance/conformance_objc.m
index 84a4381..1124bfe 100644
--- a/conformance/conformance_objc.m
+++ b/conformance/conformance_objc.m
@@ -31,8 +31,6 @@
 #import <Foundation/Foundation.h>
 
 #import "Conformance.pbobjc.h"
-#import "google/protobuf/TestMessagesProto2.pbobjc.h"
-#import "google/protobuf/TestMessagesProto3.pbobjc.h"
 
 static void Die(NSString *format, ...) __dead2;
 
@@ -64,7 +62,7 @@
 
 static ConformanceResponse *DoTest(ConformanceRequest *request) {
   ConformanceResponse *response = [ConformanceResponse message];
-  GPBMessage *testMessage = nil;
+  TestAllTypes *testMessage = nil;
 
   switch (request.payloadOneOfCase) {
     case ConformanceRequest_Payload_OneOfCase_GPBUnsetOneOfCase:
@@ -72,16 +70,9 @@
       break;
 
     case ConformanceRequest_Payload_OneOfCase_ProtobufPayload: {
-      Class msgClass = nil;
-      if ([request.messageType isEqual:@"protobuf_test_messages.proto3.TestAllTypesProto3"]) {
-        msgClass = [Proto3TestAllTypesProto3 class];
-      } else if ([request.messageType isEqual:@"protobuf_test_messages.proto2.TestAllTypesProto2"]) {
-        msgClass = [TestAllTypesProto2 class];
-      } else {
-        Die(@"Protobuf request had an unknown message_type: %@", request.messageType);
-      }
       NSError *error = nil;
-      testMessage = [msgClass parseFromData:request.protobufPayload error:&error];
+      testMessage = [TestAllTypes parseFromData:request.protobufPayload
+                                          error:&error];
       if (!testMessage) {
         response.parseError =
             [NSString stringWithFormat:@"Parse error: %@", error];
diff --git a/conformance/conformance_php.php b/conformance/conformance_php.php
deleted file mode 100755
index 19f9a09..0000000
--- a/conformance/conformance_php.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-
-require_once("Conformance/WireFormat.php");
-require_once("Conformance/ConformanceResponse.php");
-require_once("Conformance/ConformanceRequest.php");
-require_once("Protobuf_test_messages/Proto3/ForeignMessage.php");
-require_once("Protobuf_test_messages/Proto3/ForeignEnum.php");
-require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3.php");
-require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3_NestedMessage.php");
-require_once("Protobuf_test_messages/Proto3/TestAllTypesProto3_NestedEnum.php");
-
-require_once("GPBMetadata/Conformance.php");
-require_once("GPBMetadata/Google/Protobuf/TestMessagesProto3.php");
-
-use  \Conformance\WireFormat;
-
-if (!ini_get("date.timezone")) {
-  ini_set("date.timezone", "UTC");
-}
-
-$test_count = 0;
-
-function doTest($request)
-{
-    $test_message = new \Protobuf_test_messages\Proto3\TestAllTypesProto3();
-    $response = new \Conformance\ConformanceResponse();
-    if ($request->getPayload() == "protobuf_payload") {
-      if ($request->getMessageType() == "protobuf_test_messages.proto3.TestAllTypesProto3") {
-        try {
-          $test_message->mergeFromString($request->getProtobufPayload());
-        } catch (Exception $e) {
-          $response->setParseError($e->getMessage());
-          return $response;
-        }
-      } elseif ($request->getMessageType() == "protobuf_test_messages.proto2.TestAllTypesProto2") {
-        $response->setSkipped("PHP doesn't support proto2");
-        return $response;
-      } else {
-        trigger_error("Protobuf request doesn't have specific payload type", E_USER_ERROR);
-      }
-    } elseif ($request->getPayload() == "json_payload") {
-      try {
-          $test_message->mergeFromJsonString($request->getJsonPayload());
-      } catch (Exception $e) {
-          $response->setParseError($e->getMessage());
-          return $response;
-      }
-    } else {
-      trigger_error("Request didn't have payload.", E_USER_ERROR);
-    }
-
-    if ($request->getRequestedOutputFormat() == WireFormat::UNSPECIFIED) {
-      trigger_error("Unspecified output format.", E_USER_ERROR);
-    } elseif ($request->getRequestedOutputFormat() == WireFormat::PROTOBUF) {
-      $response->setProtobufPayload($test_message->serializeToString());
-    } elseif ($request->getRequestedOutputFormat() == WireFormat::JSON) {
-      try {
-          $response->setJsonPayload($test_message->serializeToJsonString());
-      } catch (Exception $e) {
-          $response->setSerializeError($e->getMessage());
-          return $response;
-      }
-    }
-
-    return $response;
-}
-
-function doTestIO()
-{
-    $length_bytes = fread(STDIN, 4);
-    if (strlen($length_bytes) == 0) {
-      return false;   # EOF
-    } elseif (strlen($length_bytes) != 4) {
-      fwrite(STDERR, "I/O error\n");
-      return false;
-    }
-
-    $length = unpack("V", $length_bytes)[1];
-    $serialized_request = fread(STDIN, $length);
-    if (strlen($serialized_request) != $length) {
-      trigger_error("I/O error", E_USER_ERROR);
-    }
-
-    $request = new \Conformance\ConformanceRequest();
-    $request->mergeFromString($serialized_request);
-
-    $response = doTest($request);
-
-    $serialized_response = $response->serializeToString();
-    fwrite(STDOUT, pack("V", strlen($serialized_response)));
-    fwrite(STDOUT, $serialized_response);
-
-    $GLOBALS['test_count'] += 1;
-
-    return true;
-}
-
-while(true){
-  if (!doTestIO()) {
-      fprintf(STDERR,
-             "conformance_php: received EOF from test runner " +
-             "after %d tests, exiting\n", $test_count);
-      exit;
-  }
-}
diff --git a/conformance/conformance_python.py b/conformance/conformance_python.py
index c5ba246..a490c8e 100755
--- a/conformance/conformance_python.py
+++ b/conformance/conformance_python.py
@@ -38,12 +38,8 @@
 import struct
 import sys
 import os
-from google.protobuf import descriptor
-from google.protobuf import descriptor_pool
-from google.protobuf import json_format
 from google.protobuf import message
-from google.protobuf import test_messages_proto3_pb2
-from google.protobuf import test_messages_proto2_pb2
+from google.protobuf import json_format
 import conformance_pb2
 
 sys.stdout = os.fdopen(sys.stdout.fileno(), 'wb', 0)
@@ -56,17 +52,9 @@
   pass
 
 def do_test(request):
-  isProto3 = (request.message_type == "protobuf_test_messages.proto3.TestAllTypesProto3")
-  isJson = (request.WhichOneof('payload') == 'json_payload')
-  isProto2 = (request.message_type == "protobuf_test_messages.proto2.TestAllTypesProto2")
-  
-  if (not isProto3) and (not isJson) and (not isProto2):
-    raise ProtocolError("Protobuf request doesn't have specific payload type")
-      
-  test_message = test_messages_proto2_pb2.TestAllTypesProto2() if isProto2 else \
-    test_messages_proto3_pb2.TestAllTypesProto3()
-
+  test_message = conformance_pb2.TestAllTypes()
   response = conformance_pb2.ConformanceResponse()
+  test_message = conformance_pb2.TestAllTypes()
 
   try:
     if request.WhichOneof('payload') == 'protobuf_payload':
@@ -74,12 +62,12 @@
         test_message.ParseFromString(request.protobuf_payload)
       except message.DecodeError as e:
         response.parse_error = str(e)
-        return response  
-      
+        return response
+
     elif request.WhichOneof('payload') == 'json_payload':
       try:
         json_format.Parse(request.json_payload, test_message)
-      except Exception as e:
+      except json_format.ParseError as e:
         response.parse_error = str(e)
         return response
 
@@ -93,11 +81,7 @@
       response.protobuf_payload = test_message.SerializeToString()
 
     elif request.requested_output_format == conformance_pb2.JSON:
-      try: 
-        response.json_payload = json_format.MessageToJson(test_message)
-      except Exception as e:
-        response.serialize_error = str(e)
-        return response
+      response.json_payload = json_format.MessageToJson(test_message)
 
   except Exception as e:
     response.runtime_error = str(e)
diff --git a/conformance/conformance_ruby.rb b/conformance/conformance_ruby.rb
index df63bf7..c716fac 100755
--- a/conformance/conformance_ruby.rb
+++ b/conformance/conformance_ruby.rb
@@ -30,38 +30,29 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-require 'conformance_pb'
-require 'google/protobuf/test_messages_proto3_pb'
+require 'conformance'
 
 $test_count = 0
 $verbose = false
 
 def do_test(request)
-  test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.new
+  test_message = Conformance::TestAllTypes.new
   response = Conformance::ConformanceResponse.new
 
   begin
     case request.payload
     when :protobuf_payload
-      if request.message_type.eql?('protobuf_test_messages.proto3.TestAllTypesProto3')
-        begin
-          test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.decode(
-              request.protobuf_payload)
-        rescue Google::Protobuf::ParseError => err
-          response.parse_error = err.message.encode('utf-8')
-          return response
-        end
-      elsif request.message_type.eql?('protobuf_test_messages.proto2.TestAllTypesProto2')
-        response.skipped = "Ruby doesn't support proto2"
+      begin
+        test_message =
+          Conformance::TestAllTypes.decode(request.protobuf_payload)
+      rescue Google::Protobuf::ParseError => err
+        response.parse_error = err.message.encode('utf-8')
         return response
-      else 
-        fail "Protobuf request doesn't have specific payload type"
       end
 
     when :json_payload
       begin
-        test_message = ProtobufTestMessages::Proto3::TestAllTypesProto3.decode_json(
-            request.json_payload)
+        test_message = Conformance::TestAllTypes.decode_json(request.json_payload)
       rescue Google::Protobuf::ParseError => err
         response.parse_error = err.message.encode('utf-8')
         return response
diff --git a/conformance/conformance_test.cc b/conformance/conformance_test.cc
index 98c2eae..fc0605b 100644
--- a/conformance/conformance_test.cc
+++ b/conformance/conformance_test.cc
@@ -30,18 +30,14 @@
 
 #include <stdarg.h>
 #include <string>
-#include <fstream>
 
 #include "conformance.pb.h"
 #include "conformance_test.h"
-#include <google/protobuf/test_messages_proto3.pb.h>
-#include <google/protobuf/test_messages_proto2.pb.h>
-
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/stringprintf.h>
 #include <google/protobuf/text_format.h>
-#include <google/protobuf/util/field_comparator.h>
 #include <google/protobuf/util/json_util.h>
+#include <google/protobuf/util/field_comparator.h>
 #include <google/protobuf/util/message_differencer.h>
 #include <google/protobuf/util/type_resolver_util.h>
 #include <google/protobuf/wire_format_lite.h>
@@ -50,6 +46,7 @@
 
 using conformance::ConformanceRequest;
 using conformance::ConformanceResponse;
+using conformance::TestAllTypes;
 using conformance::WireFormat;
 using google::protobuf::Descriptor;
 using google::protobuf::FieldDescriptor;
@@ -60,8 +57,6 @@
 using google::protobuf::util::MessageDifferencer;
 using google::protobuf::util::NewTypeResolverForDescriptorPool;
 using google::protobuf::util::Status;
-using protobuf_test_messages::proto3::TestAllTypesProto3;
-using protobuf_test_messages::proto2::TestAllTypesProto2;
 using std::string;
 
 namespace {
@@ -111,18 +106,13 @@
 // The maximum number of bytes that it takes to encode a 64-bit varint.
 #define VARINT_MAX_LEN 10
 
-size_t vencode64(uint64_t val, int over_encoded_bytes, char *buf) {
+size_t vencode64(uint64_t val, char *buf) {
   if (val == 0) { buf[0] = 0; return 1; }
   size_t i = 0;
   while (val) {
     uint8_t byte = val & 0x7fU;
     val >>= 7;
-    if (val || over_encoded_bytes) byte |= 0x80U;
-    buf[i++] = byte;
-  }
-  while (over_encoded_bytes--) {
-    assert(i < 10);
-    uint8_t byte = over_encoded_bytes ? 0x80 : 0;
+    if (val) byte |= 0x80U;
     buf[i++] = byte;
   }
   return i;
@@ -130,15 +120,7 @@
 
 string varint(uint64_t x) {
   char buf[VARINT_MAX_LEN];
-  size_t len = vencode64(x, 0, buf);
-  return string(buf, len);
-}
-
-// Encodes a varint that is |extra| bytes longer than it needs to be, but still
-// valid.
-string longvarint(uint64_t x, int extra) {
-  char buf[VARINT_MAX_LEN];
-  size_t len = vencode64(x, extra, buf);
+  size_t len = vencode64(x, buf);
   return string(buf, len);
 }
 
@@ -147,8 +129,8 @@
 string fixed64(void *data) { return string(static_cast<char*>(data), 8); }
 
 string delim(const string& buf) { return cat(varint(buf.size()), buf); }
-string u32(uint32_t u32) { return fixed32(&u32); }
-string u64(uint64_t u64) { return fixed64(&u64); }
+string uint32(uint32_t u32) { return fixed32(&u32); }
+string uint64(uint64_t u64) { return fixed64(&u64); }
 string flt(float f) { return fixed32(&f); }
 string dbl(double d) { return fixed64(&d); }
 string zz32(int32_t x) { return varint(WireFormatLite::ZigZagEncode32(x)); }
@@ -164,19 +146,16 @@
 
 #define UNKNOWN_FIELD 666
 
-const FieldDescriptor* GetFieldForType(FieldDescriptor::Type type,
-                                       bool repeated, bool isProto3) {
-
-  const Descriptor* d = isProto3 ?
-      TestAllTypesProto3().GetDescriptor() : TestAllTypesProto2().GetDescriptor();
+uint32_t GetFieldNumberForType(FieldDescriptor::Type type, bool repeated) {
+  const Descriptor* d = TestAllTypes().GetDescriptor();
   for (int i = 0; i < d->field_count(); i++) {
     const FieldDescriptor* f = d->field(i);
     if (f->type() == type && f->is_repeated() == repeated) {
-      return f;
+      return f->number();
     }
   }
   GOOGLE_LOG(FATAL) << "Couldn't find field with type " << (int)type;
-  return nullptr;
+  return 0;
 }
 
 string UpperCase(string str) {
@@ -203,7 +182,6 @@
 }
 
 void ConformanceTestSuite::ReportFailure(const string& test_name,
-                                         ConformanceLevel level,
                                          const ConformanceRequest& request,
                                          const ConformanceResponse& response,
                                          const char* fmt, ...) {
@@ -211,8 +189,6 @@
     expected_failures_++;
     if (!verbose_)
       return;
-  } else if (level == RECOMMENDED && !enforce_recommended_) {
-    StringAppendF(&output_, "WARNING, test=%s: ", test_name.c_str());
   } else {
     StringAppendF(&output_, "ERROR, test=%s: ", test_name.c_str());
     unexpected_failing_tests_.insert(test_name);
@@ -237,15 +213,6 @@
   skipped_.insert(test_name);
 }
 
-string ConformanceTestSuite::ConformanceLevelToString(ConformanceLevel level) {
-  switch (level) {
-    case REQUIRED: return "Required";
-    case RECOMMENDED: return "Recommended";
-  }
-  GOOGLE_LOG(FATAL) << "Unknown value: " << level;
-  return "";
-}
-
 void ConformanceTestSuite::RunTest(const string& test_name,
                                    const ConformanceRequest& request,
                                    ConformanceResponse* response) {
@@ -273,65 +240,25 @@
 }
 
 void ConformanceTestSuite::RunValidInputTest(
-    const string& test_name, ConformanceLevel level, const string& input,
-    WireFormat input_format, const string& equivalent_text_format,
-    WireFormat requested_output, bool isProto3) {
-  auto newTestMessage = [&isProto3]() {
-    Message* newMessage;
-    if (isProto3) {
-      newMessage = new TestAllTypesProto3;
-    } else {
-      newMessage = new TestAllTypesProto2;
-    }
-    return newMessage;
-  };
-  Message* reference_message = newTestMessage();
+    const string& test_name, const string& input, WireFormat input_format,
+    const string& equivalent_text_format, WireFormat requested_output) {
+  TestAllTypes reference_message;
   GOOGLE_CHECK(
-      TextFormat::ParseFromString(equivalent_text_format, reference_message))
+      TextFormat::ParseFromString(equivalent_text_format, &reference_message))
           << "Failed to parse data for test case: " << test_name
           << ", data: " << equivalent_text_format;
-  const string equivalent_wire_format = reference_message->SerializeAsString();
-  RunValidBinaryInputTest(test_name, level, input, input_format,
-                          equivalent_wire_format, requested_output, isProto3);
-}
-
-void ConformanceTestSuite::RunValidBinaryInputTest(
-    const string& test_name, ConformanceLevel level, const string& input,
-    WireFormat input_format, const string& equivalent_wire_format,
-    WireFormat requested_output, bool isProto3) {
-  auto newTestMessage = [&isProto3]() {
-    Message* newMessage;
-    if (isProto3) {
-      newMessage = new TestAllTypesProto3;
-    } else {
-      newMessage = new TestAllTypesProto2;
-    }
-    return newMessage;
-  };
-  Message* reference_message = newTestMessage();
-  GOOGLE_CHECK(
-      reference_message->ParseFromString(equivalent_wire_format))
-          << "Failed to parse wire data for test case: " << test_name;
 
   ConformanceRequest request;
   ConformanceResponse response;
 
   switch (input_format) {
-    case conformance::PROTOBUF: {
+    case conformance::PROTOBUF:
       request.set_protobuf_payload(input);
-      if (isProto3) {
-        request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3");
-      } else {
-        request.set_message_type("protobuf_test_messages.proto2.TestAllTypesProto2");
-      }
       break;
-    }
 
-    case conformance::JSON: {
-      request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3");
+    case conformance::JSON:
       request.set_json_payload(input);
       break;
-    }
 
     default:
       GOOGLE_LOG(FATAL) << "Unspecified input format";
@@ -341,19 +268,14 @@
 
   RunTest(test_name, request, &response);
 
-  Message *test_message = newTestMessage();
+  TestAllTypes test_message;
 
   switch (response.result_case()) {
-    case ConformanceResponse::RESULT_NOT_SET:
-      ReportFailure(test_name, level, request, response,
-                    "Response didn't have any field in the Response.");
-      return;
-
     case ConformanceResponse::kParseError:
     case ConformanceResponse::kRuntimeError:
     case ConformanceResponse::kSerializeError:
-      ReportFailure(test_name, level, request, response,
-                    "Failed to parse input or produce output.");
+      ReportFailure(test_name, request, response,
+                    "Failed to parse JSON input or produce JSON output.");
       return;
 
     case ConformanceResponse::kSkipped:
@@ -363,7 +285,7 @@
     case ConformanceResponse::kJsonPayload: {
       if (requested_output != conformance::JSON) {
         ReportFailure(
-            test_name, level, request, response,
+            test_name, request, response,
             "Test was asked for protobuf output but provided JSON instead.");
         return;
       }
@@ -372,15 +294,15 @@
           JsonToBinaryString(type_resolver_.get(), type_url_,
                              response.json_payload(), &binary_protobuf);
       if (!status.ok()) {
-        ReportFailure(test_name, level, request, response,
+        ReportFailure(test_name, request, response,
                       "JSON output we received from test was unparseable.");
         return;
       }
 
-      if (!test_message->ParseFromString(binary_protobuf)) {
-        ReportFailure(test_name, level, request, response,
-                    "INTERNAL ERROR: internal JSON->protobuf transcode "
-                    "yielded unparseable proto.");
+      if (!test_message.ParseFromString(binary_protobuf)) {
+        ReportFailure(test_name, request, response,
+                      "INTERNAL ERROR: internal JSON->protobuf transcode "
+                      "yielded unparseable proto.");
         return;
       }
 
@@ -390,14 +312,14 @@
     case ConformanceResponse::kProtobufPayload: {
       if (requested_output != conformance::PROTOBUF) {
         ReportFailure(
-            test_name, level, request, response,
+            test_name, request, response,
             "Test was asked for JSON output but provided protobuf instead.");
         return;
       }
 
-      if (!test_message->ParseFromString(response.protobuf_payload())) {
-        ReportFailure(test_name, level, request, response,
-                   "Protobuf output we received from test was unparseable.");
+      if (!test_message.ParseFromString(response.protobuf_payload())) {
+        ReportFailure(test_name, request, response,
+                      "Protobuf output we received from test was unparseable.");
         return;
       }
 
@@ -416,30 +338,22 @@
   string differences;
   differencer.ReportDifferencesToString(&differences);
 
-  bool check;
-  check = differencer.Compare(*reference_message, *test_message);
-  if (check) {
+  if (differencer.Compare(reference_message, test_message)) {
     ReportSuccess(test_name);
   } else {
-    ReportFailure(test_name, level, request, response,
+    ReportFailure(test_name, request, response,
                   "Output was not equivalent to reference message: %s.",
                   differences.c_str());
   }
 }
-void ConformanceTestSuite::ExpectParseFailureForProtoWithProtoVersion (
-    const string& proto, const string& test_name, ConformanceLevel level,
-    bool isProto3) {
+
+// Expect that this precise protobuf will cause a parse error.
+void ConformanceTestSuite::ExpectParseFailureForProto(
+    const string& proto, const string& test_name) {
   ConformanceRequest request;
   ConformanceResponse response;
   request.set_protobuf_payload(proto);
-  if (isProto3) {
-    request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3");
-  } else {
-    request.set_message_type("protobuf_test_messages.proto2.TestAllTypesProto2");
-  }
-  string effective_test_name = ConformanceLevelToString(level) +
-      (isProto3 ? ".Proto3" : ".Proto2") +
-      ".ProtobufInput." + test_name;
+  string effective_test_name = "ProtobufInput." + test_name;
 
   // We don't expect output, but if the program erroneously accepts the protobuf
   // we let it send its response as this.  We must not leave it unspecified.
@@ -451,87 +365,38 @@
   } else if (response.result_case() == ConformanceResponse::kSkipped) {
     ReportSkip(effective_test_name, request, response);
   } else {
-    ReportFailure(effective_test_name, level, request, response,
+    ReportFailure(effective_test_name, request, response,
                   "Should have failed to parse, but didn't.");
   }
 }
 
-// Expect that this precise protobuf will cause a parse error.
-void ConformanceTestSuite::ExpectParseFailureForProto(
-    const string& proto, const string& test_name, ConformanceLevel level) {
-  ExpectParseFailureForProtoWithProtoVersion(proto, test_name, level, true);
-  ExpectParseFailureForProtoWithProtoVersion(proto, test_name, level, false);
-}
-
 // Expect that this protobuf will cause a parse error, even if it is followed
 // by valid protobuf data.  We can try running this twice: once with this
 // data verbatim and once with this data followed by some valid data.
 //
 // TODO(haberman): implement the second of these.
 void ConformanceTestSuite::ExpectHardParseFailureForProto(
-    const string& proto, const string& test_name, ConformanceLevel level) {
-  return ExpectParseFailureForProto(proto, test_name, level);
+    const string& proto, const string& test_name) {
+  return ExpectParseFailureForProto(proto, test_name);
 }
 
 void ConformanceTestSuite::RunValidJsonTest(
-    const string& test_name, ConformanceLevel level, const string& input_json,
+    const string& test_name, const string& input_json,
     const string& equivalent_text_format) {
-  RunValidInputTest(
-      ConformanceLevelToString(level) + ".Proto3.JsonInput." + test_name +
-      ".ProtobufOutput", level, input_json, conformance::JSON,
-      equivalent_text_format, conformance::PROTOBUF, true);
-  RunValidInputTest(
-      ConformanceLevelToString(level) + ".Proto3.JsonInput." + test_name +
-      ".JsonOutput", level, input_json, conformance::JSON,
-      equivalent_text_format, conformance::JSON, true);
+  RunValidInputTest("JsonInput." + test_name + ".ProtobufOutput", input_json,
+                    conformance::JSON, equivalent_text_format,
+                    conformance::PROTOBUF);
+  RunValidInputTest("JsonInput." + test_name + ".JsonOutput", input_json,
+                    conformance::JSON, equivalent_text_format,
+                    conformance::JSON);
 }
 
 void ConformanceTestSuite::RunValidJsonTestWithProtobufInput(
-    const string& test_name, ConformanceLevel level, const TestAllTypesProto3& input,
+    const string& test_name, const TestAllTypes& input,
     const string& equivalent_text_format) {
-  RunValidInputTest(
-      ConformanceLevelToString(level) + ".Proto3" + ".ProtobufInput." + test_name +
-      ".JsonOutput", level, input.SerializeAsString(), conformance::PROTOBUF,
-      equivalent_text_format, conformance::JSON, true);
-}
-
-void ConformanceTestSuite::RunValidProtobufTest(
-    const string& test_name, ConformanceLevel level,
-    const string& input_protobuf, const string& equivalent_text_format,
-    bool isProto3) {
-  string rname = ".Proto3";
-  if (!isProto3) {
-    rname = ".Proto2";
-  }
-  RunValidInputTest(
-      ConformanceLevelToString(level) + rname + ".ProtobufInput." + test_name +
-      ".ProtobufOutput", level, input_protobuf, conformance::PROTOBUF,
-      equivalent_text_format, conformance::PROTOBUF, isProto3);
-  if (isProto3) {
-    RunValidInputTest(
-        ConformanceLevelToString(level) + rname + ".ProtobufInput." +  test_name +
-        ".JsonOutput", level, input_protobuf, conformance::PROTOBUF,
-        equivalent_text_format, conformance::JSON, isProto3);
-  }
-}
-
-void ConformanceTestSuite::RunValidBinaryProtobufTest(
-    const string& test_name, ConformanceLevel level,
-    const string& input_protobuf, bool isProto3) {
-  string rname = ".Proto3";
-  if (!isProto3) {
-    rname = ".Proto2";
-  }
-  RunValidBinaryInputTest(
-      ConformanceLevelToString(level) + rname + ".ProtobufInput." + test_name +
-      ".ProtobufOutput", level, input_protobuf, conformance::PROTOBUF,
-      input_protobuf, conformance::PROTOBUF, isProto3);
-}
-
-void ConformanceTestSuite::RunValidProtobufTestWithMessage(
-    const string& test_name, ConformanceLevel level, const Message *input,
-    const string& equivalent_text_format, bool isProto3) {
-  RunValidProtobufTest(test_name, level, input->SerializeAsString(), equivalent_text_format, isProto3);
+  RunValidInputTest("ProtobufInput." + test_name + ".JsonOutput",
+                    input.SerializeAsString(), conformance::PROTOBUF,
+                    equivalent_text_format, conformance::JSON);
 }
 
 // According to proto3 JSON specification, JSON serializers follow more strict
@@ -540,16 +405,14 @@
 // method allows strict checking on a proto3 JSON serializer by inspecting
 // the JSON output directly.
 void ConformanceTestSuite::RunValidJsonTestWithValidator(
-    const string& test_name, ConformanceLevel level, const string& input_json,
+    const string& test_name, const string& input_json,
     const Validator& validator) {
   ConformanceRequest request;
   ConformanceResponse response;
   request.set_json_payload(input_json);
   request.set_requested_output_format(conformance::JSON);
-  request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3");
 
-  string effective_test_name = ConformanceLevelToString(level) +
-      ".Proto3.JsonInput." + test_name + ".Validator";
+  string effective_test_name = "JsonInput." + test_name + ".Validator";
 
   RunTest(effective_test_name, request, &response);
 
@@ -559,7 +422,7 @@
   }
 
   if (response.result_case() != ConformanceResponse::kJsonPayload) {
-    ReportFailure(effective_test_name, level, request, response,
+    ReportFailure(effective_test_name, request, response,
                   "Expected JSON payload but got type %d.",
                   response.result_case());
     return;
@@ -567,13 +430,13 @@
   Json::Reader reader;
   Json::Value value;
   if (!reader.parse(response.json_payload(), value)) {
-    ReportFailure(effective_test_name, level, request, response,
+    ReportFailure(effective_test_name, request, response,
                   "JSON payload cannot be parsed as valid JSON: %s",
                   reader.getFormattedErrorMessages().c_str());
     return;
   }
   if (!validator(value)) {
-    ReportFailure(effective_test_name, level, request, response,
+    ReportFailure(effective_test_name, request, response,
                   "JSON payload validation failed.");
     return;
   }
@@ -581,13 +444,11 @@
 }
 
 void ConformanceTestSuite::ExpectParseFailureForJson(
-    const string& test_name, ConformanceLevel level, const string& input_json) {
+    const string& test_name, const string& input_json) {
   ConformanceRequest request;
   ConformanceResponse response;
   request.set_json_payload(input_json);
-  request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3");
-  string effective_test_name =
-      ConformanceLevelToString(level) + ".Proto3.JsonInput." + test_name;
+  string effective_test_name = "JsonInput." + test_name;
 
   // We don't expect output, but if the program erroneously accepts the protobuf
   // we let it send its response as this.  We must not leave it unspecified.
@@ -599,14 +460,14 @@
   } else if (response.result_case() == ConformanceResponse::kSkipped) {
     ReportSkip(effective_test_name, request, response);
   } else {
-    ReportFailure(effective_test_name, level, request, response,
+    ReportFailure(effective_test_name, request, response,
                   "Should have failed to parse, but didn't.");
   }
 }
 
 void ConformanceTestSuite::ExpectSerializeFailureForJson(
-    const string& test_name, ConformanceLevel level, const string& text_format) {
-  TestAllTypesProto3 payload_message;
+    const string& test_name, const string& text_format) {
+  TestAllTypes payload_message;
   GOOGLE_CHECK(
       TextFormat::ParseFromString(text_format, &payload_message))
           << "Failed to parse: " << text_format;
@@ -614,9 +475,7 @@
   ConformanceRequest request;
   ConformanceResponse response;
   request.set_protobuf_payload(payload_message.SerializeAsString());
-  request.set_message_type("protobuf_test_messages.proto3.TestAllTypesProto3");
-  string effective_test_name =
-      ConformanceLevelToString(level) + "." + test_name + ".JsonOutput";
+  string effective_test_name = test_name + ".JsonOutput";
   request.set_requested_output_format(conformance::JSON);
 
   RunTest(effective_test_name, request, &response);
@@ -625,12 +484,11 @@
   } else if (response.result_case() == ConformanceResponse::kSkipped) {
     ReportSkip(effective_test_name, request, response);
   } else {
-    ReportFailure(effective_test_name, level, request, response,
+    ReportFailure(effective_test_name, request, response,
                   "Should have failed to serialize, but didn't.");
   }
 }
 
-//TODO: proto2?
 void ConformanceTestSuite::TestPrematureEOFForType(FieldDescriptor::Type type) {
   // Incomplete values for each wire type.
   static const string incompletes[6] = {
@@ -642,8 +500,8 @@
     string("abc")       // 32BIT
   };
 
-  const FieldDescriptor* field = GetFieldForType(type, false, true);
-  const FieldDescriptor* rep_field = GetFieldForType(type, true, true);
+  uint32_t fieldnum = GetFieldNumberForType(type, false);
+  uint32_t rep_fieldnum = GetFieldNumberForType(type, true);
   WireFormatLite::WireType wire_type = WireFormatLite::WireTypeForFieldType(
       static_cast<WireFormatLite::FieldType>(type));
   const string& incomplete = incompletes[wire_type];
@@ -651,44 +509,42 @@
       UpperCase(string(".") + FieldDescriptor::TypeName(type));
 
   ExpectParseFailureForProto(
-      tag(field->number(), wire_type),
-      "PrematureEofBeforeKnownNonRepeatedValue" + type_name, REQUIRED);
+      tag(fieldnum, wire_type),
+      "PrematureEofBeforeKnownNonRepeatedValue" + type_name);
 
   ExpectParseFailureForProto(
-      tag(rep_field->number(), wire_type),
-      "PrematureEofBeforeKnownRepeatedValue" + type_name, REQUIRED);
+      tag(rep_fieldnum, wire_type),
+      "PrematureEofBeforeKnownRepeatedValue" + type_name);
 
   ExpectParseFailureForProto(
       tag(UNKNOWN_FIELD, wire_type),
-      "PrematureEofBeforeUnknownValue" + type_name, REQUIRED);
+      "PrematureEofBeforeUnknownValue" + type_name);
 
   ExpectParseFailureForProto(
-      cat( tag(field->number(), wire_type), incomplete ),
-      "PrematureEofInsideKnownNonRepeatedValue" + type_name, REQUIRED);
+      cat( tag(fieldnum, wire_type), incomplete ),
+      "PrematureEofInsideKnownNonRepeatedValue" + type_name);
 
   ExpectParseFailureForProto(
-      cat( tag(rep_field->number(), wire_type), incomplete ),
-      "PrematureEofInsideKnownRepeatedValue" + type_name, REQUIRED);
+      cat( tag(rep_fieldnum, wire_type), incomplete ),
+      "PrematureEofInsideKnownRepeatedValue" + type_name);
 
   ExpectParseFailureForProto(
       cat( tag(UNKNOWN_FIELD, wire_type), incomplete ),
-      "PrematureEofInsideUnknownValue" + type_name, REQUIRED);
+      "PrematureEofInsideUnknownValue" + type_name);
 
   if (wire_type == WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
     ExpectParseFailureForProto(
-        cat( tag(field->number(), wire_type), varint(1) ),
-        "PrematureEofInDelimitedDataForKnownNonRepeatedValue" + type_name,
-        REQUIRED);
+        cat( tag(fieldnum, wire_type), varint(1) ),
+        "PrematureEofInDelimitedDataForKnownNonRepeatedValue" + type_name);
 
     ExpectParseFailureForProto(
-        cat( tag(rep_field->number(), wire_type), varint(1) ),
-        "PrematureEofInDelimitedDataForKnownRepeatedValue" + type_name,
-        REQUIRED);
+        cat( tag(rep_fieldnum, wire_type), varint(1) ),
+        "PrematureEofInDelimitedDataForKnownRepeatedValue" + type_name);
 
     // EOF in the middle of delimited data for unknown value.
     ExpectParseFailureForProto(
         cat( tag(UNKNOWN_FIELD, wire_type), varint(1) ),
-        "PrematureEofInDelimitedDataForUnknownValue" + type_name, REQUIRED);
+        "PrematureEofInDelimitedDataForUnknownValue" + type_name);
 
     if (type == FieldDescriptor::TYPE_MESSAGE) {
       // Submessage ends in the middle of a value.
@@ -696,164 +552,51 @@
           cat( tag(WireFormatLite::TYPE_INT32, WireFormatLite::WIRETYPE_VARINT),
                 incompletes[WireFormatLite::WIRETYPE_VARINT] );
       ExpectHardParseFailureForProto(
-          cat( tag(field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED),
+          cat( tag(fieldnum, WireFormatLite::WIRETYPE_LENGTH_DELIMITED),
                varint(incomplete_submsg.size()),
                incomplete_submsg ),
-          "PrematureEofInSubmessageValue" + type_name, REQUIRED);
+          "PrematureEofInSubmessageValue" + type_name);
     }
   } else if (type != FieldDescriptor::TYPE_GROUP) {
     // Non-delimited, non-group: eligible for packing.
 
     // Packed region ends in the middle of a value.
     ExpectHardParseFailureForProto(
-        cat(tag(rep_field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED),
-            varint(incomplete.size()), incomplete),
-        "PrematureEofInPackedFieldValue" + type_name, REQUIRED);
+        cat( tag(rep_fieldnum, WireFormatLite::WIRETYPE_LENGTH_DELIMITED),
+             varint(incomplete.size()),
+             incomplete ),
+        "PrematureEofInPackedFieldValue" + type_name);
 
     // EOF in the middle of packed region.
     ExpectParseFailureForProto(
-        cat(tag(rep_field->number(), WireFormatLite::WIRETYPE_LENGTH_DELIMITED),
-            varint(1)),
-        "PrematureEofInPackedField" + type_name, REQUIRED);
+        cat( tag(rep_fieldnum, WireFormatLite::WIRETYPE_LENGTH_DELIMITED),
+             varint(1) ),
+        "PrematureEofInPackedField" + type_name);
   }
 }
 
-void ConformanceTestSuite::TestValidDataForType(
-    FieldDescriptor::Type type,
-    std::vector<std::pair<std::string, std::string>> values) {
-  for (int isProto3 = 0; isProto3 < 2; isProto3++) {
-    const string type_name =
-        UpperCase(string(".") + FieldDescriptor::TypeName(type));
-    WireFormatLite::WireType wire_type = WireFormatLite::WireTypeForFieldType(
-        static_cast<WireFormatLite::FieldType>(type));
-    const FieldDescriptor* field = GetFieldForType(type, false, isProto3);
-    const FieldDescriptor* rep_field = GetFieldForType(type, true, isProto3);
-
-    RunValidProtobufTest("ValidDataScalar" + type_name, REQUIRED,
-                         cat(tag(field->number(), wire_type), values[0].first),
-                         field->name() + ": " + values[0].second, isProto3);
-
-    string proto;
-    string text = field->name() + ": " + values.back().second;
-    for (size_t i = 0; i < values.size(); i++) {
-      proto += cat(tag(field->number(), wire_type), values[i].first);
-    }
-    RunValidProtobufTest("RepeatedScalarSelectsLast" + type_name, REQUIRED,
-                         proto, text, isProto3);
-
-    proto.clear();
-    text.clear();
-
-    for (size_t i = 0; i < values.size(); i++) {
-      proto += cat(tag(rep_field->number(), wire_type), values[i].first);
-      text += rep_field->name() + ": " + values[i].second + " ";
-    }
-    RunValidProtobufTest("ValidDataRepeated" + type_name, REQUIRED,
-                         proto, text, isProto3);
-  }
-}
-
-void ConformanceTestSuite::SetFailureList(const string& filename,
-                                          const vector<string>& failure_list) {
-  failure_list_filename_ = filename;
+void ConformanceTestSuite::SetFailureList(const vector<string>& failure_list) {
   expected_to_fail_.clear();
   std::copy(failure_list.begin(), failure_list.end(),
             std::inserter(expected_to_fail_, expected_to_fail_.end()));
 }
 
-bool ConformanceTestSuite::CheckSetEmpty(const std::set<string>& set_to_check,
-                                         const std::string& write_to_file,
-                                         const std::string& msg) {
+bool ConformanceTestSuite::CheckSetEmpty(const set<string>& set_to_check,
+                                         const char* msg) {
   if (set_to_check.empty()) {
     return true;
   } else {
     StringAppendF(&output_, "\n");
-    StringAppendF(&output_, "%s\n\n", msg.c_str());
-    for (std::set<string>::const_iterator iter = set_to_check.begin();
+    StringAppendF(&output_, "%s:\n", msg);
+    for (set<string>::const_iterator iter = set_to_check.begin();
          iter != set_to_check.end(); ++iter) {
       StringAppendF(&output_, "  %s\n", iter->c_str());
     }
     StringAppendF(&output_, "\n");
-
-    if (!write_to_file.empty()) {
-      std::ofstream os(write_to_file);
-      if (os) {
-        for (std::set<string>::const_iterator iter = set_to_check.begin();
-             iter != set_to_check.end(); ++iter) {
-          os << *iter << "\n";
-        }
-      } else {
-        StringAppendF(&output_, "Failed to open file: %s\n",
-                      write_to_file.c_str());
-      }
-    }
-
     return false;
   }
 }
 
-// TODO: proto2?
-void ConformanceTestSuite::TestIllegalTags() {
-  // field num 0 is illegal
-  string nullfield[] = {
-    "\1DEADBEEF",
-    "\2\1\1",
-    "\3\4",
-    "\5DEAD"
-  };
-  for (int i = 0; i < 4; i++) {
-    string name = "IllegalZeroFieldNum_Case_0";
-    name.back() += i;
-    ExpectParseFailureForProto(nullfield[i], name, REQUIRED);
-  }
-}
-template <class MessageType>
-void ConformanceTestSuite::TestOneofMessage (MessageType &message,
-                                             bool isProto3) {
-  message.set_oneof_uint32(0);
-  RunValidProtobufTestWithMessage(
-      "OneofZeroUint32", RECOMMENDED, &message, "oneof_uint32: 0", isProto3);
-  message.mutable_oneof_nested_message()->set_a(0);
-  RunValidProtobufTestWithMessage(
-      "OneofZeroMessage", RECOMMENDED, &message,
-      isProto3 ? "oneof_nested_message: {}" : "oneof_nested_message: {a: 0}",
-      isProto3);
-  message.mutable_oneof_nested_message()->set_a(1);
-  RunValidProtobufTestWithMessage(
-      "OneofZeroMessageSetTwice", RECOMMENDED, &message,
-      "oneof_nested_message: {a: 1}",
-      isProto3);
-  message.set_oneof_string("");
-  RunValidProtobufTestWithMessage(
-      "OneofZeroString", RECOMMENDED, &message, "oneof_string: \"\"", isProto3);
-  message.set_oneof_bytes("");
-  RunValidProtobufTestWithMessage(
-      "OneofZeroBytes", RECOMMENDED, &message, "oneof_bytes: \"\"", isProto3);
-  message.set_oneof_bool(false);
-  RunValidProtobufTestWithMessage(
-      "OneofZeroBool", RECOMMENDED, &message, "oneof_bool: false", isProto3);
-  message.set_oneof_uint64(0);
-  RunValidProtobufTestWithMessage(
-      "OneofZeroUint64", RECOMMENDED, &message, "oneof_uint64: 0", isProto3);
-  message.set_oneof_float(0.0f);
-  RunValidProtobufTestWithMessage(
-      "OneofZeroFloat", RECOMMENDED, &message, "oneof_float: 0", isProto3);
-  message.set_oneof_double(0.0);
-  RunValidProtobufTestWithMessage(
-      "OneofZeroDouble", RECOMMENDED, &message, "oneof_double: 0", isProto3);
-  message.set_oneof_enum(MessageType::FOO);
-  RunValidProtobufTestWithMessage(
-      "OneofZeroEnum", RECOMMENDED, &message, "oneof_enum: FOO", isProto3);
-}
-
-template <class MessageType>
-void ConformanceTestSuite::TestUnknownMessage(MessageType& message,
-                                              bool isProto3) {
-  message.ParseFromString("\xA8\x1F\x01");
-  RunValidBinaryProtobufTest("UnknownVarint", REQUIRED,
-                             message.SerializeAsString(), isProto3);
-}
-
 bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
                                     std::string* output) {
   runner_ = runner;
@@ -865,7 +608,7 @@
   unexpected_succeeding_tests_.clear();
   type_resolver_.reset(NewTypeResolverForDescriptorPool(
       kTypeUrlPrefix, DescriptorPool::generated_pool()));
-  type_url_ = GetTypeUrl(TestAllTypesProto3::descriptor());
+  type_url_ = GetTypeUrl(TestAllTypes::descriptor());
 
   output_ = "\nCONFORMANCE TEST BEGIN ====================================\n\n";
 
@@ -874,122 +617,24 @@
     TestPrematureEOFForType(static_cast<FieldDescriptor::Type>(i));
   }
 
-  TestIllegalTags();
-
-  int64 kInt64Min = -9223372036854775808ULL;
-  int64 kInt64Max = 9223372036854775807ULL;
-  uint64 kUint64Max = 18446744073709551615ULL;
-  int32 kInt32Max = 2147483647;
-  int32 kInt32Min = -2147483648;
-  uint32 kUint32Max = 4294967295UL;
-
-  TestValidDataForType(FieldDescriptor::TYPE_DOUBLE, {
-    {dbl(0.1), "0.1"},
-    {dbl(1.7976931348623157e+308), "1.7976931348623157e+308"},
-    {dbl(2.22507385850720138309e-308), "2.22507385850720138309e-308"}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_FLOAT, {
-    {flt(0.1), "0.1"},
-    {flt(1.00000075e-36), "1.00000075e-36"},
-    {flt(3.402823e+38), "3.402823e+38"},  // 3.40282347e+38
-    {flt(1.17549435e-38f), "1.17549435e-38"}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_INT64, {
-    {varint(12345), "12345"},
-    {varint(kInt64Max), std::to_string(kInt64Max)},
-    {varint(kInt64Min), std::to_string(kInt64Min)}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_UINT64, {
-    {varint(12345), "12345"},
-    {varint(kUint64Max), std::to_string(kUint64Max)},
-    {varint(0), "0"}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_INT32, {
-    {varint(12345), "12345"},
-    {longvarint(12345, 2), "12345"},
-    {longvarint(12345, 7), "12345"},
-    {varint(kInt32Max), std::to_string(kInt32Max)},
-    {varint(kInt32Min), std::to_string(kInt32Min)},
-    {varint(1LL << 33), std::to_string(static_cast<int32>(1LL << 33))},
-    {varint((1LL << 33) - 1),
-     std::to_string(static_cast<int32>((1LL << 33) - 1))},
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_UINT32, {
-    {varint(12345), "12345"},
-    {longvarint(12345, 2), "12345"},
-    {longvarint(12345, 7), "12345"},
-    {varint(kUint32Max), std::to_string(kUint32Max)},  // UINT32_MAX
-    {varint(0), "0"},
-    {varint(1LL << 33), std::to_string(static_cast<uint32>(1LL << 33))},
-    {varint((1LL << 33) - 1),
-     std::to_string(static_cast<uint32>((1LL << 33) - 1))},
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_FIXED64, {
-    {u64(12345), "12345"},
-    {u64(kUint64Max), std::to_string(kUint64Max)},
-    {u64(0), "0"}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_FIXED32, {
-    {u32(12345), "12345"},
-    {u32(kUint32Max), std::to_string(kUint32Max)},  // UINT32_MAX
-    {u32(0), "0"}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_SFIXED64, {
-    {u64(12345), "12345"},
-    {u64(kInt64Max), std::to_string(kInt64Max)},
-    {u64(kInt64Min), std::to_string(kInt64Min)}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_SFIXED32, {
-    {u32(12345), "12345"},
-    {u32(kInt32Max), std::to_string(kInt32Max)},
-    {u32(kInt32Min), std::to_string(kInt32Min)}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_BOOL, {
-    {varint(1), "true"},
-    {varint(0), "false"},
-    {varint(12345678), "true"}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_SINT32, {
-    {zz32(12345), "12345"},
-    {zz32(kInt32Max), std::to_string(kInt32Max)},
-    {zz32(kInt32Min), std::to_string(kInt32Min)}
-  });
-  TestValidDataForType(FieldDescriptor::TYPE_SINT64, {
-    {zz64(12345), "12345"},
-    {zz64(kInt64Max), std::to_string(kInt64Max)},
-    {zz64(kInt64Min), std::to_string(kInt64Min)}
-  });
-
-  // TODO(haberman):
-  // TestValidDataForType(FieldDescriptor::TYPE_STRING
-  // TestValidDataForType(FieldDescriptor::TYPE_GROUP
-  // TestValidDataForType(FieldDescriptor::TYPE_MESSAGE
-  // TestValidDataForType(FieldDescriptor::TYPE_BYTES
-  // TestValidDataForType(FieldDescriptor::TYPE_ENUM
-
-  RunValidJsonTest("HelloWorld", REQUIRED,
-                   "{\"optionalString\":\"Hello, World!\"}",
+  RunValidJsonTest("HelloWorld", "{\"optionalString\":\"Hello, World!\"}",
                    "optional_string: 'Hello, World!'");
 
-  // NOTE: The spec for JSON support is still being sorted out, these may not
-  // all be correct.
   // Test field name conventions.
   RunValidJsonTest(
-      "FieldNameInSnakeCase", REQUIRED,
+      "FieldNameInSnakeCase",
       R"({
         "fieldname1": 1,
         "fieldName2": 2,
-        "FieldName3": 3,
-        "fieldName4": 4
+        "FieldName3": 3
       })",
       R"(
         fieldname1: 1
         field_name2: 2
         _field_name3: 3
-        field__name4_: 4
       )");
   RunValidJsonTest(
-      "FieldNameWithNumbers", REQUIRED,
+      "FieldNameWithNumbers",
       R"({
         "field0name5": 5,
         "field0Name6": 6
@@ -999,14 +644,14 @@
         field_0_name6: 6
       )");
   RunValidJsonTest(
-      "FieldNameWithMixedCases", REQUIRED,
+      "FieldNameWithMixedCases",
       R"({
         "fieldName7": 7,
-        "FieldName8": 8,
+        "fieldName8": 8,
         "fieldName9": 9,
-        "FieldName10": 10,
-        "FIELDNAME11": 11,
-        "FIELDName12": 12
+        "fieldName10": 10,
+        "fIELDNAME11": 11,
+        "fIELDName12": 12
       })",
       R"(
         fieldName7: 7
@@ -1016,32 +661,13 @@
         FIELD_NAME11: 11
         FIELD_name12: 12
       )");
-  RunValidJsonTest(
-      "FieldNameWithDoubleUnderscores", RECOMMENDED,
-      R"({
-        "FieldName13": 13,
-        "FieldName14": 14,
-        "fieldName15": 15,
-        "fieldName16": 16,
-        "fieldName17": 17,
-        "FieldName18": 18
-      })",
-      R"(
-        __field_name13: 13
-        __Field_name14: 14
-        field__name15: 15
-        field__Name16: 16
-        field_name17__: 17
-        Field_name18__: 18
-      )");
   // Using the original proto field name in JSON is also allowed.
   RunValidJsonTest(
-      "OriginalProtoFieldName", REQUIRED,
+      "OriginalProtoFieldName",
       R"({
         "fieldname1": 1,
         "field_name2": 2,
         "_field_name3": 3,
-        "field__name4_": 4,
         "field0name5": 5,
         "field_0_name6": 6,
         "fieldName7": 7,
@@ -1049,19 +675,12 @@
         "field_Name9": 9,
         "Field_Name10": 10,
         "FIELD_NAME11": 11,
-        "FIELD_name12": 12,
-        "__field_name13": 13,
-        "__Field_name14": 14,
-        "field__name15": 15,
-        "field__Name16": 16,
-        "field_name17__": 17,
-        "Field_name18__": 18
+        "FIELD_name12": 12
       })",
       R"(
         fieldname1: 1
         field_name2: 2
         _field_name3: 3
-        field__name4_: 4
         field0name5: 5
         field_0_name6: 6
         fieldName7: 7
@@ -1070,120 +689,61 @@
         Field_Name10: 10
         FIELD_NAME11: 11
         FIELD_name12: 12
-        __field_name13: 13
-        __Field_name14: 14
-        field__name15: 15
-        field__Name16: 16
-        field_name17__: 17
-        Field_name18__: 18
       )");
   // Field names can be escaped.
   RunValidJsonTest(
-      "FieldNameEscaped", REQUIRED,
+      "FieldNameEscaped",
       R"({"fieldn\u0061me1": 1})",
       "fieldname1: 1");
-  // String ends with escape character.
-  ExpectParseFailureForJson(
-      "StringEndsWithEscapeChar", RECOMMENDED,
-      "{\"optionalString\": \"abc\\");
   // Field names must be quoted (or it's not valid JSON).
   ExpectParseFailureForJson(
-      "FieldNameNotQuoted", RECOMMENDED,
+      "FieldNameNotQuoted",
       "{fieldname1: 1}");
   // Trailing comma is not allowed (not valid JSON).
   ExpectParseFailureForJson(
-      "TrailingCommaInAnObject", RECOMMENDED,
+      "TrailingCommaInAnObject",
       R"({"fieldname1":1,})");
-  ExpectParseFailureForJson(
-      "TrailingCommaInAnObjectWithSpace", RECOMMENDED,
-      R"({"fieldname1":1 ,})");
-  ExpectParseFailureForJson(
-      "TrailingCommaInAnObjectWithSpaceCommaSpace", RECOMMENDED,
-      R"({"fieldname1":1 , })");
-  ExpectParseFailureForJson(
-      "TrailingCommaInAnObjectWithNewlines", RECOMMENDED,
-      R"({
-        "fieldname1":1,
-      })");
   // JSON doesn't support comments.
   ExpectParseFailureForJson(
-      "JsonWithComments", RECOMMENDED,
+      "JsonWithComments",
       R"({
         // This is a comment.
         "fieldname1": 1
       })");
-  // JSON spec says whitespace doesn't matter, so try a few spacings to be sure.
-  RunValidJsonTest(
-      "OneLineNoSpaces", RECOMMENDED,
-      "{\"optionalInt32\":1,\"optionalInt64\":2}",
-      R"(
-        optional_int32: 1
-        optional_int64: 2
-      )");
-  RunValidJsonTest(
-      "OneLineWithSpaces", RECOMMENDED,
-      "{ \"optionalInt32\" : 1 , \"optionalInt64\" : 2 }",
-      R"(
-        optional_int32: 1
-        optional_int64: 2
-      )");
-  RunValidJsonTest(
-      "MultilineNoSpaces", RECOMMENDED,
-      "{\n\"optionalInt32\"\n:\n1\n,\n\"optionalInt64\"\n:\n2\n}",
-      R"(
-        optional_int32: 1
-        optional_int64: 2
-      )");
-  RunValidJsonTest(
-      "MultilineWithSpaces", RECOMMENDED,
-      "{\n  \"optionalInt32\"  :  1\n  ,\n  \"optionalInt64\"  :  2\n}\n",
-      R"(
-        optional_int32: 1
-        optional_int64: 2
-      )");
-  // Missing comma between key/value pairs.
-  ExpectParseFailureForJson(
-      "MissingCommaOneLine", RECOMMENDED,
-      "{ \"optionalInt32\": 1 \"optionalInt64\": 2 }");
-  ExpectParseFailureForJson(
-      "MissingCommaMultiline", RECOMMENDED,
-      "{\n  \"optionalInt32\": 1\n  \"optionalInt64\": 2\n}");
   // Duplicated field names are not allowed.
   ExpectParseFailureForJson(
-      "FieldNameDuplicate", RECOMMENDED,
+      "FieldNameDuplicate",
       R"({
         "optionalNestedMessage": {a: 1},
         "optionalNestedMessage": {}
       })");
   ExpectParseFailureForJson(
-      "FieldNameDuplicateDifferentCasing1", RECOMMENDED,
+      "FieldNameDuplicateDifferentCasing1",
       R"({
         "optional_nested_message": {a: 1},
         "optionalNestedMessage": {}
       })");
   ExpectParseFailureForJson(
-      "FieldNameDuplicateDifferentCasing2", RECOMMENDED,
+      "FieldNameDuplicateDifferentCasing2",
       R"({
         "optionalNestedMessage": {a: 1},
         "optional_nested_message": {}
       })");
   // Serializers should use lowerCamelCase by default.
   RunValidJsonTestWithValidator(
-      "FieldNameInLowerCamelCase", REQUIRED,
+      "FieldNameInLowerCamelCase",
       R"({
         "fieldname1": 1,
         "fieldName2": 2,
-        "FieldName3": 3,
-        "fieldName4": 4
+        "FieldName3": 3
       })",
       [](const Json::Value& value) {
         return value.isMember("fieldname1") &&
             value.isMember("fieldName2") &&
-            value.isMember("FieldName3") &&
-            value.isMember("fieldName4");
+            value.isMember("FieldName3");
       });
   RunValidJsonTestWithValidator(
-      "FieldNameWithNumbers", REQUIRED,
+      "FieldNameWithNumbers",
       R"({
         "field0name5": 5,
         "field0Name6": 6
@@ -1193,195 +753,169 @@
             value.isMember("field0Name6");
       });
   RunValidJsonTestWithValidator(
-      "FieldNameWithMixedCases", REQUIRED,
+      "FieldNameWithMixedCases",
       R"({
         "fieldName7": 7,
-        "FieldName8": 8,
+        "fieldName8": 8,
         "fieldName9": 9,
-        "FieldName10": 10,
-        "FIELDNAME11": 11,
-        "FIELDName12": 12
+        "fieldName10": 10,
+        "fIELDNAME11": 11,
+        "fIELDName12": 12
       })",
       [](const Json::Value& value) {
         return value.isMember("fieldName7") &&
-            value.isMember("FieldName8") &&
+            value.isMember("fieldName8") &&
             value.isMember("fieldName9") &&
-            value.isMember("FieldName10") &&
-            value.isMember("FIELDNAME11") &&
-            value.isMember("FIELDName12");
-      });
-  RunValidJsonTestWithValidator(
-      "FieldNameWithDoubleUnderscores", RECOMMENDED,
-      R"({
-        "FieldName13": 13,
-        "FieldName14": 14,
-        "fieldName15": 15,
-        "fieldName16": 16,
-        "fieldName17": 17,
-        "FieldName18": 18
-      })",
-      [](const Json::Value& value) {
-        return value.isMember("FieldName13") &&
-            value.isMember("FieldName14") &&
-            value.isMember("fieldName15") &&
-            value.isMember("fieldName16") &&
-            value.isMember("fieldName17") &&
-            value.isMember("FieldName18");
+            value.isMember("fieldName10") &&
+            value.isMember("fIELDNAME11") &&
+            value.isMember("fIELDName12");
       });
 
   // Integer fields.
   RunValidJsonTest(
-      "Int32FieldMaxValue", REQUIRED,
+      "Int32FieldMaxValue",
       R"({"optionalInt32": 2147483647})",
       "optional_int32: 2147483647");
   RunValidJsonTest(
-      "Int32FieldMinValue", REQUIRED,
+      "Int32FieldMinValue",
       R"({"optionalInt32": -2147483648})",
       "optional_int32: -2147483648");
   RunValidJsonTest(
-      "Uint32FieldMaxValue", REQUIRED,
+      "Uint32FieldMaxValue",
       R"({"optionalUint32": 4294967295})",
       "optional_uint32: 4294967295");
   RunValidJsonTest(
-      "Int64FieldMaxValue", REQUIRED,
+      "Int64FieldMaxValue",
       R"({"optionalInt64": "9223372036854775807"})",
       "optional_int64: 9223372036854775807");
   RunValidJsonTest(
-      "Int64FieldMinValue", REQUIRED,
+      "Int64FieldMinValue",
       R"({"optionalInt64": "-9223372036854775808"})",
       "optional_int64: -9223372036854775808");
   RunValidJsonTest(
-      "Uint64FieldMaxValue", REQUIRED,
+      "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", REQUIRED,
-      R"({"optionalInt64": 9223372036854774784})",
-      "optional_int64: 9223372036854774784");
+      "Int64FieldMaxValueNotQuoted",
+      R"({"optionalInt64": 9223372036854775807})",
+      "optional_int64: 9223372036854775807");
   RunValidJsonTest(
-      "Int64FieldMinValueNotQuoted", REQUIRED,
+      "Int64FieldMinValueNotQuoted",
       R"({"optionalInt64": -9223372036854775808})",
       "optional_int64: -9223372036854775808");
-  // Largest interoperable Uint64; see comment above
-  // for Int64FieldMaxValueNotQuoted.
   RunValidJsonTest(
-      "Uint64FieldMaxValueNotQuoted", REQUIRED,
-      R"({"optionalUint64": 18446744073709549568})",
-      "optional_uint64: 18446744073709549568");
+      "Uint64FieldMaxValueNotQuoted",
+      R"({"optionalUint64": 18446744073709551615})",
+      "optional_uint64: 18446744073709551615");
   // Values can be represented as JSON strings.
   RunValidJsonTest(
-      "Int32FieldStringValue", REQUIRED,
+      "Int32FieldStringValue",
       R"({"optionalInt32": "2147483647"})",
       "optional_int32: 2147483647");
   RunValidJsonTest(
-      "Int32FieldStringValueEscaped", REQUIRED,
+      "Int32FieldStringValueEscaped",
       R"({"optionalInt32": "2\u003147483647"})",
       "optional_int32: 2147483647");
 
   // Parsers reject out-of-bound integer values.
   ExpectParseFailureForJson(
-      "Int32FieldTooLarge", REQUIRED,
+      "Int32FieldTooLarge",
       R"({"optionalInt32": 2147483648})");
   ExpectParseFailureForJson(
-      "Int32FieldTooSmall", REQUIRED,
+      "Int32FieldTooSmall",
       R"({"optionalInt32": -2147483649})");
   ExpectParseFailureForJson(
-      "Uint32FieldTooLarge", REQUIRED,
+      "Uint32FieldTooLarge",
       R"({"optionalUint32": 4294967296})");
   ExpectParseFailureForJson(
-      "Int64FieldTooLarge", REQUIRED,
+      "Int64FieldTooLarge",
       R"({"optionalInt64": "9223372036854775808"})");
   ExpectParseFailureForJson(
-      "Int64FieldTooSmall", REQUIRED,
+      "Int64FieldTooSmall",
       R"({"optionalInt64": "-9223372036854775809"})");
   ExpectParseFailureForJson(
-      "Uint64FieldTooLarge", REQUIRED,
+      "Uint64FieldTooLarge",
       R"({"optionalUint64": "18446744073709551616"})");
   // Parser reject non-integer numeric values as well.
   ExpectParseFailureForJson(
-      "Int32FieldNotInteger", REQUIRED,
+      "Int32FieldNotInteger",
       R"({"optionalInt32": 0.5})");
   ExpectParseFailureForJson(
-      "Uint32FieldNotInteger", REQUIRED,
+      "Uint32FieldNotInteger",
       R"({"optionalUint32": 0.5})");
   ExpectParseFailureForJson(
-      "Int64FieldNotInteger", REQUIRED,
+      "Int64FieldNotInteger",
       R"({"optionalInt64": "0.5"})");
   ExpectParseFailureForJson(
-      "Uint64FieldNotInteger", REQUIRED,
+      "Uint64FieldNotInteger",
       R"({"optionalUint64": "0.5"})");
 
   // Integers but represented as float values are accepted.
   RunValidJsonTest(
-      "Int32FieldFloatTrailingZero", REQUIRED,
+      "Int32FieldFloatTrailingZero",
       R"({"optionalInt32": 100000.000})",
       "optional_int32: 100000");
   RunValidJsonTest(
-      "Int32FieldExponentialFormat", REQUIRED,
+      "Int32FieldExponentialFormat",
       R"({"optionalInt32": 1e5})",
       "optional_int32: 100000");
   RunValidJsonTest(
-      "Int32FieldMaxFloatValue", REQUIRED,
+      "Int32FieldMaxFloatValue",
       R"({"optionalInt32": 2.147483647e9})",
       "optional_int32: 2147483647");
   RunValidJsonTest(
-      "Int32FieldMinFloatValue", REQUIRED,
+      "Int32FieldMinFloatValue",
       R"({"optionalInt32": -2.147483648e9})",
       "optional_int32: -2147483648");
   RunValidJsonTest(
-      "Uint32FieldMaxFloatValue", REQUIRED,
+      "Uint32FieldMaxFloatValue",
       R"({"optionalUint32": 4.294967295e9})",
       "optional_uint32: 4294967295");
 
   // Parser reject non-numeric values.
   ExpectParseFailureForJson(
-      "Int32FieldNotNumber", REQUIRED,
+      "Int32FieldNotNumber",
       R"({"optionalInt32": "3x3"})");
   ExpectParseFailureForJson(
-      "Uint32FieldNotNumber", REQUIRED,
+      "Uint32FieldNotNumber",
       R"({"optionalUint32": "3x3"})");
   ExpectParseFailureForJson(
-      "Int64FieldNotNumber", REQUIRED,
+      "Int64FieldNotNumber",
       R"({"optionalInt64": "3x3"})");
   ExpectParseFailureForJson(
-      "Uint64FieldNotNumber", REQUIRED,
+      "Uint64FieldNotNumber",
       R"({"optionalUint64": "3x3"})");
   // JSON does not allow "+" on numric values.
   ExpectParseFailureForJson(
-      "Int32FieldPlusSign", REQUIRED,
+      "Int32FieldPlusSign",
       R"({"optionalInt32": +1})");
   // JSON doesn't allow leading 0s.
   ExpectParseFailureForJson(
-      "Int32FieldLeadingZero", REQUIRED,
+      "Int32FieldLeadingZero",
       R"({"optionalInt32": 01})");
   ExpectParseFailureForJson(
-      "Int32FieldNegativeWithLeadingZero", REQUIRED,
+      "Int32FieldNegativeWithLeadingZero",
       R"({"optionalInt32": -01})");
   // String values must follow the same syntax rule. Specifically leading
-  // or trailing spaces are not allowed.
+  // or traling spaces are not allowed.
   ExpectParseFailureForJson(
-      "Int32FieldLeadingSpace", REQUIRED,
+      "Int32FieldLeadingSpace",
       R"({"optionalInt32": " 1"})");
   ExpectParseFailureForJson(
-      "Int32FieldTrailingSpace", REQUIRED,
+      "Int32FieldTrailingSpace",
       R"({"optionalInt32": "1 "})");
 
   // 64-bit values are serialized as strings.
   RunValidJsonTestWithValidator(
-      "Int64FieldBeString", RECOMMENDED,
+      "Int64FieldBeString",
       R"({"optionalInt64": 1})",
       [](const Json::Value& value) {
         return value["optionalInt64"].type() == Json::stringValue &&
             value["optionalInt64"].asString() == "1";
       });
   RunValidJsonTestWithValidator(
-      "Uint64FieldBeString", RECOMMENDED,
+      "Uint64FieldBeString",
       R"({"optionalUint64": 1})",
       [](const Json::Value& value) {
         return value["optionalUint64"].type() == Json::stringValue &&
@@ -1390,202 +924,202 @@
 
   // Bool fields.
   RunValidJsonTest(
-      "BoolFieldTrue", REQUIRED,
+      "BoolFieldTrue",
       R"({"optionalBool":true})",
       "optional_bool: true");
   RunValidJsonTest(
-      "BoolFieldFalse", REQUIRED,
+      "BoolFieldFalse",
       R"({"optionalBool":false})",
       "optional_bool: false");
 
   // Other forms are not allowed.
   ExpectParseFailureForJson(
-      "BoolFieldIntegerZero", RECOMMENDED,
+      "BoolFieldIntegerZero",
       R"({"optionalBool":0})");
   ExpectParseFailureForJson(
-      "BoolFieldIntegerOne", RECOMMENDED,
+      "BoolFieldIntegerOne",
       R"({"optionalBool":1})");
   ExpectParseFailureForJson(
-      "BoolFieldCamelCaseTrue", RECOMMENDED,
+      "BoolFieldCamelCaseTrue",
       R"({"optionalBool":True})");
   ExpectParseFailureForJson(
-      "BoolFieldCamelCaseFalse", RECOMMENDED,
+      "BoolFieldCamelCaseFalse",
       R"({"optionalBool":False})");
   ExpectParseFailureForJson(
-      "BoolFieldAllCapitalTrue", RECOMMENDED,
+      "BoolFieldAllCapitalTrue",
       R"({"optionalBool":TRUE})");
   ExpectParseFailureForJson(
-      "BoolFieldAllCapitalFalse", RECOMMENDED,
+      "BoolFieldAllCapitalFalse",
       R"({"optionalBool":FALSE})");
   ExpectParseFailureForJson(
-      "BoolFieldDoubleQuotedTrue", RECOMMENDED,
+      "BoolFieldDoubleQuotedTrue",
       R"({"optionalBool":"true"})");
   ExpectParseFailureForJson(
-      "BoolFieldDoubleQuotedFalse", RECOMMENDED,
+      "BoolFieldDoubleQuotedFalse",
       R"({"optionalBool":"false"})");
 
   // Float fields.
   RunValidJsonTest(
-      "FloatFieldMinPositiveValue", REQUIRED,
+      "FloatFieldMinPositiveValue",
       R"({"optionalFloat": 1.175494e-38})",
       "optional_float: 1.175494e-38");
   RunValidJsonTest(
-      "FloatFieldMaxNegativeValue", REQUIRED,
+      "FloatFieldMaxNegativeValue",
       R"({"optionalFloat": -1.175494e-38})",
       "optional_float: -1.175494e-38");
   RunValidJsonTest(
-      "FloatFieldMaxPositiveValue", REQUIRED,
+      "FloatFieldMaxPositiveValue",
       R"({"optionalFloat": 3.402823e+38})",
       "optional_float: 3.402823e+38");
   RunValidJsonTest(
-      "FloatFieldMinNegativeValue", REQUIRED,
+      "FloatFieldMinNegativeValue",
       R"({"optionalFloat": 3.402823e+38})",
       "optional_float: 3.402823e+38");
   // Values can be quoted.
   RunValidJsonTest(
-      "FloatFieldQuotedValue", REQUIRED,
+      "FloatFieldQuotedValue",
       R"({"optionalFloat": "1"})",
       "optional_float: 1");
   // Special values.
   RunValidJsonTest(
-      "FloatFieldNan", REQUIRED,
+      "FloatFieldNan",
       R"({"optionalFloat": "NaN"})",
       "optional_float: nan");
   RunValidJsonTest(
-      "FloatFieldInfinity", REQUIRED,
+      "FloatFieldInfinity",
       R"({"optionalFloat": "Infinity"})",
       "optional_float: inf");
   RunValidJsonTest(
-      "FloatFieldNegativeInfinity", REQUIRED,
+      "FloatFieldNegativeInfinity",
       R"({"optionalFloat": "-Infinity"})",
       "optional_float: -inf");
   // Non-cannonical Nan will be correctly normalized.
   {
-    TestAllTypesProto3 message;
+    TestAllTypes message;
     // IEEE floating-point standard 32-bit quiet NaN:
     //   0111 1111 1xxx xxxx xxxx xxxx xxxx xxxx
     message.set_optional_float(
         WireFormatLite::DecodeFloat(0x7FA12345));
     RunValidJsonTestWithProtobufInput(
-        "FloatFieldNormalizeQuietNan", REQUIRED, message,
+        "FloatFieldNormalizeQuietNan", message,
         "optional_float: nan");
     // IEEE floating-point standard 64-bit signaling NaN:
     //   1111 1111 1xxx xxxx xxxx xxxx xxxx xxxx
     message.set_optional_float(
         WireFormatLite::DecodeFloat(0xFFB54321));
     RunValidJsonTestWithProtobufInput(
-        "FloatFieldNormalizeSignalingNan", REQUIRED, message,
+        "FloatFieldNormalizeSignalingNan", message,
         "optional_float: nan");
   }
 
   // Special values must be quoted.
   ExpectParseFailureForJson(
-      "FloatFieldNanNotQuoted", RECOMMENDED,
+      "FloatFieldNanNotQuoted",
       R"({"optionalFloat": NaN})");
   ExpectParseFailureForJson(
-      "FloatFieldInfinityNotQuoted", RECOMMENDED,
+      "FloatFieldInfinityNotQuoted",
       R"({"optionalFloat": Infinity})");
   ExpectParseFailureForJson(
-      "FloatFieldNegativeInfinityNotQuoted", RECOMMENDED,
+      "FloatFieldNegativeInfinityNotQuoted",
       R"({"optionalFloat": -Infinity})");
   // Parsers should reject out-of-bound values.
   ExpectParseFailureForJson(
-      "FloatFieldTooSmall", REQUIRED,
+      "FloatFieldTooSmall",
       R"({"optionalFloat": -3.502823e+38})");
   ExpectParseFailureForJson(
-      "FloatFieldTooLarge", REQUIRED,
+      "FloatFieldTooLarge",
       R"({"optionalFloat": 3.502823e+38})");
 
   // Double fields.
   RunValidJsonTest(
-      "DoubleFieldMinPositiveValue", REQUIRED,
+      "DoubleFieldMinPositiveValue",
       R"({"optionalDouble": 2.22507e-308})",
       "optional_double: 2.22507e-308");
   RunValidJsonTest(
-      "DoubleFieldMaxNegativeValue", REQUIRED,
+      "DoubleFieldMaxNegativeValue",
       R"({"optionalDouble": -2.22507e-308})",
       "optional_double: -2.22507e-308");
   RunValidJsonTest(
-      "DoubleFieldMaxPositiveValue", REQUIRED,
+      "DoubleFieldMaxPositiveValue",
       R"({"optionalDouble": 1.79769e+308})",
       "optional_double: 1.79769e+308");
   RunValidJsonTest(
-      "DoubleFieldMinNegativeValue", REQUIRED,
+      "DoubleFieldMinNegativeValue",
       R"({"optionalDouble": -1.79769e+308})",
       "optional_double: -1.79769e+308");
   // Values can be quoted.
   RunValidJsonTest(
-      "DoubleFieldQuotedValue", REQUIRED,
+      "DoubleFieldQuotedValue",
       R"({"optionalDouble": "1"})",
       "optional_double: 1");
   // Speical values.
   RunValidJsonTest(
-      "DoubleFieldNan", REQUIRED,
+      "DoubleFieldNan",
       R"({"optionalDouble": "NaN"})",
       "optional_double: nan");
   RunValidJsonTest(
-      "DoubleFieldInfinity", REQUIRED,
+      "DoubleFieldInfinity",
       R"({"optionalDouble": "Infinity"})",
       "optional_double: inf");
   RunValidJsonTest(
-      "DoubleFieldNegativeInfinity", REQUIRED,
+      "DoubleFieldNegativeInfinity",
       R"({"optionalDouble": "-Infinity"})",
       "optional_double: -inf");
   // Non-cannonical Nan will be correctly normalized.
   {
-    TestAllTypesProto3 message;
+    TestAllTypes message;
     message.set_optional_double(
         WireFormatLite::DecodeDouble(0x7FFA123456789ABCLL));
     RunValidJsonTestWithProtobufInput(
-        "DoubleFieldNormalizeQuietNan", REQUIRED, message,
+        "DoubleFieldNormalizeQuietNan", message,
         "optional_double: nan");
     message.set_optional_double(
         WireFormatLite::DecodeDouble(0xFFFBCBA987654321LL));
     RunValidJsonTestWithProtobufInput(
-        "DoubleFieldNormalizeSignalingNan", REQUIRED, message,
+        "DoubleFieldNormalizeSignalingNan", message,
         "optional_double: nan");
   }
 
   // Special values must be quoted.
   ExpectParseFailureForJson(
-      "DoubleFieldNanNotQuoted", RECOMMENDED,
+      "DoubleFieldNanNotQuoted",
       R"({"optionalDouble": NaN})");
   ExpectParseFailureForJson(
-      "DoubleFieldInfinityNotQuoted", RECOMMENDED,
+      "DoubleFieldInfinityNotQuoted",
       R"({"optionalDouble": Infinity})");
   ExpectParseFailureForJson(
-      "DoubleFieldNegativeInfinityNotQuoted", RECOMMENDED,
+      "DoubleFieldNegativeInfinityNotQuoted",
       R"({"optionalDouble": -Infinity})");
 
   // Parsers should reject out-of-bound values.
   ExpectParseFailureForJson(
-      "DoubleFieldTooSmall", REQUIRED,
+      "DoubleFieldTooSmall",
       R"({"optionalDouble": -1.89769e+308})");
   ExpectParseFailureForJson(
-      "DoubleFieldTooLarge", REQUIRED,
+      "DoubleFieldTooLarge",
       R"({"optionalDouble": +1.89769e+308})");
 
   // Enum fields.
   RunValidJsonTest(
-      "EnumField", REQUIRED,
+      "EnumField",
       R"({"optionalNestedEnum": "FOO"})",
       "optional_nested_enum: FOO");
   // Enum values must be represented as strings.
   ExpectParseFailureForJson(
-      "EnumFieldNotQuoted", REQUIRED,
+      "EnumFieldNotQuoted",
       R"({"optionalNestedEnum": FOO})");
   // Numeric values are allowed.
   RunValidJsonTest(
-      "EnumFieldNumericValueZero", REQUIRED,
+      "EnumFieldNumericValueZero",
       R"({"optionalNestedEnum": 0})",
       "optional_nested_enum: FOO");
   RunValidJsonTest(
-      "EnumFieldNumericValueNonZero", REQUIRED,
+      "EnumFieldNumericValueNonZero",
       R"({"optionalNestedEnum": 1})",
       "optional_nested_enum: BAR");
   // Unknown enum values are represented as numeric values.
   RunValidJsonTestWithValidator(
-      "EnumFieldUnknownValue", REQUIRED,
+      "EnumFieldUnknownValue",
       R"({"optionalNestedEnum": 123})",
       [](const Json::Value& value) {
         return value["optionalNestedEnum"].type() == Json::intValue &&
@@ -1594,216 +1128,177 @@
 
   // String fields.
   RunValidJsonTest(
-      "StringField", REQUIRED,
+      "StringField",
       R"({"optionalString": "Hello world!"})",
       "optional_string: \"Hello world!\"");
   RunValidJsonTest(
-      "StringFieldUnicode", REQUIRED,
+      "StringFieldUnicode",
       // Google in Chinese.
       R"({"optionalString": "谷歌"})",
       R"(optional_string: "谷歌")");
   RunValidJsonTest(
-      "StringFieldEscape", REQUIRED,
+      "StringFieldEscape",
       R"({"optionalString": "\"\\\/\b\f\n\r\t"})",
       R"(optional_string: "\"\\/\b\f\n\r\t")");
   RunValidJsonTest(
-      "StringFieldUnicodeEscape", REQUIRED,
+      "StringFieldUnicodeEscape",
       R"({"optionalString": "\u8C37\u6B4C"})",
       R"(optional_string: "谷歌")");
   RunValidJsonTest(
-      "StringFieldUnicodeEscapeWithLowercaseHexLetters", REQUIRED,
+      "StringFieldUnicodeEscapeWithLowercaseHexLetters",
       R"({"optionalString": "\u8c37\u6b4c"})",
       R"(optional_string: "谷歌")");
   RunValidJsonTest(
-      "StringFieldSurrogatePair", REQUIRED,
+      "StringFieldSurrogatePair",
       // The character is an emoji: grinning face with smiling eyes. 😁
       R"({"optionalString": "\uD83D\uDE01"})",
       R"(optional_string: "\xF0\x9F\x98\x81")");
 
   // Unicode escapes must start with "\u" (lowercase u).
   ExpectParseFailureForJson(
-      "StringFieldUppercaseEscapeLetter", RECOMMENDED,
+      "StringFieldUppercaseEscapeLetter",
       R"({"optionalString": "\U8C37\U6b4C"})");
   ExpectParseFailureForJson(
-      "StringFieldInvalidEscape", RECOMMENDED,
+      "StringFieldInvalidEscape",
       R"({"optionalString": "\uXXXX\u6B4C"})");
   ExpectParseFailureForJson(
-      "StringFieldUnterminatedEscape", RECOMMENDED,
+      "StringFieldUnterminatedEscape",
       R"({"optionalString": "\u8C3"})");
   ExpectParseFailureForJson(
-      "StringFieldUnpairedHighSurrogate", RECOMMENDED,
+      "StringFieldUnpairedHighSurrogate",
       R"({"optionalString": "\uD800"})");
   ExpectParseFailureForJson(
-      "StringFieldUnpairedLowSurrogate", RECOMMENDED,
+      "StringFieldUnpairedLowSurrogate",
       R"({"optionalString": "\uDC00"})");
   ExpectParseFailureForJson(
-      "StringFieldSurrogateInWrongOrder", RECOMMENDED,
+      "StringFieldSurrogateInWrongOrder",
       R"({"optionalString": "\uDE01\uD83D"})");
   ExpectParseFailureForJson(
-      "StringFieldNotAString", REQUIRED,
+      "StringFieldNotAString",
       R"({"optionalString": 12345})");
 
   // Bytes fields.
   RunValidJsonTest(
-      "BytesField", REQUIRED,
+      "BytesField",
       R"({"optionalBytes": "AQI="})",
       R"(optional_bytes: "\x01\x02")");
-  RunValidJsonTest(
-      "BytesFieldBase64Url", RECOMMENDED,
-      R"({"optionalBytes": "-_"})",
-      R"(optional_bytes: "\xfb")");
+  ExpectParseFailureForJson(
+      "BytesFieldNoPadding",
+      R"({"optionalBytes": "AQI"})");
+  ExpectParseFailureForJson(
+      "BytesFieldInvalidBase64Characters",
+      R"({"optionalBytes": "-_=="})");
 
   // Message fields.
   RunValidJsonTest(
-      "MessageField", REQUIRED,
+      "MessageField",
       R"({"optionalNestedMessage": {"a": 1234}})",
       "optional_nested_message: {a: 1234}");
 
   // Oneof fields.
   ExpectParseFailureForJson(
-      "OneofFieldDuplicate", REQUIRED,
+      "OneofFieldDuplicate",
       R"({"oneofUint32": 1, "oneofString": "test"})");
-  // Ensure zero values for oneof make it out/backs.
-  TestAllTypesProto3 messageProto3;
-  TestAllTypesProto2 messageProto2;
-  TestOneofMessage(messageProto3, true);
-  TestOneofMessage(messageProto2, false);
-  RunValidJsonTest(
-      "OneofZeroUint32", RECOMMENDED,
-      R"({"oneofUint32": 0})", "oneof_uint32: 0");
-  RunValidJsonTest(
-      "OneofZeroMessage", RECOMMENDED,
-      R"({"oneofNestedMessage": {}})", "oneof_nested_message: {}");
-  RunValidJsonTest(
-      "OneofZeroString", RECOMMENDED,
-      R"({"oneofString": ""})", "oneof_string: \"\"");
-  RunValidJsonTest(
-      "OneofZeroBytes", RECOMMENDED,
-      R"({"oneofBytes": ""})", "oneof_bytes: \"\"");
-  RunValidJsonTest(
-      "OneofZeroBool", RECOMMENDED,
-      R"({"oneofBool": false})", "oneof_bool: false");
-  RunValidJsonTest(
-      "OneofZeroUint64", RECOMMENDED,
-      R"({"oneofUint64": 0})", "oneof_uint64: 0");
-  RunValidJsonTest(
-      "OneofZeroFloat", RECOMMENDED,
-      R"({"oneofFloat": 0.0})", "oneof_float: 0");
-  RunValidJsonTest(
-      "OneofZeroDouble", RECOMMENDED,
-      R"({"oneofDouble": 0.0})", "oneof_double: 0");
-  RunValidJsonTest(
-      "OneofZeroEnum", RECOMMENDED,
-      R"({"oneofEnum":"FOO"})", "oneof_enum: FOO");
 
   // Repeated fields.
   RunValidJsonTest(
-      "PrimitiveRepeatedField", REQUIRED,
+      "PrimitiveRepeatedField",
       R"({"repeatedInt32": [1, 2, 3, 4]})",
       "repeated_int32: [1, 2, 3, 4]");
   RunValidJsonTest(
-      "EnumRepeatedField", REQUIRED,
+      "EnumRepeatedField",
       R"({"repeatedNestedEnum": ["FOO", "BAR", "BAZ"]})",
       "repeated_nested_enum: [FOO, BAR, BAZ]");
   RunValidJsonTest(
-      "StringRepeatedField", REQUIRED,
+      "StringRepeatedField",
       R"({"repeatedString": ["Hello", "world"]})",
       R"(repeated_string: ["Hello", "world"])");
   RunValidJsonTest(
-      "BytesRepeatedField", REQUIRED,
+      "BytesRepeatedField",
       R"({"repeatedBytes": ["AAEC", "AQI="]})",
       R"(repeated_bytes: ["\x00\x01\x02", "\x01\x02"])");
   RunValidJsonTest(
-      "MessageRepeatedField", REQUIRED,
+      "MessageRepeatedField",
       R"({"repeatedNestedMessage": [{"a": 1234}, {"a": 5678}]})",
       "repeated_nested_message: {a: 1234}"
       "repeated_nested_message: {a: 5678}");
 
   // Repeated field elements are of incorrect type.
   ExpectParseFailureForJson(
-      "RepeatedFieldWrongElementTypeExpectingIntegersGotBool", REQUIRED,
+      "RepeatedFieldWrongElementTypeExpectingIntegersGotBool",
       R"({"repeatedInt32": [1, false, 3, 4]})");
   ExpectParseFailureForJson(
-      "RepeatedFieldWrongElementTypeExpectingIntegersGotString", REQUIRED,
+      "RepeatedFieldWrongElementTypeExpectingIntegersGotString",
       R"({"repeatedInt32": [1, 2, "name", 4]})");
   ExpectParseFailureForJson(
-      "RepeatedFieldWrongElementTypeExpectingIntegersGotMessage", REQUIRED,
+      "RepeatedFieldWrongElementTypeExpectingIntegersGotMessage",
       R"({"repeatedInt32": [1, 2, 3, {"a": 4}]})");
   ExpectParseFailureForJson(
-      "RepeatedFieldWrongElementTypeExpectingStringsGotInt", REQUIRED,
+      "RepeatedFieldWrongElementTypeExpectingStringsGotInt",
       R"({"repeatedString": ["1", 2, "3", "4"]})");
   ExpectParseFailureForJson(
-      "RepeatedFieldWrongElementTypeExpectingStringsGotBool", REQUIRED,
+      "RepeatedFieldWrongElementTypeExpectingStringsGotBool",
       R"({"repeatedString": ["1", "2", false, "4"]})");
   ExpectParseFailureForJson(
-      "RepeatedFieldWrongElementTypeExpectingStringsGotMessage", REQUIRED,
+      "RepeatedFieldWrongElementTypeExpectingStringsGotMessage",
       R"({"repeatedString": ["1", 2, "3", {"a": 4}]})");
   ExpectParseFailureForJson(
-      "RepeatedFieldWrongElementTypeExpectingMessagesGotInt", REQUIRED,
+      "RepeatedFieldWrongElementTypeExpectingMessagesGotInt",
       R"({"repeatedNestedMessage": [{"a": 1}, 2]})");
   ExpectParseFailureForJson(
-      "RepeatedFieldWrongElementTypeExpectingMessagesGotBool", REQUIRED,
+      "RepeatedFieldWrongElementTypeExpectingMessagesGotBool",
       R"({"repeatedNestedMessage": [{"a": 1}, false]})");
   ExpectParseFailureForJson(
-      "RepeatedFieldWrongElementTypeExpectingMessagesGotString", REQUIRED,
+      "RepeatedFieldWrongElementTypeExpectingMessagesGotString",
       R"({"repeatedNestedMessage": [{"a": 1}, "2"]})");
   // Trailing comma in the repeated field is not allowed.
   ExpectParseFailureForJson(
-      "RepeatedFieldTrailingComma", RECOMMENDED,
+      "RepeatedFieldTrailingComma",
       R"({"repeatedInt32": [1, 2, 3, 4,]})");
-  ExpectParseFailureForJson(
-      "RepeatedFieldTrailingCommaWithSpace", RECOMMENDED,
-      "{\"repeatedInt32\": [1, 2, 3, 4 ,]}");
-  ExpectParseFailureForJson(
-      "RepeatedFieldTrailingCommaWithSpaceCommaSpace", RECOMMENDED,
-      "{\"repeatedInt32\": [1, 2, 3, 4 , ]}");
-  ExpectParseFailureForJson(
-      "RepeatedFieldTrailingCommaWithNewlines", RECOMMENDED,
-      "{\"repeatedInt32\": [\n  1,\n  2,\n  3,\n  4,\n]}");
 
   // Map fields.
   RunValidJsonTest(
-      "Int32MapField", REQUIRED,
+      "Int32MapField",
       R"({"mapInt32Int32": {"1": 2, "3": 4}})",
       "map_int32_int32: {key: 1 value: 2}"
       "map_int32_int32: {key: 3 value: 4}");
   ExpectParseFailureForJson(
-      "Int32MapFieldKeyNotQuoted", RECOMMENDED,
+      "Int32MapFieldKeyNotQuoted",
       R"({"mapInt32Int32": {1: 2, 3: 4}})");
   RunValidJsonTest(
-      "Uint32MapField", REQUIRED,
+      "Uint32MapField",
       R"({"mapUint32Uint32": {"1": 2, "3": 4}})",
       "map_uint32_uint32: {key: 1 value: 2}"
       "map_uint32_uint32: {key: 3 value: 4}");
   ExpectParseFailureForJson(
-      "Uint32MapFieldKeyNotQuoted", RECOMMENDED,
+      "Uint32MapFieldKeyNotQuoted",
       R"({"mapUint32Uint32": {1: 2, 3: 4}})");
   RunValidJsonTest(
-      "Int64MapField", REQUIRED,
+      "Int64MapField",
       R"({"mapInt64Int64": {"1": 2, "3": 4}})",
       "map_int64_int64: {key: 1 value: 2}"
       "map_int64_int64: {key: 3 value: 4}");
   ExpectParseFailureForJson(
-      "Int64MapFieldKeyNotQuoted", RECOMMENDED,
+      "Int64MapFieldKeyNotQuoted",
       R"({"mapInt64Int64": {1: 2, 3: 4}})");
   RunValidJsonTest(
-      "Uint64MapField", REQUIRED,
+      "Uint64MapField",
       R"({"mapUint64Uint64": {"1": 2, "3": 4}})",
       "map_uint64_uint64: {key: 1 value: 2}"
       "map_uint64_uint64: {key: 3 value: 4}");
   ExpectParseFailureForJson(
-      "Uint64MapFieldKeyNotQuoted", RECOMMENDED,
+      "Uint64MapFieldKeyNotQuoted",
       R"({"mapUint64Uint64": {1: 2, 3: 4}})");
   RunValidJsonTest(
-      "BoolMapField", REQUIRED,
+      "BoolMapField",
       R"({"mapBoolBool": {"true": true, "false": false}})",
       "map_bool_bool: {key: true value: true}"
       "map_bool_bool: {key: false value: false}");
   ExpectParseFailureForJson(
-      "BoolMapFieldKeyNotQuoted", RECOMMENDED,
+      "BoolMapFieldKeyNotQuoted",
       R"({"mapBoolBool": {true: true, false: false}})");
   RunValidJsonTest(
-      "MessageMapField", REQUIRED,
+      "MessageMapField",
       R"({
         "mapStringNestedMessage": {
           "hello": {"a": 1234},
@@ -1822,34 +1317,26 @@
       )");
   // Since Map keys are represented as JSON strings, escaping should be allowed.
   RunValidJsonTest(
-      "Int32MapEscapedKey", REQUIRED,
+      "Int32MapEscapedKey",
       R"({"mapInt32Int32": {"\u0031": 2}})",
       "map_int32_int32: {key: 1 value: 2}");
   RunValidJsonTest(
-      "Int64MapEscapedKey", REQUIRED,
+      "Int64MapEscapedKey",
       R"({"mapInt64Int64": {"\u0031": 2}})",
       "map_int64_int64: {key: 1 value: 2}");
   RunValidJsonTest(
-      "BoolMapEscapedKey", REQUIRED,
+      "BoolMapEscapedKey",
       R"({"mapBoolBool": {"tr\u0075e": true}})",
       "map_bool_bool: {key: true value: true}");
 
   // "null" is accepted for all fields types.
   RunValidJsonTest(
-      "AllFieldAcceptNull", REQUIRED,
+      "AllFieldAcceptNull",
       R"({
         "optionalInt32": null,
         "optionalInt64": null,
         "optionalUint32": null,
         "optionalUint64": null,
-        "optionalSint32": null,
-        "optionalSint64": null,
-        "optionalFixed32": null,
-        "optionalFixed64": null,
-        "optionalSfixed32": null,
-        "optionalSfixed64": null,
-        "optionalFloat": null,
-        "optionalDouble": null,
         "optionalBool": null,
         "optionalString": null,
         "optionalBytes": null,
@@ -1859,14 +1346,6 @@
         "repeatedInt64": null,
         "repeatedUint32": null,
         "repeatedUint64": null,
-        "repeatedSint32": null,
-        "repeatedSint64": null,
-        "repeatedFixed32": null,
-        "repeatedFixed64": null,
-        "repeatedSfixed32": null,
-        "repeatedSfixed64": null,
-        "repeatedFloat": null,
-        "repeatedDouble": null,
         "repeatedBool": null,
         "repeatedString": null,
         "repeatedBytes": null,
@@ -1880,79 +1359,59 @@
 
   // Repeated field elements cannot be null.
   ExpectParseFailureForJson(
-      "RepeatedFieldPrimitiveElementIsNull", RECOMMENDED,
+      "RepeatedFieldPrimitiveElementIsNull",
       R"({"repeatedInt32": [1, null, 2]})");
   ExpectParseFailureForJson(
-      "RepeatedFieldMessageElementIsNull", RECOMMENDED,
+      "RepeatedFieldMessageElementIsNull",
       R"({"repeatedNestedMessage": [{"a":1}, null, {"a":2}]})");
   // Map field keys cannot be null.
   ExpectParseFailureForJson(
-      "MapFieldKeyIsNull", RECOMMENDED,
+      "MapFieldKeyIsNull",
       R"({"mapInt32Int32": {null: 1}})");
   // Map field values cannot be null.
   ExpectParseFailureForJson(
-      "MapFieldValueIsNull", RECOMMENDED,
+      "MapFieldValueIsNull",
       R"({"mapInt32Int32": {"0": null}})");
 
-  // http://www.rfc-editor.org/rfc/rfc7159.txt says strings have to use double
-  // quotes.
-  ExpectParseFailureForJson(
-      "StringFieldSingleQuoteKey", RECOMMENDED,
-      R"({'optionalString': "Hello world!"})");
-  ExpectParseFailureForJson(
-      "StringFieldSingleQuoteValue", RECOMMENDED,
-      R"({"optionalString": 'Hello world!'})");
-  ExpectParseFailureForJson(
-      "StringFieldSingleQuoteBoth", RECOMMENDED,
-      R"({'optionalString': 'Hello world!'})");
-
-  // Unknown fields.
-  {
-    TestAllTypesProto3 messageProto3;
-    TestAllTypesProto2 messageProto2;
-    TestUnknownMessage(messageProto3, true);
-    TestUnknownMessage(messageProto2, false);
-  }
-
   // Wrapper types.
   RunValidJsonTest(
-      "OptionalBoolWrapper", REQUIRED,
+      "OptionalBoolWrapper",
       R"({"optionalBoolWrapper": false})",
       "optional_bool_wrapper: {value: false}");
   RunValidJsonTest(
-      "OptionalInt32Wrapper", REQUIRED,
+      "OptionalInt32Wrapper",
       R"({"optionalInt32Wrapper": 0})",
       "optional_int32_wrapper: {value: 0}");
   RunValidJsonTest(
-      "OptionalUint32Wrapper", REQUIRED,
+      "OptionalUint32Wrapper",
       R"({"optionalUint32Wrapper": 0})",
       "optional_uint32_wrapper: {value: 0}");
   RunValidJsonTest(
-      "OptionalInt64Wrapper", REQUIRED,
+      "OptionalInt64Wrapper",
       R"({"optionalInt64Wrapper": 0})",
       "optional_int64_wrapper: {value: 0}");
   RunValidJsonTest(
-      "OptionalUint64Wrapper", REQUIRED,
+      "OptionalUint64Wrapper",
       R"({"optionalUint64Wrapper": 0})",
       "optional_uint64_wrapper: {value: 0}");
   RunValidJsonTest(
-      "OptionalFloatWrapper", REQUIRED,
+      "OptionalFloatWrapper",
       R"({"optionalFloatWrapper": 0})",
       "optional_float_wrapper: {value: 0}");
   RunValidJsonTest(
-      "OptionalDoubleWrapper", REQUIRED,
+      "OptionalDoubleWrapper",
       R"({"optionalDoubleWrapper": 0})",
       "optional_double_wrapper: {value: 0}");
   RunValidJsonTest(
-      "OptionalStringWrapper", REQUIRED,
+      "OptionalStringWrapper",
       R"({"optionalStringWrapper": ""})",
       R"(optional_string_wrapper: {value: ""})");
   RunValidJsonTest(
-      "OptionalBytesWrapper", REQUIRED,
+      "OptionalBytesWrapper",
       R"({"optionalBytesWrapper": ""})",
       R"(optional_bytes_wrapper: {value: ""})");
   RunValidJsonTest(
-      "OptionalWrapperTypesWithNonDefaultValue", REQUIRED,
+      "OptionalWrapperTypesWithNonDefaultValue",
       R"({
         "optionalBoolWrapper": true,
         "optionalInt32Wrapper": 1,
@@ -1976,56 +1435,56 @@
         optional_bytes_wrapper: {value: "\x01\x02"}
       )");
   RunValidJsonTest(
-      "RepeatedBoolWrapper", REQUIRED,
+      "RepeatedBoolWrapper",
       R"({"repeatedBoolWrapper": [true, false]})",
       "repeated_bool_wrapper: {value: true}"
       "repeated_bool_wrapper: {value: false}");
   RunValidJsonTest(
-      "RepeatedInt32Wrapper", REQUIRED,
+      "RepeatedInt32Wrapper",
       R"({"repeatedInt32Wrapper": [0, 1]})",
       "repeated_int32_wrapper: {value: 0}"
       "repeated_int32_wrapper: {value: 1}");
   RunValidJsonTest(
-      "RepeatedUint32Wrapper", REQUIRED,
+      "RepeatedUint32Wrapper",
       R"({"repeatedUint32Wrapper": [0, 1]})",
       "repeated_uint32_wrapper: {value: 0}"
       "repeated_uint32_wrapper: {value: 1}");
   RunValidJsonTest(
-      "RepeatedInt64Wrapper", REQUIRED,
+      "RepeatedInt64Wrapper",
       R"({"repeatedInt64Wrapper": [0, 1]})",
       "repeated_int64_wrapper: {value: 0}"
       "repeated_int64_wrapper: {value: 1}");
   RunValidJsonTest(
-      "RepeatedUint64Wrapper", REQUIRED,
+      "RepeatedUint64Wrapper",
       R"({"repeatedUint64Wrapper": [0, 1]})",
       "repeated_uint64_wrapper: {value: 0}"
       "repeated_uint64_wrapper: {value: 1}");
   RunValidJsonTest(
-      "RepeatedFloatWrapper", REQUIRED,
+      "RepeatedFloatWrapper",
       R"({"repeatedFloatWrapper": [0, 1]})",
       "repeated_float_wrapper: {value: 0}"
       "repeated_float_wrapper: {value: 1}");
   RunValidJsonTest(
-      "RepeatedDoubleWrapper", REQUIRED,
+      "RepeatedDoubleWrapper",
       R"({"repeatedDoubleWrapper": [0, 1]})",
       "repeated_double_wrapper: {value: 0}"
       "repeated_double_wrapper: {value: 1}");
   RunValidJsonTest(
-      "RepeatedStringWrapper", REQUIRED,
+      "RepeatedStringWrapper",
       R"({"repeatedStringWrapper": ["", "AQI="]})",
       R"(
         repeated_string_wrapper: {value: ""}
         repeated_string_wrapper: {value: "AQI="}
       )");
   RunValidJsonTest(
-      "RepeatedBytesWrapper", REQUIRED,
+      "RepeatedBytesWrapper",
       R"({"repeatedBytesWrapper": ["", "AQI="]})",
       R"(
         repeated_bytes_wrapper: {value: ""}
         repeated_bytes_wrapper: {value: "\x01\x02"}
       )");
   RunValidJsonTest(
-      "WrapperTypesWithNullValue", REQUIRED,
+      "WrapperTypesWithNullValue",
       R"({
         "optionalBoolWrapper": null,
         "optionalInt32Wrapper": null,
@@ -2050,59 +1509,55 @@
 
   // Duration
   RunValidJsonTest(
-      "DurationMinValue", REQUIRED,
+      "DurationMinValue",
       R"({"optionalDuration": "-315576000000.999999999s"})",
       "optional_duration: {seconds: -315576000000 nanos: -999999999}");
   RunValidJsonTest(
-      "DurationMaxValue", REQUIRED,
+      "DurationMaxValue",
       R"({"optionalDuration": "315576000000.999999999s"})",
       "optional_duration: {seconds: 315576000000 nanos: 999999999}");
   RunValidJsonTest(
-      "DurationRepeatedValue", REQUIRED,
+      "DurationRepeatedValue",
       R"({"repeatedDuration": ["1.5s", "-1.5s"]})",
       "repeated_duration: {seconds: 1 nanos: 500000000}"
       "repeated_duration: {seconds: -1 nanos: -500000000}");
-  RunValidJsonTest(
-      "DurationNull", REQUIRED,
-      R"({"optionalDuration": null})",
-      "");
 
   ExpectParseFailureForJson(
-      "DurationMissingS", REQUIRED,
+      "DurationMissingS",
       R"({"optionalDuration": "1"})");
   ExpectParseFailureForJson(
-      "DurationJsonInputTooSmall", REQUIRED,
+      "DurationJsonInputTooSmall",
       R"({"optionalDuration": "-315576000001.000000000s"})");
   ExpectParseFailureForJson(
-      "DurationJsonInputTooLarge", REQUIRED,
+      "DurationJsonInputTooLarge",
       R"({"optionalDuration": "315576000001.000000000s"})");
   ExpectSerializeFailureForJson(
-      "DurationProtoInputTooSmall", REQUIRED,
+      "DurationProtoInputTooSmall",
       "optional_duration: {seconds: -315576000001 nanos: 0}");
   ExpectSerializeFailureForJson(
-      "DurationProtoInputTooLarge", REQUIRED,
+      "DurationProtoInputTooLarge",
       "optional_duration: {seconds: 315576000001 nanos: 0}");
 
   RunValidJsonTestWithValidator(
-      "DurationHasZeroFractionalDigit", RECOMMENDED,
+      "DurationHasZeroFractionalDigit",
       R"({"optionalDuration": "1.000000000s"})",
       [](const Json::Value& value) {
         return value["optionalDuration"].asString() == "1s";
       });
   RunValidJsonTestWithValidator(
-      "DurationHas3FractionalDigits", RECOMMENDED,
+      "DurationHas3FractionalDigits",
       R"({"optionalDuration": "1.010000000s"})",
       [](const Json::Value& value) {
         return value["optionalDuration"].asString() == "1.010s";
       });
   RunValidJsonTestWithValidator(
-      "DurationHas6FractionalDigits", RECOMMENDED,
+      "DurationHas6FractionalDigits",
       R"({"optionalDuration": "1.000010000s"})",
       [](const Json::Value& value) {
         return value["optionalDuration"].asString() == "1.000010s";
       });
   RunValidJsonTestWithValidator(
-      "DurationHas9FractionalDigits", RECOMMENDED,
+      "DurationHas9FractionalDigits",
       R"({"optionalDuration": "1.000000010s"})",
       [](const Json::Value& value) {
         return value["optionalDuration"].asString() == "1.000000010s";
@@ -2110,15 +1565,15 @@
 
   // Timestamp
   RunValidJsonTest(
-      "TimestampMinValue", REQUIRED,
+      "TimestampMinValue",
       R"({"optionalTimestamp": "0001-01-01T00:00:00Z"})",
       "optional_timestamp: {seconds: -62135596800}");
   RunValidJsonTest(
-      "TimestampMaxValue", REQUIRED,
+      "TimestampMaxValue",
       R"({"optionalTimestamp": "9999-12-31T23:59:59.999999999Z"})",
       "optional_timestamp: {seconds: 253402300799 nanos: 999999999}");
   RunValidJsonTest(
-      "TimestampRepeatedValue", REQUIRED,
+      "TimestampRepeatedValue",
       R"({
         "repeatedTimestamp": [
           "0001-01-01T00:00:00Z",
@@ -2128,72 +1583,68 @@
       "repeated_timestamp: {seconds: -62135596800}"
       "repeated_timestamp: {seconds: 253402300799 nanos: 999999999}");
   RunValidJsonTest(
-      "TimestampWithPositiveOffset", REQUIRED,
+      "TimestampWithPositiveOffset",
       R"({"optionalTimestamp": "1970-01-01T08:00:00+08:00"})",
       "optional_timestamp: {seconds: 0}");
   RunValidJsonTest(
-      "TimestampWithNegativeOffset", REQUIRED,
+      "TimestampWithNegativeOffset",
       R"({"optionalTimestamp": "1969-12-31T16:00:00-08:00"})",
       "optional_timestamp: {seconds: 0}");
-  RunValidJsonTest(
-      "TimestampNull", REQUIRED,
-      R"({"optionalTimestamp": null})",
-      "");
 
   ExpectParseFailureForJson(
-      "TimestampJsonInputTooSmall", REQUIRED,
+      "TimestampJsonInputTooSmall",
       R"({"optionalTimestamp": "0000-01-01T00:00:00Z"})");
   ExpectParseFailureForJson(
-      "TimestampJsonInputTooLarge", REQUIRED,
+      "TimestampJsonInputTooLarge",
       R"({"optionalTimestamp": "10000-01-01T00:00:00Z"})");
   ExpectParseFailureForJson(
-      "TimestampJsonInputMissingZ", REQUIRED,
+      "TimestampJsonInputMissingZ",
       R"({"optionalTimestamp": "0001-01-01T00:00:00"})");
   ExpectParseFailureForJson(
-      "TimestampJsonInputMissingT", REQUIRED,
+      "TimestampJsonInputMissingT",
       R"({"optionalTimestamp": "0001-01-01 00:00:00Z"})");
   ExpectParseFailureForJson(
-      "TimestampJsonInputLowercaseZ", REQUIRED,
+      "TimestampJsonInputLowercaseZ",
       R"({"optionalTimestamp": "0001-01-01T00:00:00z"})");
   ExpectParseFailureForJson(
-      "TimestampJsonInputLowercaseT", REQUIRED,
+      "TimestampJsonInputLowercaseT",
       R"({"optionalTimestamp": "0001-01-01t00:00:00Z"})");
   ExpectSerializeFailureForJson(
-      "TimestampProtoInputTooSmall", REQUIRED,
+      "TimestampProtoInputTooSmall",
       "optional_timestamp: {seconds: -62135596801}");
   ExpectSerializeFailureForJson(
-      "TimestampProtoInputTooLarge", REQUIRED,
+      "TimestampProtoInputTooLarge",
       "optional_timestamp: {seconds: 253402300800}");
   RunValidJsonTestWithValidator(
-      "TimestampZeroNormalized", RECOMMENDED,
+      "TimestampZeroNormalized",
       R"({"optionalTimestamp": "1969-12-31T16:00:00-08:00"})",
       [](const Json::Value& value) {
         return value["optionalTimestamp"].asString() ==
             "1970-01-01T00:00:00Z";
       });
   RunValidJsonTestWithValidator(
-      "TimestampHasZeroFractionalDigit", RECOMMENDED,
+      "TimestampHasZeroFractionalDigit",
       R"({"optionalTimestamp": "1970-01-01T00:00:00.000000000Z"})",
       [](const Json::Value& value) {
         return value["optionalTimestamp"].asString() ==
             "1970-01-01T00:00:00Z";
       });
   RunValidJsonTestWithValidator(
-      "TimestampHas3FractionalDigits", RECOMMENDED,
+      "TimestampHas3FractionalDigits",
       R"({"optionalTimestamp": "1970-01-01T00:00:00.010000000Z"})",
       [](const Json::Value& value) {
         return value["optionalTimestamp"].asString() ==
             "1970-01-01T00:00:00.010Z";
       });
   RunValidJsonTestWithValidator(
-      "TimestampHas6FractionalDigits", RECOMMENDED,
+      "TimestampHas6FractionalDigits",
       R"({"optionalTimestamp": "1970-01-01T00:00:00.000010000Z"})",
       [](const Json::Value& value) {
         return value["optionalTimestamp"].asString() ==
             "1970-01-01T00:00:00.000010Z";
       });
   RunValidJsonTestWithValidator(
-      "TimestampHas9FractionalDigits", RECOMMENDED,
+      "TimestampHas9FractionalDigits",
       R"({"optionalTimestamp": "1970-01-01T00:00:00.000000010Z"})",
       [](const Json::Value& value) {
         return value["optionalTimestamp"].asString() ==
@@ -2202,25 +1653,25 @@
 
   // FieldMask
   RunValidJsonTest(
-      "FieldMask", REQUIRED,
+      "FieldMask",
       R"({"optionalFieldMask": "foo,barBaz"})",
       R"(optional_field_mask: {paths: "foo" paths: "bar_baz"})");
   ExpectParseFailureForJson(
-      "FieldMaskInvalidCharacter", RECOMMENDED,
+      "FieldMaskInvalidCharacter",
       R"({"optionalFieldMask": "foo,bar_bar"})");
   ExpectSerializeFailureForJson(
-      "FieldMaskPathsDontRoundTrip", RECOMMENDED,
+      "FieldMaskPathsDontRoundTrip",
       R"(optional_field_mask: {paths: "fooBar"})");
   ExpectSerializeFailureForJson(
-      "FieldMaskNumbersDontRoundTrip", RECOMMENDED,
+      "FieldMaskNumbersDontRoundTrip",
       R"(optional_field_mask: {paths: "foo_3_bar"})");
   ExpectSerializeFailureForJson(
-      "FieldMaskTooManyUnderscore", RECOMMENDED,
+      "FieldMaskTooManyUnderscore",
       R"(optional_field_mask: {paths: "foo__bar"})");
 
   // Struct
   RunValidJsonTest(
-      "Struct", REQUIRED,
+      "Struct",
       R"({
         "optionalStruct": {
           "nullValue": null,
@@ -2286,27 +1737,27 @@
       )");
   // Value
   RunValidJsonTest(
-      "ValueAcceptInteger", REQUIRED,
+      "ValueAcceptInteger",
       R"({"optionalValue": 1})",
       "optional_value: { number_value: 1}");
   RunValidJsonTest(
-      "ValueAcceptFloat", REQUIRED,
+      "ValueAcceptFloat",
       R"({"optionalValue": 1.5})",
       "optional_value: { number_value: 1.5}");
   RunValidJsonTest(
-      "ValueAcceptBool", REQUIRED,
+      "ValueAcceptBool",
       R"({"optionalValue": false})",
       "optional_value: { bool_value: false}");
   RunValidJsonTest(
-      "ValueAcceptNull", REQUIRED,
+      "ValueAcceptNull",
       R"({"optionalValue": null})",
       "optional_value: { null_value: NULL_VALUE}");
   RunValidJsonTest(
-      "ValueAcceptString", REQUIRED,
+      "ValueAcceptString",
       R"({"optionalValue": "hello"})",
       R"(optional_value: { string_value: "hello"})");
   RunValidJsonTest(
-      "ValueAcceptList", REQUIRED,
+      "ValueAcceptList",
       R"({"optionalValue": [0, "hello"]})",
       R"(
         optional_value: {
@@ -2321,7 +1772,7 @@
         }
       )");
   RunValidJsonTest(
-      "ValueAcceptObject", REQUIRED,
+      "ValueAcceptObject",
       R"({"optionalValue": {"value": 1}})",
       R"(
         optional_value: {
@@ -2338,27 +1789,27 @@
 
   // Any
   RunValidJsonTest(
-      "Any", REQUIRED,
+      "Any",
       R"({
         "optionalAny": {
-          "@type": "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3",
+          "@type": "type.googleapis.com/conformance.TestAllTypes",
           "optionalInt32": 12345
         }
       })",
       R"(
         optional_any: {
-          [type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3] {
+          [type.googleapis.com/conformance.TestAllTypes] {
             optional_int32: 12345
           }
         }
       )");
   RunValidJsonTest(
-      "AnyNested", REQUIRED,
+      "AnyNested",
       R"({
         "optionalAny": {
           "@type": "type.googleapis.com/google.protobuf.Any",
           "value": {
-            "@type": "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3",
+            "@type": "type.googleapis.com/conformance.TestAllTypes",
             "optionalInt32": 12345
           }
         }
@@ -2366,7 +1817,7 @@
       R"(
         optional_any: {
           [type.googleapis.com/google.protobuf.Any] {
-            [type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3] {
+            [type.googleapis.com/conformance.TestAllTypes] {
               optional_int32: 12345
             }
           }
@@ -2374,23 +1825,23 @@
       )");
   // The special "@type" tag is not required to appear first.
   RunValidJsonTest(
-      "AnyUnorderedTypeTag", REQUIRED,
+      "AnyUnorderedTypeTag",
       R"({
         "optionalAny": {
           "optionalInt32": 12345,
-          "@type": "type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3"
+          "@type": "type.googleapis.com/conformance.TestAllTypes"
         }
       })",
       R"(
         optional_any: {
-          [type.googleapis.com/protobuf_test_messages.proto3.TestAllTypesProto3] {
+          [type.googleapis.com/conformance.TestAllTypes] {
             optional_int32: 12345
           }
         }
       )");
   // Well-known types in Any.
   RunValidJsonTest(
-      "AnyWithInt32ValueWrapper", REQUIRED,
+      "AnyWithInt32ValueWrapper",
       R"({
         "optionalAny": {
           "@type": "type.googleapis.com/google.protobuf.Int32Value",
@@ -2405,7 +1856,7 @@
         }
       )");
   RunValidJsonTest(
-      "AnyWithDuration", REQUIRED,
+      "AnyWithDuration",
       R"({
         "optionalAny": {
           "@type": "type.googleapis.com/google.protobuf.Duration",
@@ -2421,7 +1872,7 @@
         }
       )");
   RunValidJsonTest(
-      "AnyWithTimestamp", REQUIRED,
+      "AnyWithTimestamp",
       R"({
         "optionalAny": {
           "@type": "type.googleapis.com/google.protobuf.Timestamp",
@@ -2437,7 +1888,7 @@
         }
       )");
   RunValidJsonTest(
-      "AnyWithFieldMask", REQUIRED,
+      "AnyWithFieldMask",
       R"({
         "optionalAny": {
           "@type": "type.googleapis.com/google.protobuf.FieldMask",
@@ -2452,7 +1903,7 @@
         }
       )");
   RunValidJsonTest(
-      "AnyWithStruct", REQUIRED,
+      "AnyWithStruct",
       R"({
         "optionalAny": {
           "@type": "type.googleapis.com/google.protobuf.Struct",
@@ -2474,7 +1925,7 @@
         }
       )");
   RunValidJsonTest(
-      "AnyWithValueForJsonObject", REQUIRED,
+      "AnyWithValueForJsonObject",
       R"({
         "optionalAny": {
           "@type": "type.googleapis.com/google.protobuf.Value",
@@ -2498,7 +1949,7 @@
         }
       )");
   RunValidJsonTest(
-      "AnyWithValueForInteger", REQUIRED,
+      "AnyWithValueForInteger",
       R"({
         "optionalAny": {
           "@type": "type.googleapis.com/google.protobuf.Value",
@@ -2514,34 +1965,27 @@
       )");
 
   bool ok = true;
-  if (!CheckSetEmpty(expected_to_fail_, "nonexistent_tests.txt",
+  if (!CheckSetEmpty(expected_to_fail_,
                      "These tests were listed in the failure list, but they "
-                     "don't exist.  Remove them from the failure list by "
-                     "running:\n"
-                     "  ./update_failure_list.py " + failure_list_filename_ +
-                     " --remove nonexistent_tests.txt")) {
+                     "don't exist.  Remove them from the failure list")) {
     ok = false;
   }
-  if (!CheckSetEmpty(unexpected_failing_tests_, "failing_tests.txt",
+  if (!CheckSetEmpty(unexpected_failing_tests_,
                      "These tests failed.  If they can't be fixed right now, "
                      "you can add them to the failure list so the overall "
-                     "suite can succeed.  Add them to the failure list by "
-                     "running:\n"
-                     "  ./update_failure_list.py " + failure_list_filename_ +
-                     " --add failing_tests.txt")) {
-    ok = false;
-  }
-  if (!CheckSetEmpty(unexpected_succeeding_tests_, "succeeding_tests.txt",
-                     "These tests succeeded, even though they were listed in "
-                     "the failure list.  Remove them from the failure list "
-                     "by running:\n"
-                     "  ./update_failure_list.py " + failure_list_filename_ +
-                     " --remove succeeding_tests.txt")) {
+                     "suite can succeed")) {
     ok = false;
   }
 
+  // Sometimes the testee may be fixed before we update the failure list (e.g.,
+  // the testee is from a different component). We warn about this case but
+  // don't consider it an overall test failure.
+  CheckSetEmpty(unexpected_succeeding_tests_,
+                "These tests succeeded, even though they were listed in "
+                "the failure list.  Remove them from the failure list");
+
   if (verbose_) {
-    CheckSetEmpty(skipped_, "",
+    CheckSetEmpty(skipped_,
                   "These tests were skipped (probably because support for some "
                   "features is not implemented)");
   }
diff --git a/conformance/conformance_test.h b/conformance/conformance_test.h
index 4882412..75fc97b 100644
--- a/conformance/conformance_test.h
+++ b/conformance/conformance_test.h
@@ -49,14 +49,9 @@
 namespace conformance {
 class ConformanceRequest;
 class ConformanceResponse;
+class TestAllTypes;
 }  // namespace conformance
 
-namespace protobuf_test_messages {
-namespace proto3 {
-class TestAllTypesProto3;
-}  // namespace proto3
-}  // namespace protobuf_test_messages
-
 namespace google {
 namespace protobuf {
 
@@ -96,30 +91,14 @@
 //
 class ConformanceTestSuite {
  public:
-  ConformanceTestSuite() : verbose_(false), enforce_recommended_(false) {}
+  ConformanceTestSuite() : verbose_(false) {}
 
   void SetVerbose(bool verbose) { verbose_ = verbose; }
 
   // Sets the list of tests that are expected to fail when RunSuite() is called.
   // RunSuite() will fail unless the set of failing tests is exactly the same
   // as this list.
-  //
-  // The filename here is *only* used to create/format useful error messages for
-  // how to update the failure list.  We do NOT read this file at all.
-  void SetFailureList(const std::string& filename,
-                      const std::vector<std::string>& failure_list);
-
-  // Whether to require the testee to pass RECOMMENDED tests. By default failing
-  // a RECOMMENDED test case will not fail the entire suite but will only
-  // generated a warning. If this flag is set to true, RECOMMENDED tests will
-  // be treated the same way as REQUIRED tests and failing a RECOMMENDED test
-  // case will cause the entire test suite to fail as well. An implementation
-  // can enable this if it wants to be strictly conforming to protobuf spec.
-  // See the comments about ConformanceLevel below to learn more about the
-  // difference between REQUIRED and RECOMMENDED test cases.
-  void SetEnforceRecommended(bool value) {
-    enforce_recommended_ = value;
-  }
+  void SetFailureList(const std::vector<std::string>& failure_list);
 
   // Run all the conformance tests against the given test runner.
   // Test output will be stored in "output".
@@ -130,27 +109,8 @@
   bool RunSuite(ConformanceTestRunner* runner, std::string* output);
 
  private:
-  // Test cases are classified into a few categories:
-  //   REQUIRED: the test case must be passed for an implementation to be
-  //             interoperable with other implementations. For example, a
-  //             parser implementaiton must accept both packed and unpacked
-  //             form of repeated primitive fields.
-  //   RECOMMENDED: the test case is not required for the implementation to
-  //                be interoperable with other implementations, but is
-  //                recommended for best performance and compatibility. For
-  //                example, a proto3 serializer should serialize repeated
-  //                primitive fields in packed form, but an implementation
-  //                failing to do so will still be able to communicate with
-  //                other implementations.
-  enum ConformanceLevel {
-    REQUIRED = 0,
-    RECOMMENDED = 1,
-  };
-  string ConformanceLevelToString(ConformanceLevel level);
-
   void ReportSuccess(const std::string& test_name);
   void ReportFailure(const string& test_name,
-                     ConformanceLevel level,
                      const conformance::ConformanceRequest& request,
                      const conformance::ConformanceResponse& response,
                      const char* fmt, ...);
@@ -160,84 +120,35 @@
   void RunTest(const std::string& test_name,
                const conformance::ConformanceRequest& request,
                conformance::ConformanceResponse* response);
-  void RunValidInputTest(const string& test_name,
-                         ConformanceLevel level,
-                         const string& input,
+  void RunValidInputTest(const string& test_name, const string& input,
                          conformance::WireFormat input_format,
                          const string& equivalent_text_format,
-                         conformance::WireFormat requested_output,
-                         bool isProto3);
-  void RunValidBinaryInputTest(const string& test_name,
-                               ConformanceLevel level,
-                               const string& input,
-                               conformance::WireFormat input_format,
-                               const string& equivalent_wire_format,
-                               conformance::WireFormat requested_output,
-                               bool isProto3);
-  void RunValidJsonTest(const string& test_name,
-                        ConformanceLevel level,
-                        const string& input_json,
+                         conformance::WireFormat requested_output);
+  void RunValidJsonTest(const string& test_name, const string& input_json,
                         const string& equivalent_text_format);
-  void RunValidJsonTestWithProtobufInput(
-      const string& test_name,
-      ConformanceLevel level,
-      const protobuf_test_messages::proto3::TestAllTypesProto3& input,
-      const string& equivalent_text_format);
-  void RunValidProtobufTest(const string& test_name, ConformanceLevel level,
-                            const string& input_protobuf,
-                            const string& equivalent_text_format,
-                            bool isProto3);
-  void RunValidBinaryProtobufTest(const string& test_name,
-                                  ConformanceLevel level,
-                                  const string& input_protobuf,
-                                  bool isProto3);
-  void RunValidProtobufTestWithMessage(
-      const string& test_name, ConformanceLevel level,
-      const Message *input,
-      const string& equivalent_text_format,
-      bool isProto3);
+  void RunValidJsonTestWithProtobufInput(const string& test_name,
+                                         const conformance::TestAllTypes& input,
+                                         const string& equivalent_text_format);
 
   typedef std::function<bool(const Json::Value&)> Validator;
   void RunValidJsonTestWithValidator(const string& test_name,
-                                     ConformanceLevel level,
                                      const string& input_json,
                                      const Validator& validator);
   void ExpectParseFailureForJson(const string& test_name,
-                                 ConformanceLevel level,
                                  const string& input_json);
   void ExpectSerializeFailureForJson(const string& test_name,
-                                     ConformanceLevel level,
                                      const string& text_format);
-  void ExpectParseFailureForProtoWithProtoVersion (const string& proto,
-                                                   const string& test_name,
-                                                   ConformanceLevel level,
-                                                   bool isProto3);
   void ExpectParseFailureForProto(const std::string& proto,
-                                  const std::string& test_name,
-                                  ConformanceLevel level);
+                                  const std::string& test_name);
   void ExpectHardParseFailureForProto(const std::string& proto,
-                                      const std::string& test_name,
-                                      ConformanceLevel level);
+                                      const std::string& test_name);
   void TestPrematureEOFForType(google::protobuf::FieldDescriptor::Type type);
-  void TestIllegalTags();
-  template <class MessageType>
-  void TestOneofMessage (MessageType &message,
-                         bool isProto3);
-  template <class MessageType>
-  void TestUnknownMessage (MessageType &message,
-                           bool isProto3);
-  void TestValidDataForType(
-      google::protobuf::FieldDescriptor::Type,
-      std::vector<std::pair<std::string, std::string>> values);
-  bool CheckSetEmpty(const std::set<string>& set_to_check,
-                     const std::string& write_to_file, const std::string& msg);
+  bool CheckSetEmpty(const set<string>& set_to_check, const char* msg);
   ConformanceTestRunner* runner_;
   int successes_;
   int expected_failures_;
   bool verbose_;
-  bool enforce_recommended_;
   std::string output_;
-  std::string failure_list_filename_;
 
   // The set of test names that are expected to fail in this run, but haven't
   // failed yet.
diff --git a/conformance/conformance_test_runner.cc b/conformance/conformance_test_runner.cc
index 7e91d38..376a60b 100644
--- a/conformance/conformance_test_runner.cc
+++ b/conformance/conformance_test_runner.cc
@@ -251,16 +251,6 @@
           "                              should contain one test name per\n");
   fprintf(stderr,
           "                              line.  Use '#' for comments.\n");
-  fprintf(stderr,
-          "  --enforce_recommended       Enforce that recommended test\n");
-  fprintf(stderr,
-          "                              cases are also passing. Specify\n");
-  fprintf(stderr,
-          "                              this flag if you want to be\n");
-  fprintf(stderr,
-          "                              strictly conforming to protobuf\n");
-  fprintf(stderr,
-          "                              spec.\n");
   exit(1);
 }
 
@@ -290,18 +280,14 @@
   char *program;
   google::protobuf::ConformanceTestSuite suite;
 
-  string failure_list_filename;
   vector<string> failure_list;
 
   for (int arg = 1; arg < argc; ++arg) {
     if (strcmp(argv[arg], "--failure_list") == 0) {
       if (++arg == argc) UsageError();
-      failure_list_filename = argv[arg];
       ParseFailureList(argv[arg], &failure_list);
     } else if (strcmp(argv[arg], "--verbose") == 0) {
       suite.SetVerbose(true);
-    } else if (strcmp(argv[arg], "--enforce_recommended") == 0) {
-      suite.SetEnforceRecommended(true);
     } else if (argv[arg][0] == '-') {
       fprintf(stderr, "Unknown option: %s\n", argv[arg]);
       UsageError();
@@ -314,7 +300,7 @@
     }
   }
 
-  suite.SetFailureList(failure_list_filename, failure_list);
+  suite.SetFailureList(failure_list);
   ForkPipeRunner runner(program);
 
   std::string output;
diff --git a/conformance/failure_list_cpp.txt b/conformance/failure_list_cpp.txt
index 8c32889..2ddf831 100644
--- a/conformance/failure_list_cpp.txt
+++ b/conformance/failure_list_cpp.txt
@@ -7,51 +7,100 @@
 # TODO(haberman): insert links to corresponding bugs tracking the issue.
 # Should we use GitHub issues or the Google-internal bug tracker?
 
-Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
-Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
-Recommended.Proto3.JsonInput.FieldNameDuplicate
-Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing1
-Recommended.Proto3.JsonInput.FieldNameDuplicateDifferentCasing2
-Recommended.Proto3.JsonInput.FieldNameNotQuoted
-Recommended.Proto3.JsonInput.MapFieldValueIsNull
-Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull
-Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull
-Recommended.Proto3.JsonInput.RepeatedFieldTrailingComma
-Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithNewlines
-Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpace
-Recommended.Proto3.JsonInput.RepeatedFieldTrailingCommaWithSpaceCommaSpace
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue
-Recommended.Proto3.JsonInput.StringFieldUppercaseEscapeLetter
-Recommended.Proto3.JsonInput.TrailingCommaInAnObject
-Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines
-Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpace
-Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace
-Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.BOOL
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.ENUM
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT32
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT64
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT32
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT64
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT32
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT64
-Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.BOOL
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.ENUM
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.INT32
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.INT64
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.SINT32
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.SINT64
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.UINT32
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.UINT64
-
+FieldMaskNumbersDontRoundTrip.JsonOutput
+FieldMaskPathsDontRoundTrip.JsonOutput
+FieldMaskTooManyUnderscore.JsonOutput
+JsonInput.AnyUnorderedTypeTag.JsonOutput
+JsonInput.AnyUnorderedTypeTag.ProtobufOutput
+JsonInput.AnyWithValueForInteger.JsonOutput
+JsonInput.AnyWithValueForInteger.ProtobufOutput
+JsonInput.AnyWithValueForJsonObject.JsonOutput
+JsonInput.AnyWithValueForJsonObject.ProtobufOutput
+JsonInput.BoolFieldDoubleQuotedFalse
+JsonInput.BoolFieldDoubleQuotedTrue
+JsonInput.BoolFieldIntegerOne
+JsonInput.BoolFieldIntegerZero
+JsonInput.BytesFieldInvalidBase64Characters
+JsonInput.BytesFieldNoPadding
+JsonInput.DoubleFieldTooSmall
+JsonInput.DurationHasZeroFractionalDigit.Validator
+JsonInput.DurationJsonInputTooLarge
+JsonInput.DurationJsonInputTooSmall
+JsonInput.DurationMissingS
+JsonInput.EnumFieldUnknownValue.Validator
+JsonInput.FieldMaskInvalidCharacter
+JsonInput.FieldNameDuplicate
+JsonInput.FieldNameDuplicateDifferentCasing1
+JsonInput.FieldNameDuplicateDifferentCasing2
+JsonInput.FieldNameInLowerCamelCase.Validator
+JsonInput.FieldNameInSnakeCase.JsonOutput
+JsonInput.FieldNameInSnakeCase.ProtobufOutput
+JsonInput.FieldNameNotQuoted
+JsonInput.FloatFieldTooLarge
+JsonInput.FloatFieldTooSmall
+JsonInput.Int32FieldLeadingSpace
+JsonInput.Int32FieldLeadingZero
+JsonInput.Int32FieldMinFloatValue.JsonOutput
+JsonInput.Int32FieldMinFloatValue.ProtobufOutput
+JsonInput.Int32FieldMinValue.JsonOutput
+JsonInput.Int32FieldMinValue.ProtobufOutput
+JsonInput.Int32FieldNegativeWithLeadingZero
+JsonInput.Int32FieldNotInteger
+JsonInput.Int32FieldNotNumber
+JsonInput.Int32FieldTooLarge
+JsonInput.Int32FieldTooSmall
+JsonInput.Int32FieldTrailingSpace
+JsonInput.Int64FieldNotInteger
+JsonInput.Int64FieldNotNumber
+JsonInput.Int64FieldTooLarge
+JsonInput.Int64FieldTooSmall
+JsonInput.MapFieldValueIsNull
+JsonInput.OneofFieldDuplicate
+JsonInput.RepeatedFieldMessageElementIsNull
+JsonInput.RepeatedFieldPrimitiveElementIsNull
+JsonInput.RepeatedFieldTrailingComma
+JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool
+JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotMessage
+JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotString
+JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotBool
+JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotInt
+JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotString
+JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool
+JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
+JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotMessage
+JsonInput.StringFieldNotAString
+JsonInput.StringFieldSurrogateInWrongOrder
+JsonInput.StringFieldSurrogatePair.JsonOutput
+JsonInput.StringFieldSurrogatePair.ProtobufOutput
+JsonInput.StringFieldUnpairedHighSurrogate
+JsonInput.StringFieldUnpairedLowSurrogate
+JsonInput.StringFieldUppercaseEscapeLetter
+JsonInput.TimestampJsonInputLowercaseT
+JsonInput.TimestampJsonInputLowercaseZ
+JsonInput.TimestampJsonInputMissingT
+JsonInput.TimestampJsonInputMissingZ
+JsonInput.TimestampJsonInputTooLarge
+JsonInput.TimestampJsonInputTooSmall
+JsonInput.TrailingCommaInAnObject
+JsonInput.Uint32FieldNotInteger
+JsonInput.Uint32FieldNotNumber
+JsonInput.Uint32FieldTooLarge
+JsonInput.Uint64FieldNotInteger
+JsonInput.Uint64FieldNotNumber
+JsonInput.Uint64FieldTooLarge
+JsonInput.WrapperTypesWithNullValue.JsonOutput
+JsonInput.WrapperTypesWithNullValue.ProtobufOutput
+ProtobufInput.PrematureEofBeforeKnownRepeatedValue.MESSAGE
+ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
+ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
+ProtobufInput.PrematureEofInPackedField.BOOL
+ProtobufInput.PrematureEofInPackedField.ENUM
+ProtobufInput.PrematureEofInPackedField.INT32
+ProtobufInput.PrematureEofInPackedField.INT64
+ProtobufInput.PrematureEofInPackedField.SINT32
+ProtobufInput.PrematureEofInPackedField.SINT64
+ProtobufInput.PrematureEofInPackedField.UINT32
+ProtobufInput.PrematureEofInPackedField.UINT64
+ProtobufInput.PrematureEofInsideKnownRepeatedValue.MESSAGE
+TimestampProtoInputTooLarge.JsonOutput
+TimestampProtoInputTooSmall.JsonOutput
diff --git a/conformance/failure_list_csharp.txt b/conformance/failure_list_csharp.txt
index 2a20aa7..a46cee4 100644
--- a/conformance/failure_list_csharp.txt
+++ b/conformance/failure_list_csharp.txt
@@ -1,2 +1,16 @@
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
+JsonInput.AnyWithValueForInteger.JsonOutput
+JsonInput.AnyWithValueForJsonObject.JsonOutput
+JsonInput.FieldNameInLowerCamelCase.Validator
+JsonInput.FieldNameInSnakeCase.JsonOutput
+JsonInput.FieldNameInSnakeCase.ProtobufOutput
+JsonInput.FieldNameWithMixedCases.JsonOutput
+JsonInput.FieldNameWithMixedCases.ProtobufOutput
+JsonInput.FieldNameWithMixedCases.Validator
+JsonInput.Int32FieldMinFloatValue.JsonOutput
+JsonInput.Int32FieldMinValue.JsonOutput
+JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput
+JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput
+JsonInput.OriginalProtoFieldName.JsonOutput
+JsonInput.StringFieldSurrogatePair.JsonOutput
+JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput
+JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput
diff --git a/conformance/failure_list_java.txt b/conformance/failure_list_java.txt
index 5116c56..552c0cc 100644
--- a/conformance/failure_list_java.txt
+++ b/conformance/failure_list_java.txt
@@ -4,44 +4,46 @@
 # By listing them here we can keep tabs on which ones are failing and be sure
 # that we don't introduce regressions in other tests.
 
-Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.Proto3.JsonInput.BoolFieldAllCapitalFalse
-Recommended.Proto3.JsonInput.BoolFieldAllCapitalTrue
-Recommended.Proto3.JsonInput.BoolFieldCamelCaseFalse
-Recommended.Proto3.JsonInput.BoolFieldCamelCaseTrue
-Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedFalse
-Recommended.Proto3.JsonInput.BoolFieldDoubleQuotedTrue
-Recommended.Proto3.JsonInput.BoolMapFieldKeyNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted
-Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
-Recommended.Proto3.JsonInput.FieldNameDuplicate
-Recommended.Proto3.JsonInput.FieldNameNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted
-Recommended.Proto3.JsonInput.Int32MapFieldKeyNotQuoted
-Recommended.Proto3.JsonInput.Int64MapFieldKeyNotQuoted
-Recommended.Proto3.JsonInput.JsonWithComments
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteBoth
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteKey
-Recommended.Proto3.JsonInput.StringFieldSingleQuoteValue
-Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder
-Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate
-Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate
-Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted
-Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted
-Required.Proto3.JsonInput.EnumFieldNotQuoted
-Required.Proto3.JsonInput.Int32FieldLeadingZero
-Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero
-Required.Proto3.JsonInput.Int32FieldPlusSign
-Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool
-Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
-Required.Proto3.JsonInput.StringFieldNotAString
-Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
-Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
\ No newline at end of file
+FieldMaskNumbersDontRoundTrip.JsonOutput
+FieldMaskPathsDontRoundTrip.JsonOutput
+FieldMaskTooManyUnderscore.JsonOutput
+JsonInput.AnyWithFieldMask.ProtobufOutput
+JsonInput.AnyWithValueForInteger.JsonOutput
+JsonInput.AnyWithValueForJsonObject.JsonOutput
+JsonInput.BoolFieldAllCapitalFalse
+JsonInput.BoolFieldAllCapitalTrue
+JsonInput.BoolFieldCamelCaseFalse
+JsonInput.BoolFieldCamelCaseTrue
+JsonInput.BoolFieldDoubleQuotedFalse
+JsonInput.BoolFieldDoubleQuotedTrue
+JsonInput.BoolMapFieldKeyNotQuoted
+JsonInput.DoubleFieldInfinityNotQuoted
+JsonInput.DoubleFieldNanNotQuoted
+JsonInput.DoubleFieldNegativeInfinityNotQuoted
+JsonInput.EnumFieldNotQuoted
+JsonInput.FieldMask.ProtobufOutput
+JsonInput.FieldMaskInvalidCharacter
+JsonInput.FieldNameDuplicate
+JsonInput.FieldNameInSnakeCase.JsonOutput
+JsonInput.FieldNameNotQuoted
+JsonInput.FloatFieldInfinityNotQuoted
+JsonInput.FloatFieldNanNotQuoted
+JsonInput.FloatFieldNegativeInfinityNotQuoted
+JsonInput.Int32FieldLeadingZero
+JsonInput.Int32FieldMinFloatValue.JsonOutput
+JsonInput.Int32FieldMinValue.JsonOutput
+JsonInput.Int32FieldNegativeWithLeadingZero
+JsonInput.Int32FieldPlusSign
+JsonInput.Int32MapFieldKeyNotQuoted
+JsonInput.Int64MapFieldKeyNotQuoted
+JsonInput.JsonWithComments
+JsonInput.OriginalProtoFieldName.JsonOutput
+JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotBool
+JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
+JsonInput.StringFieldNotAString
+JsonInput.StringFieldSurrogateInWrongOrder
+JsonInput.StringFieldUnpairedHighSurrogate
+JsonInput.StringFieldUnpairedLowSurrogate
+JsonInput.StringFieldUppercaseEscapeLetter
+JsonInput.Uint32MapFieldKeyNotQuoted
+JsonInput.Uint64MapFieldKeyNotQuoted
diff --git a/conformance/failure_list_js.txt b/conformance/failure_list_js.txt
deleted file mode 100644
index f8f6a57..0000000
--- a/conformance/failure_list_js.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.ProtobufOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.ProtobufOutput
diff --git a/conformance/failure_list_objc.txt b/conformance/failure_list_objc.txt
index e34501e..5dac350 100644
--- a/conformance/failure_list_objc.txt
+++ b/conformance/failure_list_objc.txt
@@ -1,2 +1,4 @@
-# JSON input or output tests are skipped (in conformance_objc.m) as mobile
-# platforms don't support JSON wire format to avoid code bloat.
+# No tests currently failing.
+#
+# json input or output tests are skipped (in conformance_objc.m) as mobile
+# platforms don't support json wire format to avoid code bloat.
diff --git a/conformance/failure_list_php.txt b/conformance/failure_list_php.txt
deleted file mode 100644
index 0d23411..0000000
--- a/conformance/failure_list_php.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
-Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator
-Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator
-Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator
-Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator
-Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
-Required.Proto3.JsonInput.FloatFieldTooLarge
-Required.Proto3.JsonInput.FloatFieldTooSmall
-Required.Proto3.JsonInput.DoubleFieldTooSmall
-Required.Proto3.JsonInput.Int32FieldNotInteger
-Required.Proto3.JsonInput.Int64FieldNotInteger
-Required.Proto3.JsonInput.Uint32FieldNotInteger
-Required.Proto3.JsonInput.Uint64FieldNotInteger
-Required.Proto3.JsonInput.Int32FieldLeadingSpace
-Required.Proto3.JsonInput.OneofFieldDuplicate
-Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput
diff --git a/conformance/failure_list_php_c.txt b/conformance/failure_list_php_c.txt
deleted file mode 100644
index 088708e..0000000
--- a/conformance/failure_list_php_c.txt
+++ /dev/null
@@ -1,182 +0,0 @@
-Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.Proto3.JsonInput.BoolFieldIntegerOne
-Recommended.Proto3.JsonInput.BoolFieldIntegerZero
-Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator
-Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator
-Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator
-Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator
-Recommended.Proto3.JsonInput.Int64FieldBeString.Validator
-Recommended.Proto3.JsonInput.MapFieldValueIsNull
-Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput
-Recommended.Proto3.JsonInput.OneofZeroBytes.ProtobufOutput
-Recommended.Proto3.JsonInput.OneofZeroString.JsonOutput
-Recommended.Proto3.JsonInput.OneofZeroString.ProtobufOutput
-Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull
-Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull
-Recommended.Proto3.JsonInput.StringEndsWithEscapeChar
-Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder
-Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate
-Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate
-Recommended.Proto3.JsonInput.Uint64FieldBeString.Validator
-Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput
-Recommended.Proto3.ProtobufInput.OneofZeroBytes.ProtobufOutput
-Recommended.Proto3.ProtobufInput.OneofZeroString.JsonOutput
-Recommended.Proto3.ProtobufInput.OneofZeroString.ProtobufOutput
-Required.DurationProtoInputTooLarge.JsonOutput
-Required.DurationProtoInputTooSmall.JsonOutput
-Required.Proto3.JsonInput.Any.JsonOutput
-Required.Proto3.JsonInput.Any.ProtobufOutput
-Required.Proto3.JsonInput.AnyNested.JsonOutput
-Required.Proto3.JsonInput.AnyNested.ProtobufOutput
-Required.Proto3.JsonInput.AnyUnorderedTypeTag.JsonOutput
-Required.Proto3.JsonInput.AnyUnorderedTypeTag.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithDuration.JsonOutput
-Required.Proto3.JsonInput.AnyWithDuration.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithFieldMask.JsonOutput
-Required.Proto3.JsonInput.AnyWithFieldMask.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.JsonOutput
-Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithStruct.JsonOutput
-Required.Proto3.JsonInput.AnyWithStruct.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithTimestamp.JsonOutput
-Required.Proto3.JsonInput.AnyWithTimestamp.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithValueForInteger.JsonOutput
-Required.Proto3.JsonInput.AnyWithValueForInteger.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithValueForJsonObject.JsonOutput
-Required.Proto3.JsonInput.AnyWithValueForJsonObject.ProtobufOutput
-Required.Proto3.JsonInput.BoolMapField.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldInfinity.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldInfinity.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldNan.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldQuotedValue.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldQuotedValue.ProtobufOutput
-Required.Proto3.JsonInput.DurationMaxValue.JsonOutput
-Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput
-Required.Proto3.JsonInput.DurationMinValue.JsonOutput
-Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput
-Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput
-Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput
-Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.JsonOutput
-Required.Proto3.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput
-Required.Proto3.JsonInput.EnumFieldNumericValueZero.JsonOutput
-Required.Proto3.JsonInput.EnumFieldNumericValueZero.ProtobufOutput
-Required.Proto3.JsonInput.EnumFieldUnknownValue.Validator
-Required.Proto3.JsonInput.FieldMask.JsonOutput
-Required.Proto3.JsonInput.FieldMask.ProtobufOutput
-Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput
-Required.Proto3.JsonInput.FloatFieldInfinity.ProtobufOutput
-Required.Proto3.JsonInput.FloatFieldNan.JsonOutput
-Required.Proto3.JsonInput.FloatFieldNan.ProtobufOutput
-Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput
-Required.Proto3.JsonInput.FloatFieldNegativeInfinity.ProtobufOutput
-Required.Proto3.JsonInput.FloatFieldQuotedValue.JsonOutput
-Required.Proto3.JsonInput.FloatFieldQuotedValue.ProtobufOutput
-Required.Proto3.JsonInput.FloatFieldTooLarge
-Required.Proto3.JsonInput.FloatFieldTooSmall
-Required.Proto3.JsonInput.Int32FieldExponentialFormat.JsonOutput
-Required.Proto3.JsonInput.Int32FieldExponentialFormat.ProtobufOutput
-Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.JsonOutput
-Required.Proto3.JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput
-Required.Proto3.JsonInput.Int32FieldMaxFloatValue.JsonOutput
-Required.Proto3.JsonInput.Int32FieldMaxFloatValue.ProtobufOutput
-Required.Proto3.JsonInput.Int32FieldMinFloatValue.JsonOutput
-Required.Proto3.JsonInput.Int32FieldMinFloatValue.ProtobufOutput
-Required.Proto3.JsonInput.Int32FieldStringValue.JsonOutput
-Required.Proto3.JsonInput.Int32FieldStringValue.ProtobufOutput
-Required.Proto3.JsonInput.Int32FieldStringValueEscaped.JsonOutput
-Required.Proto3.JsonInput.Int32FieldStringValueEscaped.ProtobufOutput
-Required.Proto3.JsonInput.Int64FieldMaxValue.JsonOutput
-Required.Proto3.JsonInput.Int64FieldMaxValue.ProtobufOutput
-Required.Proto3.JsonInput.Int64FieldMinValue.JsonOutput
-Required.Proto3.JsonInput.Int64FieldMinValue.ProtobufOutput
-Required.Proto3.JsonInput.MessageField.JsonOutput
-Required.Proto3.JsonInput.MessageField.ProtobufOutput
-Required.Proto3.JsonInput.OptionalBoolWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalBoolWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalBytesWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalBytesWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalDoubleWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalDoubleWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalFloatWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalFloatWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalInt32Wrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalInt32Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalInt64Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalStringWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalUint32Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalUint64Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput
-Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedBoolWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedBytesWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedDoubleWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedDoubleWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingMessagesGotInt
-Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
-Required.Proto3.JsonInput.RepeatedFloatWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedFloatWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedInt32Wrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedInt32Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedInt64Wrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedInt64Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedStringWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedStringWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedUint32Wrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedUint32Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedUint64Wrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedUint64Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.StringFieldEscape.JsonOutput
-Required.Proto3.JsonInput.StringFieldEscape.ProtobufOutput
-Required.Proto3.JsonInput.StringFieldNotAString
-Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput
-Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput
-Required.Proto3.JsonInput.StringFieldUnicodeEscape.JsonOutput
-Required.Proto3.JsonInput.StringFieldUnicodeEscape.ProtobufOutput
-Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput
-Required.Proto3.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput
-Required.Proto3.JsonInput.Struct.JsonOutput
-Required.Proto3.JsonInput.Struct.ProtobufOutput
-Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.JsonOutput
-Required.Proto3.JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput
-Required.Proto3.JsonInput.Uint64FieldMaxValue.JsonOutput
-Required.Proto3.JsonInput.Uint64FieldMaxValue.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptBool.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptBool.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptFloat.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptFloat.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptInteger.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptInteger.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptList.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptList.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptNull.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptNull.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptObject.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptObject.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptString.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptString.ProtobufOutput
-Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput
-Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput
-Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput
-Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput
-Required.TimestampProtoInputTooLarge.JsonOutput
-Required.TimestampProtoInputTooSmall.JsonOutput
diff --git a/conformance/failure_list_php_zts_c.txt b/conformance/failure_list_php_zts_c.txt
deleted file mode 100644
index d9a8fe3..0000000
--- a/conformance/failure_list_php_zts_c.txt
+++ /dev/null
@@ -1,225 +0,0 @@
-Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.JsonInput.BoolFieldIntegerOne
-Recommended.JsonInput.BoolFieldIntegerZero
-Recommended.JsonInput.DurationHas3FractionalDigits.Validator
-Recommended.JsonInput.DurationHas6FractionalDigits.Validator
-Recommended.JsonInput.DurationHas9FractionalDigits.Validator
-Recommended.JsonInput.DurationHasZeroFractionalDigit.Validator
-Recommended.JsonInput.Int64FieldBeString.Validator
-Recommended.JsonInput.OneofZeroBytes.JsonOutput
-Recommended.JsonInput.OneofZeroBytes.ProtobufOutput
-Recommended.JsonInput.OneofZeroDouble.JsonOutput
-Recommended.JsonInput.OneofZeroDouble.ProtobufOutput
-Recommended.JsonInput.OneofZeroFloat.JsonOutput
-Recommended.JsonInput.OneofZeroFloat.ProtobufOutput
-Recommended.JsonInput.OneofZeroString.JsonOutput
-Recommended.JsonInput.OneofZeroString.ProtobufOutput
-Recommended.JsonInput.OneofZeroUint32.JsonOutput
-Recommended.JsonInput.OneofZeroUint32.ProtobufOutput
-Recommended.JsonInput.OneofZeroUint64.JsonOutput
-Recommended.JsonInput.OneofZeroUint64.ProtobufOutput
-Recommended.JsonInput.StringEndsWithEscapeChar
-Recommended.JsonInput.StringFieldSurrogateInWrongOrder
-Recommended.JsonInput.StringFieldUnpairedHighSurrogate
-Recommended.JsonInput.StringFieldUnpairedLowSurrogate
-Recommended.JsonInput.TimestampHas3FractionalDigits.Validator
-Recommended.JsonInput.TimestampHas6FractionalDigits.Validator
-Recommended.JsonInput.TimestampHas9FractionalDigits.Validator
-Recommended.JsonInput.TimestampHasZeroFractionalDigit.Validator
-Recommended.JsonInput.TimestampZeroNormalized.Validator
-Recommended.JsonInput.Uint64FieldBeString.Validator
-Recommended.ProtobufInput.OneofZeroBytes.JsonOutput
-Recommended.ProtobufInput.OneofZeroBytes.ProtobufOutput
-Recommended.ProtobufInput.OneofZeroString.JsonOutput
-Recommended.ProtobufInput.OneofZeroString.ProtobufOutput
-Required.DurationProtoInputTooLarge.JsonOutput
-Required.DurationProtoInputTooSmall.JsonOutput
-Required.JsonInput.AllFieldAcceptNull.ProtobufOutput
-Required.JsonInput.Any.JsonOutput
-Required.JsonInput.Any.ProtobufOutput
-Required.JsonInput.AnyNested.JsonOutput
-Required.JsonInput.AnyNested.ProtobufOutput
-Required.JsonInput.AnyUnorderedTypeTag.JsonOutput
-Required.JsonInput.AnyUnorderedTypeTag.ProtobufOutput
-Required.JsonInput.AnyWithDuration.JsonOutput
-Required.JsonInput.AnyWithDuration.ProtobufOutput
-Required.JsonInput.AnyWithFieldMask.JsonOutput
-Required.JsonInput.AnyWithFieldMask.ProtobufOutput
-Required.JsonInput.AnyWithInt32ValueWrapper.JsonOutput
-Required.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput
-Required.JsonInput.AnyWithStruct.JsonOutput
-Required.JsonInput.AnyWithStruct.ProtobufOutput
-Required.JsonInput.AnyWithTimestamp.JsonOutput
-Required.JsonInput.AnyWithTimestamp.ProtobufOutput
-Required.JsonInput.AnyWithValueForInteger.JsonOutput
-Required.JsonInput.AnyWithValueForInteger.ProtobufOutput
-Required.JsonInput.AnyWithValueForJsonObject.JsonOutput
-Required.JsonInput.AnyWithValueForJsonObject.ProtobufOutput
-Required.JsonInput.BoolFieldFalse.ProtobufOutput
-Required.JsonInput.BoolMapField.JsonOutput
-Required.JsonInput.DoubleFieldInfinity.JsonOutput
-Required.JsonInput.DoubleFieldInfinity.ProtobufOutput
-Required.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput
-Required.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput
-Required.JsonInput.DoubleFieldMaxPositiveValue.JsonOutput
-Required.JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput
-Required.JsonInput.DoubleFieldMinNegativeValue.JsonOutput
-Required.JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput
-Required.JsonInput.DoubleFieldMinPositiveValue.JsonOutput
-Required.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput
-Required.JsonInput.DoubleFieldNan.JsonOutput
-Required.JsonInput.DoubleFieldNan.ProtobufOutput
-Required.JsonInput.DoubleFieldNegativeInfinity.JsonOutput
-Required.JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput
-Required.JsonInput.DoubleFieldQuotedValue.JsonOutput
-Required.JsonInput.DoubleFieldQuotedValue.ProtobufOutput
-Required.JsonInput.DurationMaxValue.JsonOutput
-Required.JsonInput.DurationMaxValue.ProtobufOutput
-Required.JsonInput.DurationMinValue.JsonOutput
-Required.JsonInput.DurationMinValue.ProtobufOutput
-Required.JsonInput.DurationRepeatedValue.JsonOutput
-Required.JsonInput.DurationRepeatedValue.ProtobufOutput
-Required.JsonInput.EnumField.ProtobufOutput
-Required.JsonInput.EnumFieldNumericValueNonZero.JsonOutput
-Required.JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput
-Required.JsonInput.EnumFieldNumericValueZero.JsonOutput
-Required.JsonInput.EnumFieldNumericValueZero.ProtobufOutput
-Required.JsonInput.EnumFieldUnknownValue.Validator
-Required.JsonInput.FieldMask.JsonOutput
-Required.JsonInput.FieldMask.ProtobufOutput
-Required.JsonInput.FloatFieldInfinity.JsonOutput
-Required.JsonInput.FloatFieldInfinity.ProtobufOutput
-Required.JsonInput.FloatFieldNan.JsonOutput
-Required.JsonInput.FloatFieldNan.ProtobufOutput
-Required.JsonInput.FloatFieldNegativeInfinity.JsonOutput
-Required.JsonInput.FloatFieldNegativeInfinity.ProtobufOutput
-Required.JsonInput.FloatFieldQuotedValue.JsonOutput
-Required.JsonInput.FloatFieldQuotedValue.ProtobufOutput
-Required.JsonInput.FloatFieldTooLarge
-Required.JsonInput.FloatFieldTooSmall
-Required.JsonInput.Int32FieldExponentialFormat.JsonOutput
-Required.JsonInput.Int32FieldExponentialFormat.ProtobufOutput
-Required.JsonInput.Int32FieldFloatTrailingZero.JsonOutput
-Required.JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput
-Required.JsonInput.Int32FieldMaxFloatValue.JsonOutput
-Required.JsonInput.Int32FieldMaxFloatValue.ProtobufOutput
-Required.JsonInput.Int32FieldMinFloatValue.JsonOutput
-Required.JsonInput.Int32FieldMinFloatValue.ProtobufOutput
-Required.JsonInput.Int32FieldStringValue.JsonOutput
-Required.JsonInput.Int32FieldStringValue.ProtobufOutput
-Required.JsonInput.Int32FieldStringValueEscaped.JsonOutput
-Required.JsonInput.Int32FieldStringValueEscaped.ProtobufOutput
-Required.JsonInput.Int32MapEscapedKey.JsonOutput
-Required.JsonInput.Int32MapEscapedKey.ProtobufOutput
-Required.JsonInput.Int32MapField.JsonOutput
-Required.JsonInput.Int32MapField.ProtobufOutput
-Required.JsonInput.Int64FieldMaxValue.JsonOutput
-Required.JsonInput.Int64FieldMaxValue.ProtobufOutput
-Required.JsonInput.Int64FieldMinValue.JsonOutput
-Required.JsonInput.Int64FieldMinValue.ProtobufOutput
-Required.JsonInput.Int64MapEscapedKey.JsonOutput
-Required.JsonInput.Int64MapEscapedKey.ProtobufOutput
-Required.JsonInput.Int64MapField.JsonOutput
-Required.JsonInput.Int64MapField.ProtobufOutput
-Required.JsonInput.MessageField.JsonOutput
-Required.JsonInput.MessageField.ProtobufOutput
-Required.JsonInput.MessageMapField.JsonOutput
-Required.JsonInput.MessageMapField.ProtobufOutput
-Required.JsonInput.MessageRepeatedField.JsonOutput
-Required.JsonInput.MessageRepeatedField.ProtobufOutput
-Required.JsonInput.OptionalBoolWrapper.JsonOutput
-Required.JsonInput.OptionalBoolWrapper.ProtobufOutput
-Required.JsonInput.OptionalBytesWrapper.JsonOutput
-Required.JsonInput.OptionalBytesWrapper.ProtobufOutput
-Required.JsonInput.OptionalDoubleWrapper.JsonOutput
-Required.JsonInput.OptionalDoubleWrapper.ProtobufOutput
-Required.JsonInput.OptionalFloatWrapper.JsonOutput
-Required.JsonInput.OptionalFloatWrapper.ProtobufOutput
-Required.JsonInput.OptionalInt32Wrapper.JsonOutput
-Required.JsonInput.OptionalInt32Wrapper.ProtobufOutput
-Required.JsonInput.OptionalInt64Wrapper.JsonOutput
-Required.JsonInput.OptionalInt64Wrapper.ProtobufOutput
-Required.JsonInput.OptionalStringWrapper.JsonOutput
-Required.JsonInput.OptionalStringWrapper.ProtobufOutput
-Required.JsonInput.OptionalUint32Wrapper.JsonOutput
-Required.JsonInput.OptionalUint32Wrapper.ProtobufOutput
-Required.JsonInput.OptionalUint64Wrapper.JsonOutput
-Required.JsonInput.OptionalUint64Wrapper.ProtobufOutput
-Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput
-Required.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput
-Required.JsonInput.PrimitiveRepeatedField.JsonOutput
-Required.JsonInput.PrimitiveRepeatedField.ProtobufOutput
-Required.JsonInput.RepeatedBoolWrapper.JsonOutput
-Required.JsonInput.RepeatedBoolWrapper.ProtobufOutput
-Required.JsonInput.RepeatedBytesWrapper.JsonOutput
-Required.JsonInput.RepeatedBytesWrapper.ProtobufOutput
-Required.JsonInput.RepeatedDoubleWrapper.JsonOutput
-Required.JsonInput.RepeatedDoubleWrapper.ProtobufOutput
-Required.JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
-Required.JsonInput.RepeatedFloatWrapper.JsonOutput
-Required.JsonInput.RepeatedFloatWrapper.ProtobufOutput
-Required.JsonInput.RepeatedInt32Wrapper.JsonOutput
-Required.JsonInput.RepeatedInt32Wrapper.ProtobufOutput
-Required.JsonInput.RepeatedInt64Wrapper.JsonOutput
-Required.JsonInput.RepeatedInt64Wrapper.ProtobufOutput
-Required.JsonInput.RepeatedStringWrapper.JsonOutput
-Required.JsonInput.RepeatedStringWrapper.ProtobufOutput
-Required.JsonInput.RepeatedUint32Wrapper.JsonOutput
-Required.JsonInput.RepeatedUint32Wrapper.ProtobufOutput
-Required.JsonInput.RepeatedUint64Wrapper.JsonOutput
-Required.JsonInput.RepeatedUint64Wrapper.ProtobufOutput
-Required.JsonInput.StringFieldEscape.JsonOutput
-Required.JsonInput.StringFieldEscape.ProtobufOutput
-Required.JsonInput.StringFieldNotAString
-Required.JsonInput.StringFieldSurrogatePair.JsonOutput
-Required.JsonInput.StringFieldSurrogatePair.ProtobufOutput
-Required.JsonInput.StringFieldUnicodeEscape.JsonOutput
-Required.JsonInput.StringFieldUnicodeEscape.ProtobufOutput
-Required.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.JsonOutput
-Required.JsonInput.StringFieldUnicodeEscapeWithLowercaseHexLetters.ProtobufOutput
-Required.JsonInput.Struct.JsonOutput
-Required.JsonInput.Struct.ProtobufOutput
-Required.JsonInput.TimestampMaxValue.JsonOutput
-Required.JsonInput.TimestampMaxValue.ProtobufOutput
-Required.JsonInput.TimestampMinValue.JsonOutput
-Required.JsonInput.TimestampMinValue.ProtobufOutput
-Required.JsonInput.TimestampRepeatedValue.JsonOutput
-Required.JsonInput.TimestampRepeatedValue.ProtobufOutput
-Required.JsonInput.TimestampWithNegativeOffset.JsonOutput
-Required.JsonInput.TimestampWithNegativeOffset.ProtobufOutput
-Required.JsonInput.TimestampWithPositiveOffset.JsonOutput
-Required.JsonInput.TimestampWithPositiveOffset.ProtobufOutput
-Required.JsonInput.Uint32FieldMaxFloatValue.JsonOutput
-Required.JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput
-Required.JsonInput.Uint32MapField.JsonOutput
-Required.JsonInput.Uint32MapField.ProtobufOutput
-Required.JsonInput.Uint64FieldMaxValue.JsonOutput
-Required.JsonInput.Uint64FieldMaxValue.ProtobufOutput
-Required.JsonInput.Uint64MapField.JsonOutput
-Required.JsonInput.Uint64MapField.ProtobufOutput
-Required.JsonInput.ValueAcceptBool.JsonOutput
-Required.JsonInput.ValueAcceptBool.ProtobufOutput
-Required.JsonInput.ValueAcceptFloat.JsonOutput
-Required.JsonInput.ValueAcceptFloat.ProtobufOutput
-Required.JsonInput.ValueAcceptInteger.JsonOutput
-Required.JsonInput.ValueAcceptInteger.ProtobufOutput
-Required.JsonInput.ValueAcceptList.JsonOutput
-Required.JsonInput.ValueAcceptList.ProtobufOutput
-Required.JsonInput.ValueAcceptNull.JsonOutput
-Required.JsonInput.ValueAcceptNull.ProtobufOutput
-Required.JsonInput.ValueAcceptObject.JsonOutput
-Required.JsonInput.ValueAcceptObject.ProtobufOutput
-Required.JsonInput.ValueAcceptString.JsonOutput
-Required.JsonInput.ValueAcceptString.ProtobufOutput
-Required.JsonInput.WrapperTypesWithNullValue.ProtobufOutput
-Required.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput
-Required.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput
-Required.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput
-Required.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput
-Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput
-Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput
-Required.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput
-Required.TimestampProtoInputTooLarge.JsonOutput
-Required.TimestampProtoInputTooSmall.JsonOutput
diff --git a/conformance/failure_list_python.txt b/conformance/failure_list_python.txt
index e3ce7af..d2e5263 100644
--- a/conformance/failure_list_python.txt
+++ b/conformance/failure_list_python.txt
@@ -1,21 +1,85 @@
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
-Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted
-Required.Proto3.JsonInput.DoubleFieldTooSmall
-Required.Proto3.JsonInput.FloatFieldTooLarge
-Required.Proto3.JsonInput.FloatFieldTooSmall
-Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool
-Required.Proto3.JsonInput.TimestampJsonInputLowercaseT
-Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_0
-Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_1
-Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_2
-Required.Proto2.ProtobufInput.IllegalZeroFieldNum_Case_3
-Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_0
-Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_1
-Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_2
-Required.Proto3.ProtobufInput.IllegalZeroFieldNum_Case_3
+DurationProtoInputTooLarge.JsonOutput
+DurationProtoInputTooSmall.JsonOutput
+FieldMaskNumbersDontRoundTrip.JsonOutput
+FieldMaskPathsDontRoundTrip.JsonOutput
+FieldMaskTooManyUnderscore.JsonOutput
+JsonInput.Any.JsonOutput
+JsonInput.Any.ProtobufOutput
+JsonInput.AnyNested.JsonOutput
+JsonInput.AnyNested.ProtobufOutput
+JsonInput.AnyUnorderedTypeTag.JsonOutput
+JsonInput.AnyUnorderedTypeTag.ProtobufOutput
+JsonInput.AnyWithDuration.JsonOutput
+JsonInput.AnyWithDuration.ProtobufOutput
+JsonInput.AnyWithFieldMask.JsonOutput
+JsonInput.AnyWithFieldMask.ProtobufOutput
+JsonInput.AnyWithInt32ValueWrapper.JsonOutput
+JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput
+JsonInput.AnyWithStruct.JsonOutput
+JsonInput.AnyWithStruct.ProtobufOutput
+JsonInput.AnyWithTimestamp.JsonOutput
+JsonInput.AnyWithTimestamp.ProtobufOutput
+JsonInput.AnyWithValueForInteger.JsonOutput
+JsonInput.AnyWithValueForInteger.ProtobufOutput
+JsonInput.AnyWithValueForJsonObject.JsonOutput
+JsonInput.AnyWithValueForJsonObject.ProtobufOutput
+JsonInput.BytesFieldInvalidBase64Characters
+JsonInput.DoubleFieldInfinityNotQuoted
+JsonInput.DoubleFieldNanNotQuoted
+JsonInput.DoubleFieldNegativeInfinityNotQuoted
+JsonInput.DoubleFieldTooSmall
+JsonInput.DurationJsonInputTooLarge
+JsonInput.DurationJsonInputTooSmall
+JsonInput.DurationMissingS
+JsonInput.EnumFieldNumericValueNonZero.JsonOutput
+JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput
+JsonInput.EnumFieldNumericValueZero.JsonOutput
+JsonInput.EnumFieldNumericValueZero.ProtobufOutput
+JsonInput.EnumFieldUnknownValue.Validator
+JsonInput.FieldMask.ProtobufOutput
+JsonInput.FieldMaskInvalidCharacter
+JsonInput.FieldNameInLowerCamelCase.Validator
+JsonInput.FieldNameInSnakeCase.JsonOutput
+JsonInput.FieldNameInSnakeCase.ProtobufOutput
+JsonInput.FloatFieldInfinityNotQuoted
+JsonInput.FloatFieldNanNotQuoted
+JsonInput.FloatFieldNegativeInfinityNotQuoted
+JsonInput.FloatFieldTooLarge
+JsonInput.FloatFieldTooSmall
+JsonInput.Int32FieldExponentialFormat.JsonOutput
+JsonInput.Int32FieldExponentialFormat.ProtobufOutput
+JsonInput.Int32FieldFloatTrailingZero.JsonOutput
+JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput
+JsonInput.Int32FieldMaxFloatValue.JsonOutput
+JsonInput.Int32FieldMaxFloatValue.ProtobufOutput
+JsonInput.Int32FieldMinFloatValue.JsonOutput
+JsonInput.Int32FieldMinFloatValue.ProtobufOutput
+JsonInput.Int32FieldMinValue.JsonOutput
+JsonInput.OriginalProtoFieldName.JsonOutput
+JsonInput.OriginalProtoFieldName.ProtobufOutput
+JsonInput.RepeatedFieldMessageElementIsNull
+JsonInput.RepeatedFieldPrimitiveElementIsNull
+JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool
+JsonInput.StringFieldSurrogatePair.JsonOutput
+JsonInput.StringFieldUnpairedLowSurrogate
+JsonInput.Struct.JsonOutput
+JsonInput.Struct.ProtobufOutput
+JsonInput.TimestampJsonInputLowercaseT
+JsonInput.Uint32FieldMaxFloatValue.JsonOutput
+JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput
+JsonInput.ValueAcceptBool.JsonOutput
+JsonInput.ValueAcceptBool.ProtobufOutput
+JsonInput.ValueAcceptFloat.JsonOutput
+JsonInput.ValueAcceptFloat.ProtobufOutput
+JsonInput.ValueAcceptInteger.JsonOutput
+JsonInput.ValueAcceptInteger.ProtobufOutput
+JsonInput.ValueAcceptList.JsonOutput
+JsonInput.ValueAcceptList.ProtobufOutput
+JsonInput.ValueAcceptNull.JsonOutput
+JsonInput.ValueAcceptNull.ProtobufOutput
+JsonInput.ValueAcceptObject.JsonOutput
+JsonInput.ValueAcceptObject.ProtobufOutput
+JsonInput.ValueAcceptString.JsonOutput
+JsonInput.ValueAcceptString.ProtobufOutput
+TimestampProtoInputTooLarge.JsonOutput
+TimestampProtoInputTooSmall.JsonOutput
diff --git a/conformance/failure_list_python_cpp.txt b/conformance/failure_list_python_cpp.txt
index a498ad1..7b5e45f 100644
--- a/conformance/failure_list_python_cpp.txt
+++ b/conformance/failure_list_python_cpp.txt
@@ -7,48 +7,104 @@
 # TODO(haberman): insert links to corresponding bugs tracking the issue.
 # Should we use GitHub issues or the Google-internal bug tracker?
 
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
-Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted
-Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted
-Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted
-Required.Proto3.JsonInput.DoubleFieldTooSmall
-Required.Proto3.JsonInput.FloatFieldTooLarge
-Required.Proto3.JsonInput.FloatFieldTooSmall
-Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool
-Required.Proto3.JsonInput.TimestampJsonInputLowercaseT
-Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Proto3.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.BOOL
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.DOUBLE
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.ENUM
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.FIXED32
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.FIXED64
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.FLOAT
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT32
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.INT64
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.SFIXED32
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.SFIXED64
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT32
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.SINT64
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT32
-Required.Proto3.ProtobufInput.PrematureEofInPackedField.UINT64
-Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
-Required.Proto2.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.BOOL
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.DOUBLE
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.ENUM
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.FIXED32
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.FIXED64
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.FLOAT
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.INT32
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.INT64
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.SFIXED32
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.SFIXED64
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.SINT32
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.SINT64
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.UINT32
-Required.Proto2.ProtobufInput.PrematureEofInPackedField.UINT64
+DurationProtoInputTooLarge.JsonOutput
+DurationProtoInputTooSmall.JsonOutput
+FieldMaskNumbersDontRoundTrip.JsonOutput
+FieldMaskPathsDontRoundTrip.JsonOutput
+FieldMaskTooManyUnderscore.JsonOutput
+JsonInput.Any.JsonOutput
+JsonInput.Any.ProtobufOutput
+JsonInput.AnyNested.JsonOutput
+JsonInput.AnyNested.ProtobufOutput
+JsonInput.AnyUnorderedTypeTag.JsonOutput
+JsonInput.AnyUnorderedTypeTag.ProtobufOutput
+JsonInput.AnyWithDuration.JsonOutput
+JsonInput.AnyWithDuration.ProtobufOutput
+JsonInput.AnyWithFieldMask.JsonOutput
+JsonInput.AnyWithFieldMask.ProtobufOutput
+JsonInput.AnyWithInt32ValueWrapper.JsonOutput
+JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput
+JsonInput.AnyWithStruct.JsonOutput
+JsonInput.AnyWithStruct.ProtobufOutput
+JsonInput.AnyWithTimestamp.JsonOutput
+JsonInput.AnyWithTimestamp.ProtobufOutput
+JsonInput.AnyWithValueForInteger.JsonOutput
+JsonInput.AnyWithValueForInteger.ProtobufOutput
+JsonInput.AnyWithValueForJsonObject.JsonOutput
+JsonInput.AnyWithValueForJsonObject.ProtobufOutput
+JsonInput.BytesFieldInvalidBase64Characters
+JsonInput.DoubleFieldInfinityNotQuoted
+JsonInput.DoubleFieldNanNotQuoted
+JsonInput.DoubleFieldNegativeInfinityNotQuoted
+JsonInput.DoubleFieldTooSmall
+JsonInput.DurationJsonInputTooLarge
+JsonInput.DurationJsonInputTooSmall
+JsonInput.DurationMissingS
+JsonInput.EnumFieldNumericValueNonZero.JsonOutput
+JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput
+JsonInput.EnumFieldNumericValueZero.JsonOutput
+JsonInput.EnumFieldNumericValueZero.ProtobufOutput
+JsonInput.EnumFieldUnknownValue.Validator
+JsonInput.FieldMask.ProtobufOutput
+JsonInput.FieldMaskInvalidCharacter
+JsonInput.FieldNameInLowerCamelCase.Validator
+JsonInput.FieldNameInSnakeCase.JsonOutput
+JsonInput.FieldNameInSnakeCase.ProtobufOutput
+JsonInput.FloatFieldInfinityNotQuoted
+JsonInput.FloatFieldNanNotQuoted
+JsonInput.FloatFieldNegativeInfinityNotQuoted
+JsonInput.FloatFieldTooLarge
+JsonInput.FloatFieldTooSmall
+JsonInput.Int32FieldExponentialFormat.JsonOutput
+JsonInput.Int32FieldExponentialFormat.ProtobufOutput
+JsonInput.Int32FieldFloatTrailingZero.JsonOutput
+JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput
+JsonInput.Int32FieldMaxFloatValue.JsonOutput
+JsonInput.Int32FieldMaxFloatValue.ProtobufOutput
+JsonInput.Int32FieldMinFloatValue.JsonOutput
+JsonInput.Int32FieldMinFloatValue.ProtobufOutput
+JsonInput.Int32FieldMinValue.JsonOutput
+JsonInput.OriginalProtoFieldName.JsonOutput
+JsonInput.OriginalProtoFieldName.ProtobufOutput
+JsonInput.RepeatedFieldMessageElementIsNull
+JsonInput.RepeatedFieldPrimitiveElementIsNull
+JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool
+JsonInput.StringFieldSurrogatePair.JsonOutput
+JsonInput.StringFieldUnpairedLowSurrogate
+JsonInput.Struct.JsonOutput
+JsonInput.Struct.ProtobufOutput
+JsonInput.TimestampJsonInputLowercaseT
+JsonInput.Uint32FieldMaxFloatValue.JsonOutput
+JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput
+JsonInput.ValueAcceptBool.JsonOutput
+JsonInput.ValueAcceptBool.ProtobufOutput
+JsonInput.ValueAcceptFloat.JsonOutput
+JsonInput.ValueAcceptFloat.ProtobufOutput
+JsonInput.ValueAcceptInteger.JsonOutput
+JsonInput.ValueAcceptInteger.ProtobufOutput
+JsonInput.ValueAcceptList.JsonOutput
+JsonInput.ValueAcceptList.ProtobufOutput
+JsonInput.ValueAcceptNull.JsonOutput
+JsonInput.ValueAcceptNull.ProtobufOutput
+JsonInput.ValueAcceptObject.JsonOutput
+JsonInput.ValueAcceptObject.ProtobufOutput
+JsonInput.ValueAcceptString.JsonOutput
+JsonInput.ValueAcceptString.ProtobufOutput
+ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
+ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
+ProtobufInput.PrematureEofInPackedField.BOOL
+ProtobufInput.PrematureEofInPackedField.DOUBLE
+ProtobufInput.PrematureEofInPackedField.ENUM
+ProtobufInput.PrematureEofInPackedField.FIXED32
+ProtobufInput.PrematureEofInPackedField.FIXED64
+ProtobufInput.PrematureEofInPackedField.FLOAT
+ProtobufInput.PrematureEofInPackedField.INT32
+ProtobufInput.PrematureEofInPackedField.INT64
+ProtobufInput.PrematureEofInPackedField.SFIXED32
+ProtobufInput.PrematureEofInPackedField.SFIXED64
+ProtobufInput.PrematureEofInPackedField.SINT32
+ProtobufInput.PrematureEofInPackedField.SINT64
+ProtobufInput.PrematureEofInPackedField.UINT32
+ProtobufInput.PrematureEofInPackedField.UINT64
+TimestampProtoInputTooLarge.JsonOutput
+TimestampProtoInputTooSmall.JsonOutput
diff --git a/conformance/failure_list_ruby.txt b/conformance/failure_list_ruby.txt
index 1bab135..7c12da0 100644
--- a/conformance/failure_list_ruby.txt
+++ b/conformance/failure_list_ruby.txt
@@ -1,135 +1,199 @@
-Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput
-Recommended.FieldMaskPathsDontRoundTrip.JsonOutput
-Recommended.FieldMaskTooManyUnderscore.JsonOutput
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
-Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
-Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator
-Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator
-Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator
-Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator
-Recommended.Proto3.JsonInput.Int64FieldBeString.Validator
-Recommended.Proto3.JsonInput.MapFieldValueIsNull
-Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull
-Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull
-Recommended.Proto3.JsonInput.StringEndsWithEscapeChar
-Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder
-Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate
-Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate
-Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator
-Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator
-Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator
-Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator
-Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator
-Recommended.Proto3.JsonInput.Uint64FieldBeString.Validator
-Required.DurationProtoInputTooLarge.JsonOutput
-Required.DurationProtoInputTooSmall.JsonOutput
-Required.Proto3.JsonInput.Any.JsonOutput
-Required.Proto3.JsonInput.Any.ProtobufOutput
-Required.Proto3.JsonInput.AnyNested.JsonOutput
-Required.Proto3.JsonInput.AnyNested.ProtobufOutput
-Required.Proto3.JsonInput.AnyUnorderedTypeTag.JsonOutput
-Required.Proto3.JsonInput.AnyUnorderedTypeTag.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithDuration.JsonOutput
-Required.Proto3.JsonInput.AnyWithDuration.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithFieldMask.JsonOutput
-Required.Proto3.JsonInput.AnyWithFieldMask.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.JsonOutput
-Required.Proto3.JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithStruct.JsonOutput
-Required.Proto3.JsonInput.AnyWithStruct.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithTimestamp.JsonOutput
-Required.Proto3.JsonInput.AnyWithTimestamp.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithValueForInteger.JsonOutput
-Required.Proto3.JsonInput.AnyWithValueForInteger.ProtobufOutput
-Required.Proto3.JsonInput.AnyWithValueForJsonObject.JsonOutput
-Required.Proto3.JsonInput.AnyWithValueForJsonObject.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput
-Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput
-Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput
-Required.Proto3.JsonInput.DurationMaxValue.JsonOutput
-Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput
-Required.Proto3.JsonInput.DurationMinValue.JsonOutput
-Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput
-Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput
-Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput
-Required.Proto3.JsonInput.FieldMask.JsonOutput
-Required.Proto3.JsonInput.FieldMask.ProtobufOutput
-Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput
-Required.Proto3.JsonInput.FloatFieldNan.JsonOutput
-Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput
-Required.Proto3.JsonInput.OneofFieldDuplicate
-Required.Proto3.JsonInput.OptionalBoolWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalBoolWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalBytesWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalBytesWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalDoubleWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalDoubleWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalFloatWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalFloatWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalInt32Wrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalInt32Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalInt64Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalStringWrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalUint32Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput
-Required.Proto3.JsonInput.OptionalUint64Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput
-Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedBoolWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedBytesWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedDoubleWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedDoubleWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedFloatWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedFloatWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedInt32Wrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedInt32Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedInt64Wrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedInt64Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedStringWrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedStringWrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedUint32Wrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedUint32Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.RepeatedUint64Wrapper.JsonOutput
-Required.Proto3.JsonInput.RepeatedUint64Wrapper.ProtobufOutput
-Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput
-Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput
-Required.Proto3.JsonInput.Struct.JsonOutput
-Required.Proto3.JsonInput.Struct.ProtobufOutput
-Required.Proto3.JsonInput.TimestampMaxValue.JsonOutput
-Required.Proto3.JsonInput.TimestampMaxValue.ProtobufOutput
-Required.Proto3.JsonInput.TimestampMinValue.JsonOutput
-Required.Proto3.JsonInput.TimestampMinValue.ProtobufOutput
-Required.Proto3.JsonInput.TimestampRepeatedValue.JsonOutput
-Required.Proto3.JsonInput.TimestampRepeatedValue.ProtobufOutput
-Required.Proto3.JsonInput.TimestampWithNegativeOffset.JsonOutput
-Required.Proto3.JsonInput.TimestampWithNegativeOffset.ProtobufOutput
-Required.Proto3.JsonInput.TimestampWithPositiveOffset.JsonOutput
-Required.Proto3.JsonInput.TimestampWithPositiveOffset.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptBool.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptBool.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptFloat.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptFloat.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptInteger.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptInteger.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptList.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptList.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptNull.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptNull.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptObject.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptObject.ProtobufOutput
-Required.Proto3.JsonInput.ValueAcceptString.JsonOutput
-Required.Proto3.JsonInput.ValueAcceptString.ProtobufOutput
-Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput
-Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput
-Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput
-Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput
-Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.JsonOutput
-Required.TimestampProtoInputTooLarge.JsonOutput
-Required.TimestampProtoInputTooSmall.JsonOutput
+DurationProtoInputTooLarge.JsonOutput
+DurationProtoInputTooSmall.JsonOutput
+FieldMaskNumbersDontRoundTrip.JsonOutput
+FieldMaskPathsDontRoundTrip.JsonOutput
+FieldMaskTooManyUnderscore.JsonOutput
+JsonInput.Any.JsonOutput
+JsonInput.Any.ProtobufOutput
+JsonInput.AnyNested.JsonOutput
+JsonInput.AnyNested.ProtobufOutput
+JsonInput.AnyUnorderedTypeTag.JsonOutput
+JsonInput.AnyUnorderedTypeTag.ProtobufOutput
+JsonInput.AnyWithDuration.JsonOutput
+JsonInput.AnyWithDuration.ProtobufOutput
+JsonInput.AnyWithFieldMask.JsonOutput
+JsonInput.AnyWithFieldMask.ProtobufOutput
+JsonInput.AnyWithInt32ValueWrapper.JsonOutput
+JsonInput.AnyWithInt32ValueWrapper.ProtobufOutput
+JsonInput.AnyWithStruct.JsonOutput
+JsonInput.AnyWithStruct.ProtobufOutput
+JsonInput.AnyWithTimestamp.JsonOutput
+JsonInput.AnyWithTimestamp.ProtobufOutput
+JsonInput.AnyWithValueForInteger.JsonOutput
+JsonInput.AnyWithValueForInteger.ProtobufOutput
+JsonInput.AnyWithValueForJsonObject.JsonOutput
+JsonInput.AnyWithValueForJsonObject.ProtobufOutput
+JsonInput.BoolFieldIntegerOne
+JsonInput.BoolFieldIntegerZero
+JsonInput.DoubleFieldInfinity.JsonOutput
+JsonInput.DoubleFieldInfinity.ProtobufOutput
+JsonInput.DoubleFieldMaxNegativeValue.JsonOutput
+JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput
+JsonInput.DoubleFieldMaxPositiveValue.JsonOutput
+JsonInput.DoubleFieldMaxPositiveValue.ProtobufOutput
+JsonInput.DoubleFieldMinNegativeValue.JsonOutput
+JsonInput.DoubleFieldMinNegativeValue.ProtobufOutput
+JsonInput.DoubleFieldMinPositiveValue.JsonOutput
+JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput
+JsonInput.DoubleFieldNan.JsonOutput
+JsonInput.DoubleFieldNan.ProtobufOutput
+JsonInput.DoubleFieldNegativeInfinity.JsonOutput
+JsonInput.DoubleFieldNegativeInfinity.ProtobufOutput
+JsonInput.DoubleFieldQuotedValue.JsonOutput
+JsonInput.DoubleFieldQuotedValue.ProtobufOutput
+JsonInput.DurationHas3FractionalDigits.Validator
+JsonInput.DurationHas6FractionalDigits.Validator
+JsonInput.DurationHas9FractionalDigits.Validator
+JsonInput.DurationHasZeroFractionalDigit.Validator
+JsonInput.DurationMaxValue.JsonOutput
+JsonInput.DurationMaxValue.ProtobufOutput
+JsonInput.DurationMinValue.JsonOutput
+JsonInput.DurationMinValue.ProtobufOutput
+JsonInput.DurationRepeatedValue.JsonOutput
+JsonInput.DurationRepeatedValue.ProtobufOutput
+JsonInput.EnumFieldNumericValueNonZero.JsonOutput
+JsonInput.EnumFieldNumericValueNonZero.ProtobufOutput
+JsonInput.EnumFieldNumericValueZero.JsonOutput
+JsonInput.EnumFieldNumericValueZero.ProtobufOutput
+JsonInput.EnumFieldUnknownValue.Validator
+JsonInput.FieldMask.JsonOutput
+JsonInput.FieldMask.ProtobufOutput
+JsonInput.FieldNameInSnakeCase.JsonOutput
+JsonInput.FieldNameWithMixedCases.JsonOutput
+JsonInput.FieldNameWithMixedCases.ProtobufOutput
+JsonInput.FieldNameWithMixedCases.Validator
+JsonInput.FloatFieldInfinity.JsonOutput
+JsonInput.FloatFieldInfinity.ProtobufOutput
+JsonInput.FloatFieldNan.JsonOutput
+JsonInput.FloatFieldNan.ProtobufOutput
+JsonInput.FloatFieldNegativeInfinity.JsonOutput
+JsonInput.FloatFieldNegativeInfinity.ProtobufOutput
+JsonInput.FloatFieldQuotedValue.JsonOutput
+JsonInput.FloatFieldQuotedValue.ProtobufOutput
+JsonInput.FloatFieldTooLarge
+JsonInput.FloatFieldTooSmall
+JsonInput.Int32FieldExponentialFormat.JsonOutput
+JsonInput.Int32FieldExponentialFormat.ProtobufOutput
+JsonInput.Int32FieldFloatTrailingZero.JsonOutput
+JsonInput.Int32FieldFloatTrailingZero.ProtobufOutput
+JsonInput.Int32FieldMaxFloatValue.JsonOutput
+JsonInput.Int32FieldMaxFloatValue.ProtobufOutput
+JsonInput.Int32FieldMinFloatValue.JsonOutput
+JsonInput.Int32FieldMinFloatValue.ProtobufOutput
+JsonInput.Int32FieldStringValue.JsonOutput
+JsonInput.Int32FieldStringValue.ProtobufOutput
+JsonInput.Int32FieldStringValueEscaped.JsonOutput
+JsonInput.Int32FieldStringValueEscaped.ProtobufOutput
+JsonInput.Int32MapEscapedKey.JsonOutput
+JsonInput.Int32MapEscapedKey.ProtobufOutput
+JsonInput.Int32MapField.JsonOutput
+JsonInput.Int32MapField.ProtobufOutput
+JsonInput.Int64FieldBeString.Validator
+JsonInput.Int64FieldMaxValue.JsonOutput
+JsonInput.Int64FieldMaxValue.ProtobufOutput
+JsonInput.Int64FieldMinValue.JsonOutput
+JsonInput.Int64FieldMinValue.ProtobufOutput
+JsonInput.Int64MapEscapedKey.JsonOutput
+JsonInput.Int64MapEscapedKey.ProtobufOutput
+JsonInput.Int64MapField.JsonOutput
+JsonInput.Int64MapField.ProtobufOutput
+JsonInput.MessageField.JsonOutput
+JsonInput.MessageField.ProtobufOutput
+JsonInput.MessageMapField.JsonOutput
+JsonInput.MessageMapField.ProtobufOutput
+JsonInput.MessageRepeatedField.JsonOutput
+JsonInput.MessageRepeatedField.ProtobufOutput
+JsonInput.OptionalBoolWrapper.JsonOutput
+JsonInput.OptionalBoolWrapper.ProtobufOutput
+JsonInput.OptionalBytesWrapper.JsonOutput
+JsonInput.OptionalBytesWrapper.ProtobufOutput
+JsonInput.OptionalDoubleWrapper.JsonOutput
+JsonInput.OptionalDoubleWrapper.ProtobufOutput
+JsonInput.OptionalFloatWrapper.JsonOutput
+JsonInput.OptionalFloatWrapper.ProtobufOutput
+JsonInput.OptionalInt32Wrapper.JsonOutput
+JsonInput.OptionalInt32Wrapper.ProtobufOutput
+JsonInput.OptionalInt64Wrapper.JsonOutput
+JsonInput.OptionalInt64Wrapper.ProtobufOutput
+JsonInput.OptionalStringWrapper.JsonOutput
+JsonInput.OptionalStringWrapper.ProtobufOutput
+JsonInput.OptionalUint32Wrapper.JsonOutput
+JsonInput.OptionalUint32Wrapper.ProtobufOutput
+JsonInput.OptionalUint64Wrapper.JsonOutput
+JsonInput.OptionalUint64Wrapper.ProtobufOutput
+JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput
+JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput
+JsonInput.OriginalProtoFieldName.JsonOutput
+JsonInput.PrimitiveRepeatedField.JsonOutput
+JsonInput.PrimitiveRepeatedField.ProtobufOutput
+JsonInput.RepeatedBoolWrapper.JsonOutput
+JsonInput.RepeatedBoolWrapper.ProtobufOutput
+JsonInput.RepeatedBytesWrapper.JsonOutput
+JsonInput.RepeatedBytesWrapper.ProtobufOutput
+JsonInput.RepeatedDoubleWrapper.JsonOutput
+JsonInput.RepeatedDoubleWrapper.ProtobufOutput
+JsonInput.RepeatedFieldWrongElementTypeExpectingStringsGotInt
+JsonInput.RepeatedFloatWrapper.JsonOutput
+JsonInput.RepeatedFloatWrapper.ProtobufOutput
+JsonInput.RepeatedInt32Wrapper.JsonOutput
+JsonInput.RepeatedInt32Wrapper.ProtobufOutput
+JsonInput.RepeatedInt64Wrapper.JsonOutput
+JsonInput.RepeatedInt64Wrapper.ProtobufOutput
+JsonInput.RepeatedStringWrapper.JsonOutput
+JsonInput.RepeatedStringWrapper.ProtobufOutput
+JsonInput.RepeatedUint32Wrapper.JsonOutput
+JsonInput.RepeatedUint32Wrapper.ProtobufOutput
+JsonInput.RepeatedUint64Wrapper.JsonOutput
+JsonInput.RepeatedUint64Wrapper.ProtobufOutput
+JsonInput.StringFieldNotAString
+JsonInput.StringFieldSurrogateInWrongOrder
+JsonInput.StringFieldSurrogatePair.JsonOutput
+JsonInput.StringFieldSurrogatePair.ProtobufOutput
+JsonInput.StringFieldUnpairedHighSurrogate
+JsonInput.StringFieldUnpairedLowSurrogate
+JsonInput.Struct.JsonOutput
+JsonInput.Struct.ProtobufOutput
+JsonInput.TimestampHas3FractionalDigits.Validator
+JsonInput.TimestampHas6FractionalDigits.Validator
+JsonInput.TimestampHas9FractionalDigits.Validator
+JsonInput.TimestampHasZeroFractionalDigit.Validator
+JsonInput.TimestampMaxValue.JsonOutput
+JsonInput.TimestampMaxValue.ProtobufOutput
+JsonInput.TimestampMinValue.JsonOutput
+JsonInput.TimestampMinValue.ProtobufOutput
+JsonInput.TimestampRepeatedValue.JsonOutput
+JsonInput.TimestampRepeatedValue.ProtobufOutput
+JsonInput.TimestampWithNegativeOffset.JsonOutput
+JsonInput.TimestampWithNegativeOffset.ProtobufOutput
+JsonInput.TimestampWithPositiveOffset.JsonOutput
+JsonInput.TimestampWithPositiveOffset.ProtobufOutput
+JsonInput.TimestampZeroNormalized.Validator
+JsonInput.Uint32FieldMaxFloatValue.JsonOutput
+JsonInput.Uint32FieldMaxFloatValue.ProtobufOutput
+JsonInput.Uint32MapField.JsonOutput
+JsonInput.Uint32MapField.ProtobufOutput
+JsonInput.Uint64FieldBeString.Validator
+JsonInput.Uint64FieldMaxValue.JsonOutput
+JsonInput.Uint64FieldMaxValue.ProtobufOutput
+JsonInput.Uint64MapField.JsonOutput
+JsonInput.Uint64MapField.ProtobufOutput
+JsonInput.ValueAcceptBool.JsonOutput
+JsonInput.ValueAcceptBool.ProtobufOutput
+JsonInput.ValueAcceptFloat.JsonOutput
+JsonInput.ValueAcceptFloat.ProtobufOutput
+JsonInput.ValueAcceptInteger.JsonOutput
+JsonInput.ValueAcceptInteger.ProtobufOutput
+JsonInput.ValueAcceptList.JsonOutput
+JsonInput.ValueAcceptList.ProtobufOutput
+JsonInput.ValueAcceptNull.JsonOutput
+JsonInput.ValueAcceptNull.ProtobufOutput
+JsonInput.ValueAcceptObject.JsonOutput
+JsonInput.ValueAcceptObject.ProtobufOutput
+JsonInput.ValueAcceptString.JsonOutput
+JsonInput.ValueAcceptString.ProtobufOutput
+ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput
+ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput
+ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput
+ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput
+TimestampProtoInputTooLarge.JsonOutput
+TimestampProtoInputTooSmall.JsonOutput
diff --git a/conformance/update_failure_list.py b/conformance/update_failure_list.py
deleted file mode 100755
index ad42ed3..0000000
--- a/conformance/update_failure_list.py
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env python
-# Protocol Buffers - Google's data interchange format
-# Copyright 2008 Google Inc.  All rights reserved.
-# https://developers.google.com/protocol-buffers/
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Script to update a failure list file to add/remove failures.
-
-This is sort of like comm(1), except it recognizes comments and ignores them.
-"""
-
-import argparse
-
-parser = argparse.ArgumentParser(
-    description='Adds/removes failures from the failure list.')
-parser.add_argument('filename', type=str, help='failure list file to update')
-parser.add_argument('--add', dest='add_list', action='append')
-parser.add_argument('--remove', dest='remove_list', action='append')
-
-args = parser.parse_args()
-
-add_set = set()
-remove_set = set()
-
-for add_file in (args.add_list or []):
-  with open(add_file) as f:
-    for line in f:
-      add_set.add(line)
-
-for remove_file in (args.remove_list or []):
-  with open(remove_file) as f:
-    for line in f:
-      if line in add_set:
-        raise Exception("Asked to both add and remove test: " + line)
-      remove_set.add(line.strip())
-
-add_list = sorted(add_set, reverse=True)
-
-with open(args.filename) as in_file:
-    existing_list = in_file.read()
-
-with open(args.filename, "w") as f:
-  for line in existing_list.splitlines(True):
-    test = line.split("#")[0].strip()
-    while len(add_list) > 0 and test > add_list[-1]:
-      f.write(add_list.pop())
-    if test not in remove_set:
-      f.write(line)
diff --git a/csharp/.gitignore b/csharp/.gitignore
index 8ba8849..c88f741 100644
--- a/csharp/.gitignore
+++ b/csharp/.gitignore
@@ -1,10 +1,16 @@
-# Output
-bin
-obj
-project.lock.json
-TestResult.xml
-
-# Possibly legacy now?
+#
+# 	Untracked directories
+#
+src/AddressBook/bin
+src/AddressBook/obj
+src/Google.Protobuf/bin/
+src/Google.Protobuf/obj/
+src/Google.Protobuf.Conformance/bin/
+src/Google.Protobuf.Conformance/obj/
+src/Google.Protobuf.Test/bin/
+src/Google.Protobuf.Test/obj/
+src/Google.Protobuf.JsonDump/bin/
+src/Google.Protobuf.JsonDump/obj/
 mono/bin
 mono/tmp
 mono/protoc
@@ -17,7 +23,6 @@
 #
 # 	Untracked files
 #
-.vs
 *.user
 *.suo
 *.nupkg
diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec
index 4294949..e4240da 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.5.2</version>
+    <version>3.0.0-beta3</version>
     <authors>Google Inc.</authors>
     <owners>protobuf-packages</owners>
     <licenseUrl>https://github.com/google/protobuf/blob/master/LICENSE</licenseUrl>
diff --git a/csharp/README.md b/csharp/README.md
index c1d1241..8c3993e 100644
--- a/csharp/README.md
+++ b/csharp/README.md
@@ -1,13 +1,16 @@
 This directory contains the C# Protocol Buffers runtime library.
 
+Status: Beta - ready for external testing
+=========================================
+
 Usage
 =====
 
 The easiest way how to use C# protobufs is via the `Google.Protobuf`
 NuGet package. Just add the NuGet package to your VS project.
 
-You will also want to install the `Google.Protobuf.Tools` NuGet package, which
-contains precompiled version of `protoc.exe` and a copy of well known `.proto`
+Besides C# runtime library, the NuGet package also contains 
+precompiled version of `protoc.exe` and a copy of well known `.proto`
 files under the package's `tools` directory.
 
 To generate C# files from your `.proto` files, invoke `protoc` with the 
@@ -31,41 +34,16 @@
 Building
 ========
 
-Open the `src/Google.Protobuf.sln` solution in Visual Studio 2017 or
-later.
+Open the `src/Google.Protobuf.sln` solution in Visual Studio 2015 or
+later. You should be able to run the NUnit test from Test Explorer
+(you might need to install NUnit Visual Studio add-in).
 
 Although *users* of this project are only expected to have Visual
 Studio 2012 or later, *developers* of the library are required to
-have Visual Studio 2017 or later, as the library uses C# 6 features
-in its implementation, as well as the new Visual Studio 2017 csproj 
-format. These features have no impact when using the compiled code - 
-they're only relevant when building the `Google.Protobuf` assembly.
-
-Testing
-=======
-
-The unit tests use [NUnit 3](https://github.com/nunit/nunit). NUnit doesn't yet
-support `dotnet test`, so for now the test project is a console application 
-using NUnitLite. Simply run `Google.Protobuf.Test.exe` to run the unit tests 
-directly, or else use `dotnet run`.
-
-.NET 3.5
-========
-
-We don't officially support .NET 3.5. However, there has been some effort 
-to make enabling .NET 3.5 support relatively painless in case you require it. 
-There's no guarantee that this will continue in the future, so rely on .NET 
-3.5 support at your peril.
-
-To enable .NET 3.5 support, you must edit the `TargetFrameworks` elements of 
-[src/Google.Protobuf/Google.Protobuf.csproj](src/Google.Protobuf/Google.Protobuf.csproj) 
-(and [src/Google.Protobuf.Test/Google.Protobuf.Test.csproj](src/Google.Protobuf.Test/Google.Protobuf.Test.csproj) 
-if you want to run the unit tests): 
-
-Open the .csproj file in a text editor and simply add `net35` to the list of 
-target frameworks, noting that the `TargetFrameworks` element appears twice in 
-the file (once in the first `PropertyGroup` element, and again in the second 
-`PropertyGroup` element, i.e., the one with the conditional).
+have Visual Studio 2015 or later, as the library uses C# 6 features
+in its implementation. These features have no impact when using the
+compiled code - they're only relevant when building the
+`Google.Protobuf` assembly.
 
 History of C# protobufs
 =======================
diff --git a/csharp/build_packages.bat b/csharp/build_packages.bat
index d720565..1502f06 100644
--- a/csharp/build_packages.bat
+++ b/csharp/build_packages.bat
@@ -1,7 +1,10 @@
 @rem Builds Google.Protobuf NuGet packages
 
-dotnet restore src/Google.Protobuf.sln
-dotnet pack -c Release src/Google.Protobuf.sln || goto :error
+@rem Adjust the location of nuget.exe
+set NUGET=C:\nuget\nuget.exe
+
+@rem Build src/Google.Protobuf.sln solution in Release configuration first.
+%NUGET% pack src\Google.Protobuf\Google.Protobuf.nuspec -Symbols || goto :error
 
 goto :EOF
 
diff --git a/csharp/build_tools.sh b/csharp/build_tools.sh
deleted file mode 100755
index 182c5c5..0000000
--- a/csharp/build_tools.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-if [ $# -ne 1 ]; then
-  cat <<EOF
-Usage: $0 <VERSION_NUMBER>
-
-Example:
-  $ $0 3.0.0
-
-This script will download pre-built protoc binaries from maven repository and
-create the Google.Protobuf.Tools package. Well-known type .proto files will also
-be included.
-EOF
-  exit 1
-fi
-
-VERSION_NUMBER=$1
-# <directory name> <binary file name> pairs.
-declare -a FILE_NAMES=(          \
-  windows_x86 windows-x86_32.exe \
-  windows_x64 windows-x86_64.exe \
-  macosx_x86  osx-x86_32.exe     \
-  macosx_x64  osx-x86_64.exe     \
-  linux_x86   linux-x86_32.exe   \
-  linux_x64   linux-x86_64.exe   \
-)
-
-set -e
-
-mkdir -p protoc
-# Create a zip file for each binary.
-for((i=0;i<${#FILE_NAMES[@]};i+=2));do
-  DIR_NAME=${FILE_NAMES[$i]}
-  mkdir -p protoc/$DIR_NAME
-
-  if [ ${DIR_NAME:0:3} = "win" ]; then
-    TARGET_BINARY="protoc.exe"
-  else
-    TARGET_BINARY="protoc"
-  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 protoc/$DIR_NAME/$TARGET_BINARY &> /dev/null; then
-    echo "[ERROR] Failed to download ${BINARY_URL}" >&2
-    echo "[ERROR] Skipped $protoc-${VERSION_NAME}-${DIR_NAME}" >&2
-    continue
-  fi
-done
-
-nuget pack Google.Protobuf.Tools.nuspec
diff --git a/csharp/buildall.sh b/csharp/buildall.sh
index dd4b463..45af705 100755
--- a/csharp/buildall.sh
+++ b/csharp/buildall.sh
@@ -1,17 +1,17 @@
 #!/bin/bash
+# Use mono to build solution and run all tests.
 
+# Adjust these to reflect the location of nunit-console in your system.
+NUNIT_CONSOLE=nunit-console
+
+# The rest you can leave intact
 CONFIG=Release
 SRC=$(dirname $0)/src
 
 set -ex
 
-echo Building relevant projects.
-dotnet restore $SRC/Google.Protobuf.sln
-dotnet build -c $CONFIG $SRC/Google.Protobuf.sln
+echo Building the solution.
+xbuild /p:Configuration=$CONFIG $SRC/Google.Protobuf.sln
 
 echo Running tests.
-# Only test netcoreapp1.0, which uses the .NET Core runtime.
-# If we want to test the .NET 4.5 version separately, we could
-# run Mono explicitly. However, we don't have any differences between
-# the .NET 4.5 and netstandard1.0 assemblies.
-dotnet run -c $CONFIG -f netcoreapp1.0 -p $SRC/Google.Protobuf.Test/Google.Protobuf.Test.csproj
+$NUNIT_CONSOLE $SRC/Google.Protobuf.Test/bin/$CONFIG/Google.Protobuf.Test.dll
diff --git a/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto b/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto
deleted file mode 100644
index 6c9f763..0000000
--- a/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto
+++ /dev/null
@@ -1,126 +0,0 @@
-syntax = "proto3";
-
-// These proto descriptors have at one time been reported as an issue or defect.
-// They are kept here to replicate the issue, and continue to verify the fix.
-
-// Issue: Non-"Google.Protobuffers" namespace will ensure that protobuffer library types are qualified
-option csharp_namespace = "UnitTest.Issues.TestProtos";
-
-package unittest_issues;
-option optimize_for = SPEED;
-
-// Issue 307: when generating doubly-nested types, any references
-// should be of the form A.Types.B.Types.C.
-message Issue307 {
-  message NestedOnce {
-    message NestedTwice {
-    }
-  }
-}
-
-// Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13
-// New issue 309: https://github.com/google/protobuf/issues/309
- 
-// message A {
-//    optional int32 _A = 1;
-// }
-
-// message B {
-//    optional int32 B_ = 1;
-// }
-
-//message AB {
-//    optional int32 a_b = 1;
-//}
-
-// Similar issue with numeric names
-// Java code failed too, so probably best for this to be a restriction.
-// See https://github.com/google/protobuf/issues/308
-// message NumberField {
-//    optional int32 _01 = 1;
-// }
-
-// issue 19 - negative enum values
-
-enum NegativeEnum {
-    NEGATIVE_ENUM_ZERO = 0;
-    FiveBelow = -5;
-    MinusOne = -1;
-}
-
-message NegativeEnumMessage {
-    NegativeEnum value = 1;
-    repeated NegativeEnum values = 2 [packed = false];
-    repeated NegativeEnum packed_values = 3 [packed=true];
-}
-
-// Issue 21: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=21
-// Decorate fields with [deprecated=true] as [System.Obsolete]
-
-message DeprecatedChild {
-}
-
-enum DeprecatedEnum {
-    DEPRECATED_ZERO = 0;
-    one = 1;
-}
-
-message DeprecatedFieldsMessage {
-    int32 PrimitiveValue = 1 [deprecated = true];
-    repeated int32 PrimitiveArray = 2 [deprecated = true];
-
-    DeprecatedChild MessageValue = 3 [deprecated = true];
-    repeated DeprecatedChild MessageArray = 4 [deprecated = true];
-
-    DeprecatedEnum EnumValue = 5 [deprecated = true];
-    repeated DeprecatedEnum EnumArray = 6 [deprecated = true];
-}
-
-// Issue 45: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=45
-message ItemField {
-  int32 item = 1;
-}
-
-message ReservedNames {
-  // Force a nested type called Types
-  message SomeNestedType {
-  }
-
-  int32 types = 1;
-  int32 descriptor = 2;
-}
-
-message TestJsonFieldOrdering {
-  // These fields are deliberately not declared in numeric
-  // order, and the oneof fields aren't contiguous either.
-  // This allows for reasonably robust tests of JSON output
-  // ordering.
-  // TestFieldOrderings in unittest_proto3.proto is similar,
-  // but doesn't include oneofs.
-  // TODO: Consider adding oneofs to TestFieldOrderings, although
-  // that will require fixing other tests in multiple platforms.
-  // Alternatively, consider just adding this to
-  // unittest_proto3.proto if multiple platforms want it.
-  
-  int32 plain_int32 = 4;
-
-  oneof o1 {
-    string o1_string = 2;
-    int32 o1_int32 = 5;
-  }
-  
-  string plain_string = 1;
-  
-  oneof o2 {
-    int32 o2_int32 = 6;
-    string o2_string = 3;
-  }
-  
-}
-
-message TestJsonName {
-  // Message for testing the effects for of the json_name option
-  string name = 1;
-  string description = 2 [json_name = "desc"];
-  string guid = 3 [json_name = "exid"];
-}
diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/map_unittest_proto3.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/map_unittest_proto3.proto
deleted file mode 100644
index 16be277..0000000
--- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/map_unittest_proto3.proto
+++ /dev/null
@@ -1,120 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This file is mostly equivalent to map_unittest.proto, but imports
-// unittest_proto3.proto instead of unittest.proto, so that it only
-// uses proto3 messages. This makes it suitable for testing
-// implementations which only support proto3.
-// The TestRequiredMessageMap message has been removed as there are no
-// required fields in proto3.
-syntax = "proto3";
-
-option cc_enable_arenas = true;
-option csharp_namespace = "Google.Protobuf.TestProtos";
-
-import "google/protobuf/unittest_proto3.proto";
-
-// We don't put this in a package within proto2 because we need to make sure
-// that the generated code doesn't depend on being in the proto2 namespace.
-// In map_test_util.h we do "using namespace unittest = protobuf_unittest".
-package protobuf_unittest;
-
-// Tests maps.
-message TestMap {
-  map<int32   , int32   > map_int32_int32       = 1;
-  map<int64   , int64   > map_int64_int64       = 2;
-  map<uint32  , uint32  > map_uint32_uint32     = 3;
-  map<uint64  , uint64  > map_uint64_uint64     = 4;
-  map<sint32  , sint32  > map_sint32_sint32     = 5;
-  map<sint64  , sint64  > map_sint64_sint64     = 6;
-  map<fixed32 , fixed32 > map_fixed32_fixed32   = 7;
-  map<fixed64 , fixed64 > map_fixed64_fixed64   = 8;
-  map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 9;
-  map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 10;
-  map<int32   , float   > map_int32_float       = 11;
-  map<int32   , double  > map_int32_double      = 12;
-  map<bool    , bool    > map_bool_bool         = 13;
-  map<string  , string  > map_string_string     = 14;
-  map<int32   , bytes   > map_int32_bytes       = 15;
-  map<int32   , MapEnum > map_int32_enum        = 16;
-  map<int32   , ForeignMessage> map_int32_foreign_message = 17;
-}
-
-message TestMapSubmessage {
-  TestMap test_map = 1;
-}
-
-message TestMessageMap {
-  map<int32, TestAllTypes> map_int32_message = 1;
-}
-
-// Two map fields share the same entry default instance.
-message TestSameTypeMap {
-  map<int32, int32> map1 = 1;
-  map<int32, int32> map2 = 2;
-}
-
-enum MapEnum {
-  MAP_ENUM_FOO = 0;
-  MAP_ENUM_BAR = 1;
-  MAP_ENUM_BAZ = 2;
-}
-
-message TestArenaMap {
-  map<int32   , int32   > map_int32_int32       = 1;
-  map<int64   , int64   > map_int64_int64       = 2;
-  map<uint32  , uint32  > map_uint32_uint32     = 3;
-  map<uint64  , uint64  > map_uint64_uint64     = 4;
-  map<sint32  , sint32  > map_sint32_sint32     = 5;
-  map<sint64  , sint64  > map_sint64_sint64     = 6;
-  map<fixed32 , fixed32 > map_fixed32_fixed32   = 7;
-  map<fixed64 , fixed64 > map_fixed64_fixed64   = 8;
-  map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 9;
-  map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 10;
-  map<int32   , float   > map_int32_float       = 11;
-  map<int32   , double  > map_int32_double      = 12;
-  map<bool    , bool    > map_bool_bool         = 13;
-  map<int32   , MapEnum > map_int32_enum        = 14;
-  map<int32   , ForeignMessage> map_int32_foreign_message = 15;
-}
-
-// Previously, message containing enum called Type cannot be used as value of
-// map field.
-message MessageContainingEnumCalledType {
-  enum Type {
-    TYPE_FOO = 0;
-  }
-  map<int32, MessageContainingEnumCalledType> type = 1;
-}
-
-// Previously, message cannot contain map field called "entry".
-message MessageContainingMapCalledEntry {
-  map<int32, int32> entry = 1;
-}
diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_proto3.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_proto3.proto
deleted file mode 100644
index 59673ea..0000000
--- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_proto3.proto
+++ /dev/null
@@ -1,68 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: kenton@google.com (Kenton Varda)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
-//
-// A proto file which is imported by unittest_proto3.proto to test importing.
-
-syntax = "proto3";
-
-// We don't put this in a package within proto2 because we need to make sure
-// that the generated code doesn't depend on being in the proto2 namespace.
-// In test_util.h we do
-// "using namespace unittest_import = protobuf_unittest_import".
-package protobuf_unittest_import;
-
-option optimize_for = SPEED;
-option cc_enable_arenas = true;
-
-// Exercise the java_package option.
-option java_package = "com.google.protobuf.test";
-option csharp_namespace = "Google.Protobuf.TestProtos";
-
-// Do not set a java_outer_classname here to verify that Proto2 works without
-// one.
-
-// Test public import
-import public "google/protobuf/unittest_import_public_proto3.proto";
-
-message ImportMessage {
-  int32 d = 1;
-}
-
-enum ImportEnum {
-  IMPORT_ENUM_UNSPECIFIED = 0;
-  IMPORT_FOO = 7;
-  IMPORT_BAR = 8;
-  IMPORT_BAZ = 9;
-}
-
diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_public_proto3.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_public_proto3.proto
deleted file mode 100644
index d6f11e2..0000000
--- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_import_public_proto3.proto
+++ /dev/null
@@ -1,42 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: liujisi@google.com (Pherl Liu)
-
-syntax = "proto3";
-
-package protobuf_unittest_import;
-
-option java_package = "com.google.protobuf.test";
-option csharp_namespace = "Google.Protobuf.TestProtos";
-
-message PublicImportMessage {
- int32 e = 1;
-}
diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_proto3.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_proto3.proto
deleted file mode 100644
index f59d217..0000000
--- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_proto3.proto
+++ /dev/null
@@ -1,388 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: kenton@google.com (Kenton Varda)
-//  Based on original Protocol Buffers design by
-//  Sanjay Ghemawat, Jeff Dean, and others.
-//
-// A proto file we will use for unit testing.
-
-syntax = "proto3";
-
-// Some generic_services option(s) added automatically.
-// See:  http://go/proto2-generic-services-default
-option cc_generic_services = true;     // auto-added
-option java_generic_services = true;   // auto-added
-option py_generic_services = true;     // auto-added
-option cc_enable_arenas = true;
-option csharp_namespace = "Google.Protobuf.TestProtos";
-
-import "google/protobuf/unittest_import_proto3.proto";
-
-// We don't put this in a package within proto2 because we need to make sure
-// that the generated code doesn't depend on being in the proto2 namespace.
-// In test_util.h we do "using namespace unittest = protobuf_unittest".
-package protobuf_unittest;
-
-// Protos optimized for SPEED use a strict superset of the generated code
-// of equivalent ones optimized for CODE_SIZE, so we should optimize all our
-// tests for speed unless explicitly testing code size optimization.
-option optimize_for = SPEED;
-
-option java_outer_classname = "UnittestProto";
-
-// This proto includes every type of field in both singular and repeated
-// forms.
-message TestAllTypes {
-  message NestedMessage {
-    // The field name "b" fails to compile in proto1 because it conflicts with
-    // a local variable named "b" in one of the generated methods.  Doh.
-    // This file needs to compile in proto1 to test backwards-compatibility.
-    int32 bb = 1;
-  }
-
-  enum NestedEnum {
-    NESTED_ENUM_UNSPECIFIED = 0;
-    FOO = 1;
-    BAR = 2;
-    BAZ = 3;
-    NEG = -1;  // Intentionally negative.
-  }
-
-  // Singular
-  int32 single_int32 = 1;
-  int64 single_int64 = 2;
-  uint32 single_uint32 = 3;
-  uint64 single_uint64 = 4;
-  sint32 single_sint32 = 5;
-  sint64 single_sint64 = 6;
-  fixed32 single_fixed32 = 7;
-  fixed64 single_fixed64 = 8;
-  sfixed32 single_sfixed32 = 9;
-  sfixed64 single_sfixed64 = 10;
-  float single_float = 11;
-  double single_double = 12;
-  bool single_bool = 13;
-  string single_string = 14;
-  bytes single_bytes = 15;
-
-  NestedMessage single_nested_message = 18;
-  ForeignMessage single_foreign_message = 19;
-  protobuf_unittest_import.ImportMessage single_import_message = 20;
-
-  NestedEnum single_nested_enum = 21;
-  ForeignEnum single_foreign_enum = 22;
-  protobuf_unittest_import.ImportEnum single_import_enum = 23;
-
-  // Defined in unittest_import_public.proto
-  protobuf_unittest_import.PublicImportMessage
-      single_public_import_message = 26;
-
-  // Repeated
-  repeated    int32 repeated_int32    = 31;
-  repeated    int64 repeated_int64    = 32;
-  repeated   uint32 repeated_uint32   = 33;
-  repeated   uint64 repeated_uint64   = 34;
-  repeated   sint32 repeated_sint32   = 35;
-  repeated   sint64 repeated_sint64   = 36;
-  repeated  fixed32 repeated_fixed32  = 37;
-  repeated  fixed64 repeated_fixed64  = 38;
-  repeated sfixed32 repeated_sfixed32 = 39;
-  repeated sfixed64 repeated_sfixed64 = 40;
-  repeated    float repeated_float    = 41;
-  repeated   double repeated_double   = 42;
-  repeated     bool repeated_bool     = 43;
-  repeated   string repeated_string   = 44;
-  repeated    bytes repeated_bytes    = 45;
-
-  repeated NestedMessage                        repeated_nested_message  = 48;
-  repeated ForeignMessage                       repeated_foreign_message = 49;
-  repeated protobuf_unittest_import.ImportMessage repeated_import_message  = 50;
-
-  repeated NestedEnum                           repeated_nested_enum     = 51;
-  repeated ForeignEnum                          repeated_foreign_enum    = 52;
-  repeated protobuf_unittest_import.ImportEnum    repeated_import_enum     = 53;
-  // Defined in unittest_import_public.proto
-  repeated protobuf_unittest_import.PublicImportMessage
-      repeated_public_import_message = 54;
-
-  // For oneof test
-  oneof oneof_field {
-    uint32 oneof_uint32 = 111;
-    NestedMessage oneof_nested_message = 112;
-    string oneof_string = 113;
-    bytes oneof_bytes = 114;
-  }
-}
-
-// This proto includes a recusively nested message.
-message NestedTestAllTypes {
-  NestedTestAllTypes child = 1;
-  TestAllTypes payload = 2;
-  repeated NestedTestAllTypes repeated_child = 3;
-}
-
-message TestDeprecatedFields {
-  int32 deprecated_int32 = 1 [deprecated=true];
-}
-
-// Define these after TestAllTypes to make sure the compiler can handle
-// that.
-message ForeignMessage {
-  int32 c = 1;
-}
-
-enum ForeignEnum {
-  FOREIGN_UNSPECIFIED = 0;
-  FOREIGN_FOO = 4;
-  FOREIGN_BAR = 5;
-  FOREIGN_BAZ = 6;
-}
-
-message TestReservedFields {
-  reserved 2, 15, 9 to 11;
-  reserved "bar", "baz";
-}
-
-
-// Test that we can use NestedMessage from outside TestAllTypes.
-message TestForeignNested {
-  TestAllTypes.NestedMessage foreign_nested = 1;
-}
-
-// Test that really large tag numbers don't break anything.
-message TestReallyLargeTagNumber {
-  // The largest possible tag number is 2^28 - 1, since the wire format uses
-  // three bits to communicate wire type.
-  int32 a = 1;
-  int32 bb = 268435455;
-}
-
-message TestRecursiveMessage {
-  TestRecursiveMessage a = 1;
-  int32 i = 2;
-}
-
-// Test that mutual recursion works.
-message TestMutualRecursionA {
-  TestMutualRecursionB bb = 1;
-}
-
-message TestMutualRecursionB {
-  TestMutualRecursionA a = 1;
-  int32 optional_int32 = 2;
-}
-
-
-// Test an enum that has multiple values with the same number.
-enum TestEnumWithDupValue {
-  TEST_ENUM_WITH_DUP_VALUE_UNSPECIFIED = 0;
-  option allow_alias = true;
-
-  FOO1 = 1;
-  BAR1 = 2;
-  BAZ = 3;
-  FOO2 = 1;
-  BAR2 = 2;
-}
-
-// Test an enum with large, unordered values.
-enum TestSparseEnum {
-  TEST_SPARSE_ENUM_UNSPECIFIED = 0;
-  SPARSE_A = 123;
-  SPARSE_B = 62374;
-  SPARSE_C = 12589234;
-  SPARSE_D = -15;
-  SPARSE_E = -53452;
-  // In proto3, value 0 must be the first one specified
-  // SPARSE_F = 0;
-  SPARSE_G = 2;
-}
-
-// Test message with CamelCase field names.  This violates Protocol Buffer
-// standard style.
-message TestCamelCaseFieldNames {
-  int32 PrimitiveField = 1;
-  string StringField = 2;
-  ForeignEnum EnumField = 3;
-  ForeignMessage MessageField = 4;
-
-  repeated int32 RepeatedPrimitiveField = 7;
-  repeated string RepeatedStringField = 8;
-  repeated ForeignEnum RepeatedEnumField = 9;
-  repeated ForeignMessage RepeatedMessageField = 10;
-}
-
-
-// We list fields out of order, to ensure that we're using field number and not
-// field index to determine serialization order.
-message TestFieldOrderings {
-  string my_string = 11;
-  int64 my_int = 1;
-  float my_float = 101;
-  message NestedMessage {
-    int64 oo = 2;
-    // The field name "b" fails to compile in proto1 because it conflicts with
-    // a local variable named "b" in one of the generated methods.  Doh.
-    // This file needs to compile in proto1 to test backwards-compatibility.
-    int32 bb = 1;
-  }
-
-  NestedMessage single_nested_message  = 200;
-}
-
-message SparseEnumMessage {
-  TestSparseEnum sparse_enum = 1;
-}
-
-// Test String and Bytes: string is for valid UTF-8 strings
-message OneString {
-  string data = 1;
-}
-
-message MoreString {
-  repeated string data = 1;
-}
-
-message OneBytes {
-  bytes data = 1;
-}
-
-message MoreBytes {
-  bytes data = 1;
-}
-
-// Test int32, uint32, int64, uint64, and bool are all compatible
-message Int32Message {
-  int32 data = 1;
-}
-
-message Uint32Message {
-  uint32 data = 1;
-}
-
-message Int64Message {
-  int64 data = 1;
-}
-
-message Uint64Message {
-  uint64 data = 1;
-}
-
-message BoolMessage {
-  bool data = 1;
-}
-
-// Test oneofs.
-message TestOneof {
-  oneof foo {
-    int32 foo_int = 1;
-    string foo_string = 2;
-    TestAllTypes foo_message = 3;
-  }
-}
-
-// Test messages for packed fields
-
-message TestPackedTypes {
-  repeated    int32 packed_int32    =  90 [packed = true];
-  repeated    int64 packed_int64    =  91 [packed = true];
-  repeated   uint32 packed_uint32   =  92 [packed = true];
-  repeated   uint64 packed_uint64   =  93 [packed = true];
-  repeated   sint32 packed_sint32   =  94 [packed = true];
-  repeated   sint64 packed_sint64   =  95 [packed = true];
-  repeated  fixed32 packed_fixed32  =  96 [packed = true];
-  repeated  fixed64 packed_fixed64  =  97 [packed = true];
-  repeated sfixed32 packed_sfixed32 =  98 [packed = true];
-  repeated sfixed64 packed_sfixed64 =  99 [packed = true];
-  repeated    float packed_float    = 100 [packed = true];
-  repeated   double packed_double   = 101 [packed = true];
-  repeated     bool packed_bool     = 102 [packed = true];
-  repeated ForeignEnum packed_enum  = 103 [packed = true];
-}
-
-// A message with the same fields as TestPackedTypes, but without packing. Used
-// to test packed <-> unpacked wire compatibility.
-message TestUnpackedTypes {
-  repeated    int32 unpacked_int32    =  90 [packed = false];
-  repeated    int64 unpacked_int64    =  91 [packed = false];
-  repeated   uint32 unpacked_uint32   =  92 [packed = false];
-  repeated   uint64 unpacked_uint64   =  93 [packed = false];
-  repeated   sint32 unpacked_sint32   =  94 [packed = false];
-  repeated   sint64 unpacked_sint64   =  95 [packed = false];
-  repeated  fixed32 unpacked_fixed32  =  96 [packed = false];
-  repeated  fixed64 unpacked_fixed64  =  97 [packed = false];
-  repeated sfixed32 unpacked_sfixed32 =  98 [packed = false];
-  repeated sfixed64 unpacked_sfixed64 =  99 [packed = false];
-  repeated    float unpacked_float    = 100 [packed = false];
-  repeated   double unpacked_double   = 101 [packed = false];
-  repeated     bool unpacked_bool     = 102 [packed = false];
-  repeated ForeignEnum unpacked_enum  = 103 [packed = false];
-}
-
-message TestRepeatedScalarDifferentTagSizes {
-  // Parsing repeated fixed size values used to fail. This message needs to be
-  // used in order to get a tag of the right size; all of the repeated fields
-  // in TestAllTypes didn't trigger the check.
-  repeated fixed32 repeated_fixed32 = 12;
-  // Check for a varint type, just for good measure.
-  repeated int32   repeated_int32   = 13;
-
-  // These have two-byte tags.
-  repeated fixed64 repeated_fixed64 = 2046;
-  repeated int64   repeated_int64   = 2047;
-
-  // Three byte tags.
-  repeated float   repeated_float   = 262142;
-  repeated uint64  repeated_uint64  = 262143;
-}
-
-message TestCommentInjectionMessage {
-  // */ <- This should not close the generated doc comment
-  string a = 1;
-}
-
-
-// Test that RPC services work.
-message FooRequest  {}
-message FooResponse {}
-
-message FooClientMessage {}
-message FooServerMessage{}
-
-service TestService {
-  rpc Foo(FooRequest) returns (FooResponse);
-  rpc Bar(BarRequest) returns (BarResponse);
-}
-
-
-message BarRequest  {}
-message BarResponse {}
-
diff --git a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_well_known_types.proto b/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_well_known_types.proto
deleted file mode 100644
index c907524..0000000
--- a/csharp/compatibility_tests/v3.0.0/protos/src/google/protobuf/unittest_well_known_types.proto
+++ /dev/null
@@ -1,114 +0,0 @@
-syntax = "proto3";
-
-package protobuf_unittest;
-
-option csharp_namespace = "Google.Protobuf.TestProtos";
-option java_multiple_files = true;
-option java_package = "com.google.protobuf.test";
-
-import "google/protobuf/any.proto";
-import "google/protobuf/api.proto";
-import "google/protobuf/duration.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/field_mask.proto";
-import "google/protobuf/source_context.proto";
-import "google/protobuf/struct.proto";
-import "google/protobuf/timestamp.proto";
-import "google/protobuf/type.proto";
-import "google/protobuf/wrappers.proto";
-
-// Test that we can include all well-known types.
-// Each wrapper type is included separately, as languages
-// map handle different wrappers in different ways.
-message TestWellKnownTypes {
-  google.protobuf.Any any_field = 1;
-  google.protobuf.Api api_field = 2;
-  google.protobuf.Duration duration_field = 3;
-  google.protobuf.Empty empty_field = 4;
-  google.protobuf.FieldMask field_mask_field = 5;
-  google.protobuf.SourceContext source_context_field = 6;
-  google.protobuf.Struct struct_field = 7;
-  google.protobuf.Timestamp timestamp_field = 8;
-  google.protobuf.Type type_field = 9;
-  google.protobuf.DoubleValue double_field = 10;
-  google.protobuf.FloatValue float_field = 11;
-  google.protobuf.Int64Value int64_field = 12;
-  google.protobuf.UInt64Value uint64_field = 13;
-  google.protobuf.Int32Value int32_field = 14;
-  google.protobuf.UInt32Value uint32_field = 15;
-  google.protobuf.BoolValue bool_field = 16;
-  google.protobuf.StringValue string_field = 17;
-  google.protobuf.BytesValue bytes_field = 18;
-  // Part of struct, but useful to be able to test separately
-  google.protobuf.Value value_field = 19;
-}
-
-// A repeated field for each well-known type.
-message RepeatedWellKnownTypes {
-  repeated google.protobuf.Any any_field = 1;
-  repeated google.protobuf.Api api_field = 2;
-  repeated google.protobuf.Duration duration_field = 3;
-  repeated google.protobuf.Empty empty_field = 4;
-  repeated google.protobuf.FieldMask field_mask_field = 5;
-  repeated google.protobuf.SourceContext source_context_field = 6;
-  repeated google.protobuf.Struct struct_field = 7;
-  repeated google.protobuf.Timestamp timestamp_field = 8;
-  repeated google.protobuf.Type type_field = 9;
-  // These don't actually make a lot of sense, but they're not prohibited...
-  repeated google.protobuf.DoubleValue double_field = 10;
-  repeated google.protobuf.FloatValue float_field = 11;
-  repeated google.protobuf.Int64Value int64_field = 12;
-  repeated google.protobuf.UInt64Value uint64_field = 13;
-  repeated google.protobuf.Int32Value int32_field = 14;
-  repeated google.protobuf.UInt32Value uint32_field = 15;
-  repeated google.protobuf.BoolValue bool_field = 16;
-  repeated google.protobuf.StringValue string_field = 17;
-  repeated google.protobuf.BytesValue bytes_field = 18;
-}
-
-message OneofWellKnownTypes {
-  oneof oneof_field {
-    google.protobuf.Any any_field = 1;
-    google.protobuf.Api api_field = 2;
-    google.protobuf.Duration duration_field = 3;
-    google.protobuf.Empty empty_field = 4;
-    google.protobuf.FieldMask field_mask_field = 5;
-    google.protobuf.SourceContext source_context_field = 6;
-    google.protobuf.Struct struct_field = 7;
-    google.protobuf.Timestamp timestamp_field = 8;
-    google.protobuf.Type type_field = 9;
-    google.protobuf.DoubleValue double_field = 10;
-    google.protobuf.FloatValue float_field = 11;
-    google.protobuf.Int64Value int64_field = 12;
-    google.protobuf.UInt64Value uint64_field = 13;
-    google.protobuf.Int32Value int32_field = 14;
-    google.protobuf.UInt32Value uint32_field = 15;
-    google.protobuf.BoolValue bool_field = 16;
-    google.protobuf.StringValue string_field = 17;
-    google.protobuf.BytesValue bytes_field = 18;
-  }
-}
-
-// A map field for each well-known type. We only
-// need to worry about the value part of the map being the
-// well-known types, as messages can't be map keys.
-message MapWellKnownTypes {
-  map<int32,google.protobuf.Any> any_field = 1;
-  map<int32,google.protobuf.Api> api_field = 2;
-  map<int32,google.protobuf.Duration> duration_field = 3;
-  map<int32,google.protobuf.Empty> empty_field = 4;
-  map<int32,google.protobuf.FieldMask> field_mask_field = 5;
-  map<int32,google.protobuf.SourceContext> source_context_field = 6;
-  map<int32,google.protobuf.Struct> struct_field = 7;
-  map<int32,google.protobuf.Timestamp> timestamp_field = 8;
-  map<int32,google.protobuf.Type> type_field = 9;
-  map<int32,google.protobuf.DoubleValue> double_field = 10;
-  map<int32,google.protobuf.FloatValue> float_field = 11;
-  map<int32,google.protobuf.Int64Value> int64_field = 12;
-  map<int32,google.protobuf.UInt64Value> uint64_field = 13;
-  map<int32,google.protobuf.Int32Value> int32_field = 14;
-  map<int32,google.protobuf.UInt32Value> uint32_field = 15;
-  map<int32,google.protobuf.BoolValue> bool_field = 16;
-  map<int32,google.protobuf.StringValue> string_field = 17;
-  map<int32,google.protobuf.BytesValue> bytes_field = 18;
-}
diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/ByteStringTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/ByteStringTest.cs
deleted file mode 100644
index 685e130..0000000
--- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/ByteStringTest.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-#region Copyright notice and license

-// Protocol Buffers - Google's data interchange format

-// Copyright 2008 Google Inc.  All rights reserved.

-// https://developers.google.com/protocol-buffers/

-//

-// Redistribution and use in source and binary forms, with or without

-// modification, are permitted provided that the following conditions are

-// met:

-//

-//     * Redistributions of source code must retain the above copyright

-// notice, this list of conditions and the following disclaimer.

-//     * Redistributions in binary form must reproduce the above

-// copyright notice, this list of conditions and the following disclaimer

-// in the documentation and/or other materials provided with the

-// distribution.

-//     * Neither the name of Google Inc. nor the names of its

-// contributors may be used to endorse or promote products derived from

-// this software without specific prior written permission.

-//

-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT

-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT

-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,

-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT

-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,

-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY

-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT

-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-#endregion

-

-using System;

-using System.Text;

-using NUnit.Framework;

-

-namespace Google.Protobuf

-{

-    public class ByteStringTest

-    {

-        [Test]

-        public void Equality()

-        {

-            ByteString b1 = ByteString.CopyFrom(1, 2, 3);

-            ByteString b2 = ByteString.CopyFrom(1, 2, 3);

-            ByteString b3 = ByteString.CopyFrom(1, 2, 4);

-            ByteString b4 = ByteString.CopyFrom(1, 2, 3, 4);

-            EqualityTester.AssertEquality(b1, b1);

-            EqualityTester.AssertEquality(b1, b2);

-            EqualityTester.AssertInequality(b1, b3);

-            EqualityTester.AssertInequality(b1, b4);

-            EqualityTester.AssertInequality(b1, null);

-#pragma warning disable 1718 // Deliberately calling ==(b1, b1) and !=(b1, b1)

-            Assert.IsTrue(b1 == b1);

-            Assert.IsTrue(b1 == b2);

-            Assert.IsFalse(b1 == b3);

-            Assert.IsFalse(b1 == b4);

-            Assert.IsFalse(b1 == null);

-            Assert.IsTrue((ByteString) null == null);

-            Assert.IsFalse(b1 != b1);

-            Assert.IsFalse(b1 != b2);

-#pragma warning disable 1718

-            Assert.IsTrue(b1 != b3);

-            Assert.IsTrue(b1 != b4);

-            Assert.IsTrue(b1 != null);

-            Assert.IsFalse((ByteString) null != null);

-        }

-

-        [Test]

-        public void EmptyByteStringHasZeroSize()

-        {

-            Assert.AreEqual(0, ByteString.Empty.Length);

-        }

-

-        [Test]

-        public void CopyFromStringWithExplicitEncoding()

-        {

-            ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode);

-            Assert.AreEqual(4, bs.Length);

-            Assert.AreEqual(65, bs[0]);

-            Assert.AreEqual(0, bs[1]);

-            Assert.AreEqual(66, bs[2]);

-            Assert.AreEqual(0, bs[3]);

-        }

-

-        [Test]

-        public void IsEmptyWhenEmpty()

-        {

-            Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty);

-        }

-

-        [Test]

-        public void IsEmptyWhenNotEmpty()

-        {

-            Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty);

-        }

-

-        [Test]

-        public void CopyFromByteArrayCopiesContents()

-        {

-            byte[] data = new byte[1];

-            data[0] = 10;

-            ByteString bs = ByteString.CopyFrom(data);

-            Assert.AreEqual(10, bs[0]);

-            data[0] = 5;

-            Assert.AreEqual(10, bs[0]);

-        }

-

-        [Test]

-        public void ToByteArrayCopiesContents()

-        {

-            ByteString bs = ByteString.CopyFromUtf8("Hello");

-            byte[] data = bs.ToByteArray();

-            Assert.AreEqual((byte)'H', data[0]);

-            Assert.AreEqual((byte)'H', bs[0]);

-            data[0] = 0;

-            Assert.AreEqual(0, data[0]);

-            Assert.AreEqual((byte)'H', bs[0]);

-        }

-

-        [Test]

-        public void CopyFromUtf8UsesUtf8()

-        {

-            ByteString bs = ByteString.CopyFromUtf8("\u20ac");

-            Assert.AreEqual(3, bs.Length);

-            Assert.AreEqual(0xe2, bs[0]);

-            Assert.AreEqual(0x82, bs[1]);

-            Assert.AreEqual(0xac, bs[2]);

-        }

-

-        [Test]

-        public void CopyFromPortion()

-        {

-            byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6};

-            ByteString bs = ByteString.CopyFrom(data, 2, 3);

-            Assert.AreEqual(3, bs.Length);

-            Assert.AreEqual(2, bs[0]);

-            Assert.AreEqual(3, bs[1]);

-        }

-

-        [Test]

-        public void ToStringUtf8()

-        {

-            ByteString bs = ByteString.CopyFromUtf8("\u20ac");

-            Assert.AreEqual("\u20ac", bs.ToStringUtf8());

-        }

-

-        [Test]

-        public void ToStringWithExplicitEncoding()

-        {

-            ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode);

-            Assert.AreEqual("\u20ac", bs.ToString(Encoding.Unicode));

-        }

-

-        [Test]

-        public void FromBase64_WithText()

-        {

-            byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6};

-            string base64 = Convert.ToBase64String(data);

-            ByteString bs = ByteString.FromBase64(base64);

-            Assert.AreEqual(data, bs.ToByteArray());

-        }

-

-        [Test]

-        public void FromBase64_Empty()

-        {

-            // Optimization which also fixes issue 61.

-            Assert.AreSame(ByteString.Empty, ByteString.FromBase64(""));

-        }

-    }

-}
\ No newline at end of file
diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs
deleted file mode 100644
index 23af288..0000000
--- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-#region Copyright notice and license
-// Protocol Buffers - Google's data interchange format
-// Copyright 2015 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#endregion
-
-using NUnit.Framework;
-
-namespace Google.Protobuf
-{
-    internal static class CodedInputStreamExtensions
-    {
-        public static void AssertNextTag(this CodedInputStream input, uint expectedTag)
-        {
-            uint tag = input.ReadTag();
-            Assert.AreEqual(expectedTag, tag);
-        }
-
-        public static T ReadMessage<T>(this CodedInputStream stream, MessageParser<T> parser)
-            where T : IMessage<T>
-        {
-            var message = parser.CreateTemplate();
-            stream.ReadMessage(message);
-            return message;
-        }
-    }
-}
diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs
deleted file mode 100644
index ff44895..0000000
--- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs
+++ /dev/null
@@ -1,598 +0,0 @@
-#region Copyright notice and license

-// Protocol Buffers - Google's data interchange format

-// Copyright 2008 Google Inc.  All rights reserved.

-// https://developers.google.com/protocol-buffers/

-//

-// Redistribution and use in source and binary forms, with or without

-// modification, are permitted provided that the following conditions are

-// met:

-//

-//     * Redistributions of source code must retain the above copyright

-// notice, this list of conditions and the following disclaimer.

-//     * Redistributions in binary form must reproduce the above

-// copyright notice, this list of conditions and the following disclaimer

-// in the documentation and/or other materials provided with the

-// distribution.

-//     * Neither the name of Google Inc. nor the names of its

-// contributors may be used to endorse or promote products derived from

-// this software without specific prior written permission.

-//

-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT

-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT

-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,

-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT

-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,

-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY

-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT

-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-#endregion

-

-using System;

-using System.IO;

-using Google.Protobuf.TestProtos;

-using NUnit.Framework;

-

-namespace Google.Protobuf

-{

-    public class CodedInputStreamTest

-    {

-        /// <summary>

-        /// Helper to construct a byte array from a bunch of bytes.  The inputs are

-        /// actually ints so that I can use hex notation and not get stupid errors

-        /// about precision.

-        /// </summary>

-        private static byte[] Bytes(params int[] bytesAsInts)

-        {

-            byte[] bytes = new byte[bytesAsInts.Length];

-            for (int i = 0; i < bytesAsInts.Length; i++)

-            {

-                bytes[i] = (byte) bytesAsInts[i];

-            }

-            return bytes;

-        }

-

-        /// <summary>

-        /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64()

-        /// </summary>

-        private static void AssertReadVarint(byte[] data, ulong value)

-        {

-            CodedInputStream input = new CodedInputStream(data);

-            Assert.AreEqual((uint) value, input.ReadRawVarint32());

-

-            input = new CodedInputStream(data);

-            Assert.AreEqual(value, input.ReadRawVarint64());

-            Assert.IsTrue(input.IsAtEnd);

-

-            // Try different block sizes.

-            for (int bufferSize = 1; bufferSize <= 16; bufferSize *= 2)

-            {

-                input = new CodedInputStream(new SmallBlockInputStream(data, bufferSize));

-                Assert.AreEqual((uint) value, input.ReadRawVarint32());

-

-                input = new CodedInputStream(new SmallBlockInputStream(data, bufferSize));

-                Assert.AreEqual(value, input.ReadRawVarint64());

-                Assert.IsTrue(input.IsAtEnd);

-            }

-

-            // Try reading directly from a MemoryStream. We want to verify that it

-            // doesn't read past the end of the input, so write an extra byte - this

-            // lets us test the position at the end.

-            MemoryStream memoryStream = new MemoryStream();

-            memoryStream.Write(data, 0, data.Length);

-            memoryStream.WriteByte(0);

-            memoryStream.Position = 0;

-            Assert.AreEqual((uint) value, CodedInputStream.ReadRawVarint32(memoryStream));

-            Assert.AreEqual(data.Length, memoryStream.Position);

-        }

-

-        /// <summary>

-        /// Parses the given bytes using ReadRawVarint32() and ReadRawVarint64() and

-        /// expects them to fail with an InvalidProtocolBufferException whose

-        /// description matches the given one.

-        /// </summary>

-        private static void AssertReadVarintFailure(InvalidProtocolBufferException expected, byte[] data)

-        {

-            CodedInputStream input = new CodedInputStream(data);

-            var exception = Assert.Throws<InvalidProtocolBufferException>(() => input.ReadRawVarint32());

-            Assert.AreEqual(expected.Message, exception.Message);

-

-            input = new CodedInputStream(data);

-            exception = Assert.Throws<InvalidProtocolBufferException>(() => input.ReadRawVarint64());

-            Assert.AreEqual(expected.Message, exception.Message);

-

-            // Make sure we get the same error when reading directly from a Stream.

-            exception = Assert.Throws<InvalidProtocolBufferException>(() => CodedInputStream.ReadRawVarint32(new MemoryStream(data)));

-            Assert.AreEqual(expected.Message, exception.Message);

-        }

-

-        [Test]

-        public void ReadVarint()

-        {

-            AssertReadVarint(Bytes(0x00), 0);

-            AssertReadVarint(Bytes(0x01), 1);

-            AssertReadVarint(Bytes(0x7f), 127);

-            // 14882

-            AssertReadVarint(Bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7));

-            // 2961488830

-            AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b),

-                             (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) |

-                             (0x0bL << 28));

-

-            // 64-bit

-            // 7256456126

-            AssertReadVarint(Bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b),

-                             (0x3e << 0) | (0x77 << 7) | (0x12 << 14) | (0x04 << 21) |

-                             (0x1bL << 28));

-            // 41256202580718336

-            AssertReadVarint(Bytes(0x80, 0xe6, 0xeb, 0x9c, 0xc3, 0xc9, 0xa4, 0x49),

-                             (0x00 << 0) | (0x66 << 7) | (0x6b << 14) | (0x1c << 21) |

-                             (0x43L << 28) | (0x49L << 35) | (0x24L << 42) | (0x49L << 49));

-            // 11964378330978735131

-            AssertReadVarint(Bytes(0x9b, 0xa8, 0xf9, 0xc2, 0xbb, 0xd6, 0x80, 0x85, 0xa6, 0x01),

-                             (0x1b << 0) | (0x28 << 7) | (0x79 << 14) | (0x42 << 21) |

-                             (0x3bUL << 28) | (0x56UL << 35) | (0x00UL << 42) |

-                             (0x05UL << 49) | (0x26UL << 56) | (0x01UL << 63));

-

-            // Failures

-            AssertReadVarintFailure(

-                InvalidProtocolBufferException.MalformedVarint(),

-                Bytes(0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,

-                      0x00));

-            AssertReadVarintFailure(

-                InvalidProtocolBufferException.TruncatedMessage(),

-                Bytes(0x80));

-        }

-

-        /// <summary>

-        /// Parses the given bytes using ReadRawLittleEndian32() and checks

-        /// that the result matches the given value.

-        /// </summary>

-        private static void AssertReadLittleEndian32(byte[] data, uint value)

-        {

-            CodedInputStream input = new CodedInputStream(data);

-            Assert.AreEqual(value, input.ReadRawLittleEndian32());

-            Assert.IsTrue(input.IsAtEnd);

-

-            // Try different block sizes.

-            for (int blockSize = 1; blockSize <= 16; blockSize *= 2)

-            {

-                input = new CodedInputStream(

-                    new SmallBlockInputStream(data, blockSize));

-                Assert.AreEqual(value, input.ReadRawLittleEndian32());

-                Assert.IsTrue(input.IsAtEnd);

-            }

-        }

-

-        /// <summary>

-        /// Parses the given bytes using ReadRawLittleEndian64() and checks

-        /// that the result matches the given value.

-        /// </summary>

-        private static void AssertReadLittleEndian64(byte[] data, ulong value)

-        {

-            CodedInputStream input = new CodedInputStream(data);

-            Assert.AreEqual(value, input.ReadRawLittleEndian64());

-            Assert.IsTrue(input.IsAtEnd);

-

-            // Try different block sizes.

-            for (int blockSize = 1; blockSize <= 16; blockSize *= 2)

-            {

-                input = new CodedInputStream(

-                    new SmallBlockInputStream(data, blockSize));

-                Assert.AreEqual(value, input.ReadRawLittleEndian64());

-                Assert.IsTrue(input.IsAtEnd);

-            }

-        }

-

-        [Test]

-        public void ReadLittleEndian()

-        {

-            AssertReadLittleEndian32(Bytes(0x78, 0x56, 0x34, 0x12), 0x12345678);

-            AssertReadLittleEndian32(Bytes(0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef0);

-

-            AssertReadLittleEndian64(Bytes(0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12),

-                                     0x123456789abcdef0L);

-            AssertReadLittleEndian64(

-                Bytes(0x78, 0x56, 0x34, 0x12, 0xf0, 0xde, 0xbc, 0x9a), 0x9abcdef012345678UL);

-        }

-

-        [Test]

-        public void DecodeZigZag32()

-        {

-            Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(0));

-            Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(1));

-            Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(2));

-            Assert.AreEqual(-2, CodedInputStream.DecodeZigZag32(3));

-            Assert.AreEqual(0x3FFFFFFF, CodedInputStream.DecodeZigZag32(0x7FFFFFFE));

-            Assert.AreEqual(unchecked((int) 0xC0000000), CodedInputStream.DecodeZigZag32(0x7FFFFFFF));

-            Assert.AreEqual(0x7FFFFFFF, CodedInputStream.DecodeZigZag32(0xFFFFFFFE));

-            Assert.AreEqual(unchecked((int) 0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF));

-        }

-

-        [Test]

-        public void DecodeZigZag64()

-        {

-            Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(0));

-            Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(1));

-            Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(2));

-            Assert.AreEqual(-2, CodedInputStream.DecodeZigZag64(3));

-            Assert.AreEqual(0x000000003FFFFFFFL, CodedInputStream.DecodeZigZag64(0x000000007FFFFFFEL));

-            Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), CodedInputStream.DecodeZigZag64(0x000000007FFFFFFFL));

-            Assert.AreEqual(0x000000007FFFFFFFL, CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFEL));

-            Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFFL));

-            Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL));

-            Assert.AreEqual(unchecked((long) 0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL));

-        }

-        

-        [Test]

-        public void ReadWholeMessage_VaryingBlockSizes()

-        {

-            TestAllTypes message = SampleMessages.CreateFullTestAllTypes();

-

-            byte[] rawBytes = message.ToByteArray();

-            Assert.AreEqual(rawBytes.Length, message.CalculateSize());

-            TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(rawBytes);

-            Assert.AreEqual(message, message2);

-

-            // Try different block sizes.

-            for (int blockSize = 1; blockSize < 256; blockSize *= 2)

-            {

-                message2 = TestAllTypes.Parser.ParseFrom(new SmallBlockInputStream(rawBytes, blockSize));

-                Assert.AreEqual(message, message2);

-            }

-        }

-                

-        [Test]

-        public void ReadHugeBlob()

-        {

-            // Allocate and initialize a 1MB blob.

-            byte[] blob = new byte[1 << 20];

-            for (int i = 0; i < blob.Length; i++)

-            {

-                blob[i] = (byte) i;

-            }

-

-            // Make a message containing it.

-            var message = new TestAllTypes { SingleBytes = ByteString.CopyFrom(blob) };

-

-            // Serialize and parse it.  Make sure to parse from an InputStream, not

-            // directly from a ByteString, so that CodedInputStream uses buffered

-            // reading.

-            TestAllTypes message2 = TestAllTypes.Parser.ParseFrom(message.ToByteString());

-

-            Assert.AreEqual(message, message2);

-        }

-

-        [Test]

-        public void ReadMaliciouslyLargeBlob()

-        {

-            MemoryStream ms = new MemoryStream();

-            CodedOutputStream output = new CodedOutputStream(ms);

-

-            uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited);

-            output.WriteRawVarint32(tag);

-            output.WriteRawVarint32(0x7FFFFFFF);

-            output.WriteRawBytes(new byte[32]); // Pad with a few random bytes.

-            output.Flush();

-            ms.Position = 0;

-

-            CodedInputStream input = new CodedInputStream(ms);

-            Assert.AreEqual(tag, input.ReadTag());

-

-            Assert.Throws<InvalidProtocolBufferException>(() => input.ReadBytes());

-        }

-

-        internal static TestRecursiveMessage MakeRecursiveMessage(int depth)

-        {

-            if (depth == 0)

-            {

-                return new TestRecursiveMessage { I = 5 };

-            }

-            else

-            {

-                return new TestRecursiveMessage { A = MakeRecursiveMessage(depth - 1) };

-            }

-        }

-

-        internal static void AssertMessageDepth(TestRecursiveMessage message, int depth)

-        {

-            if (depth == 0)

-            {

-                Assert.IsNull(message.A);

-                Assert.AreEqual(5, message.I);

-            }

-            else

-            {

-                Assert.IsNotNull(message.A);

-                AssertMessageDepth(message.A, depth - 1);

-            }

-        }

-

-        [Test]

-        public void MaliciousRecursion()

-        {

-            ByteString data64 = MakeRecursiveMessage(64).ToByteString();

-            ByteString data65 = MakeRecursiveMessage(65).ToByteString();

-

-            AssertMessageDepth(TestRecursiveMessage.Parser.ParseFrom(data64), 64);

-

-            Assert.Throws<InvalidProtocolBufferException>(() => TestRecursiveMessage.Parser.ParseFrom(data65));

-

-            CodedInputStream input = CodedInputStream.CreateWithLimits(new MemoryStream(data64.ToByteArray()), 1000000, 63);

-            Assert.Throws<InvalidProtocolBufferException>(() => TestRecursiveMessage.Parser.ParseFrom(input));

-        }

-

-        [Test]

-        public void SizeLimit()

-        {

-            // Have to use a Stream rather than ByteString.CreateCodedInput as SizeLimit doesn't

-            // apply to the latter case.

-            MemoryStream ms = new MemoryStream(SampleMessages.CreateFullTestAllTypes().ToByteArray());

-            CodedInputStream input = CodedInputStream.CreateWithLimits(ms, 16, 100);

-            Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseFrom(input));

-        }

-

-        /// <summary>

-        /// Tests that if we read an string that contains invalid UTF-8, no exception

-        /// is thrown.  Instead, the invalid bytes are replaced with the Unicode

-        /// "replacement character" U+FFFD.

-        /// </summary>

-        [Test]

-        public void ReadInvalidUtf8()

-        {

-            MemoryStream ms = new MemoryStream();

-            CodedOutputStream output = new CodedOutputStream(ms);

-

-            uint tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited);

-            output.WriteRawVarint32(tag);

-            output.WriteRawVarint32(1);

-            output.WriteRawBytes(new byte[] {0x80});

-            output.Flush();

-            ms.Position = 0;

-

-            CodedInputStream input = new CodedInputStream(ms);

-

-            Assert.AreEqual(tag, input.ReadTag());

-            string text = input.ReadString();

-            Assert.AreEqual('\ufffd', text[0]);

-        }

-

-        /// <summary>

-        /// A stream which limits the number of bytes it reads at a time.

-        /// We use this to make sure that CodedInputStream doesn't screw up when

-        /// reading in small blocks.

-        /// </summary>

-        private sealed class SmallBlockInputStream : MemoryStream

-        {

-            private readonly int blockSize;

-

-            public SmallBlockInputStream(byte[] data, int blockSize)

-                : base(data)

-            {

-                this.blockSize = blockSize;

-            }

-

-            public override int Read(byte[] buffer, int offset, int count)

-            {

-                return base.Read(buffer, offset, Math.Min(count, blockSize));

-            }

-        }

-

-        [Test]

-        public void TestNegativeEnum()

-        {

-            byte[] bytes = { 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01 };

-            CodedInputStream input = new CodedInputStream(bytes);

-            Assert.AreEqual((int)SampleEnum.NegativeValue, input.ReadEnum());

-            Assert.IsTrue(input.IsAtEnd);

-        }

-

-        //Issue 71:	CodedInputStream.ReadBytes go to slow path unnecessarily

-        [Test]

-        public void TestSlowPathAvoidance()

-        {

-            using (var ms = new MemoryStream())

-            {

-                CodedOutputStream output = new CodedOutputStream(ms);

-                output.WriteTag(1, WireFormat.WireType.LengthDelimited);

-                output.WriteBytes(ByteString.CopyFrom(new byte[100]));

-                output.WriteTag(2, WireFormat.WireType.LengthDelimited);

-                output.WriteBytes(ByteString.CopyFrom(new byte[100]));

-                output.Flush();

-

-                ms.Position = 0;

-                CodedInputStream input = new CodedInputStream(ms, new byte[ms.Length / 2], 0, 0, false);

-

-                uint tag = input.ReadTag();

-                Assert.AreEqual(1, WireFormat.GetTagFieldNumber(tag));

-                Assert.AreEqual(100, input.ReadBytes().Length);

-

-                tag = input.ReadTag();

-                Assert.AreEqual(2, WireFormat.GetTagFieldNumber(tag));

-                Assert.AreEqual(100, input.ReadBytes().Length);

-            }

-        }

-

-        [Test]

-        public void Tag0Throws()

-        {

-            var input = new CodedInputStream(new byte[] { 0 });

-            Assert.Throws<InvalidProtocolBufferException>(() => input.ReadTag());

-        }

-

-        [Test]

-        public void SkipGroup()

-        {

-            // Create an output stream with a group in:

-            // Field 1: string "field 1"

-            // Field 2: group containing:

-            //   Field 1: fixed int32 value 100

-            //   Field 2: string "ignore me"

-            //   Field 3: nested group containing

-            //      Field 1: fixed int64 value 1000

-            // Field 3: string "field 3"

-            var stream = new MemoryStream();

-            var output = new CodedOutputStream(stream);

-            output.WriteTag(1, WireFormat.WireType.LengthDelimited);

-            output.WriteString("field 1");

-            

-            // The outer group...

-            output.WriteTag(2, WireFormat.WireType.StartGroup);

-            output.WriteTag(1, WireFormat.WireType.Fixed32);

-            output.WriteFixed32(100);

-            output.WriteTag(2, WireFormat.WireType.LengthDelimited);

-            output.WriteString("ignore me");

-            // The nested group...

-            output.WriteTag(3, WireFormat.WireType.StartGroup);

-            output.WriteTag(1, WireFormat.WireType.Fixed64);

-            output.WriteFixed64(1000);

-            // Note: Not sure the field number is relevant for end group...

-            output.WriteTag(3, WireFormat.WireType.EndGroup);

-

-            // End the outer group

-            output.WriteTag(2, WireFormat.WireType.EndGroup);

-

-            output.WriteTag(3, WireFormat.WireType.LengthDelimited);

-            output.WriteString("field 3");

-            output.Flush();

-            stream.Position = 0;

-

-            // Now act like a generated client

-            var input = new CodedInputStream(stream);

-            Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited), input.ReadTag());

-            Assert.AreEqual("field 1", input.ReadString());

-            Assert.AreEqual(WireFormat.MakeTag(2, WireFormat.WireType.StartGroup), input.ReadTag());

-            input.SkipLastField(); // Should consume the whole group, including the nested one.

-            Assert.AreEqual(WireFormat.MakeTag(3, WireFormat.WireType.LengthDelimited), input.ReadTag());

-            Assert.AreEqual("field 3", input.ReadString());

-        }

-

-        [Test]

-        public void SkipGroup_WrongEndGroupTag()

-        {

-            // Create an output stream with:

-            // Field 1: string "field 1"

-            // Start group 2

-            //   Field 3: fixed int32

-            // End group 4 (should give an error)

-            var stream = new MemoryStream();

-            var output = new CodedOutputStream(stream);

-            output.WriteTag(1, WireFormat.WireType.LengthDelimited);

-            output.WriteString("field 1");

-

-            // The outer group...

-            output.WriteTag(2, WireFormat.WireType.StartGroup);

-            output.WriteTag(3, WireFormat.WireType.Fixed32);

-            output.WriteFixed32(100);

-            output.WriteTag(4, WireFormat.WireType.EndGroup);

-            output.Flush();

-            stream.Position = 0;

-

-            // Now act like a generated client

-            var input = new CodedInputStream(stream);

-            Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited), input.ReadTag());

-            Assert.AreEqual("field 1", input.ReadString());

-            Assert.AreEqual(WireFormat.MakeTag(2, WireFormat.WireType.StartGroup), input.ReadTag());

-            Assert.Throws<InvalidProtocolBufferException>(input.SkipLastField);

-        }

-

-        [Test]

-        public void RogueEndGroupTag()

-        {

-            // If we have an end-group tag without a leading start-group tag, generated

-            // code will just call SkipLastField... so that should fail.

-

-            var stream = new MemoryStream();

-            var output = new CodedOutputStream(stream);

-            output.WriteTag(1, WireFormat.WireType.EndGroup);

-            output.Flush();

-            stream.Position = 0;

-

-            var input = new CodedInputStream(stream);

-            Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.EndGroup), input.ReadTag());

-            Assert.Throws<InvalidProtocolBufferException>(input.SkipLastField);

-        }

-

-        [Test]

-        public void EndOfStreamReachedWhileSkippingGroup()

-        {

-            var stream = new MemoryStream();

-            var output = new CodedOutputStream(stream);

-            output.WriteTag(1, WireFormat.WireType.StartGroup);

-            output.WriteTag(2, WireFormat.WireType.StartGroup);

-            output.WriteTag(2, WireFormat.WireType.EndGroup);

-

-            output.Flush();

-            stream.Position = 0;

-

-            // Now act like a generated client

-            var input = new CodedInputStream(stream);

-            input.ReadTag();

-            Assert.Throws<InvalidProtocolBufferException>(input.SkipLastField);

-        }

-

-        [Test]

-        public void RecursionLimitAppliedWhileSkippingGroup()

-        {

-            var stream = new MemoryStream();

-            var output = new CodedOutputStream(stream);

-            for (int i = 0; i < CodedInputStream.DefaultRecursionLimit + 1; i++)

-            {

-                output.WriteTag(1, WireFormat.WireType.StartGroup);

-            }

-            for (int i = 0; i < CodedInputStream.DefaultRecursionLimit + 1; i++)

-            {

-                output.WriteTag(1, WireFormat.WireType.EndGroup);

-            }

-            output.Flush();

-            stream.Position = 0;

-

-            // Now act like a generated client

-            var input = new CodedInputStream(stream);

-            Assert.AreEqual(WireFormat.MakeTag(1, WireFormat.WireType.StartGroup), input.ReadTag());

-            Assert.Throws<InvalidProtocolBufferException>(input.SkipLastField);

-        }

-

-        [Test]

-        public void Construction_Invalid()

-        {

-            Assert.Throws<ArgumentNullException>(() => new CodedInputStream((byte[]) null));

-            Assert.Throws<ArgumentNullException>(() => new CodedInputStream(null, 0, 0));

-            Assert.Throws<ArgumentNullException>(() => new CodedInputStream((Stream) null));

-            Assert.Throws<ArgumentOutOfRangeException>(() => new CodedInputStream(new byte[10], 100, 0));

-            Assert.Throws<ArgumentOutOfRangeException>(() => new CodedInputStream(new byte[10], 5, 10));

-        }

-

-        [Test]

-        public void CreateWithLimits_InvalidLimits()

-        {

-            var stream = new MemoryStream();

-            Assert.Throws<ArgumentOutOfRangeException>(() => CodedInputStream.CreateWithLimits(stream, 0, 1));

-            Assert.Throws<ArgumentOutOfRangeException>(() => CodedInputStream.CreateWithLimits(stream, 1, 0));

-        }

-

-        [Test]

-        public void Dispose_DisposesUnderlyingStream()

-        {

-            var memoryStream = new MemoryStream();

-            Assert.IsTrue(memoryStream.CanRead);

-            using (var cis = new CodedInputStream(memoryStream))

-            {

-            }

-            Assert.IsFalse(memoryStream.CanRead); // Disposed

-        }

-

-        [Test]

-        public void Dispose_WithLeaveOpen()

-        {

-            var memoryStream = new MemoryStream();

-            Assert.IsTrue(memoryStream.CanRead);

-            using (var cis = new CodedInputStream(memoryStream, true))

-            {

-            }

-            Assert.IsTrue(memoryStream.CanRead); // We left the stream open

-        }

-    }

-}
\ No newline at end of file
diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs
deleted file mode 100644
index 01bd321..0000000
--- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedOutputStreamTest.cs
+++ /dev/null
@@ -1,419 +0,0 @@
-#region Copyright notice and license

-// Protocol Buffers - Google's data interchange format

-// Copyright 2008 Google Inc.  All rights reserved.

-// https://developers.google.com/protocol-buffers/

-//

-// Redistribution and use in source and binary forms, with or without

-// modification, are permitted provided that the following conditions are

-// met:

-//

-//     * Redistributions of source code must retain the above copyright

-// notice, this list of conditions and the following disclaimer.

-//     * Redistributions in binary form must reproduce the above

-// copyright notice, this list of conditions and the following disclaimer

-// in the documentation and/or other materials provided with the

-// distribution.

-//     * Neither the name of Google Inc. nor the names of its

-// contributors may be used to endorse or promote products derived from

-// this software without specific prior written permission.

-//

-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT

-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR

-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT

-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, I