You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dump dependency information during the build (#874)
- Extend `BuildDependencyInfo` with module/header dependencies
- Extend `ValidateDependenciesTaskAction` to dump per target dependency information in the new format
- The new behavior is opt-in behind a `DUMP_DEPENDENCIES` build setting
/// Hierarchy of data structures containing the dependencies for all targets in a build.
34
-
///
35
-
/// These structures can be encoded to and decoded from JSON. The JSON is an API used by clients, and the data structures may become such an API eventually if we decide to share them directly with clients.
36
-
///
37
-
/// The names of properties in these structures are chosen mainly to be useful in the JSON file, so they may be a bit more verbose for use in Swift than they might be otherwise.
38
-
///
39
-
/// Presently the main way to instantiate these structures is to use `init(workspaceContext:buildRequest:buildRequestContext:operation:)`, which is defined below after the data structures.
40
-
41
-
42
-
/// The input and output dependencies for all targets in a build.
43
-
packagestructBuildDependencyInfo:Codable{
44
-
45
-
/// Structure describing the dependencies for a single target. This includes a structure describing the identity of the target, and the declared inputs and outputs of the target.
46
-
packagestructTargetDependencyInfo:Codable{
47
-
48
-
/// Structure describing the identity of a target. This structure is `Hashable` so it can be used to determine if we've seen exactly this target before, and for testing purposes.
49
-
packagestructTarget:Hashable{
50
-
51
-
/// The name of the target.
52
-
packagelettargetName:String
53
-
54
-
/// The name of the project (for builds which use multiple Xcode projects).
55
-
packageletprojectName:String?
56
-
57
-
/// The name of the platform the target is building for.
58
-
packageletplatformName:String?
59
-
60
-
}
61
-
62
-
/// Structure describing an input to a target.
63
-
packagestructInput:Hashable,Codable,Sendable{
64
-
65
-
/// An input can be a framework or a library.
66
-
packageenumInputType:String,Codable,Sendable{
67
-
case framework
68
-
case library
69
-
}
70
-
71
-
/// The name reflects what information we have about the input in the project. Since Xcode often finds libraries and frameworks with search paths, we will have the the name of the input - or even only a stem if it's a `-l` option from `OTHER_LDFLAGS`. We may have an absolute path.
72
-
packageenumNameType:Hashable,Codable,Sendable{
73
-
/// An absolute path, typically either because we found it in a build setting such as `OTHER_LDFLAGS`, or because some internal logic decided to link with an absolute path.
74
-
case absolutePath(String)
75
-
76
-
/// A file name being linked with a search path. This will be the whole name such as `Foo.framework` or `libFoo.dylib`.
77
-
case name(String)
78
-
79
-
/// The stem of a file being linked with a search path. For libraries this will be the part of the file name after `lib` and before the suffix. For other files this will be the file's base name without the suffix.
80
-
///
81
-
/// Stems are often found after `-l` or `-framework` options in a build setting such as `OTHER_LDFLAGS`.
82
-
case stem(String)
83
-
84
-
/// Convenience method to return the associated value of the input as a String. This is mainly for sorting purposes during tests to emit consistent results, since the names may be of different types.
85
-
packagevarstringForm:String{
86
-
switchself{
87
-
case.absolutePath(let str):
88
-
return str
89
-
case.name(let str):
90
-
return str
91
-
case.stem(let str):
92
-
return str
93
-
}
94
-
}
95
-
96
-
/// Convenience method to return a string to use for sorting different names.
/// For inputs which are linkages, we note whether we're linking using a search path or an absolute path.
111
-
packageenumLinkType:String,Codable,Sendable{
112
-
case absolutePath
113
-
case searchPath
114
-
}
115
-
116
-
/// The library type of the input. If we know that it's a dynamic or static library (usually from the file type of the input) then we note that. But for inputs from `-l` options in `OTHER_LDFLAGS`, we don't know the type.
// FIXME: This is incomplete. We likely need to use `TaskProducer.willProduceBinary()` to know this, which means factoring that out somewhere where we can use it. For now we use whether the target is a StandardTarget as a proxy for this.
0 commit comments