Browse Source

Merge pull request #140 from MrMage/test-compiling-generated-code

Make CI verify that runtime library+generated code are matching
Tim Burks 7 years ago
parent
commit
7ebd0afe4c
5 changed files with 49 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 2 0
      .travis.yml
  3. 11 0
      ExampleTests/Makefile
  4. 34 0
      ExampleTests/Package.swift
  5. 1 0
      ExampleTests/Sources/Echo

+ 1 - 0
.gitignore

@@ -8,5 +8,6 @@ Plugin/Sources/protoc-gen-swiftgrpc/templates.swift
 Plugin/protoc-*
 Plugin/swiftgrpc.log
 Plugin/echo.*.swift
+ExampleTests/Generated
 SwiftGRPC.xcodeproj
 Package.resolved

+ 2 - 0
.travis.yml

@@ -43,3 +43,5 @@ script:
   - make test
   - cd Plugin
   - make test
+  - cd ../ExampleTests
+  - make

+ 11 - 0
ExampleTests/Makefile

@@ -0,0 +1,11 @@
+
+all:
+	swift build -c release
+
+project:
+	swift package generate-xcodeproj
+
+clean :
+	rm -rf Packages googleapis .build
+	rm -f Package.pins
+	rm -rf Package.resolved ExampleTests.xcodeproj ExampleTests

+ 34 - 0
ExampleTests/Package.swift

@@ -0,0 +1,34 @@
+// swift-tools-version:4.0
+
+/*
+ * Copyright 2017, 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.
+ */
+import PackageDescription
+
+let package = Package(
+  name: "ExampleTests",
+  dependencies: [
+    .package(url: "../", .branch("HEAD")),
+    .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.0.2"),
+    .package(url: "https://github.com/kylef/Commander.git", from: "0.8.0")
+  ],
+  targets: [
+    .target(name: "Echo",
+            dependencies: [
+              "SwiftGRPC",
+              "SwiftProtobuf",
+              "Commander"
+            ])
+  ])

+ 1 - 0
ExampleTests/Sources/Echo

@@ -0,0 +1 @@
+../../Examples/Echo/PackageManager/Sources/