diff --git a/Cargo.lock b/Cargo.lock index 00e35fece..3491524cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,6 +185,7 @@ dependencies = [ "block2", "dispatch", "objc2", + "objc2-foundation", "objc2-helpers", "static_assertions", ] @@ -320,6 +321,17 @@ dependencies = [ name = "objc2-encode" version = "4.0.0" +[[package]] +name = "objc2-foundation" +version = "0.2.0" +dependencies = [ + "block2", + "dispatch", + "objc2", + "objc2-helpers", + "static_assertions", +] + [[package]] name = "objc2-helpers" version = "0.0.0" diff --git a/crates/header-translator/framework-includes.h b/crates/header-translator/framework-includes.h deleted file mode 100644 index a5e0f79ec..000000000 --- a/crates/header-translator/framework-includes.h +++ /dev/null @@ -1,102 +0,0 @@ -#include - -#if TARGET_OS_OSX -#import -#import -#import -#import -#endif - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import - -#import diff --git a/crates/header-translator/src/config.rs b/crates/header-translator/src/config.rs index 36dfc7f35..f79af68a1 100644 --- a/crates/header-translator/src/config.rs +++ b/crates/header-translator/src/config.rs @@ -85,6 +85,8 @@ fn get_version<'de, D: serde::Deserializer<'de>>( #[derive(Deserialize, Debug, Default, Clone, PartialEq, Eq)] #[serde(deny_unknown_fields)] pub struct LibraryData { + #[serde(rename = "crate")] + pub krate: String, pub imports: Vec, #[serde(rename = "cfg-apple-link")] #[serde(default)] diff --git a/crates/header-translator/translation-config.toml b/crates/header-translator/translation-config.toml index 8b0a2a503..c100de658 100644 --- a/crates/header-translator/translation-config.toml +++ b/crates/header-translator/translation-config.toml @@ -5,6 +5,7 @@ ### [library.Accessibility] +krate = "objc2-accessibility" imports = ["Foundation"] macos = "11.0" maccatalyst = "14.0" @@ -13,12 +14,14 @@ tvos = "14.0" watchos = "7.0" [library.AdServices] +krate = "objc2-ad-services" imports = ["Foundation"] macos = "11.1" maccatalyst = "14.3" ios = "14.3" [library.AdSupport] +krate = "objc2-ad-support" imports = ["Foundation"] macos = "10.14" maccatalyst = "13.0" @@ -26,12 +29,14 @@ ios = "6.0" tvos = "9.0" [library.AppKit] +krate = "objc2-app-kit" imports = ["CoreData", "Foundation"] cfg-apple-link = true macos = "10.0" maccatalyst = "13.0" [library.AuthenticationServices] +krate = "objc2-authentication-services" imports = ["AppKit", "Foundation"] macos = "10.15" maccatalyst = "13.0" @@ -40,35 +45,41 @@ tvos = "13.0" watchos = "6.0" [library.AutomaticAssessmentConfiguration] +krate = "objc2-automatic-assessment-configuration" imports = ["Foundation"] macos = "10.15.4" maccatalyst = "13.4" ios = "13.4" [library.Automator] +krate = "objc2-automator" imports = ["AppKit", "Foundation", "OSAKit"] macos = "10.4" maccatalyst = "14.0" [library.BackgroundAssets] +krate = "objc2-background-assets" imports = ["Foundation"] macos = "13.0" maccatalyst = "16.0" ios = "16.0" [library.BackgroundTasks] +krate = "objc2-background-tasks" imports = ["Foundation"] maccatalyst = "13.0" ios = "13.0" tvos = "13.0" [library.BusinessChat] +krate = "objc2-business-chat" imports = ["AppKit", "Foundation"] macos = "10.14" maccatalyst = "13.0" # Unsure ios = "11.0" # Unsure [library.CallKit] +krate = "objc2-call-kit" imports = ["Foundation"] macos = "13.0" maccatalyst = "13.0" @@ -76,12 +87,14 @@ ios = "10.0" watchos = "9.0" [library.ClassKit] +krate = "objc2-class-kit" imports = ["Foundation"] macos = "11.0" maccatalyst = "14.0" ios = "11.4" [library.CloudKit] +krate = "objc2-cloud-kit" imports = ["CoreLocation", "Foundation"] macos = "10.10" maccatalyst = "13.0" @@ -90,6 +103,7 @@ tvos = "9.0" watchos = "3.0" [library.Contacts] +krate = "objc2-contacts" imports = ["Foundation"] macos = "10.11" maccatalyst = "13.0" @@ -97,6 +111,7 @@ ios = "9.0" watchos = "2.0" [library.CoreData] +krate = "objc2-core-data" imports = ["Foundation"] cfg-apple-link = true macos = "10.4" @@ -106,6 +121,7 @@ tvos = "9.0" watchos = "2.0" [library.CoreLocation] +krate = "objc2-core-location" imports = ["Contacts", "Foundation"] # macos = "10.6" macos = "10.11" # Temporarily raised since `CoreLocation` imports `Contacts` @@ -115,10 +131,12 @@ tvos = "9.0" watchos = "2.0" [library.CoreWLAN] +krate = "objc2-core-wlan" imports = ["Foundation"] macos = "10.6" [library.DataDetection] +krate = "objc2-data-detection" imports = ["Foundation"] macos = "12.0" maccatalyst = "15.0" @@ -127,6 +145,7 @@ tvos = "15.0" watchos = "8.0" [library.DeviceCheck] +krate = "objc2-device-check" imports = ["Foundation"] macos = "10.15" maccatalyst = "13.0" @@ -135,6 +154,7 @@ tvos = "11.0" watchos = "9.0" [library.EventKit] +krate = "objc2-event-kit" imports = ["AppKit", "CoreLocation", "Foundation", "MapKit"] macos = "10.8" maccatalyst = "13.0" @@ -142,11 +162,13 @@ ios = "4.0" watchos = "2.0" [library.ExceptionHandling] +krate = "objc2-exception-handling" imports = ["Foundation"] macos = "10.0" maccatalyst = "13.0" [library.ExtensionKit] +krate = "objc2-extension-kit" imports = ["AppKit", "Foundation"] macos = "13.0" maccatalyst = "13.0" @@ -155,6 +177,7 @@ tvos = "16.0" watchos = "9.0" [library.ExternalAccessory] +krate = "objc2-external-accessory" imports = ["Foundation"] macos = "10.13" maccatalyst = "16.0" @@ -162,17 +185,20 @@ ios = "3.0" tvos = "10.0" [library.FileProvider] +krate = "objc2-file-provider" imports = ["AppKit", "Foundation", "UniformTypeIdentifiers"] macos = "10.15" ios = "11.0" [library.FileProviderUI] +krate = "objc2-file-provider-ui" imports = ["AppKit", "FileProvider", "Foundation"] macos = "10.15" maccatalyst = "15.0" ios = "11.0" [library.Foundation] +krate = "objc2-foundation" imports = [] cfg-apple-link = true extra-features = [ @@ -192,6 +218,7 @@ tvos = "9.0" watchos = "2.0" [library.GameController] +krate = "objc2-game-controller" imports = ["AppKit", "Foundation"] macos = "10.9" maccatalyst = "13.0" @@ -199,6 +226,7 @@ ios = "7.0" tvos = "9.0" [library.GameKit] +krate = "objc2-game-kit" imports = ["AppKit", "Foundation"] macos = "10.8" maccatalyst = "13.0" @@ -207,6 +235,7 @@ tvos = "9.0" watchos = "3.0" [library.HealthKit] +krate = "objc2-health-kit" imports = ["CoreLocation", "Foundation", "UniformTypeIdentifiers"] macos = "13.0" maccatalyst = "13.0" @@ -214,17 +243,20 @@ ios = "8.0" watchos = "2.0" [library.IdentityLookup] +krate = "objc2-identity-lookup" imports = ["Foundation"] macos = "10.15" maccatalyst = "13.0" ios = "11.0" [library.InputMethodKit] +krate = "objc2-input-method-kit" imports = ["AppKit", "Foundation"] macos = "10.5" maccatalyst = "13.0" [library.LocalAuthentication] +krate = "objc2-local-authentication" imports = ["Foundation"] macos = "10.10" maccatalyst = "13.0" @@ -232,12 +264,14 @@ ios = "8.0" watchos = "9.0" [library.LocalAuthenticationEmbeddedUI] +krate = "objc2-local-authentication-embedded-ui" imports = ["AppKit", "Foundation", "LocalAuthentication"] macos = "12.0" maccatalyst = "16.0" ios = "16.0" [library.LinkPresentation] +krate = "objc2-link-presentation" imports = ["AppKit", "Foundation"] macos = "10.15" maccatalyst = "13.0" @@ -245,10 +279,12 @@ ios = "13.0" tvos = "14.0" [library.MailKit] +krate = "objc2-mail-kit" imports = ["AppKit", "Foundation"] macos = "12.0" [library.MapKit] +krate = "objc2-map-kit" imports = ["AppKit", "Contacts", "CoreLocation", "Foundation"] macos = "10.9" maccatalyst = "13.0" @@ -257,6 +293,7 @@ tvos = "9.2" watchos = "2.0" [library.MediaPlayer] +krate = "objc2-media-player" imports = ["AppKit", "Foundation"] macos = "10.12.1" maccatalyst = "13.0" @@ -265,6 +302,7 @@ tvos = "9.0" watchos = "5.0" [library.Metal] +krate = "objc2-metal" imports = ["Foundation"] macos = "10.11" maccatalyst = "13.0" @@ -272,12 +310,14 @@ ios = "8.0" tvos = "9.0" [library.MetalFX] +krate = "objc2-metal-fx" imports = ["Foundation", "Metal"] macos = "13.0" maccatalyst = "16.0" ios = "16.0" [library.MetalKit] +krate = "objc2-metal-kit" imports = ["AppKit", "Foundation", "Metal"] macos = "10.11" maccatalyst = "13.0" @@ -285,12 +325,14 @@ ios = "9.0" tvos = "9.0" [library.MetricKit] +krate = "objc2-metric-kit" imports = ["Foundation"] macos = "12.0" maccatalyst = "13.0" ios = "13.0" [library.Photos] +krate = "objc2-photos" imports = ["AppKit", "CoreLocation", "Foundation", "UniformTypeIdentifiers"] macos = "10.11" maccatalyst = "13.0" @@ -299,10 +341,12 @@ tvos = "10.0" watchos = "9.0" [library.OSAKit] +krate = "objc2-osa-kit" imports = ["AppKit", "Foundation"] macos = "10.4" [library.QuartzCore] +krate = "objc2-quartz-core" imports = ["Foundation"] macos = "10.3" maccatalyst = "13.0" @@ -310,6 +354,7 @@ ios = "2.0" tvos = "9.0" [library.ServiceManagement] +krate = "objc2-service-management" imports = ["Foundation"] macos = "10.6" maccatalyst = "13.0" @@ -318,6 +363,7 @@ tvos = "12.1" watchos = "5.1" [library.SoundAnalysis] +krate = "objc2-sound-analysis" imports = ["Foundation"] macos = "10.15" maccatalyst = "13.0" @@ -326,12 +372,14 @@ tvos = "13.0" watchos = "9.0" [library.Speech] +krate = "objc2-speech" imports = ["Foundation"] macos = "10.15" maccatalyst = "13.0" ios = "10.0" [library.StoreKit] +krate = "objc2-store-kit" imports = ["AppKit", "Foundation"] macos = "10.7" maccatalyst = "13.0" @@ -340,6 +388,7 @@ tvos = "9.0" watchos = "6.2" [library.UniformTypeIdentifiers] +krate = "objc2-uniform-type-identifiers" imports = ["Foundation"] macos = "11.0" maccatalyst = "14.0" @@ -348,6 +397,7 @@ tvos = "14.0" watchos = "7.0" [library.UserNotifications] +krate = "objc2-user-notifications" imports = ["CoreLocation", "Foundation"] macos = "10.14" maccatalyst = "13.0" @@ -356,6 +406,7 @@ tvos = "10.0" watchos = "3.0" [library.WebKit] +krate = "objc2-web-kit" imports = ["AppKit", "Foundation"] macos = "10.2" maccatalyst = "13.0" diff --git a/crates/icrate/Cargo.toml b/crates/icrate/Cargo.toml index 9a21ff486..3827cbb47 100644 --- a/crates/icrate/Cargo.toml +++ b/crates/icrate/Cargo.toml @@ -26,6 +26,7 @@ workspace = true objc2 = { path = "../objc2", version = "0.5.0", default-features = false, optional = true } block2 = { path = "../block2", version = "0.4.0", default-features = false, optional = true } objc2-helpers = { path = "../objc2-helpers" } +objc2-foundation = { path = "../objc2-foundation", optional = true } dispatch = { version = "0.2.0", optional = true } [dev-dependencies] @@ -51,24 +52,12 @@ targets = [ "x86_64-pc-windows-msvc", ] -[[example]] -name = "basic_usage" -required-features = [ - "unstable-example-basic_usage" -] - [[example]] name = "delegate" required-features = [ "unstable-example-delegate" ] -[[example]] -name = "speech_synthesis" -required-features = [ - "unstable-example-speech_synthesis" -] - [[example]] name = "nspasteboard" required-features = [ @@ -107,12 +96,12 @@ objc2 = ["dep:objc2", "objc2-helpers/objc2"] # Deprecated. objective-c = ["objc2"] -block2 = ["dep:block2", "objc2-helpers/block2"] +block2 = ["dep:block2", "objc2-helpers/block2", "objc2-foundation?/block2"] # Deprecated. block = ["block2"] -dispatch = ["dep:dispatch"] +dispatch = ["dep:dispatch", "objc2-foundation?/dispatch"] # For better documentation on docs.rs unstable-docsrs = [] @@ -131,14 +120,6 @@ unstable-static-nsstring = [] # Examples -unstable-example-basic_usage = [ - "Foundation", - "Foundation_NSArray", - "Foundation_NSDictionary", - "Foundation_NSEnumerator", - "Foundation_NSRange", - "Foundation_NSObject", -] unstable-example-delegate = [ "apple", "Foundation", @@ -151,12 +132,6 @@ unstable-example-delegate = [ "AppKit_NSApplication", "AppKit_NSRunningApplication", ] -unstable-example-speech_synthesis = [ - "apple", - "Foundation", - "Foundation_NSString", - "Foundation_NSObject", -] unstable-example-nspasteboard = [ "apple", "Foundation", @@ -233,7 +208,7 @@ unstable-example-metal = [ # Helps with CI unstable-frameworks-all = ["unstable-frameworks-ios", "unstable-frameworks-macos-13"] # TODO: Autogenerate this -unstable-frameworks-ios = ["Foundation_all", "unstable-example-basic_usage", "unstable-example-speech_synthesis"] +unstable-frameworks-ios = ["Foundation_all"] # This section has been automatically generated by `objc2`'s `header-translator`. # DO NOT EDIT @@ -1725,6 +1700,7 @@ FileProvider_all = [ Foundation = [ "objc2", "block2", + "objc2-foundation", "Foundation_NSObjCRuntime", "Foundation_NSString", "Foundation_NSDictionary", @@ -3799,14 +3775,12 @@ unstable-frameworks-macos-10-12 = [ "ServiceManagement_all", "StoreKit_all", "WebKit_all", - "unstable-example-basic_usage", ] unstable-frameworks-macos-10-13 = [ "ExternalAccessory_all", "unstable-example-delegate", "unstable-example-metal", "unstable-example-nspasteboard", - "unstable-example-speech_synthesis", "unstable-frameworks-macos-10-12", ] unstable-frameworks-macos-11 = [ diff --git a/crates/icrate/src/additions/mod.rs b/crates/icrate/src/additions/mod.rs index 34fd81ae7..0b3487289 100644 --- a/crates/icrate/src/additions/mod.rs +++ b/crates/icrate/src/additions/mod.rs @@ -5,8 +5,6 @@ pub mod AppKit; pub mod AuthenticationServices; #[cfg(feature = "CallKit")] pub mod CallKit; -#[cfg(feature = "Foundation")] -pub mod Foundation; #[cfg(feature = "GameController")] pub mod GameController; #[cfg(feature = "InputMethodKit")] diff --git a/crates/icrate/src/lib.rs b/crates/icrate/src/lib.rs index 8d6143db7..8b6d1210e 100644 --- a/crates/icrate/src/lib.rs +++ b/crates/icrate/src/lib.rs @@ -155,14 +155,15 @@ macro_rules! ns_string { }; } +#[cfg(feature = "Foundation")] +pub use objc2_foundation as Foundation; + #[cfg(feature = "AppKit")] pub use self::additions::AppKit; #[cfg(feature = "AuthenticationServices")] pub use self::additions::AuthenticationServices; #[cfg(feature = "CallKit")] pub use self::additions::CallKit; -#[cfg(feature = "Foundation")] -pub use self::additions::Foundation; #[cfg(feature = "GameController")] pub use self::additions::GameController; #[cfg(feature = "InputMethodKit")] diff --git a/crates/objc2-foundation/Cargo.toml b/crates/objc2-foundation/Cargo.toml new file mode 100644 index 000000000..cb5faed44 --- /dev/null +++ b/crates/objc2-foundation/Cargo.toml @@ -0,0 +1,430 @@ +[package] +name = "objc2-foundation" +version = "0.2.0" +description = "Bindings to the Foundation framework" +edition = "2021" +rust-version = "1.64" +keywords = ["macos", "ios", "cocoa", "apple", "framework"] +categories = [ + "api-bindings", + "development-tools::ffi", + "external-ffi-bindings", + "os::macos-apis", +] +repository = "https://github.com/madsmtm/objc2" +license = "MIT" + +[dependencies] +objc2 = { path = "../objc2", version = "0.5.0", default-features = false } +block2 = { path = "../block2", version = "0.4.0", default-features = false, optional = true } +dispatch = { version = "0.2.0", optional = true } +objc2-helpers = { path = "../objc2-helpers" } + +[dev-dependencies] +static_assertions = "1.1.0" + +[package.metadata.docs.rs] +default-target = "aarch64-apple-darwin" +features = ["block2", "dispatch", "libc", "all", "unstable-docsrs"] +targets = [ + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "aarch64-apple-ios", + "aarch64-apple-tvos", + "aarch64-apple-watchos", +] + +[[example]] +name = "basic_usage" +required-features = [ + "Foundation_NSArray", + "Foundation_NSDictionary", + "Foundation_NSEnumerator", + "Foundation_NSRange", + "Foundation_NSObject", +] + +[[example]] +name = "speech_synthesis" +required-features = [ + "apple", + "Foundation", + "Foundation_NSString", + "Foundation_NSObject", +] + +[features] +default = [ + "std", + "apple", + "block2", + "objc2", + "Foundation_NSObjCRuntime", + "Foundation_NSString", + "Foundation_NSDictionary", + "Foundation_NSEnumerator", +] + +# Currently not possible to turn off, put here for forwards compatibility. +std = ["alloc", "objc2/std", "block2?/std", "objc2"] +alloc = ["objc2/alloc", "block2?/alloc"] + +# Runtime selection. See `objc-sys` for details. +apple = ["objc2/apple", "block2?/apple"] +gnustep-1-7 = ["objc2/gnustep-1-7", "block2?/gnustep-1-7"] +gnustep-1-8 = ["gnustep-1-7", "objc2/gnustep-1-8", "block2?/gnustep-1-8"] +gnustep-1-9 = ["gnustep-1-8", "objc2/gnustep-1-9", "block2?/gnustep-1-9"] +gnustep-2-0 = ["gnustep-1-9", "objc2/gnustep-2-0", "block2?/gnustep-2-0"] +gnustep-2-1 = ["gnustep-2-0", "objc2/gnustep-2-1", "block2?/gnustep-2-1"] + +objc2 = ["objc2-helpers/objc2"] # Required +block2 = ["dep:block2", "objc2-helpers/block2"] +dispatch = ["dep:dispatch"] + +# For better documentation on docs.rs +unstable-docsrs = [] + +# Make the `ns_string!` macro create the string statically. +# +# Please test it, and report any issues you may find: +# https://github.com/madsmtm/objc2/issues/new +unstable-static-nsstring = [] + +# This section has been automatically generated by `objc2`'s `header-translator`. +# DO NOT EDIT +Foundation_FoundationErrors = [] +Foundation_FoundationLegacySwiftCompatibility = [] +Foundation_NSAffineTransform = [] +Foundation_NSAppleEventDescriptor = [] +Foundation_NSAppleEventManager = [] +Foundation_NSAppleScript = [] +Foundation_NSArchiver = [] +Foundation_NSArray = [] +Foundation_NSAttributedString = [] +Foundation_NSAutoreleasePool = [] +Foundation_NSBackgroundActivityScheduler = [] +Foundation_NSBundle = [] +Foundation_NSByteCountFormatter = [] +Foundation_NSByteOrder = [] +Foundation_NSCache = [] +Foundation_NSCalendar = [] +Foundation_NSCalendarDate = [] +Foundation_NSCharacterSet = [] +Foundation_NSClassDescription = [] +Foundation_NSCoder = [] +Foundation_NSComparisonPredicate = [] +Foundation_NSCompoundPredicate = [] +Foundation_NSConnection = [] +Foundation_NSData = [] +Foundation_NSDate = [] +Foundation_NSDateComponentsFormatter = [] +Foundation_NSDateFormatter = [] +Foundation_NSDateInterval = [] +Foundation_NSDateIntervalFormatter = [] +Foundation_NSDecimal = [] +Foundation_NSDecimalNumber = [] +Foundation_NSDictionary = [] +Foundation_NSDistantObject = [] +Foundation_NSDistributedLock = [] +Foundation_NSDistributedNotificationCenter = [] +Foundation_NSEnergyFormatter = [] +Foundation_NSEnumerator = [] +Foundation_NSError = [] +Foundation_NSException = [] +Foundation_NSExpression = [] +Foundation_NSExtensionContext = [] +Foundation_NSExtensionItem = [] +Foundation_NSExtensionRequestHandling = [] +Foundation_NSFileCoordinator = [] +Foundation_NSFileHandle = [] +Foundation_NSFileManager = [] +Foundation_NSFilePresenter = [] +Foundation_NSFileVersion = [] +Foundation_NSFileWrapper = [] +Foundation_NSFormatter = [] +Foundation_NSGarbageCollector = [] +Foundation_NSGeometry = [] +Foundation_NSHFSFileTypes = [] +Foundation_NSHTTPCookie = [] +Foundation_NSHTTPCookieStorage = [] +Foundation_NSHashTable = [] +Foundation_NSHost = [] +Foundation_NSISO8601DateFormatter = [] +Foundation_NSIndexPath = [] +Foundation_NSIndexSet = [] +Foundation_NSInflectionRule = [] +Foundation_NSInvocation = [] +Foundation_NSItemProvider = [] +Foundation_NSJSONSerialization = [] +Foundation_NSKeyValueCoding = [] +Foundation_NSKeyValueObserving = [] +Foundation_NSKeyedArchiver = [] +Foundation_NSLengthFormatter = [] +Foundation_NSLinguisticTagger = [] +Foundation_NSListFormatter = [] +Foundation_NSLocale = [] +Foundation_NSLock = [] +Foundation_NSMapTable = [] +Foundation_NSMassFormatter = [] +Foundation_NSMeasurement = [] +Foundation_NSMeasurementFormatter = [] +Foundation_NSMetadata = [] +Foundation_NSMetadataAttributes = [] +Foundation_NSMethodSignature = [] +Foundation_NSMorphology = [] +Foundation_NSNetServices = [] +Foundation_NSNotification = [] +Foundation_NSNotificationQueue = [] +Foundation_NSNull = [] +Foundation_NSNumberFormatter = [] +Foundation_NSObjCRuntime = [] +Foundation_NSObject = [] +Foundation_NSObjectScripting = [] +Foundation_NSOperation = [] +Foundation_NSOrderedCollectionChange = [] +Foundation_NSOrderedCollectionDifference = [] +Foundation_NSOrderedSet = [] +Foundation_NSOrthography = [] +Foundation_NSPathUtilities = [] +Foundation_NSPersonNameComponents = [] +Foundation_NSPersonNameComponentsFormatter = [] +Foundation_NSPointerArray = [] +Foundation_NSPointerFunctions = [] +Foundation_NSPort = [] +Foundation_NSPortCoder = [] +Foundation_NSPortMessage = [] +Foundation_NSPortNameServer = [] +Foundation_NSPredicate = [] +Foundation_NSProcessInfo = [] +Foundation_NSProgress = [] +Foundation_NSPropertyList = [] +Foundation_NSProtocolChecker = [] +Foundation_NSProxy = [] +Foundation_NSRange = [] +Foundation_NSRegularExpression = [] +Foundation_NSRelativeDateTimeFormatter = [] +Foundation_NSRunLoop = [] +Foundation_NSScanner = [] +Foundation_NSScriptClassDescription = [] +Foundation_NSScriptCoercionHandler = [] +Foundation_NSScriptCommand = [] +Foundation_NSScriptCommandDescription = [] +Foundation_NSScriptExecutionContext = [] +Foundation_NSScriptKeyValueCoding = [] +Foundation_NSScriptObjectSpecifiers = [] +Foundation_NSScriptStandardSuiteCommands = [] +Foundation_NSScriptSuiteRegistry = [] +Foundation_NSScriptWhoseTests = [] +Foundation_NSSet = [] +Foundation_NSSortDescriptor = [] +Foundation_NSSpellServer = [] +Foundation_NSStream = [] +Foundation_NSString = [] +Foundation_NSTask = [] +Foundation_NSTermOfAddress = [] +Foundation_NSTextCheckingResult = [] +Foundation_NSThread = [] +Foundation_NSTimeZone = [] +Foundation_NSTimer = [] +Foundation_NSURL = [] +Foundation_NSURLAuthenticationChallenge = [] +Foundation_NSURLCache = [] +Foundation_NSURLConnection = [] +Foundation_NSURLCredential = [] +Foundation_NSURLCredentialStorage = [] +Foundation_NSURLDownload = [] +Foundation_NSURLError = [] +Foundation_NSURLHandle = [] +Foundation_NSURLProtectionSpace = [] +Foundation_NSURLProtocol = [] +Foundation_NSURLRequest = [] +Foundation_NSURLResponse = [] +Foundation_NSURLSession = [] +Foundation_NSUUID = [] +Foundation_NSUbiquitousKeyValueStore = [] +Foundation_NSUndoManager = [] +Foundation_NSUnit = [] +Foundation_NSUserActivity = [] +Foundation_NSUserDefaults = [] +Foundation_NSUserNotification = [] +Foundation_NSUserScriptTask = [] +Foundation_NSValue = [] +Foundation_NSValueTransformer = [] +Foundation_NSXMLDTD = [] +Foundation_NSXMLDTDNode = [] +Foundation_NSXMLDocument = [] +Foundation_NSXMLElement = [] +Foundation_NSXMLNode = [] +Foundation_NSXMLNodeOptions = [] +Foundation_NSXMLParser = [] +Foundation_NSXPCConnection = [] +Foundation_NSZone = [] +Foundation_all = [ + "Foundation_FoundationErrors", + "Foundation_FoundationLegacySwiftCompatibility", + "Foundation_NSAffineTransform", + "Foundation_NSAppleEventDescriptor", + "Foundation_NSAppleEventManager", + "Foundation_NSAppleScript", + "Foundation_NSArchiver", + "Foundation_NSArray", + "Foundation_NSAttributedString", + "Foundation_NSAutoreleasePool", + "Foundation_NSBackgroundActivityScheduler", + "Foundation_NSBundle", + "Foundation_NSByteCountFormatter", + "Foundation_NSByteOrder", + "Foundation_NSCache", + "Foundation_NSCalendar", + "Foundation_NSCalendarDate", + "Foundation_NSCharacterSet", + "Foundation_NSClassDescription", + "Foundation_NSCoder", + "Foundation_NSComparisonPredicate", + "Foundation_NSCompoundPredicate", + "Foundation_NSConnection", + "Foundation_NSData", + "Foundation_NSDate", + "Foundation_NSDateComponentsFormatter", + "Foundation_NSDateFormatter", + "Foundation_NSDateInterval", + "Foundation_NSDateIntervalFormatter", + "Foundation_NSDecimal", + "Foundation_NSDecimalNumber", + "Foundation_NSDictionary", + "Foundation_NSDistantObject", + "Foundation_NSDistributedLock", + "Foundation_NSDistributedNotificationCenter", + "Foundation_NSEnergyFormatter", + "Foundation_NSEnumerator", + "Foundation_NSError", + "Foundation_NSException", + "Foundation_NSExpression", + "Foundation_NSExtensionContext", + "Foundation_NSExtensionItem", + "Foundation_NSExtensionRequestHandling", + "Foundation_NSFileCoordinator", + "Foundation_NSFileHandle", + "Foundation_NSFileManager", + "Foundation_NSFilePresenter", + "Foundation_NSFileVersion", + "Foundation_NSFileWrapper", + "Foundation_NSFormatter", + "Foundation_NSGarbageCollector", + "Foundation_NSGeometry", + "Foundation_NSHFSFileTypes", + "Foundation_NSHTTPCookie", + "Foundation_NSHTTPCookieStorage", + "Foundation_NSHashTable", + "Foundation_NSHost", + "Foundation_NSISO8601DateFormatter", + "Foundation_NSIndexPath", + "Foundation_NSIndexSet", + "Foundation_NSInflectionRule", + "Foundation_NSInvocation", + "Foundation_NSItemProvider", + "Foundation_NSJSONSerialization", + "Foundation_NSKeyValueCoding", + "Foundation_NSKeyValueObserving", + "Foundation_NSKeyedArchiver", + "Foundation_NSLengthFormatter", + "Foundation_NSLinguisticTagger", + "Foundation_NSListFormatter", + "Foundation_NSLocale", + "Foundation_NSLock", + "Foundation_NSMapTable", + "Foundation_NSMassFormatter", + "Foundation_NSMeasurement", + "Foundation_NSMeasurementFormatter", + "Foundation_NSMetadata", + "Foundation_NSMetadataAttributes", + "Foundation_NSMethodSignature", + "Foundation_NSMorphology", + "Foundation_NSNetServices", + "Foundation_NSNotification", + "Foundation_NSNotificationQueue", + "Foundation_NSNull", + "Foundation_NSNumberFormatter", + "Foundation_NSObjCRuntime", + "Foundation_NSObject", + "Foundation_NSObjectScripting", + "Foundation_NSOperation", + "Foundation_NSOrderedCollectionChange", + "Foundation_NSOrderedCollectionDifference", + "Foundation_NSOrderedSet", + "Foundation_NSOrthography", + "Foundation_NSPathUtilities", + "Foundation_NSPersonNameComponents", + "Foundation_NSPersonNameComponentsFormatter", + "Foundation_NSPointerArray", + "Foundation_NSPointerFunctions", + "Foundation_NSPort", + "Foundation_NSPortCoder", + "Foundation_NSPortMessage", + "Foundation_NSPortNameServer", + "Foundation_NSPredicate", + "Foundation_NSProcessInfo", + "Foundation_NSProgress", + "Foundation_NSPropertyList", + "Foundation_NSProtocolChecker", + "Foundation_NSProxy", + "Foundation_NSRange", + "Foundation_NSRegularExpression", + "Foundation_NSRelativeDateTimeFormatter", + "Foundation_NSRunLoop", + "Foundation_NSScanner", + "Foundation_NSScriptClassDescription", + "Foundation_NSScriptCoercionHandler", + "Foundation_NSScriptCommand", + "Foundation_NSScriptCommandDescription", + "Foundation_NSScriptExecutionContext", + "Foundation_NSScriptKeyValueCoding", + "Foundation_NSScriptObjectSpecifiers", + "Foundation_NSScriptStandardSuiteCommands", + "Foundation_NSScriptSuiteRegistry", + "Foundation_NSScriptWhoseTests", + "Foundation_NSSet", + "Foundation_NSSortDescriptor", + "Foundation_NSSpellServer", + "Foundation_NSStream", + "Foundation_NSString", + "Foundation_NSTask", + "Foundation_NSTermOfAddress", + "Foundation_NSTextCheckingResult", + "Foundation_NSThread", + "Foundation_NSTimeZone", + "Foundation_NSTimer", + "Foundation_NSURL", + "Foundation_NSURLAuthenticationChallenge", + "Foundation_NSURLCache", + "Foundation_NSURLConnection", + "Foundation_NSURLCredential", + "Foundation_NSURLCredentialStorage", + "Foundation_NSURLDownload", + "Foundation_NSURLError", + "Foundation_NSURLHandle", + "Foundation_NSURLProtectionSpace", + "Foundation_NSURLProtocol", + "Foundation_NSURLRequest", + "Foundation_NSURLResponse", + "Foundation_NSURLSession", + "Foundation_NSUUID", + "Foundation_NSUbiquitousKeyValueStore", + "Foundation_NSUndoManager", + "Foundation_NSUnit", + "Foundation_NSUserActivity", + "Foundation_NSUserDefaults", + "Foundation_NSUserNotification", + "Foundation_NSUserScriptTask", + "Foundation_NSValue", + "Foundation_NSValueTransformer", + "Foundation_NSXMLDTD", + "Foundation_NSXMLDTDNode", + "Foundation_NSXMLDocument", + "Foundation_NSXMLElement", + "Foundation_NSXMLNode", + "Foundation_NSXMLNodeOptions", + "Foundation_NSXMLParser", + "Foundation_NSXPCConnection", + "Foundation_NSZone", +] diff --git a/crates/icrate/examples/basic_usage.rs b/crates/objc2-foundation/examples/basic_usage.rs similarity index 91% rename from crates/icrate/examples/basic_usage.rs rename to crates/objc2-foundation/examples/basic_usage.rs index 7b40c67b4..eb73b6221 100644 --- a/crates/icrate/examples/basic_usage.rs +++ b/crates/objc2-foundation/examples/basic_usage.rs @@ -1,5 +1,5 @@ -use icrate::objc2::rc::autoreleasepool; -use icrate::Foundation::{ns_string, NSArray, NSDictionary, NSObject}; +use objc2::rc::autoreleasepool; +use objc2_foundation::{ns_string, NSArray, NSDictionary, NSObject}; fn main() { // Create and compare NSObjects diff --git a/crates/icrate/examples/speech_synthesis.rs b/crates/objc2-foundation/examples/speech_synthesis.rs similarity index 98% rename from crates/icrate/examples/speech_synthesis.rs rename to crates/objc2-foundation/examples/speech_synthesis.rs index 0d0880801..87750d534 100644 --- a/crates/icrate/examples/speech_synthesis.rs +++ b/crates/objc2-foundation/examples/speech_synthesis.rs @@ -10,14 +10,14 @@ use std::thread; use std::time::Duration; -use icrate::Foundation::{ns_string, NSObject, NSString}; use objc2::mutability::InteriorMutable; use objc2::rc::Id; use objc2::{extern_class, msg_send, msg_send_id, ClassType}; +use objc2_foundation::{ns_string, NSObject, NSString}; #[cfg(target_os = "macos")] mod appkit { - use icrate::Foundation::NSCopying; + use objc2_foundation::NSCopying; use std::cell::Cell; use super::*; diff --git a/crates/icrate/src/additions/Foundation/__macro_helpers/cached.rs b/crates/objc2-foundation/src/__macro_helpers/cached.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/__macro_helpers/cached.rs rename to crates/objc2-foundation/src/__macro_helpers/cached.rs diff --git a/crates/icrate/src/additions/Foundation/__macro_helpers/mod.rs b/crates/objc2-foundation/src/__macro_helpers/mod.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/__macro_helpers/mod.rs rename to crates/objc2-foundation/src/__macro_helpers/mod.rs diff --git a/crates/icrate/src/additions/Foundation/__macro_helpers/ns_string.rs b/crates/objc2-foundation/src/__macro_helpers/ns_string.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/__macro_helpers/ns_string.rs rename to crates/objc2-foundation/src/__macro_helpers/ns_string.rs diff --git a/crates/icrate/src/additions/Foundation/array.rs b/crates/objc2-foundation/src/array.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/array.rs rename to crates/objc2-foundation/src/array.rs diff --git a/crates/icrate/src/additions/Foundation/attributed_string.rs b/crates/objc2-foundation/src/attributed_string.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/attributed_string.rs rename to crates/objc2-foundation/src/attributed_string.rs diff --git a/crates/icrate/src/additions/Foundation/bundle.rs b/crates/objc2-foundation/src/bundle.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/bundle.rs rename to crates/objc2-foundation/src/bundle.rs diff --git a/crates/icrate/src/additions/Foundation/comparison_result.rs b/crates/objc2-foundation/src/comparison_result.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/comparison_result.rs rename to crates/objc2-foundation/src/comparison_result.rs diff --git a/crates/icrate/src/additions/Foundation/copying.rs b/crates/objc2-foundation/src/copying.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/copying.rs rename to crates/objc2-foundation/src/copying.rs diff --git a/crates/icrate/src/additions/Foundation/data.rs b/crates/objc2-foundation/src/data.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/data.rs rename to crates/objc2-foundation/src/data.rs diff --git a/crates/icrate/src/additions/Foundation/decimal.rs b/crates/objc2-foundation/src/decimal.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/decimal.rs rename to crates/objc2-foundation/src/decimal.rs diff --git a/crates/icrate/src/additions/Foundation/dictionary.rs b/crates/objc2-foundation/src/dictionary.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/dictionary.rs rename to crates/objc2-foundation/src/dictionary.rs diff --git a/crates/icrate/src/additions/Foundation/enumerator.rs b/crates/objc2-foundation/src/enumerator.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/enumerator.rs rename to crates/objc2-foundation/src/enumerator.rs diff --git a/crates/icrate/src/additions/Foundation/error.rs b/crates/objc2-foundation/src/error.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/error.rs rename to crates/objc2-foundation/src/error.rs diff --git a/crates/icrate/src/additions/Foundation/exception.rs b/crates/objc2-foundation/src/exception.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/exception.rs rename to crates/objc2-foundation/src/exception.rs diff --git a/crates/icrate/src/additions/Foundation/fast_enumeration_state.rs b/crates/objc2-foundation/src/fast_enumeration_state.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/fast_enumeration_state.rs rename to crates/objc2-foundation/src/fast_enumeration_state.rs diff --git a/crates/objc2-foundation/src/generated b/crates/objc2-foundation/src/generated new file mode 120000 index 000000000..1de894a66 --- /dev/null +++ b/crates/objc2-foundation/src/generated @@ -0,0 +1 @@ +../../icrate/src/generated/Foundation \ No newline at end of file diff --git a/crates/icrate/src/additions/Foundation/generics.rs b/crates/objc2-foundation/src/generics.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/generics.rs rename to crates/objc2-foundation/src/generics.rs diff --git a/crates/icrate/src/additions/Foundation/geometry.rs b/crates/objc2-foundation/src/geometry.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/geometry.rs rename to crates/objc2-foundation/src/geometry.rs diff --git a/crates/icrate/src/additions/Foundation/iter.rs b/crates/objc2-foundation/src/iter.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/iter.rs rename to crates/objc2-foundation/src/iter.rs diff --git a/crates/icrate/src/additions/Foundation/mod.rs b/crates/objc2-foundation/src/lib.rs similarity index 88% rename from crates/icrate/src/additions/Foundation/mod.rs rename to crates/objc2-foundation/src/lib.rs index c4cc2fb51..53521db3f 100644 --- a/crates/icrate/src/additions/Foundation/mod.rs +++ b/crates/objc2-foundation/src/lib.rs @@ -11,15 +11,25 @@ //! Basic usage of a few Foundation types. //! //! ```ignore -#![doc = include_str!("../../../examples/basic_usage.rs")] +#![doc = include_str!("../examples/basic_usage.rs")] //! ``` //! //! An example showing how to define your own interfaces to parts that may be missing in `icrate`. //! //! ```ignore -#![doc = include_str!("../../../examples/speech_synthesis.rs")] +#![doc = include_str!("../examples/speech_synthesis.rs")] //! ``` +#![no_std] +// Update in Cargo.toml as well. +#![doc(html_root_url = "https://docs.rs/objc2-foundation/0.2.0")] #![allow(non_snake_case)] +#![recursion_limit = "256"] + +#[cfg(feature = "alloc")] +extern crate alloc; + +#[cfg(feature = "std")] +extern crate std; #[doc(hidden)] pub mod __macro_helpers; @@ -49,6 +59,7 @@ mod error; mod exception; #[cfg(feature = "Foundation_NSEnumerator")] mod fast_enumeration_state; +mod generated; mod generics; #[cfg(feature = "Foundation_NSGeometry")] mod geometry; @@ -75,7 +86,13 @@ mod uuid; #[cfg(feature = "Foundation_NSValue")] mod value; -pub use crate::generated::Foundation::*; +// Temporary +#[allow(non_snake_case)] +mod Foundation { + pub use crate::*; +} + +pub(crate) use objc2_helpers as common; #[cfg(feature = "Foundation_NSObjCRuntime")] pub use self::comparison_result::NSComparisonResult; @@ -85,6 +102,7 @@ pub use self::copying::{NSCopying, NSMutableCopying}; pub use self::decimal::NSDecimal; #[cfg(feature = "Foundation_NSEnumerator")] pub use self::fast_enumeration_state::NSFastEnumerationState; +pub use self::generated::*; pub use self::generics::*; #[cfg(feature = "Foundation_NSGeometry")] pub use self::geometry::{CGFloat, CGPoint, CGRect, CGSize, NSPoint, NSRect, NSRectEdge, NSSize}; @@ -99,10 +117,6 @@ pub use self::thread::{is_main_thread, is_multi_threaded}; #[cfg(feature = "dispatch")] pub use self::thread::{run_on_main, MainThreadBound}; -#[cfg(feature = "Foundation_NSString")] -#[doc(inline)] -pub use crate::__ns_string as ns_string; - // Available under Foundation, so makes sense here as well: // https://developer.apple.com/documentation/foundation/numbers_data_and_basic_values?language=objc pub use objc2::ffi::{NSInteger, NSUInteger}; diff --git a/crates/icrate/src/additions/Foundation/macros/mod.rs b/crates/objc2-foundation/src/macros/mod.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/macros/mod.rs rename to crates/objc2-foundation/src/macros/mod.rs diff --git a/crates/icrate/src/additions/Foundation/macros/ns_string.rs b/crates/objc2-foundation/src/macros/ns_string.rs similarity index 84% rename from crates/icrate/src/additions/Foundation/macros/ns_string.rs rename to crates/objc2-foundation/src/macros/ns_string.rs index 4ba6410a4..61a8b2e2b 100644 --- a/crates/icrate/src/additions/Foundation/macros/ns_string.rs +++ b/crates/objc2-foundation/src/macros/ns_string.rs @@ -67,11 +67,7 @@ // For auto_doc_cfg #[cfg(feature = "Foundation_NSString")] #[macro_export] -// `macro_export` places the macro in the crate root, while we'd rather have -// it scoped under `Foundation`; so let's call this something private, and -// export it there with `#[doc(inline)]` instead. -#[doc(hidden)] -macro_rules! __ns_string { +macro_rules! ns_string { ($s:expr) => {{ // Immediately place in constant for better UI const INPUT: &str = $s; @@ -124,7 +120,7 @@ macro_rules! __ns_string_static { // The full UTF-16 contents along with the written length. const UTF16_FULL: (&[u16; $inp.len()], usize) = { let mut out = [0u16; $inp.len()]; - let mut iter = $crate::Foundation::__macro_helpers::EncodeUtf16Iter::new($inp); + let mut iter = $crate::__macro_helpers::EncodeUtf16Iter::new($inp); let mut written = 0; while let Some((state, chars)) = iter.next() { @@ -165,17 +161,17 @@ macro_rules! __ns_string_static { // The section is the same as what clang sets, see: // https://github.com/llvm/llvm-project/blob/release/13.x/clang/lib/CodeGen/CodeGenModule.cpp#L5243 #[link_section = "__DATA,__cfstring"] - static CFSTRING: $crate::Foundation::__macro_helpers::CFConstString = unsafe { - if $crate::Foundation::__macro_helpers::is_ascii_no_nul($inp) { + static CFSTRING: $crate::__macro_helpers::CFConstString = unsafe { + if $crate::__macro_helpers::is_ascii_no_nul($inp) { // This is technically an optimization (UTF-16 strings are // always valid), but it's a fairly important one! - $crate::Foundation::__macro_helpers::CFConstString::new_ascii( - &$crate::Foundation::__macro_helpers::__CFConstantStringClassReference, + $crate::__macro_helpers::CFConstString::new_ascii( + &$crate::__macro_helpers::__CFConstantStringClassReference, &ASCII, ) } else { - $crate::Foundation::__macro_helpers::CFConstString::new_utf16( - &$crate::Foundation::__macro_helpers::__CFConstantStringClassReference, + $crate::__macro_helpers::CFConstString::new_utf16( + &$crate::__macro_helpers::__CFConstantStringClassReference, &UTF16, ) } @@ -188,9 +184,8 @@ macro_rules! __ns_string_static { #[macro_export] macro_rules! __ns_string_inner { ($inp:ident) => {{ - static CACHED_NSSTRING: $crate::Foundation::__macro_helpers::CachedId< - $crate::Foundation::NSString, - > = $crate::Foundation::__macro_helpers::CachedId::new(); - CACHED_NSSTRING.get(|| $crate::Foundation::NSString::from_str($inp)) + static CACHED_NSSTRING: $crate::__macro_helpers::CachedId<$crate::NSString> = + $crate::__macro_helpers::CachedId::new(); + CACHED_NSSTRING.get(|| $crate::NSString::from_str($inp)) }}; } diff --git a/crates/icrate/src/additions/Foundation/ns_consumed.rs b/crates/objc2-foundation/src/ns_consumed.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/ns_consumed.rs rename to crates/objc2-foundation/src/ns_consumed.rs diff --git a/crates/icrate/src/additions/Foundation/number.rs b/crates/objc2-foundation/src/number.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/number.rs rename to crates/objc2-foundation/src/number.rs diff --git a/crates/icrate/src/additions/Foundation/process_info.rs b/crates/objc2-foundation/src/process_info.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/process_info.rs rename to crates/objc2-foundation/src/process_info.rs diff --git a/crates/icrate/src/additions/Foundation/range.rs b/crates/objc2-foundation/src/range.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/range.rs rename to crates/objc2-foundation/src/range.rs diff --git a/crates/icrate/src/additions/Foundation/set.rs b/crates/objc2-foundation/src/set.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/set.rs rename to crates/objc2-foundation/src/set.rs diff --git a/crates/icrate/src/additions/Foundation/string.rs b/crates/objc2-foundation/src/string.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/string.rs rename to crates/objc2-foundation/src/string.rs diff --git a/crates/icrate/src/additions/Foundation/tests/array.rs b/crates/objc2-foundation/src/tests/array.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/array.rs rename to crates/objc2-foundation/src/tests/array.rs diff --git a/crates/icrate/src/additions/Foundation/tests/attributed_string.rs b/crates/objc2-foundation/src/tests/attributed_string.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/attributed_string.rs rename to crates/objc2-foundation/src/tests/attributed_string.rs diff --git a/crates/icrate/src/additions/Foundation/tests/auto_traits.rs b/crates/objc2-foundation/src/tests/auto_traits.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/auto_traits.rs rename to crates/objc2-foundation/src/tests/auto_traits.rs diff --git a/crates/icrate/src/additions/Foundation/tests/bundle.rs b/crates/objc2-foundation/src/tests/bundle.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/bundle.rs rename to crates/objc2-foundation/src/tests/bundle.rs diff --git a/crates/icrate/src/additions/Foundation/tests/copying.rs b/crates/objc2-foundation/src/tests/copying.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/copying.rs rename to crates/objc2-foundation/src/tests/copying.rs diff --git a/crates/icrate/src/additions/Foundation/tests/data.rs b/crates/objc2-foundation/src/tests/data.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/data.rs rename to crates/objc2-foundation/src/tests/data.rs diff --git a/crates/icrate/src/additions/Foundation/tests/dictionary.rs b/crates/objc2-foundation/src/tests/dictionary.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/dictionary.rs rename to crates/objc2-foundation/src/tests/dictionary.rs diff --git a/crates/icrate/src/additions/Foundation/tests/error.rs b/crates/objc2-foundation/src/tests/error.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/error.rs rename to crates/objc2-foundation/src/tests/error.rs diff --git a/crates/icrate/src/additions/Foundation/tests/exception.rs b/crates/objc2-foundation/src/tests/exception.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/exception.rs rename to crates/objc2-foundation/src/tests/exception.rs diff --git a/crates/icrate/src/additions/Foundation/tests/lock.rs b/crates/objc2-foundation/src/tests/lock.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/lock.rs rename to crates/objc2-foundation/src/tests/lock.rs diff --git a/crates/icrate/src/additions/Foundation/tests/mod.rs b/crates/objc2-foundation/src/tests/mod.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/mod.rs rename to crates/objc2-foundation/src/tests/mod.rs diff --git a/crates/icrate/src/additions/Foundation/tests/mutable_array.rs b/crates/objc2-foundation/src/tests/mutable_array.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/mutable_array.rs rename to crates/objc2-foundation/src/tests/mutable_array.rs diff --git a/crates/icrate/src/additions/Foundation/tests/mutable_data.rs b/crates/objc2-foundation/src/tests/mutable_data.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/mutable_data.rs rename to crates/objc2-foundation/src/tests/mutable_data.rs diff --git a/crates/icrate/src/additions/Foundation/tests/mutable_dictionary.rs b/crates/objc2-foundation/src/tests/mutable_dictionary.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/mutable_dictionary.rs rename to crates/objc2-foundation/src/tests/mutable_dictionary.rs diff --git a/crates/icrate/src/additions/Foundation/tests/mutable_set.rs b/crates/objc2-foundation/src/tests/mutable_set.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/mutable_set.rs rename to crates/objc2-foundation/src/tests/mutable_set.rs diff --git a/crates/icrate/src/additions/Foundation/tests/mutable_string.rs b/crates/objc2-foundation/src/tests/mutable_string.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/mutable_string.rs rename to crates/objc2-foundation/src/tests/mutable_string.rs diff --git a/crates/icrate/src/additions/Foundation/tests/number.rs b/crates/objc2-foundation/src/tests/number.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/number.rs rename to crates/objc2-foundation/src/tests/number.rs diff --git a/crates/icrate/src/additions/Foundation/tests/process_info.rs b/crates/objc2-foundation/src/tests/process_info.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/process_info.rs rename to crates/objc2-foundation/src/tests/process_info.rs diff --git a/crates/icrate/src/additions/Foundation/tests/proxy.rs b/crates/objc2-foundation/src/tests/proxy.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/proxy.rs rename to crates/objc2-foundation/src/tests/proxy.rs diff --git a/crates/icrate/src/additions/Foundation/tests/set.rs b/crates/objc2-foundation/src/tests/set.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/set.rs rename to crates/objc2-foundation/src/tests/set.rs diff --git a/crates/icrate/src/additions/Foundation/tests/string.rs b/crates/objc2-foundation/src/tests/string.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/string.rs rename to crates/objc2-foundation/src/tests/string.rs diff --git a/crates/icrate/src/additions/Foundation/tests/thread.rs b/crates/objc2-foundation/src/tests/thread.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/thread.rs rename to crates/objc2-foundation/src/tests/thread.rs diff --git a/crates/icrate/src/additions/Foundation/tests/uuid.rs b/crates/objc2-foundation/src/tests/uuid.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/uuid.rs rename to crates/objc2-foundation/src/tests/uuid.rs diff --git a/crates/icrate/src/additions/Foundation/tests/value.rs b/crates/objc2-foundation/src/tests/value.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/tests/value.rs rename to crates/objc2-foundation/src/tests/value.rs diff --git a/crates/icrate/src/additions/Foundation/thread.rs b/crates/objc2-foundation/src/thread.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/thread.rs rename to crates/objc2-foundation/src/thread.rs diff --git a/crates/icrate/src/additions/Foundation/to_owned.rs b/crates/objc2-foundation/src/to_owned.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/to_owned.rs rename to crates/objc2-foundation/src/to_owned.rs diff --git a/crates/icrate/src/additions/Foundation/util.rs b/crates/objc2-foundation/src/util.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/util.rs rename to crates/objc2-foundation/src/util.rs diff --git a/crates/icrate/src/additions/Foundation/uuid.rs b/crates/objc2-foundation/src/uuid.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/uuid.rs rename to crates/objc2-foundation/src/uuid.rs diff --git a/crates/icrate/src/additions/Foundation/value.rs b/crates/objc2-foundation/src/value.rs similarity index 100% rename from crates/icrate/src/additions/Foundation/value.rs rename to crates/objc2-foundation/src/value.rs