Skip to content
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

[Feature] Add Copy File name support #4

Merged
merged 2 commits into from
Nov 26, 2023
Merged
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
24 changes: 24 additions & 0 deletions Configs/Common.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// Common.xcconfig
// Forumate
//
// Created by Kyle on 2023/11/22.
//

// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974

MENUHELPER_SUFFIX_Debug = Debug
MENUHELPER_SUFFIX_Release =
MENUHELPER_SUFFIX = $(MENUHELPER_SUFFIX_$(CONFIGURATION))

MENUHELPER_APP_NAME = MenuHelper$(MENUHELPER_SUFFIX)
MENUHELPER_TARGET_NAME = $(TARGET_NAME)$(MENUHELPER_SUFFIX)
MENUHELPER_APP_VERSION = 0.3.2

MARKETING_VERSION = $(MENUHELPER_APP_VERSION)
PRODUCT_NAME = $(MENUHELPER_TARGET_NAME)

PRODUCT_BUNDLE_IDENTIFIER_MenuHelper = top.kyleye.$(MENUHELPER_APP_NAME)
PRODUCT_BUNDLE_IDENTIFIER_MenuHelperExtension = $(PRODUCT_BUNDLE_IDENTIFIER_MenuHelper).$(MENUHELPER_TARGET_NAME)
PRODUCT_BUNDLE_IDENTIFIER = $(PRODUCT_BUNDLE_IDENTIFIER_$(TARGET_NAME))
11 changes: 11 additions & 0 deletions Configs/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Debug.xcconfig
// MenuHelper
//
// Created by Kyle on 2023/11/22.
//

// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974

#include "Configs/Common.xcconfig"
11 changes: 11 additions & 0 deletions Configs/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Release.xcconfig
// MenuHelper
//
// Created by Kyle on 2023/11/22.
//

// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974

