Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Sources/SkipBuild/Commands/UpgradeCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ struct UpgradeCommand: MessageCommand, ToolOptionsCommand {
}

extension SkipCommand {
/// Checks the https://source.skip.tools/skip/releases.atom page and returns the semantic version contained in the title of the first entry (i.e., the latest release of Skip)
/// Checks the https://github.com/skiptools/skip/releases.atom page and returns the semantic version contained in the title of the first entry (i.e., the latest release of Skip)
func checkSkipUpdates(with out: MessageQueue) async -> String? {
try? await outputOptions.monitor(with: out, "Check Skip Updates", resultHandler: { result in
(result, MessageBlock(status: result?.messageStatusAny, "Check Skip Updates: \((try? result?.get()) ?? "?")"))
}) { loggingHandler in
try await fetchLatestRelease(from: URL(string: "https://source.skip.tools/skip/releases.atom")!)
try await fetchLatestRelease(from: URL(string: "https://github.com/skiptools/skip/releases.atom")!)
}.get()
}

Expand Down
22 changes: 22 additions & 0 deletions Sources/SkipBuild/Commands/VerifyCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ struct VerifyCommand: SkipCommand, StreamingCommand, ProjectCommand, ToolOptions
}


/// The host and organization for Skip repositories, to which package dependency URLs should refer.
let skipRepositoryHost = "github.com/skiptools"

/// The legacy Skip repository host, which redirects to `skipRepositoryHost`.
let legacySkipRepositoryHost = "source.skip.tools"

struct NoResultOutputError : LocalizedError {
var errorDescription: String?
}
Expand Down Expand Up @@ -227,6 +233,22 @@ extension ToolOptionsCommand where Self : StreamingCommand {
}
}

// check that the Package.swift references the current Skip repository host rather than the legacy redirecting host
let packageSwiftURL = URL(fileURLWithPath: "Package.swift", isDirectory: false, relativeTo: projectFolderURL)
await verifyFile(packageSwiftURL, title: "Check Skip repository URLs") { title, url in
let contents = try String(contentsOf: url, encoding: .utf8)
if !contents.contains(legacySkipRepositoryHost) {
return CheckStatus(status: .pass, message: title)
}
if autofix {
let updated = contents.replacingOccurrences(of: legacySkipRepositoryHost, with: skipRepositoryHost)
try updated.write(to: url, atomically: false, encoding: .utf8)
return CheckStatus(status: .warn, message: "\(title): updated \(legacySkipRepositoryHost) references to \(skipRepositoryHost)")
} else {
return CheckStatus(status: .fail, message: "\(title): Package.swift references \(legacySkipRepositoryHost), which should be \(skipRepositoryHost): run skip verify --fix")
}
}

let packageJSON = try await parseSwiftPackage(with: out, at: projectPath)
let packageName = packageJSON.name

