Skip to content

Commit 02f8fc4

Browse files
authored
Remove support for XIBs on desktop Mac targets. (flutter#124)
1 parent e8854a2 commit 02f8fc4

File tree

1 file changed

+24
-67
lines changed

1 file changed

+24
-67
lines changed

build/config/mac/rules.gni

+24-67
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ mac_app_script = "//build/config/mac/mac_app.py"
77
template("code_sign_mac") {
88
assert(defined(invoker.entitlements_path),
99
"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")
1412
assert(defined(invoker.deps))
1513

1614
action(target_name) {
@@ -23,7 +21,7 @@ template("code_sign_mac") {
2321
script = mac_app_script
2422

2523
outputs = [
26-
"$_application_path/_CodeSignature/CodeResources"
24+
"$_application_path/_CodeSignature/CodeResources",
2725
]
2826

2927
args = [
@@ -40,44 +38,12 @@ template("code_sign_mac") {
4038
}
4139
}
4240

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-
7441
template("resource_copy_mac") {
7542
assert(defined(invoker.resources),
7643
"The source list of resources to copy over")
7744
assert(defined(invoker.bundle_directory),
7845
"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")
8147

8248
_bundle_directory = invoker.bundle_directory
8349
_app_name = invoker.app_name
@@ -86,7 +52,9 @@ template("resource_copy_mac") {
8652
copy(target_name) {
8753
set_sources_assignment_filter([])
8854
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+
]
9058

9159
if (defined(invoker.deps)) {
9260
deps = invoker.deps
@@ -95,19 +63,12 @@ template("resource_copy_mac") {
9563
}
9664

9765
template("mac_app") {
98-
9966
assert(defined(invoker.deps),
10067
"Dependencies must be specified for $target_name")
10168
assert(defined(invoker.info_plist),
10269
"The application plist file must be specified for $target_name")
10370
assert(defined(invoker.app_name),
10471
"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")
11172

11273
# We just create a variable so we can use the same in interpolation
11374
app_name = invoker.app_name
@@ -117,20 +78,20 @@ template("mac_app") {
11778
struct_gen_target_name = target_name + "_struct"
11879

11980
action(struct_gen_target_name) {
120-
12181
script = mac_app_script
12282

12383
sources = []
124-
outputs = [ "$root_build_dir/$app_name.app" ]
84+
outputs = [
85+
"$root_build_dir/$app_name.app",
86+
]
12587

12688
args = [
12789
"structure",
12890
"-d",
12991
rebase_path(root_build_dir),
13092
"-n",
131-
app_name
93+
app_name,
13294
]
133-
13495
}
13596

13697
# Generate the executable
@@ -147,11 +108,14 @@ template("mac_app") {
147108
plist_gen_target_name = target_name + "_plist"
148109

149110
action(plist_gen_target_name) {
150-
151111
script = mac_app_script
152112

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+
]
155119

156120
args = [
157121
"plist",
@@ -171,7 +135,7 @@ template("mac_app") {
171135
]
172136

173137
outputs = [
174-
"$root_build_dir/$app_name.app/Contents/{{source_file_part}}"
138+
"$root_build_dir/$app_name.app/Contents/{{source_file_part}}",
175139
]
176140

177141
deps = [
@@ -186,35 +150,28 @@ template("mac_app") {
186150
]
187151

188152
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}}",
190154
]
191155

192156
deps = [
193157
":$bin_gen_target_name",
194158
]
195159
}
196160

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-
204161
copy_all_target_name = target_name + "_all_copy"
205162
group(copy_all_target_name) {
206163
deps = [
207-
":$struct_gen_target_name",
208-
":$copy_plist_gen_target_name",
209164
":$copy_bin_target_name",
210-
":$copy_xib_target_name",
165+
":$copy_plist_gen_target_name",
166+
":$struct_gen_target_name",
211167
]
212168
}
213169

214170
# Top level group
215171

216172
group(target_name) {
217-
deps = [ ":$copy_all_target_name" ]
173+
deps = [
174+
":$copy_all_target_name",
175+
]
218176
}
219-
220177
}

0 commit comments

Comments
 (0)