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
[NFC] Build/PackageModel: split Target.swift and BuildPlan.swift (#6972)
### Motivation:
The `Build` module is not very well documented and the overall flow of
build planning is not obvious when trying to read its code.
### Modifications:
`Target.swift` and `BuildPlan.swift` are split into separate files that
contain either separate types or extensions with corresponding
functionality. Now that both files are split, their extensions mostly
correspond to types of targets that SwiftPM supports:
* Clang
* Swift
* Plugin
* System Library
This separation is also closely reflected in `BuildPlan` extensions:
* Clang
* Product
* Swift
* Test
Also moved product-related build manifest code to
`LLBuildManifestBuilder+Product.swift`.
### Result:
Now it's much easier to navigate across the `Build` module codebase, and
each step of build planning has a separate directory that describes the
overall flow:
1. Build description is formed (the existing `BuildDescription`
directory);
2. Build planning assigns necessary flags, options, and arguments (the
new `BuildPlan` directory);
3. Build manifest is written out for llbuild (the existing
`BuildManifest` directory).
As a bonus, these files can now be built in parallel, but I don't think
it's noticeable when building. Another benefit is that imports for each
new file are explicit and don't pollute the corresponding namespace with
wildcard imports of whole modules.
0 commit comments