Expand Down
2 changes: 1 addition & 1 deletion Sources/SkipBuild/SkipCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ public struct PackageResolved : Hashable, Decodable {
{
"identity" : "skip",
"kind" : "remoteSourceControl",
"location" : "https://source.skip.tools/skip.git",
"location" : "https://github.com/skiptools/skip.git",
"state" : {
"revision" : "18aba366924bf622d047b97f3249560e1471cc25",
"version" : "1.5.21"
Expand Down
8 changes: 4 additions & 4 deletions Sources/SkipBuild/SkipProject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class FrameworkProjectLayout {
"""

var packageDependencies: [String] = [
".package(url: \"https://source.skip.tools/skip.git\", from: \"\(skipPackageVersion)\")"
".package(url: \"https://github.com/skiptools/skip.git\", from: \"\(skipPackageVersion)\")"
]

for moduleIndex in modules.indices {
Expand Down Expand Up @@ -1347,7 +1347,7 @@ struct TestData : Codable, Hashable {
var skipModuleDeps: [String] = []
for modDep in modDeps {
if let repoName = modDep.repositoryName {
let repoURL = modDep.organizationName != nil ? "https://github.com/\(modDep.organizationName!)" : "https://source.skip.tools"
let repoURL = modDep.organizationName != nil ? "https://github.com/\(modDep.organizationName!)" : "https://github.com/skiptools"
var packDep = ".package(url: \"\(repoURL)/\(repoName).git\", "

var depVersion = modDep.repositoryVersion ?? "1.0.0" // "1.2.3"..<"1.2.6"
Expand Down Expand Up @@ -1441,7 +1441,7 @@ struct TestData : Codable, Hashable {
packageSource += """

if Context.environment["SKIP_BRIDGE"] ?? "0" != "0" {
package.dependencies += [.package(url: "https://source.skip.tools/skip-bridge.git", "0.0.0"..<"2.0.0")]
package.dependencies += [.package(url: "https://github.com/skiptools/skip-bridge.git", "0.0.0"..<"2.0.0")]
package.targets.forEach({ target in
target.dependencies += [.product(name: "SkipBridge", package: "skip-bridge")]
})
Expand Down Expand Up @@ -1483,7 +1483,7 @@ struct TestData : Codable, Hashable {
// remove the Skip package dependencies
package.dependencies.removeAll(where: { dependency in
if case .sourceControl(_, let url, _) = dependency.kind {
return url.hasPrefix("https://source.skip.dev/") || url.hasPrefix("https://source.skip.tools/")
return url.hasPrefix("https://source.skip.dev/") || url.hasPrefix("https://source.skip.tools/") || url.hasPrefix("https://github.com/skiptools/")
} else {
return false
}
Expand Down
84 changes: 42 additions & 42 deletions Tests/SkipBuildTests/SkipCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ final class SkipCommandTests: XCTestCase {
.library(name: "SomeModule", type: .dynamic, targets: ["SomeModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-foundation.git", from: "1.0.0")
],
targets: [
.target(name: "SomeModule", dependencies: [
Expand Down Expand Up @@ -99,7 +99,7 @@ final class SkipCommandTests: XCTestCase {
// remove the Skip package dependencies
package.dependencies.removeAll(where: { dependency in
if case .sourceControl(_, let url, _) = dependency.kind {
return url.hasPrefix("https://source.skip.dev/") || url.hasPrefix("https://source.skip.tools/")
return url.hasPrefix("https://source.skip.dev/") || url.hasPrefix("https://source.skip.tools/") || url.hasPrefix("https://github.com/skiptools/")
} else {
return false
}
Expand Down Expand Up @@ -141,8 +141,8 @@ final class SkipCommandTests: XCTestCase {
.library(name: "TeenyModule", type: .dynamic, targets: ["TeenyModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-foundation.git", from: "1.0.0")
],
targets: [
.target(name: "TeenyModule", dependencies: [
Expand Down Expand Up @@ -229,8 +229,8 @@ final class SkipCommandTests: XCTestCase {
.library(name: "SomeModule", type: .dynamic, targets: ["SomeModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-foundation.git", from: "1.0.0")
],
targets: [
.target(name: "SomeModule", dependencies: [
Expand Down Expand Up @@ -292,8 +292,8 @@ final class SkipCommandTests: XCTestCase {
.library(name: "FreeModule", type: .dynamic, targets: ["FreeModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-foundation.git", from: "1.0.0")
],
targets: [
.target(name: "FreeModule", dependencies: [
Expand Down Expand Up @@ -360,8 +360,8 @@ final class SkipCommandTests: XCTestCase {
.library(name: "BridgedModule", type: .dynamic, targets: ["BridgedModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-foundation.git", from: "1.0.0")
],
targets: [
.target(name: "BridgedModule", dependencies: [
Expand All @@ -375,7 +375,7 @@ final class SkipCommandTests: XCTestCase {
)

if Context.environment["SKIP_BRIDGE"] ?? "0" != "0" {
package.dependencies += [.package(url: "https://source.skip.tools/skip-bridge.git", "0.0.0"..<"2.0.0")]
package.dependencies += [.package(url: "https://github.com/skiptools/skip-bridge.git", "0.0.0"..<"2.0.0")]
package.targets.forEach({ target in
target.dependencies += [.product(name: "SkipBridge", package: "skip-bridge")]
})
Expand Down Expand Up @@ -797,8 +797,8 @@ final class SkipCommandTests: XCTestCase {
.library(name: "SomeModule", type: .dynamic, targets: ["SomeModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-fuse.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-fuse.git", from: "1.0.0")
],
targets: [
.target(name: "SomeModule", dependencies: [
Expand Down Expand Up @@ -894,8 +894,8 @@ final class SkipCommandTests: XCTestCase {
.library(name: "SomeModule", type: .dynamic, targets: ["SomeModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-fuse.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-fuse.git", from: "1.0.0")
],
targets: [
.target(name: "SomeModule", dependencies: [
Expand Down Expand Up @@ -1065,10 +1065,10 @@ final class SkipCommandTests: XCTestCase {
.library(name: "ModelModule", type: .dynamic, targets: ["ModelModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-ui.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-fuse.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-model.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-ui.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-fuse.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-model.git", from: "1.0.0")
],
targets: [
.target(name: "AppModule", dependencies: [
Expand Down Expand Up @@ -1240,10 +1240,10 @@ final class SkipCommandTests: XCTestCase {
.library(name: "ModelModule", type: .dynamic, targets: ["ModelModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-fuse-ui.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-fuse.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-model.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-fuse-ui.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-fuse.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-model.git", from: "1.0.0")
],
targets: [
.target(name: "AppModule", dependencies: [
Expand Down Expand Up @@ -1355,8 +1355,8 @@ final class SkipCommandTests: XCTestCase {
.library(name: "AppModule", type: .dynamic, targets: ["AppModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-fuse-ui.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-fuse-ui.git", from: "1.0.0")
],
targets: [
.target(name: "AppModule", dependencies: [
Expand Down Expand Up @@ -1488,10 +1488,10 @@ final class SkipCommandTests: XCTestCase {
.library(name: "FreeAppModel", type: .dynamic, targets: ["FreeAppModel"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/appfair/appfair-app.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-model.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip-foundation.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-model.git", from: "1.0.0")
],
targets: [
.target(name: "FreeApp", dependencies: [
Expand Down Expand Up @@ -1626,10 +1626,10 @@ final class SkipCommandTests: XCTestCase {
.library(name: "BottomModule", type: .dynamic, targets: ["BottomModule"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-ui.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-model.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-ui.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-model.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-foundation.git", from: "1.0.0")
],
targets: [
.target(name: "TopModule", dependencies: [
Expand Down Expand Up @@ -1683,7 +1683,7 @@ final class SkipCommandTests: XCTestCase {
// remove the Skip package dependencies
package.dependencies.removeAll(where: { dependency in
if case .sourceControl(_, let url, _) = dependency.kind {
return url.hasPrefix("https://source.skip.dev/") || url.hasPrefix("https://source.skip.tools/")
return url.hasPrefix("https://source.skip.dev/") || url.hasPrefix("https://source.skip.tools/") || url.hasPrefix("https://github.com/skiptools/")
} else {
return false
}
Expand Down Expand Up @@ -1792,10 +1792,10 @@ final class SkipCommandTests: XCTestCase {
.library(name: "M5", type: .dynamic, targets: ["M5"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-ui.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-model.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-ui.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-model.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-foundation.git", from: "1.0.0")
],
targets: [
.target(name: "M1", dependencies: [
Expand Down Expand Up @@ -1927,10 +1927,10 @@ final class SkipCommandTests: XCTestCase {
.library(name: "M5", type: .dynamic, targets: ["M5"]),
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-ui.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-model.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-fuse.git", from: "1.0.0")
.package(url: "https://github.com/skiptools/skip.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-ui.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-model.git", from: "1.0.0"),
.package(url: "https://github.com/skiptools/skip-fuse.git", from: "1.0.0")
],
targets: [
.target(name: "M1", dependencies: [
Expand Down
Loading
Loading