@@ -7,10 +7,8 @@ mac_app_script = "//build/config/mac/mac_app.py"
7
7
template (" code_sign_mac" ) {
8
8
assert (defined (invoker .entitlements_path ),
9
9
" The path to the entitlements .xcent file" )
10
- assert (defined (invoker .identity ),
11
- " The code signing identity" )
12
- assert (defined (invoker .application_path ),
13
- " The application to code sign" )
10
+ assert (defined (invoker .identity ), " The code signing identity" )
11
+ assert (defined (invoker .application_path ), " The application to code sign" )
14
12
assert (defined (invoker .deps ))
15
13
16
14
action (target_name ) {
@@ -23,7 +21,7 @@ template("code_sign_mac") {
23
21
script = mac_app_script
24
22
25
23
outputs = [
26
- " $_application_path /_CodeSignature/CodeResources"
24
+ " $_application_path /_CodeSignature/CodeResources" ,
27
25
]
28
26
29
27
args = [
@@ -40,44 +38,12 @@ template("code_sign_mac") {
40
38
}
41
39
}
42
40
43
- template (" process_nibs_mac" ) {
44
- assert (defined (invoker .sources ),
45
- " The nib sources must be specified" )
46
- assert (defined (invoker .module ),
47
- " The nib module must be specified" )
48
- assert (defined (invoker .output_dir ),
49
- " The output directory must be specified" )
50
-
51
- action_foreach (target_name ) {
52
- sources = invoker .sources
53
-
54
- script = mac_app_script
55
-
56
- invoker_out_dir = invoker .output_dir
57
-
58
- outputs = [
59
- " $root_build_dir /$invoker_out_dir /{{source_name_part}}.nib"
60
- ]
61
-
62
- args = [
63
- " nib" ,
64
- " -i" ,
65
- " {{source}}" ,
66
- " -o" ,
67
- rebase_path (" $root_build_dir /$invoker_out_dir " ),
68
- " -m" ,
69
- invoker .module ,
70
- ]
71
- }
72
- }
73
-
74
41
template (" resource_copy_mac" ) {
75
42
assert (defined (invoker .resources ),
76
43
" The source list of resources to copy over" )
77
44
assert (defined (invoker .bundle_directory ),
78
45
" The directory within the bundle to place the sources in" )
79
- assert (defined (invoker .app_name ),
80
- " The name of the application" )
46
+ assert (defined (invoker .app_name ), " The name of the application" )
81
47
82
48
_bundle_directory = invoker .bundle_directory
83
49
_app_name = invoker .app_name
@@ -86,7 +52,9 @@ template("resource_copy_mac") {
86
52
copy (target_name ) {
87
53
set_sources_assignment_filter ([])
88
54
sources = _resources
89
- outputs = [ " $root_build_dir /$_app_name .app/$_bundle_directory /Contents/Resources/{{source_file_part}}" ]
55
+ outputs = [
56
+ " $root_build_dir /$_app_name .app/$_bundle_directory /Contents/Resources/{{source_file_part}}" ,
57
+ ]
90
58
91
59
if (defined (invoker .deps )) {
92
60
deps = invoker .deps
@@ -95,19 +63,12 @@ template("resource_copy_mac") {
95
63
}
96
64
97
65
template (" mac_app" ) {
98
-
99
66
assert (defined (invoker .deps ),
100
67
" Dependencies must be specified for $target_name " )
101
68
assert (defined (invoker .info_plist ),
102
69
" The application plist file must be specified for $target_name " )
103
70
assert (defined (invoker .app_name ),
104
71
" The name of Mac application for $target_name " )
105
- assert (defined (invoker .xibs ),
106
- " The list of XIB files must be specified for $target_name " )
107
- # assert(defined(invoker.entitlements_path),
108
- # "The entitlements path must be specified for $target_name")
109
- # assert(defined(invoker.code_signing_identity),
110
- # "The entitlements path must be specified for $target_name")
111
72
112
73
# We just create a variable so we can use the same in interpolation
113
74
app_name = invoker .app_name
@@ -117,20 +78,20 @@ template("mac_app") {
117
78
struct_gen_target_name = target_name + " _struct"
118
79
119
80
action (struct_gen_target_name ) {
120
-
121
81
script = mac_app_script
122
82
123
83
sources = []
124
- outputs = [ " $root_build_dir /$app_name .app" ]
84
+ outputs = [
85
+ " $root_build_dir /$app_name .app" ,
86
+ ]
125
87
126
88
args = [
127
89
" structure" ,
128
90
" -d" ,
129
91
rebase_path (root_build_dir ),
130
92
" -n" ,
131
- app_name
93
+ app_name ,
132
94
]
133
-
134
95
}
135
96
136
97
# Generate the executable
@@ -147,11 +108,14 @@ template("mac_app") {
147
108
plist_gen_target_name = target_name + " _plist"
148
109
149
110
action (plist_gen_target_name ) {
150
-
151
111
script = mac_app_script
152
112
153
- sources = [ invoker .info_plist ]
154
- outputs = [ " $root_build_dir /plist/$app_name /Info.plist" ]
113
+ sources = [
114
+ invoker .info_plist ,
115
+ ]
116
+ outputs = [
117
+ " $root_build_dir /plist/$app_name /Info.plist" ,
118
+ ]
155
119
156
120
args = [
157
121
" plist" ,
@@ -171,7 +135,7 @@ template("mac_app") {
171
135
]
172
136
173
137
outputs = [
174
- " $root_build_dir /$app_name .app/Contents/{{source_file_part}}"
138
+ " $root_build_dir /$app_name .app/Contents/{{source_file_part}}" ,
175
139
]
176
140
177
141
deps = [
@@ -186,35 +150,28 @@ template("mac_app") {
186
150
]
187
151
188
152
outputs = [
189
- " $root_build_dir /$app_name .app/Contents/MacOS/{{source_file_part}}"
153
+ " $root_build_dir /$app_name .app/Contents/MacOS/{{source_file_part}}" ,
190
154
]
191
155
192
156
deps = [
193
157
" :$bin_gen_target_name " ,
194
158
]
195
159
}
196
160
197
- copy_xib_target_name = target_name + " _xib_copy"
198
- process_nibs_mac (copy_xib_target_name ) {
199
- sources = invoker .xibs
200
- module = app_name
201
- output_dir = " $app_name .app/Contents/Resources"
202
- }
203
-
204
161
copy_all_target_name = target_name + " _all_copy"
205
162
group (copy_all_target_name ) {
206
163
deps = [
207
- " :$struct_gen_target_name " ,
208
- " :$copy_plist_gen_target_name " ,
209
164
" :$copy_bin_target_name " ,
210
- " :$copy_xib_target_name " ,
165
+ " :$copy_plist_gen_target_name " ,
166
+ " :$struct_gen_target_name " ,
211
167
]
212
168
}
213
169
214
170
# Top level group
215
171
216
172
group (target_name ) {
217
- deps = [ " :$copy_all_target_name " ]
173
+ deps = [
174
+ " :$copy_all_target_name " ,
175
+ ]
218
176
}
219
-
220
177
}
0 commit comments