Yields (output, resource) pairs for every resource in |resources|. Only call this for mac bundle targets. Args: product_dir: Path to the directory containing the output bundle, relative to the build directory. xcode_settings: The XcodeSettings of the current targ
(product_dir, xcode_settings, resources)
| 1611 | |
| 1612 | |
| 1613 | def GetMacBundleResources(product_dir, xcode_settings, resources): |
| 1614 | """Yields (output, resource) pairs for every resource in |resources|. |
| 1615 | Only call this for mac bundle targets. |
| 1616 | |
| 1617 | Args: |
| 1618 | product_dir: Path to the directory containing the output bundle, |
| 1619 | relative to the build directory. |
| 1620 | xcode_settings: The XcodeSettings of the current target. |
| 1621 | resources: A list of bundle resources, relative to the build directory. |
| 1622 | """ |
| 1623 | dest = os.path.join(product_dir, xcode_settings.GetBundleResourceFolder()) |
| 1624 | for res in resources: |
| 1625 | output = dest |
| 1626 | |
| 1627 | # The make generator doesn't support it, so forbid it everywhere |
| 1628 | # to keep the generators more interchangeable. |
| 1629 | assert " " not in res, "Spaces in resource filenames not supported (%s)" % res |
| 1630 | |
| 1631 | # Split into (path,file). |
| 1632 | res_parts = os.path.split(res) |
| 1633 | |
| 1634 | # Now split the path into (prefix,maybe.lproj). |
| 1635 | lproj_parts = os.path.split(res_parts[0]) |
| 1636 | # If the resource lives in a .lproj bundle, add that to the destination. |
| 1637 | if lproj_parts[1].endswith(".lproj"): |
| 1638 | output = os.path.join(output, lproj_parts[1]) |
| 1639 | |
| 1640 | output = os.path.join(output, res_parts[1]) |
| 1641 | # Compiled XIB files are referred to by .nib. |
| 1642 | if output.endswith(".xib"): |
| 1643 | output = os.path.splitext(output)[0] + ".nib" |
| 1644 | # Compiled storyboard files are referred to by .storyboardc. |
| 1645 | if output.endswith(".storyboard"): |
| 1646 | output = os.path.splitext(output)[0] + ".storyboardc" |
| 1647 | |
| 1648 | yield output, res |
| 1649 | |
| 1650 | |
| 1651 | def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path): |
nothing calls this directly
no test coverage detected