Last active
April 15, 2021 14:06
-
-
Save siemensikkema/57ef1ce3340e32b72dc59e44bc37b477 to your computer and use it in GitHub Desktop.
Post processing script for generated vapor Xcode project
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
#!/usr/bin/env ruby | |
require 'xcodeproj' | |
project_path = ARGV[0] | |
project = Xcodeproj::Project.open(project_path) | |
project.targets.each do |target| | |
# suppress warnings | |
if [ | |
"Configs", | |
"Console", | |
"CSQLite", | |
"FluentTester", | |
"FrameAddress", | |
"Meta", | |
"MySQL", | |
"MySQLDriver", | |
"MySQLProvider", | |
"Sockets", | |
"SQLite", | |
"Sugar", | |
"Validation", | |
"Vapor" | |
].include? target.name | |
target.build_configurations.each do |config| | |
config.build_settings['SWIFT_SUPPRESS_WARNINGS'] = 'YES' | |
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES' | |
end | |
end | |
end | |
project.save() |
A great script, thanks a lot!
My minor change to this is for line 5:
project_path = ARGV[0] || Dir.glob("./*.xcodeproj")[0]
This helps to run it without passing xcodeproj
name (but in this case, it's probably a good idea to have just one project in a folder - which is exactly my case)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires: xcodeproj
$ [sudo] gem install xcodeproj
Nice to haves: