-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add make target generating an xcodeproj for Carthage.
An xcodeproj needs to be present in the repo for Carthage to work. Only 4 frameworks are enabled for Carthage builds: - BoringSSL - CgRPC - SwiftGRPC - SwiftProtobuf The other targets are removed from SwiftGRPC-Carthage.xcodeproj. Moreover, a prebuild script is added to the build phases of the cartage xcodeproj file in order to download the dependencies required by Package.swift. The Carthage-compatible xcodeproj can be generated with the following: $ make project-carthage
- Loading branch information
1 parent
d8b2b51
commit ea2babf
Showing
5 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'xcodeproj' | ||
project_path = './SwiftGRPC-Carthage.xcodeproj' | ||
project = Xcodeproj::Project.open(project_path) | ||
|
||
swift_protobuf_target = project.targets.select { |target| target.name == "SwiftProtobuf" }[0] | ||
swift_protobuf_build_phases = swift_protobuf_target.build_phases | ||
|
||
swift_protobuf_target.new_shell_script_build_phase | ||
|
||
new_script_phase = swift_protobuf_build_phases.pop | ||
new_script_phase.shell_script = "swift package resolve" | ||
|
||
swift_protobuf_build_phases.unshift(new_script_phase) | ||
|
||
project.save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'xcodeproj' | ||
project_path = ARGV[0] | ||
project = Xcodeproj::Project.open(project_path) | ||
|
||
carthage_targets = ["BoringSSL", "CgRPC", "SwiftGRPC", "SwiftProtobuf"] | ||
targets_to_remove = [] | ||
|
||
project.targets.each do |target| | ||
if !carthage_targets.include?(target.name) | ||
targets_to_remove << target | ||
else | ||
puts target.name | ||
target.build_configurations.each do |config| | ||
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "9.0" | ||
end | ||
end | ||
end | ||
|
||
targets_to_remove.each do |target| | ||
target.remove_from_project | ||
end | ||
|
||
project.save |