-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[APIDiff] Improve API digester integration & polish of experimental-api-diff #3485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fd3e92d
[APIDiff] Parse serialized diagnostics from API digester to different…
owenv 8d6b0f6
[APIDiff] Refactoring and documentation to make the diffing process e…
owenv 80b8864
[APIDiff] Diff and print results from one module at a time
owenv 1f5a34b
[APIDiff] Improve test coverage
owenv 125818f
[APIDiff] Use per-module baselines
owenv ba89eaa
[APIDiff] Only diagnose API breakage in modules vended by library pro…
owenv 3a421a4
[APIDiff] Add a test case involving a C-family target
owenv 5c1e2db
[APIDiff] Print a message if a module has no breaking changes
owenv fbeb00a
[APIDiff] Skip comparison of modules which aren't present in the base…
owenv 1407c66
[APIDiff] Refactor API digester tool to accept a BuildPlan instead of…
owenv 7bbf999
[APIDiff] Remove an option-parsing hack that's no longer needed
owenv 3557105
[APIDiff] Improve failure diagnostics
owenv 5415614
[APIDiff] Remove an obsolete test
owenv 2738aa0
[APIDiff] Adapt to a TSC API change
owenv 2457b7d
[APIDiff] Rename SwiftAPIDigester.ComparisonResult.isSuccessful -> Sw…
owenv 81b4d2d
[APIDiff] Allow restricting the diff to specific products and/or targets
owenv 59f13f9
[APIDiff] Improve subcommand help
owenv cd88df0
[APIDiff] Parallelize diff operation
owenv 3f07326
[APIDiff] Parallelize baseline generation
owenv e45725d
[APIDiff] Clarify filtering options
owenv 9167479
[APIDiff] Control paralellism of api-digester invocations with -j
owenv cc0bdf4
Update help text
owenv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,14 @@ | ||
// swift-tools-version:4.2 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "Bar", | ||
products: [ | ||
.library(name: "Baz", targets: ["Baz"]), | ||
.library(name: "Qux", targets: ["Qux"]), | ||
], | ||
targets: [ | ||
.target(name: "Baz"), | ||
.target(name: "Qux") | ||
] | ||
) |
This file contains hidden or 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 @@ | ||
public func bar() -> Int { | ||
42 | ||
} |
This file contains hidden or 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 @@ | ||
public class Qux<T> { public let x = 1 } |
This file contains hidden or 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,13 @@ | ||
// swift-tools-version:4.2 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "CLibrarySources", | ||
products: [ | ||
.library(name: "Lib", targets: ["Bar"]) | ||
], | ||
targets: [ | ||
.target(name: "Foo"), | ||
.target(name: "Bar", dependencies: ["Foo"]) | ||
] | ||
) |
6 changes: 6 additions & 0 deletions
6
Fixtures/Miscellaneous/APIDiff/CTargetDep/Sources/Bar/Bar.swift
This file contains hidden or 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,6 @@ | ||
import Foo | ||
|
||
public func bar() -> Int { | ||
foo() | ||
return 42 | ||
} |
This file contains hidden or 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,8 @@ | ||
#include "Foo.h" | ||
|
||
int foo() { | ||
int a = 5; | ||
int b = a; | ||
a = b; | ||
return a; | ||
} |
1 change: 1 addition & 0 deletions
1
Fixtures/Miscellaneous/APIDiff/CTargetDep/Sources/Foo/include/Foo.h
This file contains hidden or 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 @@ | ||
int foo(); |
This file contains hidden or 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 @@ | ||
public func foo() { | ||
{}() | ||
} |
This file contains hidden or 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,12 @@ | ||
// swift-tools-version:4.2 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "Foo", | ||
products: [ | ||
.library(name: "Foo", targets: ["Foo"]), | ||
], | ||
targets: [ | ||
.target(name: "Foo", path: "./"), | ||
] | ||
) |
18 changes: 18 additions & 0 deletions
18
Fixtures/Miscellaneous/APIDiff/NonAPILibraryTargets/Package.swift
This file contains hidden or 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,18 @@ | ||
// swift-tools-version:4.2 | ||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "NonAPILibraryTargets", | ||
products: [ | ||
.library(name: "One", targets: ["Foo"]), | ||
.library(name: "Two", targets: ["Bar", "Baz"]), | ||
.executable(name: "Exec", targets: ["Exec", "Qux"]) | ||
], | ||
targets: [ | ||
.target(name: "Foo"), | ||
.target(name: "Bar", dependencies: ["Baz"]), | ||
.target(name: "Baz"), | ||
.target(name: "Qux"), | ||
.target(name: "Exec", dependencies: ["Qux"]) | ||
] | ||
) |
5 changes: 5 additions & 0 deletions
5
Fixtures/Miscellaneous/APIDiff/NonAPILibraryTargets/Sources/Bar/Bar.swift
This file contains hidden or 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 Baz | ||
|
||
public func bar() -> Int { | ||
42 | ||
} |
3 changes: 3 additions & 0 deletions
3
Fixtures/Miscellaneous/APIDiff/NonAPILibraryTargets/Sources/Baz/Baz.swift
This file contains hidden or 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 @@ | ||
public enum Baz { | ||
case a, c | ||
} |
3 changes: 3 additions & 0 deletions
3
Fixtures/Miscellaneous/APIDiff/NonAPILibraryTargets/Sources/Exec/main.swift
This file contains hidden or 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 Qux | ||
|
||
print("Hello, world!") |
3 changes: 3 additions & 0 deletions
3
Fixtures/Miscellaneous/APIDiff/NonAPILibraryTargets/Sources/Foo/Foo.swift
This file contains hidden or 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 @@ | ||
public struct Foo { | ||
func doThing() {} | ||
} |
1 change: 1 addition & 0 deletions
1
Fixtures/Miscellaneous/APIDiff/NonAPILibraryTargets/Sources/Qux/Qux.swift
This file contains hidden or 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 @@ | ||
public class Qux<T> { public let x = 1 } |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these changes unnecessary now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, as of swiftlang/swift#37206 this is unnecessary because the API digester and compiler are using the same option definitions