Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Testing Support
We now build `swift-test`, which will create a test runner based on the layout of your Test modules as per our testing proposal: https://github.com/apple/swift-evolution/blob/master/proposals/0019-package-manager-testing.md Also includes a significant refactor. I am sorry this is not more atomic, but the work just kept expanding in scope and keeping history straight was too much work. Notable improvements aside from the testing propopsal: * Whole Module Optimization is applied to release builds * A single llbuild.yaml file is created for all packages in a project, this allows llbuild to properly manage build dependencies * A new products feature has been added to Package.swift which allows you to define product targets (like dynamic libraries) that consist of a series of modules The refactor involved creating many more modules with much more refined and defined scope and responsibility. The code is now much more maintainable.
- Loading branch information
Showing
126 changed files
with
3,226 additions
and
3,693 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
Fixtures/DependencyResolution/External/Complex/app/Package.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
Fixtures/DependencyResolution/External/Complex/app/main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
Fixtures/DependencyResolution/External/Complex/deck-of-playing-cards/src/Deck.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "FooLib1", | ||
targets: [Target(name: "cli", dependencies: ["FooLib1"])]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import FooLib1 | ||
|
||
print(FooLib1()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
This source file is part of the Swift.org open source project | ||
Copyright 2015 - 2016 Apple Inc. and the Swift project authors | ||
Licensed under Apache License v2.0 with Runtime Library Exception | ||
See http://swift.org/LICENSE.txt for license information | ||
See http://swift.org/CONTRIBUTORS.txt for Swift project authors | ||
*/ | ||
|
||
import Utility | ||
import PackageType | ||
|
||
struct IncrementalNode { | ||
let module: SwiftModule | ||
let prefix: String | ||
|
||
var tempsPath: String { | ||
return Path.join(prefix, "\(module.c99name).build") | ||
} | ||
|
||
var swiftModuleName: String { | ||
return "\(module.c99name).swiftmodule" | ||
} | ||
|
||
var objectPaths: [String] { | ||
return module.sources.relativePaths.map{ Path.join(tempsPath, "\($0).o") } | ||
} | ||
|
||
var outputs: [String] { | ||
return [module.targetName] + objectPaths | ||
} | ||
|
||
var inputs: [String] { | ||
return module.recursiveDependencies.map{ $0.targetName } | ||
} | ||
|
||
var moduleOutputPath: String { | ||
return Path.join(prefix, swiftModuleName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
This source file is part of the Swift.org open source project | ||
Copyright 2015 - 2016 Apple Inc. and the Swift project authors | ||
Licensed under Apache License v2.0 with Runtime Library Exception | ||
See http://swift.org/LICENSE.txt for license information | ||
See http://swift.org/CONTRIBUTORS.txt for Swift project authors | ||
*/ | ||
|
||
import struct Utility.Path | ||
import struct libc.FILE | ||
import func libc.fclose | ||
import POSIX | ||
|
||
class YAML { | ||
let path: String | ||
private let fp: UnsafeMutablePointer<FILE> | ||
|
||
init(path: String...) throws { | ||
self.path = Path.join(path) | ||
fp = try fopen(self.path, mode: .Write) | ||
} | ||
|
||
func close() { | ||
fclose(fp) | ||
} | ||
|
||
func write(anys: Any...) throws { | ||
var anys = anys | ||
try fputs(anys.removeFirst() as! String, fp) | ||
if !anys.isEmpty { | ||
try fputs(anys.map(toYAML).joinWithSeparator(""), fp) | ||
} | ||
try fputs("\n", fp) | ||
|
||
} | ||
} | ||
|
||
private func toYAML(any: Any) -> String { | ||
|
||
func quote(input: String) -> String { | ||
for c in input.characters { | ||
if c == "@" || c == " " || c == "-" { | ||
return "\"\(input)\"" | ||
} | ||
} | ||
return input | ||
} | ||
|
||
switch any { | ||
case let string as String where string == "": | ||
return "\"\"" | ||
case let string as String: | ||
return string | ||
case let array as [String]: | ||
return "[" + array.map(quote).joinWithSeparator(", ") + "]" | ||
case let bool as Bool: | ||
return bool ? "true" : "false" | ||
default: | ||
fatalError("Unimplemented YAML type") | ||
} | ||
} |
Oops, something went wrong.