Jelajahi Sumber

Fix building with a clean Xcode and add a CI run to ensure just that.

Daniel Alm 7 tahun lalu
induk
melakukan
56ecb721c1
3 mengubah file dengan 8 tambahan dan 3 penghapusan
  1. 1 0
      .gitignore
  2. 1 0
      .travis.yml
  3. 6 3
      Makefile

+ 1 - 0
.gitignore

@@ -3,6 +3,7 @@ project.xcworkspace
 xcuserdata
 DerivedData/
 .build
+build
 /protoc-gen-swift
 /protoc-gen-swiftgrpc
 third_party/**

+ 1 - 0
.travis.yml

@@ -57,3 +57,4 @@ script:
   - make test
   - make test-plugin
   - make test-echo
+  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make xcodebuild; fi

+ 6 - 3
Makefile

@@ -2,7 +2,7 @@ UNAME_S = $(shell uname -s)
 
 ifeq ($(UNAME_S),Linux)
 else
-  CFLAGS = -Xcc -ISources/BoringSSL/include
+  CFLAGS = -Xcc -ISources/BoringSSL/include -Xlinker -lz
 endif
 
 all:
@@ -11,7 +11,7 @@ all:
 	cp .build/debug/protoc-gen-swiftgrpc .
 	
 project:
-	swift package generate-xcodeproj
+	swift package -v $(CFLAGS) generate-xcodeproj
 	@-ruby fix-project-settings.rb || echo "Consider running 'sudo gem install xcodeproj' to automatically set correct indentation settings for the generated project."
 
 test:	all
@@ -32,9 +32,12 @@ test-plugin:
 	protoc Sources/Examples/Echo/echo.proto --proto_path=Sources/Examples/Echo --plugin=.build/debug/protoc-gen-swift --plugin=.build/debug/protoc-gen-swiftgrpc --swiftgrpc_out=/tmp --swiftgrpc_opt=TestStubs=true
 	diff -u /tmp/echo.grpc.swift Sources/Examples/Echo/Generated/echo.grpc.swift
 
+xcodebuild: project
+		xcodebuild -configuration "Debug" -parallelizeTargets -target SwiftGRPC -target Echo -target Simple -target protoc-gen-swiftgrpc build
+
 clean:
 	rm -rf Packages
-	rm -rf .build
+	rm -rf .build build
 	rm -rf SwiftGRPC.xcodeproj
 	rm -rf Package.pins Package.resolved
 	rm -rf protoc-gen-swift protoc-gen-swiftgrpc