Browse Source

Create new HTTP2 transport modules (#1757)

Gustavo Cairo 1 year ago
parent
commit
da5a236bb3

+ 54 - 1
Package.swift

@@ -134,6 +134,9 @@ extension Target.Dependency {
 
   static let grpcCore: Self = .target(name: "GRPCCore")
   static let grpcInProcessTransport: Self = .target(name: "GRPCInProcessTransport")
+  static let grpcHTTP2Core: Self = .target(name: "GRPCHTTP2Core")
+  static let grpcHTTP2TransportNIOPosix: Self = .target(name: "GRPCHTTP2TransportNIOPosix")
+  static let grpcHTTP2TransportNIOTransportServices: Self = .target(name: "GRPCHTTP2TransportNIOTransportServices")
 }
 
 // MARK: - Targets
@@ -177,6 +180,29 @@ extension Target {
       .grpcCore
     ]
   )
+  
+  static let grpcHTTP2Core: Target = .target(
+    name: "GRPCHTTP2Core",
+    dependencies: [
+      .grpcCore,
+      .nioCore,
+      .nioHTTP2
+    ]
+  )
+  
+  static let grpcHTTP2TransportNIOPosix: Target = .target(
+    name: "GRPCHTTP2TransportNIOPosix",
+    dependencies: [
+      .grpcHTTP2Core
+    ]
+  )
+  
+  static let grpcHTTP2TransportNIOTransportServices: Target = .target(
+    name: "GRPCHTTP2TransportNIOTransportServices",
+    dependencies: [
+      .grpcHTTP2Core
+    ]
+  )
 
   static let cgrpcZlib: Target = .target(
     name: cgrpcZlibTargetName,
@@ -251,6 +277,27 @@ extension Target {
       .grpcInProcessTransport,
     ]
   )
+  
+  static let grpcHTTP2CoreTests: Target = .testTarget(
+    name: "GRPCHTTP2CoreTests",
+    dependencies: [
+      .grpcHTTP2Core
+    ]
+  )
+  
+  static let grpcHTTP2TransportNIOPosixTests: Target = .testTarget(
+    name: "GRPCHTTP2TransportNIOPosixTests",
+    dependencies: [
+      .grpcHTTP2TransportNIOPosix
+    ]
+  )
+  
+  static let grpcHTTP2TransportNIOTransportServicesTests: Target = .testTarget(
+    name: "GRPCHTTP2TransportNIOTransportServicesTests",
+    dependencies: [
+      .grpcHTTP2TransportNIOTransportServices
+    ]
+  )
 
   static let grpcCodeGenTests: Target = .testTarget(
     name: "GRPCCodeGenTests",
@@ -591,11 +638,17 @@ let package = Package(
     .grpcCore,
     .grpcInProcessTransport,
     .grpcCodeGen,
+    .grpcHTTP2Core,
+    .grpcHTTP2TransportNIOPosix,
+    .grpcHTTP2TransportNIOTransportServices,
 
     // v2 tests
     .grpcCoreTests,
     .grpcInProcessTransportTests,
-    .grpcCodeGenTests
+    .grpcCodeGenTests,
+    .grpcHTTP2CoreTests,
+    .grpcHTTP2TransportNIOPosixTests,
+    .grpcHTTP2TransportNIOTransportServicesTests
   ]
 )
 

+ 1 - 0
Sources/GRPCHTTP2Core/README.md

@@ -0,0 +1 @@
+# gRPC HTTP2 Core

+ 1 - 0
Sources/GRPCHTTP2TransportNIOPosix/README.md

@@ -0,0 +1 @@
+# gRPC HTTP2 Transport NIO POSIX

+ 1 - 0
Sources/GRPCHTTP2TransportNIOTransportServices/README.md

@@ -0,0 +1 @@
+# gRPC HTTP2 Transport NIO Transport Services

+ 17 - 0
Tests/GRPCHTTP2CoreTests/GRPCHTTP2CoreTests.swift

@@ -0,0 +1,17 @@
+/*
+ * Copyright 2024, gRPC Authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Add tests to this package.

+ 17 - 0
Tests/GRPCHTTP2TransportNIOPosixTests/GRPCHTTP2TransportNIOPosixTests.swift

@@ -0,0 +1,17 @@
+/*
+ * Copyright 2024, gRPC Authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Add tests to this package.

+ 17 - 0
Tests/GRPCHTTP2TransportNIOTransportServicesTests/GRPCHTTP2TransportNIOTransportServicesTests.swift

@@ -0,0 +1,17 @@
+/*
+ * Copyright 2024, gRPC Authors All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Add tests to this package.