#include "Configs/Common.xcconfig"
29 changes: 25 additions & 4 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@
}
}
},
"Add Application(s)" : {
"Add Application Menu Items(s)" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "添加应用程序"
"value" : "添加应用程序菜单项"
}
}
}
Expand Down Expand Up @@ -191,6 +191,17 @@
}
}
},
"Copy File Name" : {
"comment" : "Copy File Name",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "拷贝文件名"
}
}
}
},
"Copy Path" : {
"comment" : "Copy Path",
"localizations" : {
Expand All @@ -202,12 +213,12 @@
}
}
},
"Copy Path Settings" : {
"Copy Settings" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "拷贝路径菜单项设置"
"value" : "拷贝相关设置"
}
}
}
Expand Down Expand Up @@ -544,6 +555,16 @@
}
}
},
"Reset Action Menu Items" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "重置动作菜单项"
}
}
}
},
"Right-click is the same as control-click" : {
"localizations" : {
"zh-Hans" : {
Expand Down
46 changes: 30 additions & 16 deletions MenuHelper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
2781A62D2688A0260042B453 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2781A62C2688A0260042B453 /* Assets.xcassets */; };
2781A6302688A0260042B453 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2781A62F2688A0260042B453 /* Preview Assets.xcassets */; };
2781C5932688A4540042B453 /* FinderSync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2781C5922688A4540042B453 /* FinderSync.swift */; };
2781C5972688A4540042B453 /* MenuHelperExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 2781C5902688A4540042B453 /* MenuHelperExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
2781C5972688A4540042B453 /* MenuHelperExtensionDebug.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 2781C5902688A4540042B453 /* MenuHelperExtensionDebug.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
2795203B268B5B7E00492ABF /* SettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2795203A268B5B7E00492ABF /* SettingView.swift */; };
27952041268B5F0700492ABF /* FolderSettingTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27952040268B5F0700492ABF /* FolderSettingTab.swift */; };
27952043268B5F1100492ABF /* MenuSettingTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27952042268B5F1100492ABF /* MenuSettingTab.swift */; };
Expand Down Expand Up @@ -95,7 +95,7 @@
dstPath = "";
dstSubfolderSpec = 13;
files = (
2781C5972688A4540042B453 /* MenuHelperExtension.appex in Embed Foundation Extensions */,
2781C5972688A4540042B453 /* MenuHelperExtensionDebug.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -107,6 +107,9 @@
2732A5AF27B9558D005DB4A0 /* MenuHelperUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MenuHelperUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2732A5B327B9558D005DB4A0 /* MenuHelperUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuHelperUITestsLaunchTests.swift; sourceTree = "<group>"; };
2732A5BA27B955B9005DB4A0 /* TestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = TestPlan.xctestplan; sourceTree = "<group>"; };
273F70B12B132E4900CD37B1 /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = "<group>"; };
273F70B22B132E4900CD37B1 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
273F70B32B132E4900CD37B1 /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
27421A96271FCB0E00A0BD28 /* AppCommChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCommChannel.swift; sourceTree = "<group>"; };
27421A98271FCB1600A0BD28 /* FinderCommChannel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinderCommChannel.swift; sourceTree = "<group>"; };
27421A9B271FF10400A0BD28 /* StringExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExtension.swift; sourceTree = "<group>"; };
Expand All @@ -121,12 +124,12 @@
274C25FA2A32427000A6CE0F /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = "<group>"; };
274C25FC2A32427000A6CE0F /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
276D4122299D465E00C47CAF /* BundleHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleHelper.swift; sourceTree = "<group>"; };
2781A6252688A0260042B453 /* MenuHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MenuHelper.app; sourceTree = BUILT_PRODUCTS_DIR; };
2781A6252688A0260042B453 /* MenuHelperDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MenuHelperDebug.app; sourceTree = BUILT_PRODUCTS_DIR; };
2781A6282688A0260042B453 /* MenuHelperApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuHelperApp.swift; sourceTree = "<group>"; };
2781A62A2688A0260042B453 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
2781A62C2688A0260042B453 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2781A62F2688A0260042B453 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
2781C5902688A4540042B453 /* MenuHelperExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MenuHelperExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
2781C5902688A4540042B453 /* MenuHelperExtensionDebug.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MenuHelperExtensionDebug.appex; sourceTree = BUILT_PRODUCTS_DIR; };
2781C5922688A4540042B453 /* FinderSync.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinderSync.swift; sourceTree = "<group>"; };
2781C5942688A4540042B453 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2795203A268B5B7E00492ABF /* SettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -191,6 +194,16 @@
path = MenuHelperUITests;
sourceTree = "<group>";
};
273F70B02B132E4900CD37B1 /* Configs */ = {
isa = PBXGroup;
children = (
273F70B12B132E4900CD37B1 /* Common.xcconfig */,
273F70B22B132E4900CD37B1 /* Debug.xcconfig */,
273F70B32B132E4900CD37B1 /* Release.xcconfig */,
);
path = Configs;
sourceTree = "<group>";
};
27421A92271FCA9600A0BD28 /* Shared */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -245,6 +258,7 @@
2746559727B946A900DC2F91 /* MenuHelper-Info.plist */,
274C25F82A32427000A6CE0F /* MenuHelper-InfoPlist.xcstrings */,
274C25FC2A32427000A6CE0F /* Localizable.xcstrings */,
273F70B02B132E4900CD37B1 /* Configs */,
27421A92271FCA9600A0BD28 /* Shared */,
2781A6272688A0260042B453 /* MenuHelper */,
2781C5912688A4540042B453 /* MenuHelperExtension */,
Expand All @@ -257,8 +271,8 @@
2781A6262688A0260042B453 /* Products */ = {
isa = PBXGroup;
children = (
2781A6252688A0260042B453 /* MenuHelper.app */,
2781C5902688A4540042B453 /* MenuHelperExtension.appex */,
2781A6252688A0260042B453 /* MenuHelperDebug.app */,
2781C5902688A4540042B453 /* MenuHelperExtensionDebug.appex */,
2732A5AF27B9558D005DB4A0 /* MenuHelperUITests.xctest */,
);
name = Products;
Expand Down Expand Up @@ -396,7 +410,7 @@
27ADFF8F2AF202ED00731FA8 /* AcknowKit */,
);
productName = FinderHelper;
productReference = 2781A6252688A0260042B453 /* MenuHelper.app */;
productReference = 2781A6252688A0260042B453 /* MenuHelperDebug.app */;
productType = "com.apple.product-type.application";
};
2781C58F2688A4540042B453 /* MenuHelperExtension */ = {
Expand All @@ -416,7 +430,7 @@
272986BA2711FDCD00EBCCBF /* OrderedCollections */,
);
productName = FinderMenu;
productReference = 2781C5902688A4540042B453 /* MenuHelperExtension.appex */;
productReference = 2781C5902688A4540042B453 /* MenuHelperExtensionDebug.appex */;
productType = "com.apple.product-type.app-extension";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -577,6 +591,7 @@
/* Begin XCBuildConfiguration section */
2732A5B727B9558D005DB4A0 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 273F70B22B132E4900CD37B1 /* Debug.xcconfig */;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -596,6 +611,7 @@
};
2732A5B827B9558D005DB4A0 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 273F70B32B132E4900CD37B1 /* Release.xcconfig */;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -615,6 +631,7 @@
};
2781A6312688A0260042B453 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 273F70B22B132E4900CD37B1 /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -681,6 +698,7 @@
};
2781A6322688A0260042B453 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 273F70B32B132E4900CD37B1 /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -740,6 +758,7 @@
};
2781A6342688A0260042B453 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 273F70B22B132E4900CD37B1 /* Debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down Expand Up @@ -768,15 +787,14 @@
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 3.2.0;
OTHER_SWIFT_FLAGS = "-enable-upcoming-feature BareSlashRegexLiterals -enable-upcoming-feature ConciseMagicFile -enable-upcoming-feature ExistentialAny -enable-upcoming-feature ForwardTrailingClosures -enable-upcoming-feature ImplicitOpenExistentials -enable-upcoming-feature StrictConcurrency -warn-concurrency -enable-actor-data-race-checks";
PRODUCT_BUNDLE_IDENTIFIER = top.kyleye.MenuHelper;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
2781A6352688A0260042B453 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 273F70B32B132E4900CD37B1 /* Release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down Expand Up @@ -805,15 +823,14 @@
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 3.2.0;
OTHER_SWIFT_FLAGS = "-enable-upcoming-feature BareSlashRegexLiterals -enable-upcoming-feature ConciseMagicFile -enable-upcoming-feature ExistentialAny -enable-upcoming-feature ForwardTrailingClosures -enable-upcoming-feature ImplicitOpenExistentials -enable-upcoming-feature StrictConcurrency -warn-concurrency -enable-actor-data-race-checks";
PRODUCT_BUNDLE_IDENTIFIER = top.kyleye.MenuHelper;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
2781C5992688A4540042B453 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 273F70B22B132E4900CD37B1 /* Debug.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = MenuHelperExtension/MenuHelperExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
Expand All @@ -838,8 +855,6 @@
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 3.0.0;
OTHER_SWIFT_FLAGS = "-enable-upcoming-feature BareSlashRegexLiterals -enable-upcoming-feature ConciseMagicFile -enable-upcoming-feature ExistentialAny -enable-upcoming-feature ForwardTrailingClosures -enable-upcoming-feature ImplicitOpenExistentials -enable-upcoming-feature StrictConcurrency -warn-concurrency -enable-actor-data-race-checks";
PRODUCT_BUNDLE_IDENTIFIER = top.kyleye.MenuHelper.MenuHelperExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand All @@ -848,6 +863,7 @@
};
2781C59A2688A4540042B453 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 273F70B32B132E4900CD37B1 /* Release.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = MenuHelperExtension/MenuHelperExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
Expand All @@ -872,8 +888,6 @@
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 3.0.0;
OTHER_SWIFT_FLAGS = "-enable-upcoming-feature BareSlashRegexLiterals -enable-upcoming-feature ConciseMagicFile -enable-upcoming-feature ExistentialAny -enable-upcoming-feature ForwardTrailingClosures -enable-upcoming-feature ImplicitOpenExistentials -enable-upcoming-feature StrictConcurrency -warn-concurrency -enable-actor-data-race-checks";
PRODUCT_BUNDLE_IDENTIFIER = top.kyleye.MenuHelper.MenuHelperExtension;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion MenuHelper/MenuHelper.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.top.kyleye.MenuHelper</string>
<string>group.top.kyleye.MenuHelper$(MENUHELPER_SUFFIX)</string>
</array>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
Expand Down
1 change: 0 additions & 1 deletion MenuHelper/View/SettingView/FolderSettingTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
// Created by Kyle on 2021/6/29.
//

import MenuHelperExtension
import SwiftUI

Check notice on line 8 in MenuHelper/View/SettingView/FolderSettingTab.swift

View check run for this annotation

Xcode Cloud / MenuHelper | main branch CI | Build - macOS

MenuHelper/View/SettingView/FolderSettingTab.swift#L8

Add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'Foundation'

struct FolderSettingTab: View {
var store: FolderItemStore
Expand Down Expand Up @@ -113,7 +112,7 @@
Task {
var items = [SyncFolderItem]()
for provider in providers {
if let coding = try? await provider.loadItem(forTypeIdentifier: "public.file-url", options: nil),

Check notice on line 115 in MenuHelper/View/SettingView/FolderSettingTab.swift

View check run for this annotation

Xcode Cloud / MenuHelper | main branch CI | Build - macOS

MenuHelper/View/SettingView/FolderSettingTab.swift#L115

Passing argument of non-sendable type '[AnyHashable : Any]?' outside of main actor-isolated context may introduce data races

Check notice on line 115 in MenuHelper/View/SettingView/FolderSettingTab.swift

View check run for this annotation

Xcode Cloud / MenuHelper | main branch CI | Build - macOS

MenuHelper/View/SettingView/FolderSettingTab.swift#L115

Non-sendable type 'any NSSecureCoding' returned by implicitly asynchronous call to nonisolated function cannot cross actor boundary
let data = coding as? Data,
let urlString = String(data: data, encoding: .utf8),
let url = URL(string: urlString) {
Expand Down
Loading