Skip to content

updated project for xcode 12.2 and macOS 11 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
44 changes: 30 additions & 14 deletions FastCommentLine.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
07088B261D9BFDF800B205D8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07088B251D9BFDF800B205D8 /* AppDelegate.swift */; };
07088B281D9BFDF800B205D8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 07088B271D9BFDF800B205D8 /* Assets.xcassets */; };
07088B2B1D9BFDF800B205D8 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 07088B291D9BFDF800B205D8 /* MainMenu.xib */; };
07088B391D9BFE2C00B205D8 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07088B381D9BFE2C00B205D8 /* Cocoa.framework */; };
07088B3E1D9BFE2C00B205D8 /* SourceEditorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07088B3D1D9BFE2C00B205D8 /* SourceEditorExtension.swift */; };
07088B401D9BFE2C00B205D8 /* SourceEditorCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07088B3F1D9BFE2C00B205D8 /* SourceEditorCommand.swift */; };
07088B441D9BFE2C00B205D8 /* FastCommenter.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 07088B361D9BFE2C00B205D8 /* FastCommenter.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
29CDA0CA2566C42D00B4FE39 /* XcodeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29CDA0C92566C42D00B4FE39 /* XcodeKit.framework */; };
29CDA0CB2566C42D00B4FE39 /* XcodeKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 29CDA0C92566C42D00B4FE39 /* XcodeKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -38,6 +39,17 @@
name = "Embed App Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
29CDA0C72566C42500B4FE39 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
29CDA0CB2566C42D00B4FE39 /* XcodeKit.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
Expand All @@ -52,6 +64,7 @@
07088B3D1D9BFE2C00B205D8 /* SourceEditorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceEditorExtension.swift; sourceTree = "<group>"; };
07088B3F1D9BFE2C00B205D8 /* SourceEditorCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SourceEditorCommand.swift; sourceTree = "<group>"; };
07088B411D9BFE2C00B205D8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
29CDA0C92566C42D00B4FE39 /* XcodeKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XcodeKit.framework; path = Library/Frameworks/XcodeKit.framework; sourceTree = DEVELOPER_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -66,7 +79,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
07088B391D9BFE2C00B205D8 /* Cocoa.framework in Frameworks */,
29CDA0CA2566C42D00B4FE39 /* XcodeKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -106,6 +119,7 @@
07088B371D9BFE2C00B205D8 /* Frameworks */ = {
isa = PBXGroup;
children = (
29CDA0C92566C42D00B4FE39 /* XcodeKit.framework */,
07088B381D9BFE2C00B205D8 /* Cocoa.framework */,
);
name = Frameworks;
Expand Down Expand Up @@ -159,6 +173,7 @@
07088B321D9BFE2C00B205D8 /* Sources */,
07088B331D9BFE2C00B205D8 /* Frameworks */,
07088B341D9BFE2C00B205D8 /* Resources */,
29CDA0C72566C42500B4FE39 /* Embed Frameworks */,
);
buildRules = (
);
Expand All @@ -181,12 +196,10 @@
TargetAttributes = {
07088B211D9BFDF800B205D8 = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = 7CRPKLHC7G;
ProvisioningStyle = Automatic;
};
07088B351D9BFE2C00B205D8 = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = 7CRPKLHC7G;
ProvisioningStyle = Automatic;
};
};
Expand All @@ -196,6 +209,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -309,12 +323,13 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -352,10 +367,11 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -366,12 +382,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 7CRPKLHC7G;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = FastCommentLine/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.duneparksoftware.FastCommentLine;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -382,12 +398,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 7CRPKLHC7G;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = FastCommentLine/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.duneparksoftware.FastCommentLine;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -397,14 +413,14 @@
CODE_SIGN_ENTITLEMENTS = FastCommenter/FastCommenter.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 7CRPKLHC7G;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = FastCommenter/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = com.duneparksoftware.FastCommentLine.FastCommenter;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -414,14 +430,14 @@
CODE_SIGN_ENTITLEMENTS = FastCommenter/FastCommenter.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 7CRPKLHC7G;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = FastCommenter/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = com.duneparksoftware.FastCommentLine.FastCommenter;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
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>
9 changes: 5 additions & 4 deletions FastCommenter/SourceEditorCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import XcodeKit

class SourceEditorCommand: NSObject, XCSourceEditorCommand {

func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void ) -> Void {
func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void) -> Void {
defer {
completionHandler(nil)
}
Expand Down Expand Up @@ -53,10 +53,11 @@ class SourceEditorCommand: NSObject, XCSourceEditorCommand {
enumerateSelectedLines { line, lineIndex in
var updatedLine = line
if commentSelection {

updatedLine = "\(commentChars)\(line)"
}
else {
updatedLine.characters.removeFirst(commentChars.unicodeScalars.count)
} else {

updatedLine.removeFirst(commentChars.unicodeScalars.count)
}
invocation.buffer.lines[lineIndex] = updatedLine
updatedLines.append(lineIndex)
Expand Down