diff --git a/swift/BUILD.bazel b/swift/BUILD.bazel index 83dff3f8033..57b828ef350 100644 --- a/swift/BUILD.bazel +++ b/swift/BUILD.bazel @@ -1,4 +1,4 @@ -load("@rules_pkg//:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "strip_prefix") +load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix") load("@rules_pkg//:install.bzl", "pkg_install") load("//:defs.bzl", "codeql_platform") load("//misc/bazel:pkg_runfiles.bzl", "pkg_runfiles") @@ -57,8 +57,8 @@ pkg_filegroup( ) pkg_runfiles( - name = "xcode-autobuilder", - srcs = ["//swift/xcode-autobuilder"], + name = "swift-autobuilder", + srcs = ["//swift/swift-autobuilder"], prefix = "tools/" + codeql_platform, ) @@ -93,7 +93,7 @@ pkg_filegroup( ], }) + select({ "@platforms//os:macos": [ - ":xcode-autobuilder", + ":swift-autobuilder", ], "//conditions:default": [ ":diagnostics", @@ -130,7 +130,7 @@ generate_cmake( "//swift/logging/tests/assertion-diagnostics:assert-false", ] + select({ "@platforms//os:linux": ["//swift/tools/diagnostics:autobuilder-incompatible-os"], - "@platforms//os:macos": ["//swift/xcode-autobuilder"], + "@platforms//os:macos": ["//swift/swift-autobuilder"], }), visibility = ["//visibility:public"], ) diff --git a/swift/xcode-autobuilder/BUILD.bazel b/swift/swift-autobuilder/BUILD.bazel similarity index 92% rename from swift/xcode-autobuilder/BUILD.bazel rename to swift/swift-autobuilder/BUILD.bazel index 13d6e9818ff..951b0c243f2 100644 --- a/swift/xcode-autobuilder/BUILD.bazel +++ b/swift/swift-autobuilder/BUILD.bazel @@ -1,7 +1,7 @@ load("//swift:rules.bzl", "swift_cc_binary") swift_cc_binary( - name = "xcode-autobuilder", + name = "swift-autobuilder", srcs = glob([ "*.cpp", "*.h", diff --git a/swift/xcode-autobuilder/XcodeBuildRunner.cpp b/swift/swift-autobuilder/BuildRunner.cpp similarity index 97% rename from swift/xcode-autobuilder/XcodeBuildRunner.cpp rename to swift/swift-autobuilder/BuildRunner.cpp index 831d7e1f94e..cf0521bf789 100644 --- a/swift/xcode-autobuilder/XcodeBuildRunner.cpp +++ b/swift/swift-autobuilder/BuildRunner.cpp @@ -1,4 +1,4 @@ -#include "swift/xcode-autobuilder/XcodeBuildRunner.h" +#include "swift/swift-autobuilder/BuildRunner.h" #include #include @@ -6,7 +6,7 @@ #include "absl/strings/str_join.h" #include "swift/logging/SwiftLogging.h" -#include "swift/xcode-autobuilder/CustomizingBuildLink.h" +#include "swift/swift-autobuilder/CustomizingBuildLink.h" constexpr codeql::SwiftDiagnostic buildCommandFailed{ .id = "build-command-failed", diff --git a/swift/xcode-autobuilder/XcodeBuildRunner.h b/swift/swift-autobuilder/BuildRunner.h similarity index 70% rename from swift/xcode-autobuilder/XcodeBuildRunner.h rename to swift/swift-autobuilder/BuildRunner.h index ab86a00c767..404e74d4319 100644 --- a/swift/xcode-autobuilder/XcodeBuildRunner.h +++ b/swift/swift-autobuilder/BuildRunner.h @@ -1,7 +1,7 @@ #pragma once -#include "swift/xcode-autobuilder/XcodeTarget.h" -#include "swift/xcode-autobuilder/XcodeProjectParser.h" +#include "swift/swift-autobuilder/XcodeTarget.h" +#include "swift/swift-autobuilder/ProjectParser.h" #include void installDependencies(const ProjectStructure& target, bool dryRun); diff --git a/swift/xcode-autobuilder/CFHelpers.cpp b/swift/swift-autobuilder/CFHelpers.cpp similarity index 95% rename from swift/xcode-autobuilder/CFHelpers.cpp rename to swift/swift-autobuilder/CFHelpers.cpp index 7ca19c7b2b2..aba37e982dc 100644 --- a/swift/xcode-autobuilder/CFHelpers.cpp +++ b/swift/swift-autobuilder/CFHelpers.cpp @@ -1,4 +1,4 @@ -#include "swift/xcode-autobuilder/CFHelpers.h" +#include "swift/swift-autobuilder/CFHelpers.h" #include diff --git a/swift/xcode-autobuilder/CFHelpers.h b/swift/swift-autobuilder/CFHelpers.h similarity index 100% rename from swift/xcode-autobuilder/CFHelpers.h rename to swift/swift-autobuilder/CFHelpers.h diff --git a/swift/xcode-autobuilder/CustomizingBuildLink.h b/swift/swift-autobuilder/CustomizingBuildLink.h similarity index 100% rename from swift/xcode-autobuilder/CustomizingBuildLink.h rename to swift/swift-autobuilder/CustomizingBuildLink.h diff --git a/swift/xcode-autobuilder/XcodeProjectParser.cpp b/swift/swift-autobuilder/ProjectParser.cpp similarity index 98% rename from swift/xcode-autobuilder/XcodeProjectParser.cpp rename to swift/swift-autobuilder/ProjectParser.cpp index 072bcaeeee2..fce29e5b70b 100644 --- a/swift/xcode-autobuilder/XcodeProjectParser.cpp +++ b/swift/swift-autobuilder/ProjectParser.cpp @@ -1,4 +1,4 @@ -#include "swift/xcode-autobuilder/XcodeProjectParser.h" +#include "swift/swift-autobuilder/ProjectParser.h" #include #include @@ -8,8 +8,8 @@ #include #include -#include "swift/xcode-autobuilder/XcodeWorkspaceParser.h" -#include "swift/xcode-autobuilder/CFHelpers.h" +#include "swift/swift-autobuilder/XcodeWorkspaceParser.h" +#include "swift/swift-autobuilder/CFHelpers.h" namespace fs = std::filesystem; diff --git a/swift/xcode-autobuilder/XcodeProjectParser.h b/swift/swift-autobuilder/ProjectParser.h similarity index 90% rename from swift/xcode-autobuilder/XcodeProjectParser.h rename to swift/swift-autobuilder/ProjectParser.h index 56958f2b97e..d7e9cdb5eb9 100644 --- a/swift/xcode-autobuilder/XcodeProjectParser.h +++ b/swift/swift-autobuilder/ProjectParser.h @@ -1,6 +1,6 @@ #pragma once -#include "swift/xcode-autobuilder/XcodeTarget.h" +#include "swift/swift-autobuilder/XcodeTarget.h" #include #include #include diff --git a/swift/xcode-autobuilder/XcodeTarget.h b/swift/swift-autobuilder/XcodeTarget.h similarity index 100% rename from swift/xcode-autobuilder/XcodeTarget.h rename to swift/swift-autobuilder/XcodeTarget.h diff --git a/swift/xcode-autobuilder/XcodeWorkspaceParser.cpp b/swift/swift-autobuilder/XcodeWorkspaceParser.cpp similarity index 96% rename from swift/xcode-autobuilder/XcodeWorkspaceParser.cpp rename to swift/swift-autobuilder/XcodeWorkspaceParser.cpp index c315ba3831b..8fd9fee7a2e 100644 --- a/swift/xcode-autobuilder/XcodeWorkspaceParser.cpp +++ b/swift/swift-autobuilder/XcodeWorkspaceParser.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "swift/xcode-autobuilder/XcodeWorkspaceParser.h" +#include "swift/swift-autobuilder/XcodeWorkspaceParser.h" /* Extracts FileRef locations from an XML of the following form: diff --git a/swift/xcode-autobuilder/XcodeWorkspaceParser.h b/swift/swift-autobuilder/XcodeWorkspaceParser.h similarity index 100% rename from swift/xcode-autobuilder/XcodeWorkspaceParser.h rename to swift/swift-autobuilder/XcodeWorkspaceParser.h diff --git a/swift/xcode-autobuilder/xcode-autobuilder.cpp b/swift/swift-autobuilder/swift-autobuilder.cpp similarity index 92% rename from swift/xcode-autobuilder/xcode-autobuilder.cpp rename to swift/swift-autobuilder/swift-autobuilder.cpp index fd73d30b0ad..cbf7f217c75 100644 --- a/swift/xcode-autobuilder/xcode-autobuilder.cpp +++ b/swift/swift-autobuilder/swift-autobuilder.cpp @@ -1,11 +1,11 @@ #include #include #include -#include "swift/xcode-autobuilder/XcodeTarget.h" -#include "swift/xcode-autobuilder/XcodeBuildRunner.h" -#include "swift/xcode-autobuilder/XcodeProjectParser.h" +#include "swift/swift-autobuilder/XcodeTarget.h" +#include "swift/swift-autobuilder/BuildRunner.h" +#include "swift/swift-autobuilder/ProjectParser.h" #include "swift/logging/SwiftLogging.h" -#include "swift/xcode-autobuilder/CustomizingBuildLink.h" +#include "swift/swift-autobuilder/CustomizingBuildLink.h" static constexpr std::string_view uiTest = "com.apple.product-type.bundle.ui-testing"; static constexpr std::string_view unitTest = "com.apple.product-type.bundle.unit-test"; @@ -79,8 +79,9 @@ static bool autobuild(const CLIArgs& args) { "contain no Swift source files, or are tests."); return false; } else if (!structure.xcodeEncountered && swiftPackages.empty()) { - DIAGNOSE_ERROR(noProjectFound, - "`autobuild` detected neither an Xcode project or workspace, nor a Swift package"); + DIAGNOSE_ERROR( + noProjectFound, + "`autobuild` detected neither an Xcode project or workspace, nor a Swift package"); return false; } else if (!xcodeTargets.empty()) { LOG_INFO("Building Xcode target: {}", xcodeTargets.front()); diff --git a/swift/xcode-autobuilder/tests/.gitignore b/swift/swift-autobuilder/tests/.gitignore similarity index 100% rename from swift/xcode-autobuilder/tests/.gitignore rename to swift/swift-autobuilder/tests/.gitignore diff --git a/swift/xcode-autobuilder/tests/BUILD.bazel b/swift/swift-autobuilder/tests/BUILD.bazel similarity index 83% rename from swift/xcode-autobuilder/tests/BUILD.bazel rename to swift/swift-autobuilder/tests/BUILD.bazel index 3013dd47a10..f9a2b8eb178 100644 --- a/swift/xcode-autobuilder/tests/BUILD.bazel +++ b/swift/swift-autobuilder/tests/BUILD.bazel @@ -4,11 +4,11 @@ size = "small", srcs = ["autobuild_tester.py"], args = [ - "$(location //swift/xcode-autobuilder)", + "$(location //swift/swift-autobuilder)", "$(location %s)" % test_dir, ], data = [ - "//swift/xcode-autobuilder", + "//swift/swift-autobuilder", test_dir, ] + glob([test_dir + "/**/*"]), main = "autobuild_tester.py", diff --git a/swift/xcode-autobuilder/tests/autobuild_tester.py b/swift/swift-autobuilder/tests/autobuild_tester.py similarity index 100% rename from swift/xcode-autobuilder/tests/autobuild_tester.py rename to swift/swift-autobuilder/tests/autobuild_tester.py diff --git a/swift/xcode-autobuilder/tests/hello-autobuilder/commands.expected b/swift/swift-autobuilder/tests/hello-autobuilder/commands.expected similarity index 100% rename from swift/xcode-autobuilder/tests/hello-autobuilder/commands.expected rename to swift/swift-autobuilder/tests/hello-autobuilder/commands.expected diff --git a/swift/xcode-autobuilder/tests/hello-autobuilder/hello-autobuilder.xcodeproj/project.pbxproj b/swift/swift-autobuilder/tests/hello-autobuilder/hello-autobuilder.xcodeproj/project.pbxproj similarity index 100% rename from swift/xcode-autobuilder/tests/hello-autobuilder/hello-autobuilder.xcodeproj/project.pbxproj rename to swift/swift-autobuilder/tests/hello-autobuilder/hello-autobuilder.xcodeproj/project.pbxproj diff --git a/swift/xcode-autobuilder/tests/hello-autobuilder/hello-autobuilder.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/swift/swift-autobuilder/tests/hello-autobuilder/hello-autobuilder.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from swift/xcode-autobuilder/tests/hello-autobuilder/hello-autobuilder.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to swift/swift-autobuilder/tests/hello-autobuilder/hello-autobuilder.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/swift/xcode-autobuilder/tests/hello-targets-with-tests-suffix/Foo.xcodeproj/project.pbxproj b/swift/swift-autobuilder/tests/hello-targets-with-tests-suffix/Foo.xcodeproj/project.pbxproj similarity index 100% rename from swift/xcode-autobuilder/tests/hello-targets-with-tests-suffix/Foo.xcodeproj/project.pbxproj rename to swift/swift-autobuilder/tests/hello-targets-with-tests-suffix/Foo.xcodeproj/project.pbxproj diff --git a/swift/xcode-autobuilder/tests/hello-targets-with-tests-suffix/Foo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/swift/swift-autobuilder/tests/hello-targets-with-tests-suffix/Foo.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from swift/xcode-autobuilder/tests/hello-targets-with-tests-suffix/Foo.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to swift/swift-autobuilder/tests/hello-targets-with-tests-suffix/Foo.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/swift/xcode-autobuilder/tests/hello-targets-with-tests-suffix/commands.expected b/swift/swift-autobuilder/tests/hello-targets-with-tests-suffix/commands.expected similarity index 100% rename from swift/xcode-autobuilder/tests/hello-targets-with-tests-suffix/commands.expected rename to swift/swift-autobuilder/tests/hello-targets-with-tests-suffix/commands.expected diff --git a/swift/xcode-autobuilder/tests/hello-tests/commands.expected b/swift/swift-autobuilder/tests/hello-tests/commands.expected similarity index 100% rename from swift/xcode-autobuilder/tests/hello-tests/commands.expected rename to swift/swift-autobuilder/tests/hello-tests/commands.expected diff --git a/swift/xcode-autobuilder/tests/hello-tests/hello-tests.xcodeproj/project.pbxproj b/swift/swift-autobuilder/tests/hello-tests/hello-tests.xcodeproj/project.pbxproj similarity index 100% rename from swift/xcode-autobuilder/tests/hello-tests/hello-tests.xcodeproj/project.pbxproj rename to swift/swift-autobuilder/tests/hello-tests/hello-tests.xcodeproj/project.pbxproj diff --git a/swift/xcode-autobuilder/tests/hello-tests/hello-tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/swift/swift-autobuilder/tests/hello-tests/hello-tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from swift/xcode-autobuilder/tests/hello-tests/hello-tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to swift/swift-autobuilder/tests/hello-tests/hello-tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/swift/xcode-autobuilder/tests/hello-workspace/Hello.xcworkspace/contents.xcworkspacedata b/swift/swift-autobuilder/tests/hello-workspace/Hello.xcworkspace/contents.xcworkspacedata similarity index 100% rename from swift/xcode-autobuilder/tests/hello-workspace/Hello.xcworkspace/contents.xcworkspacedata rename to swift/swift-autobuilder/tests/hello-workspace/Hello.xcworkspace/contents.xcworkspacedata diff --git a/swift/xcode-autobuilder/tests/hello-workspace/commands.expected b/swift/swift-autobuilder/tests/hello-workspace/commands.expected similarity index 100% rename from swift/xcode-autobuilder/tests/hello-workspace/commands.expected rename to swift/swift-autobuilder/tests/hello-workspace/commands.expected diff --git a/swift/xcode-autobuilder/tests/hello-workspace/hello-workspace.xcodeproj/project.pbxproj b/swift/swift-autobuilder/tests/hello-workspace/hello-workspace.xcodeproj/project.pbxproj similarity index 100% rename from swift/xcode-autobuilder/tests/hello-workspace/hello-workspace.xcodeproj/project.pbxproj rename to swift/swift-autobuilder/tests/hello-workspace/hello-workspace.xcodeproj/project.pbxproj diff --git a/swift/xcode-autobuilder/tests/hello-workspace/hello-workspace.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/swift/swift-autobuilder/tests/hello-workspace/hello-workspace.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from swift/xcode-autobuilder/tests/hello-workspace/hello-workspace.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to swift/swift-autobuilder/tests/hello-workspace/hello-workspace.xcodeproj/project.xcworkspace/contents.xcworkspacedata