This commit is contained in:
Alin
2023-11-27 13:52:12 -07:00
parent 8712996f32
commit 7a0d8fdaea
8 changed files with 117 additions and 149 deletions
+4 -4
View File
@@ -535,7 +535,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 7;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BK8443AXLU;
ENABLE_HARDENED_RUNTIME = YES;
@@ -552,7 +552,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.6;
MARKETING_VERSION = 1.7;
PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -569,7 +569,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 7;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BK8443AXLU;
ENABLE_HARDENED_RUNTIME = YES;
@@ -586,7 +586,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.6;
MARKETING_VERSION = 1.7;
PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C77B8FFF2AF18E2E009CC655"
BuildableName = "Pearcleaner.app"
BlueprintName = "Pearcleaner"
ReferencedContainer = "container:Pearcleaner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C77B8FFF2AF18E2E009CC655"
BuildableName = "Pearcleaner.app"
BlueprintName = "Pearcleaner"
ReferencedContainer = "container:Pearcleaner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C77B8FFF2AF18E2E009CC655"
BuildableName = "Pearcleaner.app"
BlueprintName = "Pearcleaner"
ReferencedContainer = "container:Pearcleaner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "NO">
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# For troubleshooting, enable to get log with errors&#10;# exec &gt; &quot;/Users/alin/GitHub/PeakPurge/Builds/Export/Xcode.log&quot; 2&gt;&amp;1&#10;&#10;# Variables&#10;MAIN_PROJECT_PATH=&quot;/Users/alin/GitHub/Pearcleaner&quot;&#10;EXPORT_PATH=&quot;/Users/alin/GitHub/Pearcleaner/Builds/Export&quot;&#10;while [[ -z $MARKETING_VERSION ]]; do&#10; MARKETING_VERSION=$(xcodebuild -showBuildSettings 2&gt;/dev/null | awk -F&apos; = &apos; &apos;/MARKETING_VERSION/{print $2}&apos; | xargs)&#10; sleep 1&#10;done&#10;&#10;# Export the app file&#10;xcodebuild -exportArchive -archivePath &quot;${ARCHIVE_PATH}&quot; -exportOptionsPlist &quot;${MAIN_PROJECT_PATH}&quot;/Builds/ExportOptions.plist -exportPath &quot;${EXPORT_PATH}&quot;&#10;&#10;# Zip up the app file&#10;cd &quot;${EXPORT_PATH}&quot;&#10;zip -r -X &quot;Pearcleaner.zip&quot; &quot;Pearcleaner.app&quot;&#10;&#10;# Push to GitHub&#10;/opt/homebrew/bin/gh release create &quot;${MARKETING_VERSION}&quot; PeakPurge.zip --latest -t &quot;v${MARKETING_VERSION}&quot; -F &quot;${MAIN_PROJECT_PATH}/Builds/changes.md&quot;&#10;&#10;# Clean out the archive and app file, zip, etc. in Export folder&#10;rm -rf &quot;${ARCHIVE_PATH}&quot;&#10;#rm -rf &quot;${EXPORT_PATH}&quot;/*.app&#10;rm -rf &quot;${EXPORT_PATH}&quot;/*&#10;&#10;# Open folder at Export location&#10;#open &quot;${EXPORT_PATH}&quot;&#10;"
shellToInvoke = "/bin/bash">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C77B8FFF2AF18E2E009CC655"
BuildableName = "Pearcleaner.app"
BlueprintName = "Pearcleaner"
ReferencedContainer = "container:Pearcleaner.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PostActions>
</ArchiveAction>
</Scheme>
+2
View File
@@ -82,6 +82,8 @@ func getAppInfo(atPath path: URL) -> AppInfo? {
appName = localizedName
} else if let bundleName = bundle.infoDictionary?["CFBundleName"] as? String {
appName = bundleName
} else {
appName = path.deletingPathExtension().lastPathComponent
}
// Check if the icon file name has an .icns extension, if not, add it
if !appIconFileName.hasSuffix(".icns") {
+25
View File
@@ -39,6 +39,29 @@ struct PearcleanerApp: App {
.preferredColorScheme(displayMode.colorScheme)
.alert(isPresented: $appState.showAlert) { presentAlert(appState: appState) }
.handlesExternalEvents(preferring: Set(arrayLiteral: "pear"), allowing: Set(arrayLiteral: "*"))
.onOpenURL(perform: { url in
let deeplinkManager = DeeplinkManager()
deeplinkManager.manage(url: url, appState: appState)
})
.onDrop(of: ["public.file-url"], isTargeted: nil) { providers, _ in
for provider in providers {
provider.loadItem(forTypeIdentifier: "public.file-url") { data, error in
if let data = data as? Data, let url = URL(dataRepresentation: data, relativeTo: nil) {
let deeplinkManager = DeeplinkManager()
deeplinkManager.manage(url: url, appState: appState)
// // Check if the file URL has a ".app" extension
// if url.pathExtension.lowercased() == "app" {
// // Handle the dropped file URL here
// print("Dropped .app file URL: \(url)")
// } else {
// // Print a message for non-.app files
// print("Unsupported file type. Only .app files are accepted.")
// }
}
}
}
return true
}
.onAppear {
NSWindow.allowsAutomaticWindowTabbing = false
@@ -110,9 +133,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
// func application(_ sender: NSApplication, open urls: [URL]) {
// for url in urls {
// if url.pathExtension == "app" {
// writeLog(string: url.path)
// print("Dropped app path:", url.path)
// }
// }
// }
}
+1 -19
View File
@@ -25,12 +25,7 @@ struct AppListItems: View {
var body: some View {
VStack(alignment: .leading, spacing: 5) {
HStack(alignment: .center) {
// if isHovered || isSelected {
// Circle()
// .fill(Color("AccentColor"))
// .frame(width: 10)
// .padding(5)
// }
if let appIcon = appInfo.appIcon {
Image(nsImage: appIcon)
.resizable()
@@ -106,18 +101,5 @@ struct AppListItems: View {
}
}
}
// .popover(isPresented: $appState.showPopover, arrowEdge: .trailing) {
// VStack {
// FilesView()
// .id(appState.appInfo.id)
// }
// .background(
// Rectangle()
// .background(colorScheme == .dark ? .black.opacity(0.8) : .white)
// .padding(-80)
// )
// .frame(minWidth: 500, minHeight: 500)
//
// }
}
}
+23 -4
View File
@@ -146,10 +146,29 @@ struct AppListView: View {
Spacer()
}
.edgesIgnoringSafeArea(.all)
.onOpenURL(perform: { url in
let deeplinkManager = DeeplinkManager()
deeplinkManager.manage(url: url, appState: appState)
})
// .onOpenURL(perform: { url in
// let deeplinkManager = DeeplinkManager()
// deeplinkManager.manage(url: url, appState: appState)
// })
// .onDrop(of: ["public.file-url"], isTargeted: nil) { providers, _ in
// for provider in providers {
// provider.loadItem(forTypeIdentifier: "public.file-url") { data, error in
// if let data = data as? Data, let url = URL(dataRepresentation: data, relativeTo: nil) {
// let deeplinkManager = DeeplinkManager()
// deeplinkManager.manage(url: url, appState: appState)
// // // Check if the file URL has a ".app" extension
// // if url.pathExtension.lowercased() == "app" {
// // // Handle the dropped file URL here
// // print("Dropped .app file URL: \(url)")
// // } else {
// // // Print a message for non-.app files
// // print("Unsupported file type. Only .app files are accepted.")
// // }
// }
// }
// }
// return true
// }
// MARK: Background for whole app
// .background(Color("bg").opacity(1))
// .background(VisualEffect(material: .sidebar, blendingMode: .behindWindow).edgesIgnoringSafeArea(.all))
+10
View File
@@ -34,6 +34,15 @@ struct DropTarget: View, DropDelegate {
Spacer()
ZStack {
// Color("mode")
// .mask(
// Image(mini ? "pear" : "logo")
// .resizable()
// .scaledToFit()
// .frame(minWidth: mini ? 104 : 300)
// .frame(maxWidth: mini ? 104 : 500)
// .padding(mini ? 20 : 10)
// )
LinearGradient(gradient: Gradient(colors: [.pink, .orange]), startPoint: .leading, endPoint: .trailing)
.mask(
Image(mini ? "pear" : "logo")
@@ -54,6 +63,7 @@ struct DropTarget: View, DropDelegate {
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background {
RoundedRectangle(cornerRadius: 8)
// .fill(LinearGradient(gradient: Gradient(colors: [.pink, .orange]), startPoint: .leading, endPoint: .trailing))
.strokeBorder(LinearGradient(gradient: Gradient(colors: [.pink, .orange]), startPoint: .leading, endPoint: .trailing), style: StrokeStyle(lineWidth: 3, dash: [11.0], dashPhase: phase))
.onAppear {
withAnimation(.linear.speed(0.5).repeat(while: ants, autoreverses: false)) {
+52 -19
View File
@@ -39,16 +39,49 @@ struct MiniMode: View {
}
// .padding(.leading, appState.sidebar ? 0 : 10)
.transition(.move(edge: .leading))
.popover(isPresented: $showPopover, arrowEdge: .trailing) {
VStack {
FilesView(showPopover: $showPopover)
.id(appState.appInfo.id)
}
.background(
Rectangle()
.fill(Color("pop"))
.padding(-80)
)
.frame(minWidth: 600, minHeight: 500)
}
}
.frame(minWidth: 300, minHeight: 300)
.edgesIgnoringSafeArea(.all)
.background(glass ? GlassEffect(material: .sidebar, blendingMode: .behindWindow).edgesIgnoringSafeArea(.all) : nil)
.onOpenURL(perform: { url in
let deeplinkManager = DeeplinkManager()
deeplinkManager.manage(url: url, appState: appState)
})
// .onOpenURL(perform: { url in
// let deeplinkManager = DeeplinkManager()
// deeplinkManager.manage(url: url, appState: appState)
// })
// .onDrop(of: ["public.file-url"], isTargeted: nil) { providers, _ in
// for provider in providers {
// provider.loadItem(forTypeIdentifier: "public.file-url") { data, error in
// if let data = data as? Data, let url = URL(dataRepresentation: data, relativeTo: nil) {
// let deeplinkManager = DeeplinkManager()
// deeplinkManager.manage(url: url, appState: appState)
//// // Check if the file URL has a ".app" extension
//// if url.pathExtension.lowercased() == "app" {
//// // Handle the dropped file URL here
//// print("Dropped .app file URL: \(url)")
//// } else {
//// // Print a message for non-.app files
//// print("Unsupported file type. Only .app files are accepted.")
//// }
// }
// }
// }
// return true
// }
// MARK: Background for whole app
// .background(Color("bg").opacity(1))
// .background(VisualEffect(material: .sidebar, blendingMode: .behindWindow).edgesIgnoringSafeArea(.all))
@@ -193,20 +226,20 @@ struct MiniAppView: View {
}
}
.transition(.move(edge: .leading))
.popover(isPresented: $showPopover, arrowEdge: .trailing) {
VStack {
FilesView(showPopover: $showPopover)
.id(appState.appInfo.id)
}
.background(
Rectangle()
.fill(Color("pop"))
// .background(Color("pop"))
.padding(-80)
)
.frame(minWidth: 600, minHeight: 500)
}
// .popover(isPresented: $showPopover, arrowEdge: .trailing) {
// VStack {
// FilesView(showPopover: $showPopover)
// .id(appState.appInfo.id)
// }
// .background(
// Rectangle()
// .fill(Color("pop"))
//// .background(Color("pop"))
// .padding(-80)
// )
// .frame(minWidth: 600, minHeight: 500)
//
// }
}
}