Skip to content

Remove fix-project-settings.rb references from Makefile #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ project: ${XCODEPROJ}

${XCODEPROJ}:
${SWIFT_PACKAGE} generate-xcodeproj --output $@
@-ruby fix-project-settings.rb GRPC.xcodeproj || \
@-ruby scripts/fix-project-settings.rb GRPC.xcodeproj || \
echo "Consider running 'sudo gem install xcodeproj' to automatically set correct indentation settings for the generated project."

# Generates LinuxMain.swift, only on macOS.
Expand Down
26 changes: 26 additions & 0 deletions scripts/fix-project-settings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require 'xcodeproj'
project_path = ARGV[0]
project = Xcodeproj::Project.open(project_path)

# Fix indentation settings.
project.main_group.uses_tabs = '0'
project.main_group.tab_width = '2'
project.main_group.indent_width = '2'

# Set the `CURRENT_PROJECT_VERSION` variable for each config to ensure
# that the generated frameworks pass App Store validation (#291).
project.build_configurations.each do |config|
config.build_settings["CURRENT_PROJECT_VERSION"] = "1.0"
end

# Set each target's iOS deployment target to 10.0
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "10.0"
if config.build_settings["PRODUCT_BUNDLE_IDENTIFIER"] then
config.build_settings["PRODUCT_BUNDLE_IDENTIFIER"] = "io.grpc." + config.build_settings["PRODUCT_BUNDLE_IDENTIFIER"]
end
end
end

project.save