-
-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for XCLocalSwiftPackageReference (#346)
Co-authored-by: Michal Szelag <[email protected]>
- Loading branch information
1 parent
ecc86b7
commit 2f502e5
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from pbxproj import PBXGenericObject | ||
|
||
|
||
class XCLocalSwiftPackageReference(PBXGenericObject): | ||
@classmethod | ||
def create(cls, relative_path): | ||
return cls().parse({ | ||
'_id': cls._generate_id(), | ||
'isa': cls.__name__, | ||
'relativePath': relative_path | ||
}) | ||
|
||
def _get_comment(self): | ||
return f'XCLocalSwiftPackageReference "{self.relativePath}"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import unittest | ||
from pbxproj.pbxsections.XCLocalSwiftPackageReference import * | ||
|
||
|
||
class TestXCLocalSwiftPackageReference(unittest.TestCase): | ||
def testGetComment(self): | ||
obj = XCLocalSwiftPackageReference.create('MyPackage') | ||
assert obj._get_comment() == 'XCLocalSwiftPackageReference "MyPackage"' |