Cleanup build scripts

This commit is contained in:
Christian Treffs 2018-09-27 21:10:14 +02:00
parent 664d208284
commit d0ec57991c
2 changed files with 13 additions and 10 deletions

View File

@ -11,7 +11,12 @@ bundle install
swift package update
# generate project
swift package generate-xcodeproj --enable-code-coverage #--xcconfig-overrides settings.xcconfig
# --enable-code-coverage Enable code coverage in the generated project
# --legacy-scheme-generator Use the legacy scheme generator
# --output Path where the Xcode project should be generated
# --watch Watch for changes to the Package manifest to regenerate the Xcode project
# --xcconfig-overrides Path to xcconfig file
swift package generate-xcodeproj --enable-code-coverage
# add project specialities
bundle exec ./prepareXcodeProject.rb

View File

@ -8,19 +8,17 @@ project = Xcodeproj::Project.open(path_to_project)
# add build phases
project.targets.each do |target|
puts "Add Run Shell Script Phase: Swiftlint to #{target}"
swiftlint_phase = target.new_shell_script_build_phase("Run Swiftlint")
swiftlint_phase.shell_script = """
set -e
puts "Add Run Shell Script Phase: Swiftlint to #{target}"
swiftlint_phase = target.new_shell_script_build_phase('Run Swiftlint')
swiftlint_phase.shell_script = 'set -eu
if which swiftlint >/dev/null; then
swiftlint autocorrect
swiftlint
else
echo 'warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint'
echo \'warning: SwiftLint not installed,
download from https://github.com/realm/SwiftLint\'
fi
"""
'
end
project.save()
project.save