浏览代码

Make the first plugin build step build only the template encoder, as template.swift does not exist at that time.
In the second step, we then only need to build the actual plugin.

(Also removes the plugin's dependency from the template encoder, as the plugin's code does not actually depend on the template encoder.)

Daniel Alm 7 年之前
父节点
当前提交
3f7052e964
共有 2 个文件被更改,包括 3 次插入6 次删除
  1. 2 2
      Plugin/Makefile
  2. 1 4
      Plugin/Package.swift

+ 2 - 2
Plugin/Makefile

@@ -2,9 +2,9 @@
 default:	build
 
 build:  clear
-	swift build # This run is to build the template encoder
+	swift build --product TemplateEncoder
 	.build/debug/TemplateEncoder > Sources/protoc-gen-swiftgrpc/templates.swift
-	swift build # This run is to build the plugin
+	swift build --product protoc-gen-swiftgrpc
 	cp .build/debug/protoc-gen-swiftgrpc .
 	cp .build/debug/protoc-gen-swift .
 

+ 1 - 4
Plugin/Package.swift

@@ -18,10 +18,7 @@ import PackageDescription
 let package = Package(
   name: "SwiftGRPCPlugin",
   targets: [
-    Target(name: "protoc-gen-swiftgrpc",
-           dependencies: [
-            "TemplateEncoder",
-            ]),
+    Target(name: "protoc-gen-swiftgrpc"),
     Target(name: "TemplateEncoder")
   ],
   dependencies: [