Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Commit

Permalink
Add support for Swift Package Manager. (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
GetToSet authored Mar 15, 2022
1 parent 135869c commit 8c5dd19
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ profile
.DS_Store
# Carthage
Carthage/Build
# Swift Package Manager
.swiftpm
1 change: 1 addition & 0 deletions Framework/Headers/MASPreferences.h
1 change: 1 addition & 0 deletions Framework/Headers/MASPreferences.modulemap
1 change: 1 addition & 0 deletions Framework/Headers/MASPreferencesViewController.h
1 change: 1 addition & 0 deletions Framework/Headers/MASPreferencesWindowController.h
4 changes: 4 additions & 0 deletions Framework/MASPreferencesWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,12 @@ - (IBAction)goPreviousTab:(id __unused)sender
#pragma mark Helper Functions

+ (NSBundle *)resourceBundle {
#ifdef SWIFT_PACKAGE
return SWIFTPM_MODULE_BUNDLE;
#else
NSBundle *moduleBundle = [NSBundle bundleForClass:MASPreferencesWindowController.class];
return [NSBundle bundleWithURL:[NSURL fileURLWithPath:[moduleBundle pathForResource:@"MASPreferences" ofType:@"bundle"]]];
#endif
}

@end
4 changes: 2 additions & 2 deletions MASPreferences.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|
s.platform = :osx, '10.10'
s.name = "MASPreferences"
s.version = "1.3"
s.version = "1.4"
s.summary = "Modern implementation of the Preferences window for OS X apps, used in TextMate, GitBox and Mou."
s.homepage = "https://github.com/shpakovski/MASPreferences"
s.license = { :type => 'BSD', :file => 'LICENSE.md' }
s.author = { "Vadim Shpakovski" => "[email protected]" }
s.source = { :git => 'https://github.com/shpakovski/MASPreferences.git', :tag => '1.3' }
s.source = { :git => 'https://github.com/shpakovski/MASPreferences.git', :tag => '1.4' }
s.source_files = 'Framework/*.{h,m}'
s.resource_bundles = {
'MASPreferences' => ['Framework/en.lproj/*.xib']
Expand Down
26 changes: 26 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "MASPreferences",
defaultLocalization: "en",
platforms: [
.macOS(.v10_10),
],
products: [
.library(name: "MASPreferences",
targets: ["MASPreferences"])
],
targets: [
.target(
name: "MASPreferences",
path: "./Framework",
exclude: [
"Info.plist",
"MASPreferences.modulemap",
],
resources: [],
publicHeadersPath: "./Headers"
)
]
)
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ This component is intended as a replacement for SS_PrefsController by Matt Legen
You can find a Demo project at [MASPreferencesDemo](https://github.com/shpakovski/MASPreferencesDemo).

# Install

#### [Carthage](https://github.com/Carthage/Carthage)

- Add `github "shpakovski/MASPreferences"` to your Cartfile.

#### [CocoaPods](https://github.com/cocoapods/cocoapods)

- Add `pod 'MASPreferences'` to your Podfile.

#### [Swift Package Manager](https://www.swift.org/package-manager/)

- Add `.package(url: "https://github.com/shpakovski/MASPreferences.git", .upToNextMajor(from: "1.4"))` to your Package.swift.

0 comments on commit 8c5dd19

Please sign in to comment.