diff --git a/LetsMove.h b/LetsMove.h index e4c6d77..82cf00f 100644 --- a/LetsMove.h +++ b/LetsMove.h @@ -7,4 +7,4 @@ // The contents of this file are dedicated to the public domain. #import -#import +#import "PFMoveApplication.h" diff --git a/LetsMove.podspec b/LetsMove.podspec index 9db006c..cf514db 100644 --- a/LetsMove.podspec +++ b/LetsMove.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LetsMove" - s.version = "1.25" + s.version = "1.26" s.summary = "Moves a running Mac application to the /Applications directory." s.homepage = "https://github.com/potionfactory/LetsMove/" s.license = 'Public Domain' @@ -10,14 +10,14 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/potionfactory/LetsMove.git", - :tag => "v1.25" + :tag => "v1.26" } s.source_files = '*.{h,m}' s.exclude_files = 'main.m', 'LetsMoveAppDelegate.{h,m}' s.public_header_files = 'PFMoveApplication.h' - s.resources = '*.lproj' + s.resources = 'Resources/*.lproj' s.requires_arc = false end diff --git a/LetsMove.xcodeproj/project.pbxproj b/LetsMove.xcodeproj/project.pbxproj index b595d9e..4f1e604 100644 --- a/LetsMove.xcodeproj/project.pbxproj +++ b/LetsMove.xcodeproj/project.pbxproj @@ -63,9 +63,9 @@ F146F8271CE7094400233A9B /* LetsMove.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LetsMove.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F146F82F1CE7097500233A9B /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; F146F8311CE7097800233A9B /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; - F146F8381CE7164D00233A9B /* LetsMove.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = LetsMove.modulemap; sourceTree = ""; }; F146F83A1CE71D8A00233A9B /* LetsMove-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LetsMove-Info.plist"; sourceTree = ""; }; F146F83B1CE71D9700233A9B /* LetsMove.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LetsMove.h; sourceTree = ""; }; + F185A567284D93750026A6EA /* LetsMove.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = LetsMove.modulemap; sourceTree = ""; }; F7846CE41A9F83E100BFAF88 /* ca */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/MoveApplication.strings; sourceTree = ""; }; /* End PBXFileReference section */ @@ -128,6 +128,7 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( + F185A567284D93750026A6EA /* LetsMove.modulemap */, F146F83B1CE71D9700233A9B /* LetsMove.h */, 256AC3F00F4B6AF500CF3369 /* LetsMove_Prefix.pch */, 29B97316FDCFA39411CA2CEA /* main.m */, @@ -140,12 +141,11 @@ children = ( F146F83A1CE71D8A00233A9B /* LetsMove-Info.plist */, 8D1107310486CEB800E47090 /* LetsMove-Test-Info.plist */, - F146F8381CE7164D00233A9B /* LetsMove.modulemap */, A17CADE5192F7E14008A209F /* InfoPlist.strings */, A17CADE7192F7E14008A209F /* MainMenu.xib */, A17CADE9192F7E14008A209F /* MoveApplication.strings */, ); - name = Resources; + path = Resources; sourceTree = ""; }; 29B97323FDCFA39411CA2CEA /* Frameworks */ = { @@ -370,7 +370,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = LetsMove_Prefix.pch; - INFOPLIST_FILE = "LetsMove-Test-Info.plist"; + INFOPLIST_FILE = "Resources/LetsMove-Test-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; PRODUCT_BUNDLE_IDENTIFIER = "com.potionfactory.LetsMove-Test"; PRODUCT_NAME = "LetsMove Test"; @@ -387,7 +387,7 @@ GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = LetsMove_Prefix.pch; - INFOPLIST_FILE = "LetsMove-Test-Info.plist"; + INFOPLIST_FILE = "Resources/LetsMove-Test-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; PRODUCT_BUNDLE_IDENTIFIER = "com.potionfactory.LetsMove-Test"; PRODUCT_NAME = "LetsMove Test"; @@ -544,7 +544,7 @@ "$(inherited)", ); GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - INFOPLIST_FILE = "LetsMove-Info.plist"; + INFOPLIST_FILE = "Resources/LetsMove-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = LetsMove.modulemap; @@ -585,7 +585,7 @@ FRAMEWORK_VERSION = A; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - INFOPLIST_FILE = "LetsMove-Info.plist"; + INFOPLIST_FILE = "Resources/LetsMove-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = LetsMove.modulemap; diff --git a/PFMoveApplication.m b/PFMoveApplication.m index 0797524..02d6e9c 100644 --- a/PFMoveApplication.m +++ b/PFMoveApplication.m @@ -18,7 +18,11 @@ @interface LetsMove : NSObject @implementation LetsMove + (NSBundle *)bundle { +#ifdef SWIFT_PACKAGE + return SWIFTPM_MODULE_BUNDLE; +#else return [NSBundle bundleForClass:self]; +#endif } @end diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..6cac530 --- /dev/null +++ b/Package.swift @@ -0,0 +1,35 @@ +// swift-tools-version:5.4 +import PackageDescription + +let package = Package( + name: "LetsMove", + defaultLocalization: "en", + platforms: [ + .macOS(.v10_10), + ], + products: [ + .library(name: "LetsMove", + targets: ["LetsMove"]) + ], + targets: [ + .target( + name: "LetsMove", + path: ".", + exclude: [ + "main.m", + "LetsMoveAppDelegate.m", + "LetsMoveAppDelegate.h", + "Resources/LetsMove-Info.plist", + "Resources/LetsMove-Test-Info.plist", + "LetsMove.modulemap", + "LetsMove_Prefix.pch" + ], + resources: [ + .process("Resources") + ], + publicHeadersPath: "include", + cSettings: [.unsafeFlags(["-fno-objc-arc"])] + ) + ], + swiftLanguageVersions: [.v5] +) diff --git a/README.md b/README.md index b5a20b1..c16c84e 100644 --- a/README.md +++ b/README.md @@ -11,27 +11,61 @@ Requirements Builds and runs on Mac OS X 10.6 or higher. Does NOT support sandboxed applications. -Usage +Installation ----- -Option 1: +#### Swift Package Manager + +In Xcode, add the following Package Dependency: + +``` +https://github.com/potionfactory/LetsMove +``` + +To add LetsMove to your own Swift package, add the following line to your to your `Package.swift` file: + +``` +.package(url: "https://github.com/potionfactory/LetsMove", .upToNextMajor(from: "1.0.0")) +``` + + +#### CocoaPods + +Add the following line to your `Podfile`: + +``` +pod 'LetsMove', '~> 1.0' +``` -Build then embed LetsMove.framework into your app. +#### Carthage: -Option 2: +Add the following line to your `Cartfile`: + +``` +github "potionfactory/LetsMove" ~> 1.0 +``` + +#### Add the Framework Manually: + +Build then embed `LetsMove.framework` into your app. + +#### Add the Source Manually: Copy the following files into your project: -- PFMoveApplication.h -- PFMoveApplication.m +- `PFMoveApplication.h` +- `PFMoveApplication.m` If your project has ARC enabled, you'll want to disable ARC on the above files. You can do so by adding -fno-objc-arc compiler flag to your PFMoveApplication.m source file. See http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project/6658549#6658549 If your application is localized, also copy the 'MoveApplication.string' files into your project. -Link your application against Security.framework. +Link your application against `Security.framework`. -In your app delegate's "-[applicationWillFinishLaunching:]" method, call the PFMoveToApplicationsFolderIfNecessary function at the very top. +Usage +----- + +In your app delegate's `-[applicationWillFinishLaunching:]` method, call the `PFMoveToApplicationsFolderIfNecessary` function at the very top. License @@ -43,6 +77,9 @@ Public domain Version History --------------- +* 1.26 + - Support for [Swift Package Manager](https://www.swift.org/package-manager/) added + * 1.25 - Added Greek and Vietnamese localizations - Update project for Xcode 11.5 diff --git a/Base.lproj/MainMenu.xib b/Resources/Base.lproj/MainMenu.xib similarity index 100% rename from Base.lproj/MainMenu.xib rename to Resources/Base.lproj/MainMenu.xib diff --git a/LetsMove-Info.plist b/Resources/LetsMove-Info.plist similarity index 100% rename from LetsMove-Info.plist rename to Resources/LetsMove-Info.plist diff --git a/LetsMove-Test-Info.plist b/Resources/LetsMove-Test-Info.plist similarity index 100% rename from LetsMove-Test-Info.plist rename to Resources/LetsMove-Test-Info.plist diff --git a/ca.lproj/MoveApplication.strings b/Resources/ca.lproj/MoveApplication.strings similarity index 100% rename from ca.lproj/MoveApplication.strings rename to Resources/ca.lproj/MoveApplication.strings diff --git a/cs.lproj/MoveApplication.strings b/Resources/cs.lproj/MoveApplication.strings similarity index 100% rename from cs.lproj/MoveApplication.strings rename to Resources/cs.lproj/MoveApplication.strings diff --git a/da.lproj/MoveApplication.strings b/Resources/da.lproj/MoveApplication.strings similarity index 100% rename from da.lproj/MoveApplication.strings rename to Resources/da.lproj/MoveApplication.strings diff --git a/de.lproj/MoveApplication.strings b/Resources/de.lproj/MoveApplication.strings similarity index 100% rename from de.lproj/MoveApplication.strings rename to Resources/de.lproj/MoveApplication.strings diff --git a/el.lproj/MoveApplication.strings b/Resources/el.lproj/MoveApplication.strings similarity index 100% rename from el.lproj/MoveApplication.strings rename to Resources/el.lproj/MoveApplication.strings diff --git a/en.lproj/InfoPlist.strings b/Resources/en.lproj/InfoPlist.strings similarity index 100% rename from en.lproj/InfoPlist.strings rename to Resources/en.lproj/InfoPlist.strings diff --git a/en.lproj/MainMenu.xib b/Resources/en.lproj/MainMenu.xib similarity index 100% rename from en.lproj/MainMenu.xib rename to Resources/en.lproj/MainMenu.xib diff --git a/en.lproj/MoveApplication.strings b/Resources/en.lproj/MoveApplication.strings similarity index 100% rename from en.lproj/MoveApplication.strings rename to Resources/en.lproj/MoveApplication.strings diff --git a/es.lproj/MoveApplication.strings b/Resources/es.lproj/MoveApplication.strings similarity index 100% rename from es.lproj/MoveApplication.strings rename to Resources/es.lproj/MoveApplication.strings diff --git a/fr.lproj/MoveApplication.strings b/Resources/fr.lproj/MoveApplication.strings similarity index 100% rename from fr.lproj/MoveApplication.strings rename to Resources/fr.lproj/MoveApplication.strings diff --git a/hu.lproj/MoveApplication.strings b/Resources/hu.lproj/MoveApplication.strings similarity index 100% rename from hu.lproj/MoveApplication.strings rename to Resources/hu.lproj/MoveApplication.strings diff --git a/it.lproj/MoveApplication.strings b/Resources/it.lproj/MoveApplication.strings similarity index 100% rename from it.lproj/MoveApplication.strings rename to Resources/it.lproj/MoveApplication.strings diff --git a/ja.lproj/MoveApplication.strings b/Resources/ja.lproj/MoveApplication.strings similarity index 100% rename from ja.lproj/MoveApplication.strings rename to Resources/ja.lproj/MoveApplication.strings diff --git a/ko.lproj/MoveApplication.strings b/Resources/ko.lproj/MoveApplication.strings similarity index 100% rename from ko.lproj/MoveApplication.strings rename to Resources/ko.lproj/MoveApplication.strings diff --git a/mk.lproj/MoveApplication.strings b/Resources/mk.lproj/MoveApplication.strings similarity index 100% rename from mk.lproj/MoveApplication.strings rename to Resources/mk.lproj/MoveApplication.strings diff --git a/nb.lproj/MoveApplication.strings b/Resources/nb.lproj/MoveApplication.strings similarity index 100% rename from nb.lproj/MoveApplication.strings rename to Resources/nb.lproj/MoveApplication.strings diff --git a/nl.lproj/MoveApplication.strings b/Resources/nl.lproj/MoveApplication.strings similarity index 100% rename from nl.lproj/MoveApplication.strings rename to Resources/nl.lproj/MoveApplication.strings diff --git a/pl.lproj/MoveApplication.strings b/Resources/pl.lproj/MoveApplication.strings similarity index 100% rename from pl.lproj/MoveApplication.strings rename to Resources/pl.lproj/MoveApplication.strings diff --git a/pt.lproj/MoveApplication.strings b/Resources/pt.lproj/MoveApplication.strings similarity index 100% rename from pt.lproj/MoveApplication.strings rename to Resources/pt.lproj/MoveApplication.strings diff --git a/pt_BR.lproj/MoveApplication.strings b/Resources/pt_BR.lproj/MoveApplication.strings similarity index 100% rename from pt_BR.lproj/MoveApplication.strings rename to Resources/pt_BR.lproj/MoveApplication.strings diff --git a/ru.lproj/MoveApplication.strings b/Resources/ru.lproj/MoveApplication.strings similarity index 100% rename from ru.lproj/MoveApplication.strings rename to Resources/ru.lproj/MoveApplication.strings diff --git a/sk.lproj/MoveApplication.strings b/Resources/sk.lproj/MoveApplication.strings similarity index 100% rename from sk.lproj/MoveApplication.strings rename to Resources/sk.lproj/MoveApplication.strings diff --git a/sr.lproj/MoveApplication.strings b/Resources/sr.lproj/MoveApplication.strings similarity index 100% rename from sr.lproj/MoveApplication.strings rename to Resources/sr.lproj/MoveApplication.strings diff --git a/sv.lproj/MoveApplication.strings b/Resources/sv.lproj/MoveApplication.strings similarity index 100% rename from sv.lproj/MoveApplication.strings rename to Resources/sv.lproj/MoveApplication.strings diff --git a/tr.lproj/MoveApplication.strings b/Resources/tr.lproj/MoveApplication.strings similarity index 100% rename from tr.lproj/MoveApplication.strings rename to Resources/tr.lproj/MoveApplication.strings diff --git a/vi-VN.lproj/MoveApplication.strings b/Resources/vi-VN.lproj/MoveApplication.strings similarity index 100% rename from vi-VN.lproj/MoveApplication.strings rename to Resources/vi-VN.lproj/MoveApplication.strings diff --git a/zh_CN.lproj/MoveApplication.strings b/Resources/zh_CN.lproj/MoveApplication.strings similarity index 100% rename from zh_CN.lproj/MoveApplication.strings rename to Resources/zh_CN.lproj/MoveApplication.strings diff --git a/zh_TW.lproj/MoveApplication.strings b/Resources/zh_TW.lproj/MoveApplication.strings similarity index 100% rename from zh_TW.lproj/MoveApplication.strings rename to Resources/zh_TW.lproj/MoveApplication.strings diff --git a/include/LetsMove.h b/include/LetsMove.h new file mode 120000 index 0000000..1a5156f --- /dev/null +++ b/include/LetsMove.h @@ -0,0 +1 @@ +../LetsMove.h \ No newline at end of file diff --git a/include/PFMoveApplication.h b/include/PFMoveApplication.h new file mode 120000 index 0000000..1811c34 --- /dev/null +++ b/include/PFMoveApplication.h @@ -0,0 +1 @@ +../PFMoveApplication.h \ No newline at end of file