Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LetsMove.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
// The contents of this file are dedicated to the public domain.

#import <Cocoa/Cocoa.h>
#import <LetsMove/PFMoveApplication.h>
#import "PFMoveApplication.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to make this a local #import to keep SPM happy.

6 changes: 3 additions & 3 deletions LetsMove.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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'
Copy link
Contributor Author

@mattprowse mattprowse Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the Podfile to account for the relocated resources and to bump the version number.

s.requires_arc = false
end

14 changes: 7 additions & 7 deletions LetsMove.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<group>"; };
F146F83A1CE71D8A00233A9B /* LetsMove-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LetsMove-Info.plist"; sourceTree = "<group>"; };
F146F83B1CE71D9700233A9B /* LetsMove.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LetsMove.h; sourceTree = "<group>"; };
F185A567284D93750026A6EA /* LetsMove.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = LetsMove.modulemap; sourceTree = "<group>"; };
F7846CE41A9F83E100BFAF88 /* ca */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/MoveApplication.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -128,6 +128,7 @@
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
F185A567284D93750026A6EA /* LetsMove.modulemap */,
F146F83B1CE71D9700233A9B /* LetsMove.h */,
256AC3F00F4B6AF500CF3369 /* LetsMove_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
Expand All @@ -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 = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions PFMoveApplication.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ @interface LetsMove : NSObject

@implementation LetsMove
+ (NSBundle *)bundle {
#ifdef SWIFT_PACKAGE
return SWIFTPM_MODULE_BUNDLE;
#else
Comment on lines +21 to +23
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure the resources can be located when building with SPM.

return [NSBundle bundleForClass:self];
#endif
}
@end

Expand Down
35 changes: 35 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// swift-tools-version:5.4
import PackageDescription

let package = Package(
name: "LetsMove",
defaultLocalization: "en",
platforms: [
.macOS(.v10_10),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the lowest macOS version that can be specified in Package.swift.

],
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"])]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disable ARC.

)
],
swiftLanguageVersions: [.v5]
)
53 changes: 45 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions include/LetsMove.h
1 change: 1 addition & 0 deletions include/PFMoveApplication.h