Skip to content

Commit

Permalink
Mark all current vNext functionality as 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
hartbit authored and ankitspd committed Apr 8, 2020
1 parent 76cb47f commit d196d9d
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 57 deletions.
2 changes: 1 addition & 1 deletion Fixtures/Resources/Localized/Package.swift
@@ -1,4 +1,4 @@
// swift-tools-version:999.0
// swift-tools-version:5.3
import PackageDescription

let package = Package(
Expand Down
2 changes: 1 addition & 1 deletion Fixtures/Resources/Simple/Package.swift
@@ -1,4 +1,4 @@
// swift-tools-version:999.0
// swift-tools-version:5.3
import PackageDescription

let package = Package(
Expand Down
@@ -1,4 +1,4 @@
// swift-tools-version:999.0
// swift-tools-version:5.3

import PackageDescription

Expand Down
8 changes: 4 additions & 4 deletions Sources/PackageDescription/PackageDescription.swift
Expand Up @@ -178,7 +178,7 @@ public final class Package {
private var _platforms: [SupportedPlatform]?

/// The default localization for resources.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public var defaultLocalization: LanguageTag? {
get { return _defaultLocalization }
set { _defaultLocalization = newValue }
Expand Down Expand Up @@ -298,7 +298,7 @@ public final class Package {
/// - swiftLanguageVersions: The list of Swift versions that this package is compatible with.
/// - cLanguageStandard: The C language standard to use for all C targets in this package.
/// - cxxLanguageStandard: The C++ language standard to use for all C++ targets in this package.
@available(_PackageDescription, introduced: 5, obsoleted: 999)
@available(_PackageDescription, introduced: 5, obsoleted: 5.3)
public init(
name: String,
platforms: [SupportedPlatform]? = nil,
Expand Down Expand Up @@ -336,7 +336,7 @@ public final class Package {
/// - swiftLanguageVersions: The list of Swift versions that this package is compatible with.
/// - cLanguageStandard: The C language standard to use for all C targets in this package.
/// - cxxLanguageStandard: The C++ language standard to use for all C++ targets in this package.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public init(
name: String,
defaultLocalization: LanguageTag? = nil,
Expand Down Expand Up @@ -466,7 +466,7 @@ public enum SystemPackageProvider {
///
/// - Parameters:
/// - packages: The list of package names.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public static func yum(_ packages: [String]) -> SystemPackageProvider {
return ._yumItem(packages)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/PackageDescription/SupportedPlatforms.swift
Expand Up @@ -43,7 +43,7 @@ public struct Platform: Encodable {
public static let android: Platform = Platform(name: "android")

/// The WASI platform
@available(_PackageDescription, introduced: 999.0)
@available(_PackageDescription, introduced: 5.3)
public static let wasi: Platform = Platform(name: "wasi")
}

Expand Down
26 changes: 13 additions & 13 deletions Sources/PackageDescription/Target.swift
Expand Up @@ -76,7 +76,7 @@ public final class Target {
public var sources: [String]?

/// The explicit list of resource files in the target.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public var resources: [Resource]? {
get { _resources }
set { _resources = newValue }
Expand Down Expand Up @@ -148,7 +148,7 @@ public final class Target {
private var _linkerSettings: [LinkerSetting]?

/// The binary target's checksum.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public var checksum: String? {
get { _checksum }
set { _checksum = newValue }
Expand Down Expand Up @@ -292,7 +292,7 @@ public final class Target {
/// - cxxSettings: The C++ settings for this target.
/// - swiftSettings: The Swift settings for this target.
/// - linkerSettings: The linker settings for this target.
@available(_PackageDescription, introduced: 5, obsoleted: 999)
@available(_PackageDescription, introduced: 5, obsoleted: 5.3)
public static func target(
name: String,
dependencies: [Dependency] = [],
Expand Down Expand Up @@ -344,7 +344,7 @@ public final class Target {
/// - cxxSettings: The C++ settings for this target.
/// - swiftSettings: The Swift settings for this target.
/// - linkerSettings: The linker settings for this target.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public static func target(
name: String,
dependencies: [Dependency] = [],
Expand Down Expand Up @@ -474,7 +474,7 @@ public final class Target {
/// - cxxSettings: The C++ settings for this target.
/// - swiftSettings: The Swift settings for this target.
/// - linkerSettings: The linker settings for this target.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public static func testTarget(
name: String,
dependencies: [Dependency] = [],
Expand Down Expand Up @@ -544,7 +544,7 @@ public final class Target {
/// - name: The name of the target.
/// - url: The URL to the binary artifact. Should point to a `zip` archive containing a `XCFramework`.
/// - checksum: The checksum of the artifact archive for validation.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public static func binaryTarget(
name: String,
url: String,
Expand All @@ -571,7 +571,7 @@ public final class Target {
/// - name: The name of the target.
/// - path: The path to the binary artifact. Can point directly to a `XCFramework` or a zip containing the
/// `XCFramework`.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public static func binaryTarget(
name: String,
path: String
Expand Down Expand Up @@ -647,7 +647,7 @@ extension Target.Dependency {
///
/// - parameters:
/// - name: The name of the target.
@available(_PackageDescription, obsoleted: 999)
@available(_PackageDescription, obsoleted: 5.3)
public static func target(name: String) -> Target.Dependency {
#if PACKAGE_DESCRIPTION_4
return .targetItem(name: name)
Expand Down Expand Up @@ -675,7 +675,7 @@ extension Target.Dependency {
///
/// - parameters:
/// - name: The name of the dependency, either a target or a product.
@available(_PackageDescription, obsoleted: 999)
@available(_PackageDescription, obsoleted: 5.3)
public static func byName(name: String) -> Target.Dependency {
#if PACKAGE_DESCRIPTION_4
return .byNameItem(name: name)
Expand All @@ -690,7 +690,7 @@ extension Target.Dependency {
/// - parameters:
/// - name: The name of the product.
/// - package: The name of the package.
@available(_PackageDescription, introduced: 5.2, obsoleted: 999)
@available(_PackageDescription, introduced: 5.2, obsoleted: 5.3)
public static func product(
name: String,
package: String
Expand All @@ -703,7 +703,7 @@ extension Target.Dependency {
/// - parameters:
/// - name: The name of the target.
/// - condition: The condition under which the dependency is exercised.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public static func target(name: String, condition: TargetDependencyCondition? = nil) -> Target.Dependency {
return ._targetItem(name: name, condition: condition)
}
Expand All @@ -714,7 +714,7 @@ extension Target.Dependency {
/// - name: The name of the product.
/// - package: The name of the package.
/// - condition: The condition under which the dependency is exercised.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public static func product(
name: String,
package: String,
Expand All @@ -729,7 +729,7 @@ extension Target.Dependency {
/// - parameters:
/// - name: The name of the dependency, either a target or a product.
/// - condition: The condition under which the dependency is exercised.
@available(_PackageDescription, introduced: 999)
@available(_PackageDescription, introduced: 5.3)
public static func byName(name: String, condition: TargetDependencyCondition? = nil) -> Target.Dependency {
return ._byNameItem(name: name, condition: condition)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/PackageLoading/ManifestLoader.swift
Expand Up @@ -712,7 +712,7 @@ private func sandboxProfile(toolsVersion: ToolsVersion, cacheDirectories: [Absol
stream <<< "(import \"system.sb\")" <<< "\n"

// The following accesses are only needed when interpreting the manifest (versus running a compiled version).
if toolsVersion < .vNext {
if toolsVersion < .v5_3 {
// Allow reading all files.
stream <<< "(allow file-read*)" <<< "\n"
// These are required by the Swift compiler.
Expand Down
16 changes: 8 additions & 8 deletions Sources/PackageLoading/TargetSourcesBuilder.swift
Expand Up @@ -112,9 +112,9 @@ public struct TargetSourcesBuilder {
}

// Emit an error if we found files without a matching rule in
// tools version >= vNext. This will be activated once resources
// tools version >= v5_3. This will be activated once resources
// support is complete.
if toolsVersion >= .vNext {
if toolsVersion >= .v5_3 {
let filesWithNoRules = pathToRule.filter { $0.value.rule == .none }
if !filesWithNoRules.isEmpty {
var error = "found \(filesWithNoRules.count) file(s) which are unhandled; explicitly declare them as resources or exclude from the target\n"
Expand Down Expand Up @@ -323,7 +323,7 @@ public struct TargetSourcesBuilder {
var ignoredDirectoryExtensions = ["xcodeproj", "playground", "xcworkspace"]

// Ignore localization directories if not supported.
if toolsVersion < .vNext {
if toolsVersion < .v5_3 {
ignoredDirectoryExtensions.append(Resource.localizationDirectoryExtension)
}

Expand Down Expand Up @@ -366,7 +366,7 @@ public struct TargetSourcesBuilder {
// sources that have an extension but are not explicitly
// declared as sources in the manifest.
if
toolsVersion >= .vNext &&
toolsVersion >= .v5_3 &&
path.extension != nil &&
path.extension != Resource.localizationDirectoryExtension &&
!isDeclaredSource(path)
Expand Down Expand Up @@ -519,7 +519,7 @@ public struct FileRuleDescription {
public static let xib: FileRuleDescription = {
.init(
rule: .processResource,
toolsVersion: .vNext,
toolsVersion: .v5_3,
fileTypes: ["nib", "xib", "storyboard"]
)
}()
Expand All @@ -528,7 +528,7 @@ public struct FileRuleDescription {
public static let assetCatalog: FileRuleDescription = {
.init(
rule: .processResource,
toolsVersion: .vNext,
toolsVersion: .v5_3,
fileTypes: ["xcassets"]
)
}()
Expand All @@ -537,7 +537,7 @@ public struct FileRuleDescription {
public static let coredata: FileRuleDescription = {
.init(
rule: .processResource,
toolsVersion: .vNext,
toolsVersion: .v5_3,
fileTypes: ["xcdatamodeld", "xcdatamodel", "xcmappingmodel"]
)
}()
Expand All @@ -546,7 +546,7 @@ public struct FileRuleDescription {
public static let metal: FileRuleDescription = {
.init(
rule: .processResource,
toolsVersion: .vNext,
toolsVersion: .v5_3,
fileTypes: ["metal"]
)
}()
Expand Down
1 change: 1 addition & 0 deletions Sources/PackageModel/ToolsVersion.swift
Expand Up @@ -21,6 +21,7 @@ public struct ToolsVersion: CustomStringConvertible, Comparable, Hashable, Codab
public static let v4_2 = ToolsVersion(version: "4.2.0")
public static let v5 = ToolsVersion(version: "5.0.0")
public static let v5_2 = ToolsVersion(version: "5.2.0")
public static let v5_3 = ToolsVersion(version: "5.3.0")
public static let vNext = ToolsVersion(version: "999.0.0")

/// The current tools version in use.
Expand Down
10 changes: 5 additions & 5 deletions Tests/PackageLoadingTests/PD5_2LoadingTests.swift
Expand Up @@ -231,7 +231,7 @@ class PackageDescription5_2LoadingTests: PackageDescriptionLoadingTests {
}

XCTAssertMatch(message, .contains("is unavailable"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 999"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 5.3"))
}
}

Expand All @@ -257,7 +257,7 @@ class PackageDescription5_2LoadingTests: PackageDescriptionLoadingTests {
}

XCTAssertMatch(message, .contains("is unavailable"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 999"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 5.3"))
}
}

Expand All @@ -283,7 +283,7 @@ class PackageDescription5_2LoadingTests: PackageDescriptionLoadingTests {
}

XCTAssertMatch(message, .contains("is unavailable"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 999"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 5.3"))
}
}
}
Expand Down Expand Up @@ -313,7 +313,7 @@ class PackageDescription5_2LoadingTests: PackageDescriptionLoadingTests {
}

XCTAssertMatch(message, .contains("is unavailable"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 999"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 5.3"))
}
}

Expand Down Expand Up @@ -341,7 +341,7 @@ class PackageDescription5_2LoadingTests: PackageDescriptionLoadingTests {
}

XCTAssertMatch(message, .contains("is unavailable"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 999"))
XCTAssertMatch(message, .contains("was introduced in PackageDescription 5.3"))
}
}
}
Expand Down
Expand Up @@ -18,7 +18,7 @@ import PackageLoading

class PackageDescriptionNextLoadingTests: PackageDescriptionLoadingTests {
override var toolsVersion: ToolsVersion {
.vNext
.v5_3
}

func testResources() throws {
Expand Down
4 changes: 2 additions & 2 deletions Tests/PackageLoadingTests/PackageBuilderTests.swift
Expand Up @@ -1918,7 +1918,7 @@ class PackageBuilderTests: XCTestCase {

let manifest = Manifest.createManifest(
name: "Foo",
v: .vNext,
v: .v5_3,
targets: [
TargetDescription(name: "Foo", resources: [
.init(rule: .process, path: "Resources")
Expand All @@ -1942,7 +1942,7 @@ class PackageBuilderTests: XCTestCase {

let manifest = Manifest.createManifest(
name: "Foo",
v: .vNext,
v: .v5_3,
targets: [
TargetDescription(name: "Foo"),
]
Expand Down

0 comments on commit d196d9d

Please sign in to comment.