File tree Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,10 @@ def codesign(platform)
86
86
builder . codesign ( config , platform )
87
87
end
88
88
89
+ def codesign_framework ( framework )
90
+ builder . codesign_framework ( framework , config )
91
+ end
92
+
89
93
def profile ( platform , config_plist )
90
94
builder . profile ( config , platform , config_plist )
91
95
end
Original file line number Diff line number Diff line change 39
39
desc "Build the project for development"
40
40
task :development do
41
41
App . build ( 'MacOSX' )
42
- App . codesign ( 'MacOSX' ) if App . config_without_setup . codesign_for_development
42
+ if App . config_without_setup . codesign_for_development
43
+ App . config . codesign_frameworks . each do |e |
44
+ App . codesign_framework ( e )
45
+ end
46
+ App . codesign ( 'MacOSX' )
47
+ end
43
48
end
44
49
45
50
desc "Build the project for release"
46
51
task :release do
47
52
App . config_without_setup . build_mode = :release
48
53
App . build ( 'MacOSX' )
49
- App . codesign ( 'MacOSX' ) if App . config_without_setup . codesign_for_release
54
+ if App . config_without_setup . codesign_for_release
55
+ App . config . codesign_frameworks . each do |e |
56
+ App . codesign_framework ( e )
57
+ end
58
+ App . codesign ( 'MacOSX' )
59
+ end
50
60
end
51
61
end
52
62
Original file line number Diff line number Diff line change @@ -52,5 +52,15 @@ def codesign(config, platform)
52
52
sh "/usr/bin/codesign --force --sign \" #{ config . codesign_certificate } \" --entitlements \" #{ entitlements } \" \" #{ app_bundle } \" "
53
53
end
54
54
end
55
+
56
+ def codesign_framework ( framework , config )
57
+ app_bundle = config . app_bundle_raw ( 'MacOSX' )
58
+ path = "#{ app_bundle } /Contents/Frameworks/#{ framework } /Versions/A"
59
+ if File . mtime ( config . project_file ) > File . mtime ( path ) \
60
+ or !system ( "/usr/bin/codesign --verify \" #{ path } \" >& /dev/null" )
61
+ App . info 'Codesign' , path
62
+ sh "/usr/bin/codesign --force --sign \" #{ config . codesign_certificate } \" \" #{ path } \" "
63
+ end
64
+ end
55
65
end
56
66
end ; end
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class OSXConfig < XcodeConfig
33
33
variable :icon , :copyright , :category ,
34
34
:embedded_frameworks , :external_frameworks ,
35
35
:codesign_for_development , :codesign_for_release ,
36
- :eval_support
36
+ :eval_support , :codesign_frameworks
37
37
38
38
def initialize ( project_dir , build_mode )
39
39
super
@@ -43,6 +43,7 @@ def initialize(project_dir, build_mode)
43
43
@frameworks = [ 'AppKit' , 'Foundation' , 'CoreGraphics' , 'CoreServices' ]
44
44
@codesign_for_development = false
45
45
@codesign_for_release = true
46
+ @codesign_frameworks = [ ]
46
47
@eval_support = false
47
48
end
48
49
You can’t perform that action at this time.
0 commit comments