Skip to content

Commit 942a1e8

Browse files
authored
[5.9] Documentation update. (#6434)
* Updated documentation for BuildSettings. * Updated documentation for PackageDescription.
1 parent 8f9556f commit 942a1e8

File tree

5 files changed

+37
-19
lines changed

5 files changed

+37
-19
lines changed

Sources/PackageDescription/BuildSettings.swift

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
/// The build configuration such as debug or release.
1414
public struct BuildConfiguration {
15+
/// The configuration of the build. Valid values are `debug` and `release`.
1516
let config: String
1617

1718
private init(_ config: String) {
@@ -54,7 +55,9 @@ public struct BuildConfiguration {
5455
/// ),
5556
/// ```
5657
public struct BuildSettingCondition {
58+
/// The applicable platforms for this build setting condition.
5759
let platforms: [Platform]?
60+
/// The applicable build configuration for this build setting condition.
5861
let config: BuildConfiguration?
5962

6063
private init(platforms: [Platform]?, config: BuildConfiguration?) {
@@ -113,6 +116,7 @@ struct BuildSettingData {
113116

114117
/// A C-language build setting.
115118
public struct CSetting {
119+
/// The abstract build setting data.
116120
let data: BuildSettingData
117121

118122
private init(name: String, value: [String], condition: BuildSettingCondition?) {
@@ -182,6 +186,7 @@ public struct CSetting {
182186

183187
/// A CXX-language build setting.
184188
public struct CXXSetting {
189+
/// The abstract build setting data.
185190
let data: BuildSettingData
186191

187192
private init(name: String, value: [String], condition: BuildSettingCondition?) {
@@ -250,6 +255,7 @@ public struct CXXSetting {
250255

251256
/// A Swift language build setting.
252257
public struct SwiftSetting {
258+
/// The abstract build setting data.
253259
let data: BuildSettingData
254260

255261
private init(name: String, value: [String], condition: BuildSettingCondition?) {
@@ -306,13 +312,13 @@ public struct SwiftSetting {
306312

307313
/// Enable an upcoming feature with the given name.
308314
///
309-
/// An upcoming feature is one that has been accepted into Swift as of a
315+
/// An upcoming feature is one that is available in Swift as of a
310316
/// certain language version, but is not available by default in prior
311317
/// language modes because it has some impact on source compatibility.
312318
///
313-
/// Multiple upcoming features can be added to a given target, and can
314-
/// be used in a target without affecting its dependencies. An unknown
315-
/// upcoming feature will be ignored by the implementation.
319+
/// You can add multiple upcoming features to a given target, and can
320+
/// use in a target without affecting its dependencies. Targets will ignore any unknown
321+
/// upcoming features.
316322
///
317323
/// - Since: First available in PackageDescription 5.8.
318324
///
@@ -332,11 +338,11 @@ public struct SwiftSetting {
332338
/// Enable an experimental feature with the given name.
333339
///
334340
/// An experimental feature is one that is in development, but
335-
/// has not been accepted into Swift as a language feature.
341+
/// is not yet available in Swift as a language feature.
336342
///
337-
/// Multiple experimental features can be added to a given target, and can
338-
/// be used in a target without affecting its dependencies. An unknown
339-
/// experimental feature will be ignored by the implementation.
343+
/// You can add multiple experimental features to a given target, and can
344+
/// use in a target without affecting its dependencies. Targets will ignore any unknown
345+
/// experimental features.
340346
///
341347
/// - Since: First available in PackageDescription 5.8.
342348
///
@@ -391,6 +397,7 @@ public struct SwiftSetting {
391397

392398
/// A linker build setting.
393399
public struct LinkerSetting {
400+
/// The abstract build setting data.
394401
let data: BuildSettingData
395402

396403
private init(name: String, value: [String], condition: BuildSettingCondition?) {

Sources/PackageDescription/PackageDescription.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ public enum SystemPackageProvider {
380380
/// Packages installable by the yum package manager.
381381
@available(_PackageDescription, introduced: 5.3)
382382
case yumItem([String])
383+
/// Packages installable by the NuGet package manager.
383384
@available(_PackageDescription, introduced: 999.0)
384385
case nugetItem([String])
385386

@@ -416,7 +417,7 @@ public enum SystemPackageProvider {
416417
}
417418

418419
/// Creates a system package provider with a list of installable packages
419-
/// for users of the nuget package manager on Linux or Windows.
420+
/// for users of the NuGet package manager on Linux or Windows.
420421
///
421422
/// - Parameter packages: The list of package names.
422423
///

Sources/PackageDescription/Resource.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public struct Resource {
4747

4848
/// The rule for the resource.
4949
let rule: String
50-
50+
5151
/// The path of the resource.
5252
let path: String
5353

@@ -97,6 +97,10 @@ public struct Resource {
9797
}
9898

9999
/// Applies the embed rule to a resource at the given path.
100+
///
101+
/// You can use the embed rule to embed the contents of the resource into the executable code.
102+
/// - Parameter path: The path for a resource.
103+
/// - Returns: A `Resource` instance.
100104
@available(_PackageDescription, introduced: 5.9)
101105
public static func embedInCode(_ path: String) -> Resource {
102106
return Resource(rule: "embedInCode", path: path, localization: nil)

Sources/PackageDescription/SupportedPlatforms.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,11 @@ extension SupportedPlatform {
601601
public static let v22: DriverKitVersion = .init(string: "22.0")
602602
}
603603

604+
/// A supported custom platform version.
604605
public struct CustomPlatformVersion: AppleOSVersion {
606+
/// The name of the custom platform.
605607
static var name: String = "custom platform"
608+
/// The minimum valid major version number.
606609
static var minimumMajorVersion = 0
607610

608611
fileprivate init(uncheckedVersion version: String) {

Sources/PackageDescription/Target.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ public final class Target {
4141
case `macro`
4242
}
4343

44-
/// A group a target belongs to that allows customizing access boundaries. A target is treated as
45-
/// a client outside of the package if `excluded`, inside the package boundary if `package`.
44+
/// A group a target belongs to that allows customizing access boundaries. By default, the target belongs
45+
/// to the `package` group, and has access to the symbols inside the package. If the target's group is
46+
/// `excluded`, it is essentially a client of the package.
4647
public enum TargetGroup {
48+
/// Treat this target as inside the package boundary.
4749
case package
50+
/// Treat this target as outside the package boundary.
4851
case excluded
4952
}
5053
/// The different types of a target's dependency on another entity.
@@ -561,7 +564,7 @@ public final class Target {
561564
///
562565
/// - Parameters:
563566
/// - name: The name of the target.
564-
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside (package by default).
567+
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside. The default value is `package`.
565568
/// - dependencies: The dependencies of the target. A dependency can be another target in the package or a product from a package dependency.
566569
/// - path: The custom path for the target. By default, the Swift Package Manager requires a target's sources to reside at predefined search paths;
567570
/// for example, `[PackageRoot]/Sources/[TargetName]`.
@@ -733,7 +736,7 @@ public final class Target {
733736
///
734737
/// - Parameters:
735738
/// - name: The name of the target.
736-
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside (package by default).
739+
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside. The default value is `package`.
737740
/// - dependencies: The dependencies of the target. A dependency can be another target in the package or a product from a package dependency.
738741
/// - path: The custom path for the target. By default, the Swift Package Manager requires a target's sources to reside at predefined search paths;
739742
/// for example, `[PackageRoot]/Sources/[TargetName]`.
@@ -980,7 +983,7 @@ public final class Target {
980983
///
981984
/// - Parameters:
982985
/// - name: The name of the target.
983-
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside (package by default).
986+
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside. The default value is `package`.
984987
/// - dependencies: The dependencies of the target. A dependency can be another target in the package or a product from a package dependency.
985988
/// - path: The custom path for the target. By default, the Swift Package Manager requires a target's sources to reside at predefined search paths;
986989
/// for example, `[PackageRoot]/Sources/[TargetName]`.
@@ -1217,7 +1220,7 @@ public final class Target {
12171220
///
12181221
/// - Parameters:
12191222
/// - name: The name of the plugin target.
1220-
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside (package by default).
1223+
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside. The default value is `package`.
12211224
/// - capability: The type of capability the plugin target provides.
12221225
/// - dependencies: The plugin target's dependencies.
12231226
/// - path: The path of the plugin target, relative to the package root.
@@ -1412,7 +1415,7 @@ public struct TargetDependencyCondition {
14121415

14131416
extension Target.PluginCapability {
14141417

1415-
/// Specifies that the plugin provides a build tool capability.
1418+
/// The plugin is a build tool.
14161419
///
14171420
/// The plugin will be applied to each target that uses it and should create commands
14181421
/// that will run before or during the build of the target.
@@ -1496,7 +1499,7 @@ public enum PluginPermission {
14961499
case writeToPackageDirectory(reason: String)
14971500
}
14981501

1499-
/// The scope of a network permission. This can be none, local connections only or all connections.
1502+
/// The scope of a network permission. This can be none, local connections only, or all connections.
15001503
@available(_PackageDescription, introduced: 5.9)
15011504
public enum PluginNetworkPermissionScope {
15021505
/// Do not allow network access.
@@ -1510,7 +1513,7 @@ public enum PluginNetworkPermissionScope {
15101513
/// Allow connections to any unix domain socket.
15111514
case unixDomainSocket
15121515

1513-
/// Allow local and outgoing network connections, limited to a range of allowed ports.
1516+
/// Allow local and outgoing network connections, limited to a range of allowed ports.
15141517
public static func all(ports: Range<UInt8>) -> PluginNetworkPermissionScope {
15151518
return .all(ports: Array(ports))
15161519
}

0 commit comments

Comments
 (0)