From e67343b007f0e457c3ea1ebbd768a7fe6acf501f Mon Sep 17 00:00:00 2001 From: Leo Natan Date: Wed, 31 Mar 2021 22:51:56 +0300 Subject: [PATCH] =?UTF-8?q?Restructure=20project=20to=20make=20SPM=20work?= =?UTF-8?q?=20=F0=9F=A4=A6=E2=80=8D=E2=99=82=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project.pbxproj | 50 +++++++--------- .../AppIcon.appiconset/Contents.json | 58 ------------------- .../Assets.xcassets/Contents.json | 6 +- .../LNPropertyListCellView.h | 2 +- .../LNPropertyListCellView.m | 0 .../LNPropertyListDatePicker.h | 0 .../LNPropertyListDatePicker.m | 0 .../LNPropertyListDatePickerCell.h | 0 .../LNPropertyListDatePickerCell.mm | 0 .../LNPropertyListDatePickerPanel.h | 0 .../LNPropertyListDatePickerPanel.m | 0 .../LNPropertyListEditor-Private.h | 0 .../LNPropertyListEditor.m | 23 +++++++- .../LNPropertyListEditorOutline.xib | 22 +++---- .../LNPropertyListNode-Private.h | 0 .../LNPropertyListNode.m | 0 .../LNPropertyListOutlineView.h | 0 .../LNPropertyListOutlineView.m | 0 .../LNPropertyListPopUpButtonCell.h | 0 .../LNPropertyListPopUpButtonCell.m | 0 .../LNPropertyListRowView.h | 2 +- .../LNPropertyListRowView.m | 0 .../_LNPropertyListDatePicker.h | 0 .../_LNPropertyListDatePicker.m | 0 .../LNPropertyListEditor/Info.plist | 2 +- .../{Model => }/LNPropertyListNode.h | 0 .../include/LNPropertyListEditor.h | 1 - .../LNPropertyListEditor.h | 1 + .../LNPropertyListEditor/LNPropertyListNode.h | 1 + .../include/LNPropertyListNode.h | 1 - Package.swift | 12 ++-- 31 files changed, 71 insertions(+), 110 deletions(-) delete mode 100644 LNPropertyListEditor/LNPropertyListEditor/Assets.xcassets/AppIcon.appiconset/Contents.json rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListCellView.h (94%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListCellView.m (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListDatePicker.h (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListDatePicker.m (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListDatePickerCell.h (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListDatePickerCell.mm (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListDatePickerPanel.h (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListDatePickerPanel.m (100%) rename LNPropertyListEditor/LNPropertyListEditor/{ => Implementation}/LNPropertyListEditor-Private.h (100%) rename LNPropertyListEditor/LNPropertyListEditor/{ => Implementation}/LNPropertyListEditor.m (97%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListEditorOutline.xib (97%) rename LNPropertyListEditor/LNPropertyListEditor/{Model => Implementation}/LNPropertyListNode-Private.h (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Model => Implementation}/LNPropertyListNode.m (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListOutlineView.h (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListOutlineView.m (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListPopUpButtonCell.h (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListPopUpButtonCell.m (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListRowView.h (86%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/LNPropertyListRowView.m (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/_LNPropertyListDatePicker.h (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Views => Implementation}/_LNPropertyListDatePicker.m (100%) rename LNPropertyListEditor/LNPropertyListEditor/{Model => }/LNPropertyListNode.h (100%) delete mode 120000 LNPropertyListEditor/include/LNPropertyListEditor.h create mode 120000 LNPropertyListEditor/include/LNPropertyListEditor/LNPropertyListEditor.h create mode 120000 LNPropertyListEditor/include/LNPropertyListEditor/LNPropertyListNode.h delete mode 120000 LNPropertyListEditor/include/LNPropertyListNode.h diff --git a/LNPropertyListEditor/LNPropertyListEditor.xcodeproj/project.pbxproj b/LNPropertyListEditor/LNPropertyListEditor.xcodeproj/project.pbxproj index e2a4353..dc141aa 100644 --- a/LNPropertyListEditor/LNPropertyListEditor.xcodeproj/project.pbxproj +++ b/LNPropertyListEditor/LNPropertyListEditor.xcodeproj/project.pbxproj @@ -92,49 +92,41 @@ 393E183B207F6119002E6136 /* LNPropertyListEditor */ = { isa = PBXGroup; children = ( - 393E187B207F68B7002E6136 /* Model */, - 393E1880207FA52B002E6136 /* Views */, + 391FF02A2084060000005D0F /* Assets.xcassets */, + 3954022126150727005EEA38 /* Implementation */, + 393E1877207F68B4002E6136 /* LNPropertyListNode.h */, 393E1873207F64A0002E6136 /* LNPropertyListEditor.h */, - 39DE8E9B2092214300ED16B4 /* LNPropertyListEditor-Private.h */, - 393E1874207F64A0002E6136 /* LNPropertyListEditor.m */, 393E183D207F6119002E6136 /* Info.plist */, - 391FF02A2084060000005D0F /* Assets.xcassets */, ); path = LNPropertyListEditor; sourceTree = ""; }; - 393E187B207F68B7002E6136 /* Model */ = { - isa = PBXGroup; - children = ( - 393E1877207F68B4002E6136 /* LNPropertyListNode.h */, - 393E1881207FAD26002E6136 /* LNPropertyListNode-Private.h */, - 393E1878207F68B4002E6136 /* LNPropertyListNode.m */, - ); - path = Model; - sourceTree = ""; - }; - 393E1880207FA52B002E6136 /* Views */ = { + 3954022126150727005EEA38 /* Implementation */ = { isa = PBXGroup; children = ( - 393E1871207F61C2002E6136 /* LNPropertyListEditorOutline.xib */, - 391FF0312084270400005D0F /* LNPropertyListOutlineView.h */, - 391FF0322084270400005D0F /* LNPropertyListOutlineView.m */, - 391FF02D208412CC00005D0F /* LNPropertyListRowView.h */, - 391FF02E208412CC00005D0F /* LNPropertyListRowView.m */, + 39D152942328A9C4009124C8 /* _LNPropertyListDatePicker.h */, + 39D152952328A9C4009124C8 /* _LNPropertyListDatePicker.m */, 393E1883207FAEC6002E6136 /* LNPropertyListCellView.h */, 393E1884207FAEC6002E6136 /* LNPropertyListCellView.m */, - 39DE8E922092030500ED16B4 /* LNPropertyListPopUpButtonCell.h */, - 39DE8E932092030500ED16B4 /* LNPropertyListPopUpButtonCell.m */, + 3946906A20976ED300B4A457 /* LNPropertyListDatePicker.h */, + 3946906B20976ED300B4A457 /* LNPropertyListDatePicker.m */, 3941486D2095E85900A21F96 /* LNPropertyListDatePickerCell.h */, 3941486E2095E85900A21F96 /* LNPropertyListDatePickerCell.mm */, 39D1528D23289668009124C8 /* LNPropertyListDatePickerPanel.h */, 39D1528E23289668009124C8 /* LNPropertyListDatePickerPanel.m */, - 39D152942328A9C4009124C8 /* _LNPropertyListDatePicker.h */, - 39D152952328A9C4009124C8 /* _LNPropertyListDatePicker.m */, - 3946906A20976ED300B4A457 /* LNPropertyListDatePicker.h */, - 3946906B20976ED300B4A457 /* LNPropertyListDatePicker.m */, + 39DE8E9B2092214300ED16B4 /* LNPropertyListEditor-Private.h */, + 393E1874207F64A0002E6136 /* LNPropertyListEditor.m */, + 393E1871207F61C2002E6136 /* LNPropertyListEditorOutline.xib */, + 393E1881207FAD26002E6136 /* LNPropertyListNode-Private.h */, + 393E1878207F68B4002E6136 /* LNPropertyListNode.m */, + 391FF0312084270400005D0F /* LNPropertyListOutlineView.h */, + 391FF0322084270400005D0F /* LNPropertyListOutlineView.m */, + 39DE8E922092030500ED16B4 /* LNPropertyListPopUpButtonCell.h */, + 39DE8E932092030500ED16B4 /* LNPropertyListPopUpButtonCell.m */, + 391FF02D208412CC00005D0F /* LNPropertyListRowView.h */, + 391FF02E208412CC00005D0F /* LNPropertyListRowView.m */, ); - path = Views; + path = Implementation; sourceTree = ""; }; /* End PBXGroup section */ @@ -367,6 +359,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; @@ -392,6 +385,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; diff --git a/LNPropertyListEditor/LNPropertyListEditor/Assets.xcassets/AppIcon.appiconset/Contents.json b/LNPropertyListEditor/LNPropertyListEditor/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 50ab7bd..0000000 --- a/LNPropertyListEditor/LNPropertyListEditor/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "images" : [ - { - "idiom" : "mac", - "scale" : "1x", - "size" : "16x16" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "16x16" - }, - { - "idiom" : "mac", - "scale" : "1x", - "size" : "32x32" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "32x32" - }, - { - "idiom" : "mac", - "scale" : "1x", - "size" : "128x128" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "128x128" - }, - { - "idiom" : "mac", - "scale" : "1x", - "size" : "256x256" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "256x256" - }, - { - "idiom" : "mac", - "scale" : "1x", - "size" : "512x512" - }, - { - "idiom" : "mac", - "scale" : "2x", - "size" : "512x512" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/LNPropertyListEditor/LNPropertyListEditor/Assets.xcassets/Contents.json b/LNPropertyListEditor/LNPropertyListEditor/Assets.xcassets/Contents.json index da4a164..73c0059 100644 --- a/LNPropertyListEditor/LNPropertyListEditor/Assets.xcassets/Contents.json +++ b/LNPropertyListEditor/LNPropertyListEditor/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListCellView.h b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListCellView.h similarity index 94% rename from LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListCellView.h rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListCellView.h index 196ddda..f6518e1 100644 --- a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListCellView.h +++ b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListCellView.h @@ -7,7 +7,7 @@ // #import -#import +#import "LNPropertyListDatePicker.h" @interface LNPropertyListCellView : NSTableCellView diff --git a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListCellView.m b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListCellView.m similarity index 100% rename from LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListCellView.m rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListCellView.m diff --git a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePicker.h b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePicker.h similarity index 100% rename from LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePicker.h rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePicker.h diff --git a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePicker.m b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePicker.m similarity index 100% rename from LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePicker.m rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePicker.m diff --git a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePickerCell.h b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePickerCell.h similarity index 100% rename from LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePickerCell.h rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePickerCell.h diff --git a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePickerCell.mm b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePickerCell.mm similarity index 100% rename from LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePickerCell.mm rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePickerCell.mm diff --git a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePickerPanel.h b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePickerPanel.h similarity index 100% rename from LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePickerPanel.h rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePickerPanel.h diff --git a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePickerPanel.m b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePickerPanel.m similarity index 100% rename from LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListDatePickerPanel.m rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListDatePickerPanel.m diff --git a/LNPropertyListEditor/LNPropertyListEditor/LNPropertyListEditor-Private.h b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListEditor-Private.h similarity index 100% rename from LNPropertyListEditor/LNPropertyListEditor/LNPropertyListEditor-Private.h rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListEditor-Private.h diff --git a/LNPropertyListEditor/LNPropertyListEditor/LNPropertyListEditor.m b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListEditor.m similarity index 97% rename from LNPropertyListEditor/LNPropertyListEditor/LNPropertyListEditor.m rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListEditor.m index 8d5f9a5..5b6140d 100644 --- a/LNPropertyListEditor/LNPropertyListEditor/LNPropertyListEditor.m +++ b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListEditor.m @@ -61,7 +61,28 @@ - (instancetype)initWithCoder:(NSCoder *)decoder - (void)_commonInit { - [[[NSNib alloc] initWithNibNamed:@"LNPropertyListEditorOutline" bundle:[NSBundle bundleForClass:self.class]] instantiateWithOwner:self topLevelObjects:nil]; + NSBundle* bundleToUse; + + NSURL* spmBundleURL = [[NSBundle mainBundle] URLForResource:@"LNPropertyListEditor_LNPropertyListEditor" withExtension:@"bundle"]; + if(spmBundleURL != nil) + { + bundleToUse = [NSBundle bundleWithURL:spmBundleURL]; + } + else + { + spmBundleURL = [[NSBundle bundleForClass:self.class] URLForResource:@"LNPropertyListEditor_LNPropertyListEditor" withExtension:@"bundle"]; + if(spmBundleURL != nil) + { + bundleToUse = [NSBundle bundleWithURL:spmBundleURL]; + } + } + + if(bundleToUse == nil) + { + bundleToUse = [NSBundle bundleForClass:self.class]; + } + + [[[NSNib alloc] initWithNibNamed:@"LNPropertyListEditorOutline" bundle:bundleToUse] instantiateWithOwner:self topLevelObjects:nil]; _outlineView.enclosingScrollView.translatesAutoresizingMaskIntoConstraints = NO; _outlineView.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"key" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)]]; diff --git a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListEditorOutline.xib b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListEditorOutline.xib similarity index 97% rename from LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListEditorOutline.xib rename to LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListEditorOutline.xib index 10fb6d2..5c1c600 100644 --- a/LNPropertyListEditor/LNPropertyListEditor/Views/LNPropertyListEditorOutline.xib +++ b/LNPropertyListEditor/LNPropertyListEditor/Implementation/LNPropertyListEditorOutline.xib @@ -1,8 +1,8 @@ - + - + @@ -42,7 +42,7 @@ - +