| 1528 | |
| 1529 | |
| 1530 | class PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject): |
| 1531 | _schema = XCFileLikeElement._schema.copy() |
| 1532 | _schema.update( |
| 1533 | { |
| 1534 | "explicitFileType": [0, str, 0, 0], |
| 1535 | "lastKnownFileType": [0, str, 0, 0], |
| 1536 | "name": [0, str, 0, 0], |
| 1537 | "path": [0, str, 0, 1], |
| 1538 | } |
| 1539 | ) |
| 1540 | |
| 1541 | # Weird output rules for PBXFileReference. |
| 1542 | _should_print_single_line = True |
| 1543 | # super |
| 1544 | _encode_transforms = XCFileLikeElement._alternate_encode_transforms |
| 1545 | |
| 1546 | def __init__(self, properties=None, id=None, parent=None): |
| 1547 | # super |
| 1548 | XCFileLikeElement.__init__(self, properties, id, parent) |
| 1549 | if "path" in self._properties and self._properties["path"].endswith("/"): |
| 1550 | self._properties["path"] = self._properties["path"][:-1] |
| 1551 | is_dir = True |
| 1552 | else: |
| 1553 | is_dir = False |
| 1554 | |
| 1555 | if ( |
| 1556 | "path" in self._properties |
| 1557 | and "lastKnownFileType" not in self._properties |
| 1558 | and "explicitFileType" not in self._properties |
| 1559 | ): |
| 1560 | # TODO(mark): This is the replacement for a replacement for a quick hack. |
| 1561 | # It is no longer incredibly sucky, but this list needs to be extended. |
| 1562 | extension_map = { |
| 1563 | "a": "archive.ar", |
| 1564 | "app": "wrapper.application", |
| 1565 | "bdic": "file", |
| 1566 | "bundle": "wrapper.cfbundle", |
| 1567 | "c": "sourcecode.c.c", |
| 1568 | "cc": "sourcecode.cpp.cpp", |
| 1569 | "cpp": "sourcecode.cpp.cpp", |
| 1570 | "css": "text.css", |
| 1571 | "cxx": "sourcecode.cpp.cpp", |
| 1572 | "dart": "sourcecode", |
| 1573 | "dylib": "compiled.mach-o.dylib", |
| 1574 | "framework": "wrapper.framework", |
| 1575 | "gyp": "sourcecode", |
| 1576 | "gypi": "sourcecode", |
| 1577 | "h": "sourcecode.c.h", |
| 1578 | "hxx": "sourcecode.cpp.h", |
| 1579 | "icns": "image.icns", |
| 1580 | "java": "sourcecode.java", |
| 1581 | "js": "sourcecode.javascript", |
| 1582 | "kext": "wrapper.kext", |
| 1583 | "m": "sourcecode.c.objc", |
| 1584 | "mm": "sourcecode.cpp.objcpp", |
| 1585 | "nib": "wrapper.nib", |
| 1586 | "o": "compiled.mach-o.objfile", |
| 1587 | "pdf": "image.pdf", |
no test coverage detected