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

Updated to Swift 5.2 #2

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ xcuserdata
*.xccheckout
*.moved-aside
*.xcuserstate
*.hmap
*.hmap

*xcshareddata/
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// swift-tools-version:5.2

import PackageDescription

let package = Package(
name: "ZMAX",
platforms: [
.macOS(.v10_15)
],
products: [
.library(
name: "ZMAX",
targets: ["ZMAX"]),
],
targets: [
.target(
name: "ZMAX",
path: "ZMAX/Sources"),
]
)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

ZMAX is a framework that bridges AX (Accessibility) APIs to Swift.

- Requirements: OS X 10.11 or later
- Swift version: 4.0
- Requirements: OS X 10.15 or later
- Swift version: 5.2

## Installation

Expand All @@ -12,7 +12,7 @@ ZMAX is a framework that bridges AX (Accessibility) APIs to Swift.
To install this framework using [Carthage](https://github.com/Carthage/Carthage), add the following line to your Cartfile.

```
github "zumuya/ZMAX"
github "soundflix/ZMAX"
```

## General usage
Expand Down
67 changes: 46 additions & 21 deletions ZMAX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
7839D15E2054CB43003B388E /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7839D15D2054CB43003B388E /* Constants.swift */; };
7839D1602054CC5A003B388E /* Observer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7839D15F2054CC5A003B388E /* Observer.swift */; };
7839D1622054CC8D003B388E /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7839D1612054CC8D003B388E /* Extensions.swift */; };
DCF6E2BC292D9C9B00CBF027 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCF6E2BB292D9C9B00CBF027 /* Utilities.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
28EEEBA126B89FA400360256 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
7839D151205418D0003B388E /* ZMAX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZMAX.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7839D155205418D0003B388E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7839D15D2054CB43003B388E /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
7839D15F2054CC5A003B388E /* Observer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Observer.swift; sourceTree = "<group>"; };
7839D1612054CC8D003B388E /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
7839D16320550CC8003B388E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
DCF6E2BB292D9C9B00CBF027 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -32,30 +35,32 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
7839D147205418D0003B388E = {
28EEEBAE26B8A90C00360256 /* ZMAX */ = {
isa = PBXGroup;
children = (
7839D16320550CC8003B388E /* README.md */,
7839D153205418D0003B388E /* ZMAX */,
7839D155205418D0003B388E /* Info.plist */,
7839D15C2054CAF0003B388E /* Sources */,
7839D152205418D0003B388E /* Products */,
);
path = ZMAX;
sourceTree = "<group>";
};
7839D152205418D0003B388E /* Products */ = {
7839D147205418D0003B388E = {
isa = PBXGroup;
children = (
7839D151205418D0003B388E /* ZMAX.framework */,
7839D16320550CC8003B388E /* README.md */,
28EEEBA126B89FA400360256 /* Package.swift */,
28EEEBAE26B8A90C00360256 /* ZMAX */,
);
name = Products;
sourceTree = "<group>";
};
7839D153205418D0003B388E /* ZMAX */ = {
7839D152205418D0003B388E /* Products */ = {
isa = PBXGroup;
children = (
7839D155205418D0003B388E /* Info.plist */,
7839D15C2054CAF0003B388E /* Sources */,
7839D151205418D0003B388E /* ZMAX.framework */,
);
path = ZMAX;
name = Products;
path = ..;
sourceTree = "<group>";
};
7839D15C2054CAF0003B388E /* Sources */ = {
Expand All @@ -64,6 +69,7 @@
7839D15D2054CB43003B388E /* Constants.swift */,
7839D15F2054CC5A003B388E /* Observer.swift */,
7839D1612054CC8D003B388E /* Extensions.swift */,
DCF6E2BB292D9C9B00CBF027 /* Utilities.swift */,
);
path = Sources;
sourceTree = "<group>";
Expand Down Expand Up @@ -105,22 +111,23 @@
7839D148205418D0003B388E /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = zumuya;
TargetAttributes = {
7839D150205418D0003B388E = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 0900;
LastSwiftMigration = 1240;
ProvisioningStyle = Manual;
};
};
};
buildConfigurationList = 7839D14B205418D0003B388E /* Build configuration list for PBXProject "ZMAX" */;
compatibilityVersion = "Xcode 8.0";
compatibilityVersion = "Xcode 12.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 7839D147205418D0003B388E;
productRefGroup = 7839D152205418D0003B388E /* Products */;
Expand Down Expand Up @@ -149,6 +156,7 @@
files = (
7839D15E2054CB43003B388E /* Constants.swift in Sources */,
7839D1622054CC8D003B388E /* Extensions.swift in Sources */,
DCF6E2BC292D9C9B00CBF027 /* Utilities.swift in Sources */,
7839D1602054CC5A003B388E /* Observer.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -170,15 +178,18 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -205,7 +216,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
GENERATE_PKGINFO_FILE = NO;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand All @@ -230,15 +242,18 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand All @@ -259,10 +274,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
GENERATE_PKGINFO_FILE = NO;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -283,13 +300,17 @@
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = ZMAX/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = zom.zumuya.ZMAX;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -308,12 +329,16 @@
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = ZMAX/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = zom.zumuya.ZMAX;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
8 changes: 1 addition & 7 deletions ZMAX.xcodeproj/xcshareddata/xcschemes/ZMAX.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,18 +26,14 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand All @@ -53,8 +49,6 @@
ReferencedContainer = "container:ZMAX.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
4 changes: 2 additions & 2 deletions ZMAX/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand All @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<string>1.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
8 changes: 6 additions & 2 deletions ZMAX/Sources/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

import Cocoa
import os

public struct ZMAXActionName: RawRepresentable
{
Expand Down Expand Up @@ -137,7 +138,7 @@ extension AXError: LocalizedError
case .invalidUIElementObserver:
return "Accessibility: Invalid UI element observer"
case .cannotComplete:
return "Cannot complete."
return "Accessibility: Cannot complete."
case .attributeUnsupported:
return "Accessibility Attribute is not supported."
case .actionUnsupported:
Expand All @@ -158,6 +159,9 @@ extension AXError: LocalizedError
return "Accessibility parameterized attribute is not supported"
case .notEnoughPrecision:
return "Accessibility: Not enough precision"
}
@unknown default:
os_log(.error, log: .init(subsystem: "ZMAX", category: "Constants"), "Unknown Error")
return "Accessibility: Unknown Error"
}
}
}
Loading