Quellcode durchsuchen

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 vor 7 Jahren
Ursprung
Commit
3f7052e964
2 geänderte Dateien mit 3 neuen und 6 gelöschten Zeilen
  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: [