ninja/mac: Don't write an empty binary into sourceless bundles.

I fixed this issue once in but added
the test in the wrong way so that it's not run automatically, and broke that again.

Rename the test from .gyp to .py to make sure the bots run it, so that it
doesn't break again.


Review URL:

git-svn-id: 78cadc50-ecff-11dd-a971-7dbc132099af
diff --git a/pylib/gyp/generator/ b/pylib/gyp/generator/
index 4574375..8074136 100644
--- a/pylib/gyp/generator/
+++ b/pylib/gyp/generator/
@@ -474,15 +474,17 @@
     # Write out a link step, if needed.
     output = None
+    is_empty_bundle = True
     if link_deps or or actions_depends:
       output = self.WriteTarget(spec, config_name, config, link_deps,
                        or actions_depends)
       if self.is_mac_bundle:
+        is_empty_bundle = not link_deps and not mac_bundle_depends
     # Bundle all of the above together, if needed.
     if self.is_mac_bundle:
-      output = self.WriteMacBundle(spec, mac_bundle_depends)
+      output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle)
     if not output:
       return None
@@ -1071,7 +1073,7 @@
     return linked_binary
   def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
-    if spec['type'] == 'none':
+    if spec['type'] == 'none' or not link_deps:
       # TODO(evan): don't call this function for 'none' target types, as
       # it doesn't do anything, and we fake out a 'binary' with a stamp file. = compile_deps
@@ -1117,14 +1119,16 @@ = self.WriteLink(spec, config_name, config, link_deps)
-  def WriteMacBundle(self, spec, mac_bundle_depends):
+  def WriteMacBundle(self, spec, mac_bundle_depends, is_empty):
     assert self.is_mac_bundle
     package_framework = spec['type'] in ('shared_library', 'loadable_module')
     output = self.ComputeMacBundleOutput()
+    if is_empty:
+      output += '.stamp'
     variables = []
     self.AppendPostbuildVariable(variables, spec, output,,
                                  is_command_start=not package_framework)
-    if package_framework:
+    if package_framework and not is_empty:
       variables.append(('version', self.xcode_settings.GetFrameworkVersion())), 'package_framework', mac_bundle_depends,
diff --git a/test/mac/gyptest-sourceless-module.gyp b/test/mac/
similarity index 100%
rename from test/mac/gyptest-sourceless-module.gyp
rename to test/mac/