-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-codesign-flags.rb
More file actions
24 lines (19 loc) · 1.01 KB
/
Copy pathfix-codesign-flags.rb
File metadata and controls
24 lines (19 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env ruby
# Make codesign flags self-contained in the project so build.sh no longer needs to
# pass OTHER_CODE_SIGN_FLAGS on the command line (which clobbers per-target flags).
# The helper needs an explicit --identifier because codesign strips the ".helper"
# suffix from the executable name and would otherwise reuse the app's identifier.
require 'xcodeproj'
project_path = File.expand_path('../../Modafinil.xcodeproj', __FILE__)
project = Xcodeproj::Project.open(project_path)
app = project.targets.find { |t| t.name == 'Modafinil' } or abort 'app target missing'
helper = project.targets.find { |t| t.name == 'ModafinilHelper' } or abort 'helper target missing'
app.build_configurations.each do |c|
c.build_settings['OTHER_CODE_SIGN_FLAGS'] = '$(inherited) --timestamp'
end
helper.build_configurations.each do |c|
c.build_settings['OTHER_CODE_SIGN_FLAGS'] =
'$(inherited) --timestamp --identifier com.gigaptera.modafinil.helper'
end
project.save
puts 'Set OTHER_CODE_SIGN_FLAGS on both targets'