Skip to content
Merged
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
15 changes: 14 additions & 1 deletion Sources/Runtimes/PackageDescription/Resource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,20 @@ public struct Resource: Sendable {

/// Applies the embed rule to a resource at the given path.
///
/// You can use the embed rule to embed the contents of the resource into the executable code.
/// Use the embed rule to embed the bytes that represent the contents of a resource into executable code.
/// For example, if you embed the file `identifier.txt` that has the contents:
/// ```
/// Hello Swift
/// ```
///
/// Package manager generates a PackageResources class with each embedded resource as a static property based on the name of the resource.
/// For the example above, the code generated by Package Manager is equivalent to the following source:
/// ```
/// struct PackageResources {
/// static let identifier_txt: [UInt8] = [72,101,108,108,111,32,83,119,105,102,116,10]
/// }
/// ```
///
/// - Parameter path: The path for a resource.
/// - Returns: A `Resource` instance.
@available(_PackageDescription, introduced: 5.9)
Expand Down