Skip to content

Commit

Permalink
(Feature)|Add support for SwiftPM (#8)
Browse files Browse the repository at this point in the history
This adds support for SwiftPM 5.3 while also maintaining existing support for Carthage / CocoaPods:
- Source files have been restructured to follow Swift Package guidelines
- Headers have been isolated in order to specify a `publicHeadersPath`. This includes `_Private` and `_Protected` headers, which don't really provide much benefit to begin with
- `NSBundle` resolution attempts to access the generated `SWIFTPM_MODULE_BUNDLE` if it exists, which is necessary for projects that link the target via SwiftPM
  • Loading branch information
johnhammerlund authored Nov 11, 2020
1 parent 47a1ab4 commit bb9362f
Show file tree
Hide file tree
Showing 48 changed files with 94 additions and 299 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ Pods

#Carthage
Carthage

# SwiftPM
.build
.swiftpm
11 changes: 5 additions & 6 deletions MBDebugPanel.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ Pod::Spec.new do |s|
s.version = "0.2.3"
s.summary = "A painless, configurable, hidden panel to add shortcuts to run code, test features, or whatever you like."
s.description = <<-DESC
MBDebugPanel offers a simple way to embed a set of dev-mode-only features
MBDebugPanel offers a simple way to embed a set of dev-mode-only features
(Though you could ship it with your app if you really wanted to.)
It's like the Konami code, but for your app.
DESC
s.homepage = "https://github.com/mindbody/MBDebugPanel.git"
s.license = 'MIT'
s.author = { "Matthew Holden" => "[email protected]" }
s.source = { :git => "https://github.com/mindbody/MBDebugPanel.git", :tag => s.version.to_s }

s.platform = :ios, '7.0'
s.platform = :ios, '8.0'
s.requires_arc = true

s.source_files = 'MBDebugPanel/Sources/Classes/**/*.{h,m}'
s.resources = 'MBDebugPanel/Sources/Assets/componentCells/*.xib'
s.private_header_files = 'MBDebugPanel/Sources/Classes/ios/private/*.h'
s.source_files = 'MBDebugPanel/Sources/MBDebugPanel/Classes/**/*.{h,m}', 'MBDebugPanel/Sources/MBDebugPanel/Headers/**/*.{h}'
s.resources = 'MBDebugPanel/Sources/MBDebugPanel/Assets/componentCells/*.xib'
end
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
1B2A4CC7255C2C7F00DA9688 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
9A10FA381EA5633500D2B095 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
9A10FA391EA5633500D2B095 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
9A10FA3A1EA5633500D2B095 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -174,6 +175,32 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
1B2A4CC3255C2BD100DA9688 /* MBDebugPanel */ = {
isa = PBXGroup;
children = (
1B2A4CCE255C2F9800DA9688 /* Headers */,
9A5DE2991EA55DC500C90F62 /* Assets */,
9A5DE29E1EA55DC500C90F62 /* Classes */,
9A5DE2B51EA55DC500C90F62 /* SupportingFiles */,
);
path = MBDebugPanel;
sourceTree = "<group>";
};
1B2A4CCE255C2F9800DA9688 /* Headers */ = {
isa = PBXGroup;
children = (
9A5DE2A91EA55DC500C90F62 /* MBDebugPanel.h */,
9A5DE2AD1EA55DC500C90F62 /* MBDebugPanel_Private.h */,
9A5DE2AB1EA55DC500C90F62 /* MBDebugPanelComponent.h */,
9A5DE2A11EA55DC500C90F62 /* MBDebugPanelSimpleButtonComponent.h */,
9A5DE2A31EA55DC500C90F62 /* MBDebugPanelSimpleComponent.h */,
9A5DE2AE1EA55DC500C90F62 /* MBDebugPanelSimpleComponent_Protected.h */,
9A5DE2A51EA55DC500C90F62 /* MBDebugPanelSimpleSwitchComponent.h */,
9A5DE2A71EA55DC500C90F62 /* MBDebugPanelSimpleTextFieldComponent.h */,
);
path = Headers;
sourceTree = "<group>";
};
9A10FA361EA5633500D2B095 /* MBDebugPanelTestsApplicationContainer */ = {
isa = PBXGroup;
children = (
Expand All @@ -191,9 +218,7 @@
9A5DE2981EA55DC500C90F62 /* Sources */ = {
isa = PBXGroup;
children = (
9A5DE2991EA55DC500C90F62 /* Assets */,
9A5DE29E1EA55DC500C90F62 /* Classes */,
9A5DE2B51EA55DC500C90F62 /* Supporting Files */,
1B2A4CC3255C2BD100DA9688 /* MBDebugPanel */,
);
path = Sources;
sourceTree = "<group>";
Expand Down Expand Up @@ -228,45 +253,29 @@
isa = PBXGroup;
children = (
9A5DE2A01EA55DC500C90F62 /* components */,
9A5DE2A91EA55DC500C90F62 /* MBDebugPanel.h */,
9A5DE2AA1EA55DC500C90F62 /* MBDebugPanel.m */,
9A5DE2AB1EA55DC500C90F62 /* MBDebugPanelComponent.h */,
9A5DE2AC1EA55DC500C90F62 /* private */,
);
path = ios;
sourceTree = "<group>";
};
9A5DE2A01EA55DC500C90F62 /* components */ = {
isa = PBXGroup;
children = (
9A5DE2A11EA55DC500C90F62 /* MBDebugPanelSimpleButtonComponent.h */,
9A5DE2A21EA55DC500C90F62 /* MBDebugPanelSimpleButtonComponent.m */,
9A5DE2A31EA55DC500C90F62 /* MBDebugPanelSimpleComponent.h */,
9A5DE2A41EA55DC500C90F62 /* MBDebugPanelSimpleComponent.m */,
9A5DE2A51EA55DC500C90F62 /* MBDebugPanelSimpleSwitchComponent.h */,
9A5DE2A61EA55DC500C90F62 /* MBDebugPanelSimpleSwitchComponent.m */,
9A5DE2A71EA55DC500C90F62 /* MBDebugPanelSimpleTextFieldComponent.h */,
9A5DE2A81EA55DC500C90F62 /* MBDebugPanelSimpleTextFieldComponent.m */,
);
path = components;
sourceTree = "<group>";
};
9A5DE2AC1EA55DC500C90F62 /* private */ = {
isa = PBXGroup;
children = (
9A5DE2AD1EA55DC500C90F62 /* MBDebugPanel_Private.h */,
9A5DE2AE1EA55DC500C90F62 /* MBDebugPanelSimpleComponent_Protected.h */,
);
path = private;
sourceTree = "<group>";
};
9A5DE2B51EA55DC500C90F62 /* Supporting Files */ = {
9A5DE2B51EA55DC500C90F62 /* SupportingFiles */ = {
isa = PBXGroup;
children = (
9A5DE2B61EA55DC500C90F62 /* Info-iOS.plist */,
9A5DE2BA1EA55DC500C90F62 /* MBDebugPanel.h */,
);
path = "Supporting Files";
path = SupportingFiles;
sourceTree = "<group>";
};
9A5DE3331EA55DEC00C90F62 /* Tests */ = {
Expand Down Expand Up @@ -302,6 +311,7 @@
FDCFACE418A49E6800E4AD74 = {
isa = PBXGroup;
children = (
1B2A4CC7255C2C7F00DA9688 /* Package.swift */,
9A5DE2981EA55DC500C90F62 /* Sources */,
9A5DE3331EA55DEC00C90F62 /* Tests */,
FDCFACF118A49E9200E4AD74 /* Frameworks */,
Expand Down Expand Up @@ -462,6 +472,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = FDCFACE418A49E6800E4AD74;
Expand Down Expand Up @@ -650,7 +661,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Supporting Files/Info-iOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/Sources/MBDebugPanel/SupportingFiles/Info-iOS.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand Down Expand Up @@ -713,7 +724,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "$(SRCROOT)/Sources/Supporting Files/Info-iOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/Sources/MBDebugPanel/SupportingFiles/Info-iOS.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion MBDebugPanel.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit bb9362f

Please sign in to comment.