8000 Swift: separate installation of dependencies and autobuilding · github/codeql@dd13ea3 · GitHub
[go: up one dir, main page]

Skip to content

Commit dd13ea3

Browse files
committed
Swift: separate installation of dependencies and autobuilding
`pod install` could generate Xcode projects files needed for autobuilding, so it's better to install dependencies first, and then do re-scan to pick up the new files.
1 parent 1ea1130 commit dd13ea3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

swift/swift-autobuilder/swift-autobuilder.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ static bool buildSwiftPackages(const std::vector<std::filesystem::path>& swiftPa
5454
return any_successful;
5555
}
5656

57+
static void installDependencies(const CLIArgs& args) {
58+
auto structure = scanProjectStructure(args.workingDir);
59+
installDependencies(structure, args.dryRun);
60+
}
61+
5762
static bool autobuild(const CLIArgs& args) {
5863
auto structure = scanProjectStructure(args.workingDir);
5964
auto& xcodeTargets = structure.xcodeTargets;
@@ -82,7 +87,6 @@ static bool autobuild(const CLIArgs& args) {
8287
return false;
8388
} else if (!xcodeTargets.empty()) {
8489
LOG_INFO("Building Xcode target: {}", xcodeTargets.front());
85-
installDependencies(structure, args.dryRun);
8690
auto buildSucceeded = buildXcodeTarget(xcodeTargets.front(), args.dryRun);
8791
// If build failed, try to build Swift packages
8892
if (!buildSucceeded && !swiftPackages.empty()) {
@@ -113,6 +117,7 @@ static CLIArgs parseCLIArgs(int argc, char** argv) {
113117

114118
int main(int argc, char** argv) {
115119
auto args = parseCLIArgs(argc, argv);
120+
installDependencies(args);
116121
auto success = autobuild(args);
117122
codeql::Log::flush();
118123
if (!success) {

0 commit comments

Comments
 (0)
0