Skip to content

Commit 43bd269

Browse files
zkiralyZsolt Kiraly
authored andcommitted
[5.9] Documentation update. (swiftlang#6434)
* Updated documentation for BuildSettings. * Updated documentation for PackageDescription.
1 parent 340db0b commit 43bd269

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ public final class Target {
551551
///
552552
/// - Parameters:
553553
/// - name: The name of the target.
554-
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside (package by default).
554+
/// - 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`.
555555
/// - dependencies: The dependencies of the target. A dependency can be another target in the package or a product from a package dependency.
556556
/// - path: The custom path for the target. By default, the Swift Package Manager requires a target's sources to reside at predefined search paths;
557557
/// for example, `[PackageRoot]/Sources/[TargetName]`.
@@ -724,7 +724,7 @@ public final class Target {
724724
///
725725
/// - Parameters:
726726
/// - name: The name of the target.
727-
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside (package by default).
727+
/// - 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`.
728728
/// - dependencies: The dependencies of the target. A dependency can be another target in the package or a product from a package dependency.
729729
/// - path: The custom path for the target. By default, the Swift Package Manager requires a target's sources to reside at predefined search paths;
730730
/// for example, `[PackageRoot]/Sources/[TargetName]`.
@@ -972,7 +972,7 @@ public final class Target {
972972
///
973973
/// - Parameters:
974974
/// - name: The name of the target.
975-
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside (package by default).
975+
/// - 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`.
976976
/// - dependencies: The dependencies of the target. A dependency can be another target in the package or a product from a package dependency.
977977
/// - path: The custom path for the target. By default, the Swift Package Manager requires a target's sources to reside at predefined search paths;
978978
/// for example, `[PackageRoot]/Sources/[TargetName]`.
@@ -1210,7 +1210,7 @@ public final class Target {
12101210
///
12111211
/// - Parameters:
12121212
/// - name: The name of the plugin target.
1213-
/// - group: The group this target belongs to, where access to the target's group-specific APIs is not allowed from outside (package by default).
1213+
/// - 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`.
12141214
/// - capability: The type of capability the plugin target provides.
12151215
/// - dependencies: The plugin target's dependencies.
12161216
/// - path: The path of the plugin target, relative to the package root.
@@ -1406,7 +1406,7 @@ public struct TargetDependencyCondition {
14061406

14071407
extension Target.PluginCapability {
14081408

1409-
/// Specifies that the plugin provides a build tool capability.
1409+
/// The plugin is a build tool.
14101410
///
14111411
/// The plugin will be applied to each target that uses it and should create commands
14121412
/// that will run before or during the build of the target.
@@ -1490,7 +1490,7 @@ public enum PluginPermission {
14901490
case writeToPackageDirectory(reason: String)
14911491
}
14921492

1493-
/// The scope of a network permission. This can be none, local connections only or all connections.
1493+
/// The scope of a network permission. This can be none, local connections only, or all connections.
14941494
@available(_PackageDescription, introduced: 5.9)
14951495
public enum PluginNetworkPermissionScope {
14961496
/// Do not allow network access.
@@ -1504,7 +1504,7 @@ public enum PluginNetworkPermissionScope {
15041504
/// Allow connections to any unix domain socket.
15051505
case unixDomainSocket
15061506

1507-
/// Allow local and outgoing network connections, limited to a range of allowed ports.
1507+
/// Allow local and outgoing network connections, limited to a range of allowed ports.
15081508
public static func all(ports: Range<UInt8>) -> PluginNetworkPermissionScope {
15091509
return .all(ports: Array(ports))
15101510
}

0 commit comments

Comments
 (0)