aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml11
-rw-r--r--BUILD4
-rw-r--r--csharp/global.json2
-rw-r--r--docs/third_party.md2
-rw-r--r--java/pom.xml4
-rw-r--r--kokoro/linux/prepare_build_linux_rc10
-rw-r--r--objectivec/GPBMessage_PackagePrivate.h6
-rw-r--r--objectivec/google/protobuf/Struct.pbobjc.m2
-rw-r--r--objectivec/google/protobuf/Type.pbobjc.m2
-rw-r--r--src/google/protobuf/compiler/objectivec/objectivec_file.cc35
10 files changed, 67 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml
index 6e34d45a..99981466 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -59,9 +59,16 @@ matrix:
env: CONFIG=csharp
language: csharp
dist: trusty
- sudo: required
- dotnet: 1.0.4
+ dotnet: 2.0.3
mono: none
+ # Install the .NET Core 1.0 runtime as that's what we test against
+ addons:
+ apt:
+ sources:
+ - sourceline: 'deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main'
+ key_url: 'https://packages.microsoft.com/keys/microsoft.asc'
+ packages:
+ - dotnet-sharedframework-microsoft.netcore.app-1.0.5
# This test is kept on travis because it doesn't play nicely with other
# tests on jenkins running in parallel.
- os: linux
diff --git a/BUILD b/BUILD
index 547181e8..2902e9e2 100644
--- a/BUILD
+++ b/BUILD
@@ -608,7 +608,7 @@ java_library(
]) + [
":gen_well_known_protos_java",
],
- javacopts = ["-source 6", "-target 6"],
+ javacopts = ["-source 7", "-target 7"],
visibility = ["//visibility:public"],
)
@@ -617,7 +617,7 @@ java_library(
srcs = glob([
"java/util/src/main/java/com/google/protobuf/util/*.java",
]),
- javacopts = ["-source 6", "-target 6"],
+ javacopts = ["-source 7", "-target 7"],
visibility = ["//visibility:public"],
deps = [
"protobuf_java",
diff --git a/csharp/global.json b/csharp/global.json
index 3622b564..5ab775b9 100644
--- a/csharp/global.json
+++ b/csharp/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "1.0.0"
+ "version": "2.0.3"
}
}
diff --git a/docs/third_party.md b/docs/third_party.md
index 1a22e7f9..86b534da 100644
--- a/docs/third_party.md
+++ b/docs/third_party.md
@@ -45,6 +45,7 @@ These are projects we know about implementing Protocol Buffers for other program
* GopherJS: https://github.com/johanbrandhorst/protobuf
* Haskell: http://hackage.haskell.org/package/hprotoc
* Haskell: https://github.com/google/proto-lens (Google-unofficial implementation)
+* Haskell: https://github.com/awakesecurity/proto3-suite (code generator) https://github.com/awakesecurity/proto3-wire (binary serializer/deserializer)
* Haxe: https://github.com/Atry/protoc-gen-haxe
* Java: https://github.com/google/protobuf (Google-official implementation)
* Java/Android: https://github.com/square/wire
@@ -122,6 +123,7 @@ GRPC (http://www.grpc.io/) is Google's RPC implementation for Protocol Buffers.
* https://github.com/SeriousMa/grpc-protobuf-validation (Java)
* https://github.com/tony612/grpc-elixir (Elixir)
* https://github.com/johanbrandhorst/protobuf (GopherJS)
+* https://github.com/awakesecurity/gRPC-haskell (Haskell)
## Other Utilities
diff --git a/java/pom.xml b/java/pom.xml
index 6e339d7f..b7c3e485 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -96,8 +96,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
</plugin>
<plugin>
diff --git a/kokoro/linux/prepare_build_linux_rc b/kokoro/linux/prepare_build_linux_rc
index 4c3f255d..f64ea952 100644
--- a/kokoro/linux/prepare_build_linux_rc
+++ b/kokoro/linux/prepare_build_linux_rc
@@ -3,7 +3,11 @@
# Source this rc script to prepare the environment for Linux builds
# Set up dotnet
-sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
-sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
+sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
+sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF
sudo apt-get update
-sudo apt-get install -y dotnet-dev-1.0.4
+# We use the .NET Core SDK 2.x to build...
+sudo apt-get install -y dotnet-sdk-2.0.3
+# But we also need the 1.x framework to test against, as we
+# target netstandard1.x
+sudo apt-get install -y dotnet-sharedframework-microsoft.netcore.app-1.0.5
diff --git a/objectivec/GPBMessage_PackagePrivate.h b/objectivec/GPBMessage_PackagePrivate.h
index c5501c85..366e5bbf 100644
--- a/objectivec/GPBMessage_PackagePrivate.h
+++ b/objectivec/GPBMessage_PackagePrivate.h
@@ -34,7 +34,11 @@
#import "GPBMessage.h"
-#import <stdatomic.h>
+// TODO: Remove this import. Older generated code use the OSAtomic* apis,
+// so anyone that hasn't regenerated says building by having this. After
+// enough time has passed, this likely can be removed as folks should have
+// regenerated.
+#import <libkern/OSAtomic.h>
#import "GPBBootstrap.h"
diff --git a/objectivec/google/protobuf/Struct.pbobjc.m b/objectivec/google/protobuf/Struct.pbobjc.m
index dff2f844..6d9d7b75 100644
--- a/objectivec/google/protobuf/Struct.pbobjc.m
+++ b/objectivec/google/protobuf/Struct.pbobjc.m
@@ -13,6 +13,8 @@
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
+#import <stdatomic.h>
+
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Struct.pbobjc.h>
#else
diff --git a/objectivec/google/protobuf/Type.pbobjc.m b/objectivec/google/protobuf/Type.pbobjc.m
index 06795308..981ae4d4 100644
--- a/objectivec/google/protobuf/Type.pbobjc.m
+++ b/objectivec/google/protobuf/Type.pbobjc.m
@@ -13,6 +13,8 @@
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
+#import <stdatomic.h>
+
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Type.pbobjc.h>
#import <Protobuf/Any.pbobjc.h>
diff --git a/src/google/protobuf/compiler/objectivec/objectivec_file.cc b/src/google/protobuf/compiler/objectivec/objectivec_file.cc
index 954b2688..a249c71b 100644
--- a/src/google/protobuf/compiler/objectivec/objectivec_file.cc
+++ b/src/google/protobuf/compiler/objectivec/objectivec_file.cc
@@ -56,6 +56,20 @@ const int32 GOOGLE_PROTOBUF_OBJC_VERSION = 30002;
const char* kHeaderExtension = ".pbobjc.h";
+// Checks if a message contains any enums definitions (on the message or
+// a nested message under it).
+bool MessageContainsEnums(const Descriptor* message) {
+ if (message->enum_type_count() > 0) {
+ return true;
+ }
+ for (int i = 0; i < message->nested_type_count(); i++) {
+ if (MessageContainsEnums(message->nested_type(i))) {
+ return true;
+ }
+ }
+ return false;
+}
+
// Checks if a message contains any extension definitions (on the message or
// a nested message under it).
bool MessageContainsExtensions(const Descriptor* message) {
@@ -70,6 +84,20 @@ bool MessageContainsExtensions(const Descriptor* message) {
return false;
}
+// Checks if the file contains any enum definitions (at the root or
+// nested under a message).
+bool FileContainsEnums(const FileDescriptor* file) {
+ if (file->enum_type_count() > 0) {
+ return true;
+ }
+ for (int i = 0; i < file->message_type_count(); i++) {
+ if (MessageContainsEnums(file->message_type(i))) {
+ return true;
+ }
+ }
+ return false;
+}
+
// Checks if the file contains any extensions definitions (at the root or
// nested under a message).
bool FileContainsExtensions(const FileDescriptor* file) {
@@ -311,6 +339,13 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
// #import the runtime support.
PrintFileRuntimePreamble(printer, "GPBProtocolBuffers_RuntimeSupport.h");
+ // Enums use atomic in the generated code, so add the system import as needed.
+ if (FileContainsEnums(file_)) {
+ printer->Print(
+ "#import <stdatomic.h>\n"
+ "\n");
+ }
+
vector<const FileDescriptor*> deps_with_extensions;
CollectMinimalFileDepsContainingExtensions(file_, &deps_with_extensions);