Skip to content

Commit 2c25f31

Browse files
Benjamin ScholtysikElektrojungeAtWork
andauthored
Minor Updates to the PackageDescription In-Source Documentation (swiftlang#2753)
* Address editorial feedback on in-source documentation. * Use em-dashes in comments. * Address some editorial feedback. * A single-word change to the docs for an initializer. Co-authored-by: Ben Scholtysik <[email protected]>
1 parent e028ef3 commit 2c25f31

File tree

3 files changed

+92
-92
lines changed

3 files changed

+92
-92
lines changed

Sources/PackageDescription/PackageDescription.swift

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,14 @@ public final class Package {
218218
public var cxxLanguageStandard: CXXLanguageStandard?
219219

220220
#if PACKAGE_DESCRIPTION_4
221-
/// Initializes a Swift package with the provided configuration options.
221+
/// Initializes a Swift package with configuration options you provide.
222222
///
223223
/// - Parameters:
224-
/// - name: The name of the Swift package or `nil` to deduce the name from the package’s Git URL.
224+
/// - name: The name of the Swift package, or `nil`, if you want the Swift Package Manager to deduce the
225+
/// name from the package’s Git URL.
225226
/// - pkgConfig: The name to use for C modules. If present, the Swift
226-
/// Package Manager searches for a <name>.pc file to get the
227-
/// required additional flags for a system target.
227+
/// Package Manager searches for a `<name>.pc` file to get the
228+
/// additional flags required for a system target.
228229
/// - providers: The package providers for a system package.
229230
/// - products: The list of products that this package vends and that clients can use.
230231
/// - dependencies: The list of package dependencies.
@@ -255,14 +256,15 @@ public final class Package {
255256
registerExitHandler()
256257
}
257258
#else
258-
/// Initializes a Swift package with the provided configuration options.
259+
/// Initializes a Swift package with configuration options you provide.
259260
///
260261
/// - Parameters:
261-
/// - name: The name of the Swift package or `nil` to deduce the name from the package’s Git URL.
262+
/// - name: The name of the Swift package, or `nil`, if you want the Swift Package Manager to deduce the
263+
/// name from the package’s Git URL.
262264
/// - pkgConfig: The name to use for C modules. If present, the Swift
263-
/// Package Manager searches for a <name>.pc file to get the
264-
/// required additional flags for a system target.
265-
/// - products: The list of products that this package vends and that clients can use.
265+
/// Package Manager searches for a `<name>.pc` file to get the
266+
/// additional flags required for a system target.
267+
/// - products: The list of products that this package makes available for clients to use.
266268
/// - dependencies: The list of package dependencies.
267269
/// - targets: The list of targets that are part of this package.
268270
/// - swiftLanguageVersions: The list of Swift versions that this package is compatible with.
@@ -292,15 +294,16 @@ public final class Package {
292294
registerExitHandler()
293295
}
294296

295-
/// Initializes a Swift package with the provided configuration options.
297+
/// Initializes a Swift package with configuration options you provide.
296298
///
297299
/// - Parameters:
298-
/// - name: The name of the Swift package or `nil` to deduce the name from the package’s Git URL.
299-
/// - platforms: The list of supported platforms with a custom deployment target.
300+
/// - name: The name of the Swift package, or `nil`, if you want the Swift Package Manager to deduce the
301+
/// name from the package’s Git URL.
302+
/// - platforms: The list of supported platforms that have a custom deployment target.
300303
/// - pkgConfig: The name to use for C modules. If present, the Swift
301-
/// Package Manager searches for a <name>.pc file to get the
302-
/// required additional flags for a system target.
303-
/// - products: The list of products that this package vends and that clients can use.
304+
/// Package Manager searches for a `<name>.pc` file to get the
305+
/// additional flags required for a system target.
306+
/// - products: The list of products that this package makes available for clients to use.
304307
/// - dependencies: The list of package dependencies.
305308
/// - targets: The list of targets that are part of this package.
306309
/// - swiftLanguageVersions: The list of Swift versions that this package is compatible with.
@@ -332,15 +335,16 @@ public final class Package {
332335
registerExitHandler()
333336
}
334337

335-
/// Initializes a Swift package with the provided configuration options.
338+
/// Initializes a Swift package with configuration options you provide.
336339
///
337340
/// - Parameters:
338-
/// - name: The name of the Swift package or `nil` to deduce the name from the package’s Git URL.
341+
/// - name: The name of the Swift package, or `nil`, if you want the Swift Package Manager to deduce the
342+
/// name from the package’s Git URL.
339343
/// - defaultLocalization: The default localization for resources.
340-
/// - platforms: The list of supported platforms with a custom deployment target.
344+
/// - platforms: The list of supported platforms that have a custom deployment target.
341345
/// - pkgConfig: The name to use for C modules. If present, the Swift
342-
/// Package Manager searches for a <name>.pc file to get the
343-
/// required additional flags for a system target.
346+
/// Package Manager searches for a `<name>.pc` file to get the
347+
/// additional flags required for a system target.
344348
/// - products: The list of products that this package vends and that clients can use.
345349
/// - dependencies: The list of package dependencies.
346350
/// - targets: The list of targets that are part of this package.
@@ -410,8 +414,7 @@ public final class Package {
410414

411415
/// A wrapper around an IETF language tag.
412416
///
413-
/// To learn more about IETF language tags, a worldwide standard for language
414-
/// tags, visit [the IEFT website for RFC5646](https://tools.ietf.org/html/rfc5646).
417+
/// To learn more about the IETF worldwide standard for language tags, see [RFC5646](https://tools.ietf.org/html/rfc5646).
415418
public struct LanguageTag: Hashable {
416419

417420
/// An IETF language tag.
@@ -464,7 +467,7 @@ public enum SystemPackageProvider {
464467
#endif
465468

466469
/// Creates a system package provider with a list of installable packages
467-
/// for users of the homebrew package manager on macOS.
470+
/// for users of the HomeBrew package manager on macOS.
468471
///
469472
/// - Parameters:
470473
/// - packages: The list of package names.

Sources/PackageDescription/Resource.swift

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@
1111
/// A resource to bundle with the Swift package.
1212
///
1313
/// If a Swift package declares a Swift tools version of 5.3 or later, it can include resource files.
14-
/// Similar to source code, Xcode scopes resources to a target. As a result,
15-
/// you need to put them into the folder that corresponds to the target they belong to.
16-
/// For example, any resources for the `MyLibrary` target need to reside in `Sources/MyLibrary`.
17-
/// Use subdirectories to organize your resource files in a way that makes it easy to identify and manage them.
14+
/// Similar to source code, the Swift Package Manager scopes resources to a target, so you must put them
15+
/// into the folder that corresponds to the target they belong to.
16+
/// For example, any resources for the `MyLibrary` target must reside in `Sources/MyLibrary`.
17+
/// Use subdirectories to organize your resource files in a way that simplifies file identification and management.
1818
/// For example, put all resource files into a directory named `Resources`,
19-
/// so your resource files reside at `Sources/MyLibrary/Resources`.
20-
///
21-
/// Per default, Xcode handles common resources types for Apple platforms automatically.
22-
/// For example, you don’t need to declare XIB files, storyboards, CoreData file types, and asset catalogs
19+
/// so they reside at `Sources/MyLibrary/Resources.
20+
/// By default, the Swift Package Manager handles common resources types for Apple platforms automatically.
21+
/// For example, you don’t need to declare XIB files, storyboards, Core Data file types, and asset catalogs
2322
/// as resources in your package manifest.
24-
/// However, you must declare other file types, for example image files, as resources explicitly
25-
/// using the `process(_:localization:)` or `copy(_:)` rules.
26-
/// Alternatively, exclude resource files from a target by passing them to the
27-
/// target initializer’s `exclude` parameter.
23+
/// However, you must explicitly declare other file types—for example image files—as resources
24+
/// using the `process(_:localization:)`` or `copy(_:)`` rules. Alternatively, exclude resource files from a target
25+
/// by passing them to the target initializer’s `exclude` parameter.
2826
public struct Resource: Encodable {
2927

3028
/// Defines the explicit type of localization for resources.
@@ -54,7 +52,7 @@ public struct Resource: Encodable {
5452

5553
/// Applies a platform-specific rule to the resource at the given path.
5654
///
57-
/// Use the process rule to process resources at the given path
55+
/// Use the `process` rule to process resources at the given path
5856
/// according to the platform it builds the target for. For example, the
5957
/// Swift Package Manager may optimize image files for platforms that
6058
/// support such optimizations. If no optimization is available for a file
@@ -74,13 +72,12 @@ public struct Resource: Encodable {
7472

7573
/// Applies the copy rule to a resource at the given path.
7674
///
77-
/// If possible, use `process(_:localization:)`` to automatically apply optimizations
75+
/// If possible, use `process(_:localization:)`` and automatically apply optimizations
7876
/// to resources.
7977
///
80-
/// If you need resources to remain untouched or retain a specific folder structure,
81-
/// use the copy rule. It copies resources at the given path as is to the top-level
82-
/// in the package’s resource bundle.
83-
/// If the given path represents a directory, the Swift Package Manager preserves its structure.
78+
/// If your resources must remain untouched or must retain a specific folder structure,
79+
/// use the `copy` rule. It copies resources at the given path, as is, to the top level
80+
/// in the package’s resource bundle. If the given path represents a directory, Xcode preserves its structure.
8481
///
8582
/// - Parameters:
8683
/// - path: The path for a resource.

0 commit comments

Comments
 (0)