From f860367b0357d7e12aac0fcc6165cc55bc276ad6 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Thu, 12 Jan 2023 18:08:53 -0700 Subject: [PATCH] feat: support storing Swift dependency files in a sub-package (#146) - Add `swift_deps_index` attribute to `swift_update_packages`. - Update `vapor_example` to demonstrate storing the Swift dependency files in a sub-package. Closes #136. --- .bazelrc | 4 +- docs/faq.md | 7 + examples/vapor_example/BUILD.bazel | 23 +- examples/vapor_example/README.md | 2 + examples/vapor_example/WORKSPACE | 4 +- examples/vapor_example/set_up_clean_test | 35 +- examples/vapor_example/swift/BUILD.bazel | 25 + .../{ => swift}/Package.resolved | 0 .../vapor_example/{ => swift}/Package.swift | 0 .../{swift_deps.bzl => swift/deps.bzl} | 52 +- .../deps_index.json} | 0 .../vapor_example/swift/swift_deps_index.json | 1177 +++++++++++++++++ gazelle/config.go | 8 +- .../swift/repo_rule_from_bazel_repo.go | 10 +- gazelle/internal/swiftcfg/swift_config.go | 9 +- gazelle/update_repos.go | 3 +- swiftpkg/internal/swift_update_packages.bzl | 7 +- 17 files changed, 1295 insertions(+), 71 deletions(-) create mode 100644 examples/vapor_example/swift/BUILD.bazel rename examples/vapor_example/{ => swift}/Package.resolved (100%) rename examples/vapor_example/{ => swift}/Package.swift (100%) rename examples/vapor_example/{swift_deps.bzl => swift/deps.bzl} (78%) rename examples/vapor_example/{swift_deps_index.json => swift/deps_index.json} (100%) create mode 100644 examples/vapor_example/swift/swift_deps_index.json diff --git a/.bazelrc b/.bazelrc index 9aad734ca..bc9666786 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,7 +1,7 @@ # To update these lines, execute # `bazel run @contrib_rules_bazel_integration_test//tools:update_deleted_packages` -build --deleted_packages=examples/http_archive_ext_deps,examples/http_archive_ext_deps/Sources/MyDequeModule,examples/http_archive_ext_deps/Sources/PrintStuff,examples/http_archive_ext_deps/Tests/MyDequeModuleTests,examples/http_archive_ext_deps/third_party,examples/interesting_deps,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/objc_code,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/xcmetrics_example -query --deleted_packages=examples/http_archive_ext_deps,examples/http_archive_ext_deps/Sources/MyDequeModule,examples/http_archive_ext_deps/Sources/PrintStuff,examples/http_archive_ext_deps/Tests/MyDequeModuleTests,examples/http_archive_ext_deps/third_party,examples/interesting_deps,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/objc_code,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/xcmetrics_example +build --deleted_packages=examples/http_archive_ext_deps,examples/http_archive_ext_deps/Sources/MyDequeModule,examples/http_archive_ext_deps/Sources/PrintStuff,examples/http_archive_ext_deps/Tests/MyDequeModuleTests,examples/http_archive_ext_deps/third_party,examples/interesting_deps,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/objc_code,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example +query --deleted_packages=examples/http_archive_ext_deps,examples/http_archive_ext_deps/Sources/MyDequeModule,examples/http_archive_ext_deps/Sources/PrintStuff,examples/http_archive_ext_deps/Tests/MyDequeModuleTests,examples/http_archive_ext_deps/third_party,examples/interesting_deps,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/objc_code,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example # Import Shared settings import %workspace%/shared.bazelrc diff --git a/docs/faq.md b/docs/faq.md index 2f2cb851f..540cb09c4 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -12,6 +12,7 @@ * [Can I just manage my external Swift packages and not generate Bazel build files for my project?](#can-i-just-manage-my-external-swift-packages-and-not-generate-bazel-build-files-for-my-project) * [After running //:swift\_update\_pkgs , I see a \.build directory\. What is it? Do I need it?](#after-running-swift_update_pkgs-i-see-a-build-directory-what-is-it-do-i-need-it) * [Does the Gazelle plugin run Swift package manager with every execution?](#does-the-gazelle-plugin-run-swift-package-manager-with-every-execution) +* [Can I store the Swift dependency files in a sub\-package (i\.e\., not in the root of the workspace)?](#can-i-store-the-swift-dependency-files-in-a-sub-package-ie-not-in-the-root-of-the-workspace) ## Why use Gazelle and Go? @@ -83,9 +84,15 @@ update the version selection for a dependency). The `update` mode for the Gazell Bazel build files for your project. It uses information written to the `swift_deps_index.json` and the source files that exist in your project to generate the Bazel build files. +## Can I store the Swift dependency files in a sub-package (i.e., not in the root of the workspace)? + +Yes. The [vapor example] demonstrates storing the Swift dependency files in a sub-package called +`swift`. + [loading phase]: https://bazel.build/run/build#loading [quickstart]: https://github.com/cgrindel/swift_bazel/blob/main/README.md#quickstart [rules_spm]: https://github.com/cgrindel/rules_spm/ [rules_swift]: https://github.com/bazelbuild/rules_swift [Gazelle framework]: https://github.com/bazelbuild/bazel-gazelle/blob/master/extend.md +[vapor example]: /examples/vapor_example diff --git a/examples/vapor_example/BUILD.bazel b/examples/vapor_example/BUILD.bazel index 6e01045b8..edd5d4be7 100644 --- a/examples/vapor_example/BUILD.bazel +++ b/examples/vapor_example/BUILD.bazel @@ -1,46 +1,33 @@ load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@cgrindel_bazel_starlib//bzltidy:defs.bzl", "tidy") -load("@cgrindel_swift_bazel//swiftpkg:defs.bzl", "swift_update_packages") tidy( name = "tidy", targets = [ - ":swift_update_pkgs", + "//swift:update_pkgs", ":update_build_files", ], ) # MARK: - Gazelle -# Ignore the Swift build folder -# gazelle:exclude .build - gazelle_binary( name = "gazelle_bin", languages = [ "@bazel_skylib//gazelle/bzl", "@cgrindel_swift_bazel//gazelle", ], + visibility = ["//:__subpackages__"], ) gazelle( name = "update_build_files", + args = [ + "-swift_dependency_index=swift/deps_index.json", + ], gazelle = ":gazelle_bin", ) -swift_update_packages( - name = "swift_update_pkgs", - gazelle = ":gazelle_bin", -) - -bzl_library( - name = "swift_deps", - srcs = ["swift_deps.bzl"], - visibility = ["//visibility:public"], - deps = ["@cgrindel_swift_bazel//swiftpkg:defs"], -) - # Vapor was not happy building under 13.2.1. Fix the version for now. # See Keith's article for more details: # https://www.smileykeith.com/2021/03/08/locking-xcode-in-bazel/ diff --git a/examples/vapor_example/README.md b/examples/vapor_example/README.md index 88f9ec0f2..90279f699 100644 --- a/examples/vapor_example/README.md +++ b/examples/vapor_example/README.md @@ -6,6 +6,8 @@ Swift and Clang dependencies. Some of their Clang modules have custom module maps. This example exercises the `swift_bazel` code that processes custom module maps and handles novel Clang module linking issues. +Also, this example demonstrates how to store the Swift-specific dependency files in a sub-package. + ## Linux Prequisites diff --git a/examples/vapor_example/WORKSPACE b/examples/vapor_example/WORKSPACE index dcecae92a..ec2a0a701 100644 --- a/examples/vapor_example/WORKSPACE +++ b/examples/vapor_example/WORKSPACE @@ -44,9 +44,9 @@ load( "@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies", ) -load("//:swift_deps.bzl", "swift_dependencies") +load("//swift:deps.bzl", "swift_dependencies") -# gazelle:repository_macro swift_deps.bzl%swift_dependencies +# gazelle:repository_macro swift/deps.bzl%swift_dependencies swift_dependencies() swift_rules_dependencies() diff --git a/examples/vapor_example/set_up_clean_test b/examples/vapor_example/set_up_clean_test index cf5875006..d216997e0 100755 --- a/examples/vapor_example/set_up_clean_test +++ b/examples/vapor_example/set_up_clean_test @@ -11,10 +11,10 @@ find "${script_dir}" \ -exec rm {} \; # Remove the SPM build folder -rm -rf .build +rm -rf "${script_dir}/swift/.build" -# Replace the swift_deps.bzl with no declarations. -cat > "${script_dir}/swift_deps.bzl" <<-EOF +# Replace the swift/deps.bzl with no declarations. +cat > "${script_dir}/swift/deps.bzl" <<-EOF def swift_dependencies(): pass EOF @@ -29,37 +29,50 @@ load("@cgrindel_swift_bazel//swiftpkg:defs.bzl", "swift_update_packages") tidy( name = "tidy", targets = [ - ":swift_update_pkgs", + "//swift:update_pkgs", ":update_build_files", ], ) # MARK: - Gazelle -# Ignore the Swift build folder -# gazelle:exclude .build - gazelle_binary( name = "gazelle_bin", languages = [ "@bazel_skylib//gazelle/bzl", "@cgrindel_swift_bazel//gazelle", ], + visibility = ["//:__subpackages__"], ) gazelle( name = "update_build_files", + args = [ + "-swift_dependency_index=swift/deps_index.json", + ], gazelle = ":gazelle_bin", ) +EOF + +cat > "${script_dir}/swift/BUILD.bazel" <<-EOF +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@cgrindel_swift_bazel//swiftpkg:defs.bzl", "swift_update_packages") + +# Ignore the Swift build folder +# gazelle:exclude .build + swift_update_packages( - name = "swift_update_pkgs", - gazelle = ":gazelle_bin", + name = "update_pkgs", + gazelle = "//:gazelle_bin", + package_manifest = "swift/Package.swift", + swift_deps = "swift/deps.bzl", + swift_deps_index = "swift/deps_index.json", ) bzl_library( - name = "swift_deps", - srcs = ["swift_deps.bzl"], + name = "deps", + srcs = ["deps.bzl"], visibility = ["//visibility:public"], deps = ["@cgrindel_swift_bazel//swiftpkg:defs"], ) diff --git a/examples/vapor_example/swift/BUILD.bazel b/examples/vapor_example/swift/BUILD.bazel new file mode 100644 index 000000000..7a1f39ae8 --- /dev/null +++ b/examples/vapor_example/swift/BUILD.bazel @@ -0,0 +1,25 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@cgrindel_swift_bazel//swiftpkg:defs.bzl", "swift_update_packages") + +# NOTE: If you decide to move the Swift dependency files like this example, do +# not forget to update the `gazelle` declaration `//:update_build_files` to +# point at the new location of the Swift dependency index JSON file. Also, the +# `//:gazelle_bin target` must be visible to this package. + +# Ignore the Swift build folder +# gazelle:exclude .build + +swift_update_packages( + name = "update_pkgs", + gazelle = "//:gazelle_bin", + package_manifest = "swift/Package.swift", + swift_deps = "swift/deps.bzl", + swift_deps_index = "swift/deps_index.json", +) + +bzl_library( + name = "deps", + srcs = ["deps.bzl"], + visibility = ["//visibility:public"], + deps = ["@cgrindel_swift_bazel//swiftpkg:defs"], +) diff --git a/examples/vapor_example/Package.resolved b/examples/vapor_example/swift/Package.resolved similarity index 100% rename from examples/vapor_example/Package.resolved rename to examples/vapor_example/swift/Package.resolved diff --git a/examples/vapor_example/Package.swift b/examples/vapor_example/swift/Package.swift similarity index 100% rename from examples/vapor_example/Package.swift rename to examples/vapor_example/swift/Package.swift diff --git a/examples/vapor_example/swift_deps.bzl b/examples/vapor_example/swift/deps.bzl similarity index 78% rename from examples/vapor_example/swift_deps.bzl rename to examples/vapor_example/swift/deps.bzl index ec7e90920..9d39b8f61 100644 --- a/examples/vapor_example/swift_deps.bzl +++ b/examples/vapor_example/swift/deps.bzl @@ -5,7 +5,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_async_http_client", commit = "5bee16a79922e3efcb5cea06ecd27e6f8048b56b", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/swift-server/async-http-client.git", ) @@ -13,7 +13,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_async_kit", commit = "929808e51fea04f01de0e911ce826ef70c4db4ea", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/async-kit.git", ) @@ -21,7 +21,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_console_kit", commit = "a7e67a1719933318b5ab7eaaed355cde020465b1", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/console-kit.git", ) @@ -29,7 +29,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_fluent", commit = "2da106f46b093885f77fa03e3c719ab5bb8cfab4", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/fluent.git", ) @@ -37,7 +37,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_fluent_kit", commit = "be7912ee4991bcc8a5390fac0424d1d08221dcc6", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/fluent-kit.git", ) @@ -45,7 +45,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_fluent_sqlite_driver", commit = "7f2a0b105e9cd22141dee220848d8739da6b7232", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/fluent-sqlite-driver.git", ) @@ -53,7 +53,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_multipart_kit", commit = "0d55c35e788451ee27222783c7d363cb88092fab", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/multipart-kit.git", ) @@ -61,7 +61,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_routing_kit", commit = "ffac7b3a127ce1e85fb232f1a6271164628809ad", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/routing-kit.git", ) @@ -69,7 +69,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_sql_kit", commit = "dcf10a00d7d5df987b7948e6fd5596fb65f6d0c2", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/sql-kit.git", ) @@ -77,7 +77,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_sqlite_kit", commit = "c07d53044727db7edf8550c2e8ccfe1fa40177d2", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/sqlite-kit.git", ) @@ -85,7 +85,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_sqlite_nio", commit = "3b93e0a58643cc02a8bc42014fe462e1532df62d", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/sqlite-nio.git", ) @@ -93,7 +93,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_algorithms", commit = "b14b7f4c528c942f121c8b860b9410b2bf57825e", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-algorithms.git", ) @@ -101,7 +101,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_atomics", commit = "ff3d2212b6b093db7f177d0855adbc4ef9c5f036", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-atomics.git", ) @@ -109,7 +109,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_backtrace", commit = "f25620d5d05e2f1ba27154b40cafea2b67566956", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/swift-server/swift-backtrace.git", ) @@ -117,7 +117,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_collections", commit = "937e904258d22af6e447a0b72c0bc67583ef64a2", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-collections.git", ) @@ -125,7 +125,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_crypto", commit = "92a04c10fc5ce0504f8396aac7392126033e547c", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-crypto.git", ) @@ -133,7 +133,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_log", commit = "6fe203dc33195667ce1759bf0182975e4653ba1c", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-log.git", ) @@ -141,7 +141,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_metrics", commit = "9b39d811a83cf18b79d7d5513b06f8b290198b10", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-metrics.git", ) @@ -149,7 +149,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_nio", commit = "7e3b50b38e4e66f31db6cf4a784c6af148bac846", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-nio.git", ) @@ -157,7 +157,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_nio_extras", commit = "91dd2d61fb772e1311bb5f13b59266b579d77e42", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-nio-extras.git", ) @@ -165,7 +165,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_nio_http2", commit = "d6656967f33ed8b368b38e4b198631fc7c484a40", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-nio-http2.git", ) @@ -173,7 +173,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_nio_ssl", commit = "4fb7ead803e38949eb1d6fabb849206a72c580f3", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-nio-ssl.git", ) @@ -181,7 +181,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_nio_transport_services", commit = "c0d9a144cfaec8d3d596aadde3039286a266c15c", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-nio-transport-services.git", ) @@ -189,7 +189,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_swift_numerics", commit = "0a5bc04095a675662cf24757cc0640aa2204253b", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/apple/swift-numerics", ) @@ -197,7 +197,7 @@ def swift_dependencies(): swift_package( name = "swiftpkg_vapor", commit = "eb2da0d749e185789970c32f7fd9c114a339fa13", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/vapor.git", ) @@ -205,6 +205,6 @@ def swift_dependencies(): swift_package( name = "swiftpkg_websocket_kit", commit = "2d9d2188a08eef4a869d368daab21b3c08510991", - dependencies_index = "@//:swift_deps_index.json", + dependencies_index = "@//swift:deps_index.json", remote = "https://github.com/vapor/websocket-kit.git", ) diff --git a/examples/vapor_example/swift_deps_index.json b/examples/vapor_example/swift/deps_index.json similarity index 100% rename from examples/vapor_example/swift_deps_index.json rename to examples/vapor_example/swift/deps_index.json diff --git a/examples/vapor_example/swift/swift_deps_index.json b/examples/vapor_example/swift/swift_deps_index.json new file mode 100644 index 000000000..2aa15fe3e --- /dev/null +++ b/examples/vapor_example/swift/swift_deps_index.json @@ -0,0 +1,1177 @@ +{ + "modules": [ + { + "name": "AsyncHTTPClient", + "c99name": "AsyncHTTPClient", + "label": "@swiftpkg_async_http_client//:Sources_AsyncHTTPClient" + }, + { + "name": "CAsyncHTTPClient", + "c99name": "CAsyncHTTPClient", + "label": "@swiftpkg_async_http_client//:Sources_CAsyncHTTPClient" + }, + { + "name": "AsyncHTTPClientTests", + "c99name": "AsyncHTTPClientTests", + "label": "@swiftpkg_async_http_client//:Tests_AsyncHTTPClientTests" + }, + { + "name": "AsyncKit", + "c99name": "AsyncKit", + "label": "@swiftpkg_async_kit//:Sources_AsyncKit" + }, + { + "name": "AsyncKitTests", + "c99name": "AsyncKitTests", + "label": "@swiftpkg_async_kit//:Tests_AsyncKitTests" + }, + { + "name": "ConsoleKit", + "c99name": "ConsoleKit", + "label": "@swiftpkg_console_kit//:Sources_ConsoleKit" + }, + { + "name": "ConsoleKitAsyncExample", + "c99name": "ConsoleKitAsyncExample", + "label": "@swiftpkg_console_kit//:Sources_ConsoleKitAsyncExample" + }, + { + "name": "ConsoleKitExample", + "c99name": "ConsoleKitExample", + "label": "@swiftpkg_console_kit//:Sources_ConsoleKitExample" + }, + { + "name": "AsyncConsoleKitTests", + "c99name": "AsyncConsoleKitTests", + "label": "@swiftpkg_console_kit//:Tests_AsyncConsoleKitTests" + }, + { + "name": "ConsoleKitTests", + "c99name": "ConsoleKitTests", + "label": "@swiftpkg_console_kit//:Tests_ConsoleKitTests" + }, + { + "name": "Fluent", + "c99name": "Fluent", + "label": "@swiftpkg_fluent//:Sources_Fluent" + }, + { + "name": "FluentTests", + "c99name": "FluentTests", + "label": "@swiftpkg_fluent//:Tests_FluentTests" + }, + { + "name": "FluentBenchmark", + "c99name": "FluentBenchmark", + "label": "@swiftpkg_fluent_kit//:Sources_FluentBenchmark" + }, + { + "name": "FluentKit", + "c99name": "FluentKit", + "label": "@swiftpkg_fluent_kit//:Sources_FluentKit" + }, + { + "name": "FluentSQL", + "c99name": "FluentSQL", + "label": "@swiftpkg_fluent_kit//:Sources_FluentSQL" + }, + { + "name": "XCTFluent", + "c99name": "XCTFluent", + "label": "@swiftpkg_fluent_kit//:Sources_XCTFluent" + }, + { + "name": "FluentKitTests", + "c99name": "FluentKitTests", + "label": "@swiftpkg_fluent_kit//:Tests_FluentKitTests" + }, + { + "name": "FluentSQLiteDriver", + "c99name": "FluentSQLiteDriver", + "label": "@swiftpkg_fluent_sqlite_driver//:Sources_FluentSQLiteDriver" + }, + { + "name": "FluentSQLiteDriverTests", + "c99name": "FluentSQLiteDriverTests", + "label": "@swiftpkg_fluent_sqlite_driver//:Tests_FluentSQLiteDriverTests" + }, + { + "name": "MultipartKit", + "c99name": "MultipartKit", + "label": "@swiftpkg_multipart_kit//:Sources_MultipartKit" + }, + { + "name": "MultipartKitTests", + "c99name": "MultipartKitTests", + "label": "@swiftpkg_multipart_kit//:Tests_MultipartKitTests" + }, + { + "name": "RoutingKit", + "c99name": "RoutingKit", + "label": "@swiftpkg_routing_kit//:Sources_RoutingKit" + }, + { + "name": "RoutingKitTests", + "c99name": "RoutingKitTests", + "label": "@swiftpkg_routing_kit//:Tests_RoutingKitTests" + }, + { + "name": "SQLKit", + "c99name": "SQLKit", + "label": "@swiftpkg_sql_kit//:Sources_SQLKit" + }, + { + "name": "SQLKitBenchmark", + "c99name": "SQLKitBenchmark", + "label": "@swiftpkg_sql_kit//:Sources_SQLKitBenchmark" + }, + { + "name": "SQLKitTests", + "c99name": "SQLKitTests", + "label": "@swiftpkg_sql_kit//:Tests_SQLKitTests" + }, + { + "name": "SQLiteKit", + "c99name": "SQLiteKit", + "label": "@swiftpkg_sqlite_kit//:Sources_SQLiteKit" + }, + { + "name": "SQLiteKitTests", + "c99name": "SQLiteKitTests", + "label": "@swiftpkg_sqlite_kit//:Tests_SQLiteKitTests" + }, + { + "name": "CSQLite", + "c99name": "CSQLite", + "label": "@swiftpkg_sqlite_nio//:Sources_CSQLite" + }, + { + "name": "SQLiteNIO", + "c99name": "SQLiteNIO", + "label": "@swiftpkg_sqlite_nio//:Sources_SQLiteNIO" + }, + { + "name": "SQLiteNIOTests", + "c99name": "SQLiteNIOTests", + "label": "@swiftpkg_sqlite_nio//:Tests_SQLiteNIOTests" + }, + { + "name": "Algorithms", + "c99name": "Algorithms", + "label": "@swiftpkg_swift_algorithms//:Sources_Algorithms" + }, + { + "name": "SwiftAlgorithmsTests", + "c99name": "SwiftAlgorithmsTests", + "label": "@swiftpkg_swift_algorithms//:Tests_SwiftAlgorithmsTests" + }, + { + "name": "Atomics", + "c99name": "Atomics", + "label": "@swiftpkg_swift_atomics//:Sources_Atomics" + }, + { + "name": "_AtomicsShims", + "c99name": "_AtomicsShims", + "label": "@swiftpkg_swift_atomics//:Sources__AtomicsShims" + }, + { + "name": "AtomicsTests", + "c99name": "AtomicsTests", + "label": "@swiftpkg_swift_atomics//:Tests_AtomicsTests" + }, + { + "name": "Backtrace", + "c99name": "Backtrace", + "label": "@swiftpkg_swift_backtrace//:Sources_Backtrace" + }, + { + "name": "CBacktrace", + "c99name": "CBacktrace", + "label": "@swiftpkg_swift_backtrace//:Sources_CBacktrace" + }, + { + "name": "Sample", + "c99name": "Sample", + "label": "@swiftpkg_swift_backtrace//:Sources_Sample" + }, + { + "name": "BacktraceTests", + "c99name": "BacktraceTests", + "label": "@swiftpkg_swift_backtrace//:Tests_BacktraceTests" + }, + { + "name": "Collections", + "c99name": "Collections", + "label": "@swiftpkg_swift_collections//:Sources_Collections" + }, + { + "name": "DequeModule", + "c99name": "DequeModule", + "label": "@swiftpkg_swift_collections//:Sources_DequeModule" + }, + { + "name": "OrderedCollections", + "c99name": "OrderedCollections", + "label": "@swiftpkg_swift_collections//:Sources_OrderedCollections" + }, + { + "name": "_CollectionsTestSupport", + "c99name": "_CollectionsTestSupport", + "label": "@swiftpkg_swift_collections//:Sources__CollectionsTestSupport" + }, + { + "name": "CollectionsTestSupportTests", + "c99name": "CollectionsTestSupportTests", + "label": "@swiftpkg_swift_collections//:Tests_CollectionsTestSupportTests" + }, + { + "name": "DequeTests", + "c99name": "DequeTests", + "label": "@swiftpkg_swift_collections//:Tests_DequeTests" + }, + { + "name": "OrderedCollectionsTests", + "c99name": "OrderedCollectionsTests", + "label": "@swiftpkg_swift_collections//:Tests_OrderedCollectionsTests" + }, + { + "name": "CCryptoBoringSSL", + "c99name": "CCryptoBoringSSL", + "label": "@swiftpkg_swift_crypto//:Sources_CCryptoBoringSSL" + }, + { + "name": "CCryptoBoringSSLShims", + "c99name": "CCryptoBoringSSLShims", + "label": "@swiftpkg_swift_crypto//:Sources_CCryptoBoringSSLShims" + }, + { + "name": "Crypto", + "c99name": "Crypto", + "label": "@swiftpkg_swift_crypto//:Sources_Crypto" + }, + { + "name": "CryptoBoringWrapper", + "c99name": "CryptoBoringWrapper", + "label": "@swiftpkg_swift_crypto//:Sources_CryptoBoringWrapper" + }, + { + "name": "_CryptoExtras", + "c99name": "_CryptoExtras", + "label": "@swiftpkg_swift_crypto//:Sources__CryptoExtras" + }, + { + "name": "crypto-shasum", + "c99name": "crypto_shasum", + "label": "@swiftpkg_swift_crypto//:Sources_crypto-shasum" + }, + { + "name": "CryptoTests", + "c99name": "CryptoTests", + "label": "@swiftpkg_swift_crypto//:Tests_CryptoTests" + }, + { + "name": "_CryptoExtrasTests", + "c99name": "_CryptoExtrasTests", + "label": "@swiftpkg_swift_crypto//:Tests__CryptoExtrasTests" + }, + { + "name": "Logging", + "c99name": "Logging", + "label": "@swiftpkg_swift_log//:Sources_Logging" + }, + { + "name": "LoggingTests", + "c99name": "LoggingTests", + "label": "@swiftpkg_swift_log//:Tests_LoggingTests" + }, + { + "name": "CoreMetrics", + "c99name": "CoreMetrics", + "label": "@swiftpkg_swift_metrics//:Sources_CoreMetrics" + }, + { + "name": "Metrics", + "c99name": "Metrics", + "label": "@swiftpkg_swift_metrics//:Sources_Metrics" + }, + { + "name": "MetricsTestKit", + "c99name": "MetricsTestKit", + "label": "@swiftpkg_swift_metrics//:Sources_MetricsTestKit" + }, + { + "name": "MetricsTests", + "c99name": "MetricsTests", + "label": "@swiftpkg_swift_metrics//:Tests_MetricsTests" + }, + { + "name": "CNIOAtomics", + "c99name": "CNIOAtomics", + "label": "@swiftpkg_swift_nio//:Sources_CNIOAtomics" + }, + { + "name": "CNIODarwin", + "c99name": "CNIODarwin", + "label": "@swiftpkg_swift_nio//:Sources_CNIODarwin" + }, + { + "name": "CNIOLLHTTP", + "c99name": "CNIOLLHTTP", + "label": "@swiftpkg_swift_nio//:Sources_CNIOLLHTTP" + }, + { + "name": "CNIOLinux", + "c99name": "CNIOLinux", + "label": "@swiftpkg_swift_nio//:Sources_CNIOLinux" + }, + { + "name": "CNIOSHA1", + "c99name": "CNIOSHA1", + "label": "@swiftpkg_swift_nio//:Sources_CNIOSHA1" + }, + { + "name": "CNIOWindows", + "c99name": "CNIOWindows", + "label": "@swiftpkg_swift_nio//:Sources_CNIOWindows" + }, + { + "name": "NIO", + "c99name": "NIO", + "label": "@swiftpkg_swift_nio//:Sources_NIO" + }, + { + "name": "NIOAsyncAwaitDemo", + "c99name": "NIOAsyncAwaitDemo", + "label": "@swiftpkg_swift_nio//:Sources_NIOAsyncAwaitDemo" + }, + { + "name": "NIOChatClient", + "c99name": "NIOChatClient", + "label": "@swiftpkg_swift_nio//:Sources_NIOChatClient" + }, + { + "name": "NIOChatServer", + "c99name": "NIOChatServer", + "label": "@swiftpkg_swift_nio//:Sources_NIOChatServer" + }, + { + "name": "NIOConcurrencyHelpers", + "c99name": "NIOConcurrencyHelpers", + "label": "@swiftpkg_swift_nio//:Sources_NIOConcurrencyHelpers" + }, + { + "name": "NIOCore", + "c99name": "NIOCore", + "label": "@swiftpkg_swift_nio//:Sources_NIOCore" + }, + { + "name": "NIOCrashTester", + "c99name": "NIOCrashTester", + "label": "@swiftpkg_swift_nio//:Sources_NIOCrashTester" + }, + { + "name": "NIOEchoClient", + "c99name": "NIOEchoClient", + "label": "@swiftpkg_swift_nio//:Sources_NIOEchoClient" + }, + { + "name": "NIOEchoServer", + "c99name": "NIOEchoServer", + "label": "@swiftpkg_swift_nio//:Sources_NIOEchoServer" + }, + { + "name": "NIOEmbedded", + "c99name": "NIOEmbedded", + "label": "@swiftpkg_swift_nio//:Sources_NIOEmbedded" + }, + { + "name": "NIOFoundationCompat", + "c99name": "NIOFoundationCompat", + "label": "@swiftpkg_swift_nio//:Sources_NIOFoundationCompat" + }, + { + "name": "NIOHTTP1", + "c99name": "NIOHTTP1", + "label": "@swiftpkg_swift_nio//:Sources_NIOHTTP1" + }, + { + "name": "NIOHTTP1Client", + "c99name": "NIOHTTP1Client", + "label": "@swiftpkg_swift_nio//:Sources_NIOHTTP1Client" + }, + { + "name": "NIOHTTP1Server", + "c99name": "NIOHTTP1Server", + "label": "@swiftpkg_swift_nio//:Sources_NIOHTTP1Server" + }, + { + "name": "NIOMulticastChat", + "c99name": "NIOMulticastChat", + "label": "@swiftpkg_swift_nio//:Sources_NIOMulticastChat" + }, + { + "name": "NIOPerformanceTester", + "c99name": "NIOPerformanceTester", + "label": "@swiftpkg_swift_nio//:Sources_NIOPerformanceTester" + }, + { + "name": "NIOPosix", + "c99name": "NIOPosix", + "label": "@swiftpkg_swift_nio//:Sources_NIOPosix" + }, + { + "name": "NIOTLS", + "c99name": "NIOTLS", + "label": "@swiftpkg_swift_nio//:Sources_NIOTLS" + }, + { + "name": "NIOTestUtils", + "c99name": "NIOTestUtils", + "label": "@swiftpkg_swift_nio//:Sources_NIOTestUtils" + }, + { + "name": "NIOUDPEchoClient", + "c99name": "NIOUDPEchoClient", + "label": "@swiftpkg_swift_nio//:Sources_NIOUDPEchoClient" + }, + { + "name": "NIOUDPEchoServer", + "c99name": "NIOUDPEchoServer", + "label": "@swiftpkg_swift_nio//:Sources_NIOUDPEchoServer" + }, + { + "name": "NIOWebSocket", + "c99name": "NIOWebSocket", + "label": "@swiftpkg_swift_nio//:Sources_NIOWebSocket" + }, + { + "name": "NIOWebSocketClient", + "c99name": "NIOWebSocketClient", + "label": "@swiftpkg_swift_nio//:Sources_NIOWebSocketClient" + }, + { + "name": "NIOWebSocketServer", + "c99name": "NIOWebSocketServer", + "label": "@swiftpkg_swift_nio//:Sources_NIOWebSocketServer" + }, + { + "name": "_NIOConcurrency", + "c99name": "_NIOConcurrency", + "label": "@swiftpkg_swift_nio//:Sources__NIOConcurrency" + }, + { + "name": "_NIODataStructures", + "c99name": "_NIODataStructures", + "label": "@swiftpkg_swift_nio//:Sources__NIODataStructures" + }, + { + "name": "NIOConcurrencyHelpersTests", + "c99name": "NIOConcurrencyHelpersTests", + "label": "@swiftpkg_swift_nio//:Tests_NIOConcurrencyHelpersTests" + }, + { + "name": "NIOCoreTests", + "c99name": "NIOCoreTests", + "label": "@swiftpkg_swift_nio//:Tests_NIOCoreTests" + }, + { + "name": "NIODataStructuresTests", + "c99name": "NIODataStructuresTests", + "label": "@swiftpkg_swift_nio//:Tests_NIODataStructuresTests" + }, + { + "name": "NIOEmbeddedTests", + "c99name": "NIOEmbeddedTests", + "label": "@swiftpkg_swift_nio//:Tests_NIOEmbeddedTests" + }, + { + "name": "NIOFoundationCompatTests", + "c99name": "NIOFoundationCompatTests", + "label": "@swiftpkg_swift_nio//:Tests_NIOFoundationCompatTests" + }, + { + "name": "NIOHTTP1Tests", + "c99name": "NIOHTTP1Tests", + "label": "@swiftpkg_swift_nio//:Tests_NIOHTTP1Tests" + }, + { + "name": "NIOPosixTests", + "c99name": "NIOPosixTests", + "label": "@swiftpkg_swift_nio//:Tests_NIOPosixTests" + }, + { + "name": "NIOTLSTests", + "c99name": "NIOTLSTests", + "label": "@swiftpkg_swift_nio//:Tests_NIOTLSTests" + }, + { + "name": "NIOTestUtilsTests", + "c99name": "NIOTestUtilsTests", + "label": "@swiftpkg_swift_nio//:Tests_NIOTestUtilsTests" + }, + { + "name": "NIOTests", + "c99name": "NIOTests", + "label": "@swiftpkg_swift_nio//:Tests_NIOTests" + }, + { + "name": "NIOWebSocketTests", + "c99name": "NIOWebSocketTests", + "label": "@swiftpkg_swift_nio//:Tests_NIOWebSocketTests" + }, + { + "name": "CNIOExtrasZlib", + "c99name": "CNIOExtrasZlib", + "label": "@swiftpkg_swift_nio_extras//:Sources_CNIOExtrasZlib" + }, + { + "name": "HTTPServerWithQuiescingDemo", + "c99name": "HTTPServerWithQuiescingDemo", + "label": "@swiftpkg_swift_nio_extras//:Sources_HTTPServerWithQuiescingDemo" + }, + { + "name": "NIOExtras", + "c99name": "NIOExtras", + "label": "@swiftpkg_swift_nio_extras//:Sources_NIOExtras" + }, + { + "name": "NIOExtrasPerformanceTester", + "c99name": "NIOExtrasPerformanceTester", + "label": "@swiftpkg_swift_nio_extras//:Sources_NIOExtrasPerformanceTester" + }, + { + "name": "NIOHTTPCompression", + "c99name": "NIOHTTPCompression", + "label": "@swiftpkg_swift_nio_extras//:Sources_NIOHTTPCompression" + }, + { + "name": "NIOSOCKS", + "c99name": "NIOSOCKS", + "label": "@swiftpkg_swift_nio_extras//:Sources_NIOSOCKS" + }, + { + "name": "NIOSOCKSClient", + "c99name": "NIOSOCKSClient", + "label": "@swiftpkg_swift_nio_extras//:Sources_NIOSOCKSClient" + }, + { + "name": "NIOWritePCAPDemo", + "c99name": "NIOWritePCAPDemo", + "label": "@swiftpkg_swift_nio_extras//:Sources_NIOWritePCAPDemo" + }, + { + "name": "NIOWritePartialPCAPDemo", + "c99name": "NIOWritePartialPCAPDemo", + "label": "@swiftpkg_swift_nio_extras//:Sources_NIOWritePartialPCAPDemo" + }, + { + "name": "NIOExtrasTests", + "c99name": "NIOExtrasTests", + "label": "@swiftpkg_swift_nio_extras//:Tests_NIOExtrasTests" + }, + { + "name": "NIOHTTPCompressionTests", + "c99name": "NIOHTTPCompressionTests", + "label": "@swiftpkg_swift_nio_extras//:Tests_NIOHTTPCompressionTests" + }, + { + "name": "NIOSOCKSTests", + "c99name": "NIOSOCKSTests", + "label": "@swiftpkg_swift_nio_extras//:Tests_NIOSOCKSTests" + }, + { + "name": "NIOHPACK", + "c99name": "NIOHPACK", + "label": "@swiftpkg_swift_nio_http2//:Sources_NIOHPACK" + }, + { + "name": "NIOHTTP2", + "c99name": "NIOHTTP2", + "label": "@swiftpkg_swift_nio_http2//:Sources_NIOHTTP2" + }, + { + "name": "NIOHTTP2PerformanceTester", + "c99name": "NIOHTTP2PerformanceTester", + "label": "@swiftpkg_swift_nio_http2//:Sources_NIOHTTP2PerformanceTester" + }, + { + "name": "NIOHTTP2Server", + "c99name": "NIOHTTP2Server", + "label": "@swiftpkg_swift_nio_http2//:Sources_NIOHTTP2Server" + }, + { + "name": "NIOHPACKTests", + "c99name": "NIOHPACKTests", + "label": "@swiftpkg_swift_nio_http2//:Tests_NIOHPACKTests" + }, + { + "name": "NIOHTTP2Tests", + "c99name": "NIOHTTP2Tests", + "label": "@swiftpkg_swift_nio_http2//:Tests_NIOHTTP2Tests" + }, + { + "name": "CNIOBoringSSL", + "c99name": "CNIOBoringSSL", + "label": "@swiftpkg_swift_nio_ssl//:Sources_CNIOBoringSSL" + }, + { + "name": "CNIOBoringSSLShims", + "c99name": "CNIOBoringSSLShims", + "label": "@swiftpkg_swift_nio_ssl//:Sources_CNIOBoringSSLShims" + }, + { + "name": "NIOSSL", + "c99name": "NIOSSL", + "label": "@swiftpkg_swift_nio_ssl//:Sources_NIOSSL" + }, + { + "name": "NIOSSLHTTP1Client", + "c99name": "NIOSSLHTTP1Client", + "label": "@swiftpkg_swift_nio_ssl//:Sources_NIOSSLHTTP1Client" + }, + { + "name": "NIOSSLPerformanceTester", + "c99name": "NIOSSLPerformanceTester", + "label": "@swiftpkg_swift_nio_ssl//:Sources_NIOSSLPerformanceTester" + }, + { + "name": "NIOTLSServer", + "c99name": "NIOTLSServer", + "label": "@swiftpkg_swift_nio_ssl//:Sources_NIOTLSServer" + }, + { + "name": "NIOSSLTests", + "c99name": "NIOSSLTests", + "label": "@swiftpkg_swift_nio_ssl//:Tests_NIOSSLTests" + }, + { + "name": "NIOTSHTTPClient", + "c99name": "NIOTSHTTPClient", + "label": "@swiftpkg_swift_nio_transport_services//:Sources_NIOTSHTTPClient" + }, + { + "name": "NIOTSHTTPServer", + "c99name": "NIOTSHTTPServer", + "label": "@swiftpkg_swift_nio_transport_services//:Sources_NIOTSHTTPServer" + }, + { + "name": "NIOTransportServices", + "c99name": "NIOTransportServices", + "label": "@swiftpkg_swift_nio_transport_services//:Sources_NIOTransportServices" + }, + { + "name": "NIOTransportServicesTests", + "c99name": "NIOTransportServicesTests", + "label": "@swiftpkg_swift_nio_transport_services//:Tests_NIOTransportServicesTests" + }, + { + "name": "ComplexModule", + "c99name": "ComplexModule", + "label": "@swiftpkg_swift_numerics//:Sources_ComplexModule" + }, + { + "name": "Numerics", + "c99name": "Numerics", + "label": "@swiftpkg_swift_numerics//:Sources_Numerics" + }, + { + "name": "RealModule", + "c99name": "RealModule", + "label": "@swiftpkg_swift_numerics//:Sources_RealModule" + }, + { + "name": "_NumericsShims", + "c99name": "_NumericsShims", + "label": "@swiftpkg_swift_numerics//:Sources__NumericsShims" + }, + { + "name": "_TestSupport", + "c99name": "_TestSupport", + "label": "@swiftpkg_swift_numerics//:Sources__TestSupport" + }, + { + "name": "ComplexTests", + "c99name": "ComplexTests", + "label": "@swiftpkg_swift_numerics//:Tests_ComplexTests" + }, + { + "name": "ComplexLog", + "c99name": "ComplexLog", + "label": "@swiftpkg_swift_numerics//:Tests_Executable_ComplexLog" + }, + { + "name": "ComplexLog1p", + "c99name": "ComplexLog1p", + "label": "@swiftpkg_swift_numerics//:Tests_Executable_ComplexLog1p" + }, + { + "name": "RealTests", + "c99name": "RealTests", + "label": "@swiftpkg_swift_numerics//:Tests_RealTests" + }, + { + "name": "CVaporBcrypt", + "c99name": "CVaporBcrypt", + "label": "@swiftpkg_vapor//:Sources_CVaporBcrypt" + }, + { + "name": "CVaporURLParser", + "c99name": "CVaporURLParser", + "label": "@swiftpkg_vapor//:Sources_CVaporURLParser" + }, + { + "name": "Development", + "c99name": "Development", + "label": "@swiftpkg_vapor//:Sources_Development" + }, + { + "name": "Vapor", + "c99name": "Vapor", + "label": "@swiftpkg_vapor//:Sources_Vapor" + }, + { + "name": "XCTVapor", + "c99name": "XCTVapor", + "label": "@swiftpkg_vapor//:Sources_XCTVapor" + }, + { + "name": "AsyncTests", + "c99name": "AsyncTests", + "label": "@swiftpkg_vapor//:Tests_AsyncTests" + }, + { + "name": "VaporTests", + "c99name": "VaporTests", + "label": "@swiftpkg_vapor//:Tests_VaporTests" + }, + { + "name": "WebSocketKit", + "c99name": "WebSocketKit", + "label": "@swiftpkg_websocket_kit//:Sources_WebSocketKit" + }, + { + "name": "WebSocketKitTests", + "c99name": "WebSocketKitTests", + "label": "@swiftpkg_websocket_kit//:Tests_WebSocketKitTests" + } + ], + "products": [ + { + "identity": "async-http-client", + "name": "AsyncHTTPClient", + "type": "library", + "target_labels": [ + "@swiftpkg_async_http_client//:Sources_AsyncHTTPClient" + ] + }, + { + "identity": "async-kit", + "name": "AsyncKit", + "type": "library", + "target_labels": [ + "@swiftpkg_async_kit//:Sources_AsyncKit" + ] + }, + { + "identity": "console-kit", + "name": "ConsoleKit", + "type": "library", + "target_labels": [ + "@swiftpkg_console_kit//:Sources_ConsoleKit" + ] + }, + { + "identity": "fluent-kit", + "name": "FluentBenchmark", + "type": "library", + "target_labels": [ + "@swiftpkg_fluent_kit//:Sources_FluentBenchmark" + ] + }, + { + "identity": "fluent-kit", + "name": "FluentKit", + "type": "library", + "target_labels": [ + "@swiftpkg_fluent_kit//:Sources_FluentKit" + ] + }, + { + "identity": "fluent-kit", + "name": "FluentSQL", + "type": "library", + "target_labels": [ + "@swiftpkg_fluent_kit//:Sources_FluentSQL" + ] + }, + { + "identity": "fluent-kit", + "name": "XCTFluent", + "type": "library", + "target_labels": [ + "@swiftpkg_fluent_kit//:Sources_XCTFluent" + ] + }, + { + "identity": "fluent-sqlite-driver", + "name": "FluentSQLiteDriver", + "type": "library", + "target_labels": [ + "@swiftpkg_fluent_sqlite_driver//:Sources_FluentSQLiteDriver" + ] + }, + { + "identity": "fluent", + "name": "Fluent", + "type": "library", + "target_labels": [ + "@swiftpkg_fluent//:Sources_Fluent" + ] + }, + { + "identity": "multipart-kit", + "name": "MultipartKit", + "type": "library", + "target_labels": [ + "@swiftpkg_multipart_kit//:Sources_MultipartKit" + ] + }, + { + "identity": "routing-kit", + "name": "RoutingKit", + "type": "library", + "target_labels": [ + "@swiftpkg_routing_kit//:Sources_RoutingKit" + ] + }, + { + "identity": "sql-kit", + "name": "SQLKit", + "type": "library", + "target_labels": [ + "@swiftpkg_sql_kit//:Sources_SQLKit" + ] + }, + { + "identity": "sql-kit", + "name": "SQLKitBenchmark", + "type": "library", + "target_labels": [ + "@swiftpkg_sql_kit//:Sources_SQLKitBenchmark" + ] + }, + { + "identity": "sqlite-kit", + "name": "SQLiteKit", + "type": "library", + "target_labels": [ + "@swiftpkg_sqlite_kit//:Sources_SQLiteKit" + ] + }, + { + "identity": "sqlite-nio", + "name": "SQLiteNIO", + "type": "library", + "target_labels": [ + "@swiftpkg_sqlite_nio//:Sources_SQLiteNIO" + ] + }, + { + "identity": "swift-algorithms", + "name": "Algorithms", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_algorithms//:Sources_Algorithms" + ] + }, + { + "identity": "swift-atomics", + "name": "Atomics", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_atomics//:Sources_Atomics" + ] + }, + { + "identity": "swift-backtrace", + "name": "Backtrace", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_backtrace//:Sources_Backtrace" + ] + }, + { + "identity": "swift-collections", + "name": "Collections", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_collections//:Sources_Collections" + ] + }, + { + "identity": "swift-collections", + "name": "DequeModule", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_collections//:Sources_DequeModule" + ] + }, + { + "identity": "swift-collections", + "name": "OrderedCollections", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_collections//:Sources_OrderedCollections" + ] + }, + { + "identity": "swift-crypto", + "name": "Crypto", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_crypto//:Sources_Crypto" + ] + }, + { + "identity": "swift-crypto", + "name": "_CryptoExtras", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_crypto//:Sources__CryptoExtras" + ] + }, + { + "identity": "swift-log", + "name": "Logging", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_log//:Sources_Logging" + ] + }, + { + "identity": "swift-metrics", + "name": "CoreMetrics", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_metrics//:Sources_CoreMetrics" + ] + }, + { + "identity": "swift-metrics", + "name": "Metrics", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_metrics//:Sources_Metrics" + ] + }, + { + "identity": "swift-metrics", + "name": "MetricsTestKit", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_metrics//:Sources_MetricsTestKit" + ] + }, + { + "identity": "swift-nio-extras", + "name": "NIOExtras", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio_extras//:Sources_NIOExtras" + ] + }, + { + "identity": "swift-nio-extras", + "name": "NIOHTTPCompression", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio_extras//:Sources_NIOHTTPCompression" + ] + }, + { + "identity": "swift-nio-extras", + "name": "NIOSOCKS", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio_extras//:Sources_NIOSOCKS" + ] + }, + { + "identity": "swift-nio-http2", + "name": "NIOHTTP2", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio_http2//:Sources_NIOHTTP2" + ] + }, + { + "identity": "swift-nio-ssl", + "name": "NIOSSL", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio_ssl//:Sources_NIOSSL" + ] + }, + { + "identity": "swift-nio-ssl", + "name": "NIOSSLHTTP1Client", + "type": "executable", + "target_labels": [ + "@swiftpkg_swift_nio_ssl//:Sources_NIOSSLHTTP1Client" + ] + }, + { + "identity": "swift-nio-ssl", + "name": "NIOTLSServer", + "type": "executable", + "target_labels": [ + "@swiftpkg_swift_nio_ssl//:Sources_NIOTLSServer" + ] + }, + { + "identity": "swift-nio-transport-services", + "name": "NIOTransportServices", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio_transport_services//:Sources_NIOTransportServices" + ] + }, + { + "identity": "swift-nio", + "name": "NIO", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIO" + ] + }, + { + "identity": "swift-nio", + "name": "NIOConcurrencyHelpers", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIOConcurrencyHelpers" + ] + }, + { + "identity": "swift-nio", + "name": "NIOCore", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIOCore" + ] + }, + { + "identity": "swift-nio", + "name": "NIOEmbedded", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIOEmbedded" + ] + }, + { + "identity": "swift-nio", + "name": "NIOFoundationCompat", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIOFoundationCompat" + ] + }, + { + "identity": "swift-nio", + "name": "NIOHTTP1", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIOHTTP1" + ] + }, + { + "identity": "swift-nio", + "name": "NIOPosix", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIOPosix" + ] + }, + { + "identity": "swift-nio", + "name": "NIOTLS", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIOTLS" + ] + }, + { + "identity": "swift-nio", + "name": "NIOTestUtils", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIOTestUtils" + ] + }, + { + "identity": "swift-nio", + "name": "NIOWebSocket", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources_NIOWebSocket" + ] + }, + { + "identity": "swift-nio", + "name": "_NIOConcurrency", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_nio//:Sources__NIOConcurrency" + ] + }, + { + "identity": "swift-numerics", + "name": "ComplexModule", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_numerics//:Sources_ComplexModule" + ] + }, + { + "identity": "swift-numerics", + "name": "Numerics", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_numerics//:Sources_Numerics" + ] + }, + { + "identity": "swift-numerics", + "name": "RealModule", + "type": "library", + "target_labels": [ + "@swiftpkg_swift_numerics//:Sources_RealModule" + ] + }, + { + "identity": "vapor", + "name": "Vapor", + "type": "library", + "target_labels": [ + "@swiftpkg_vapor//:Sources_Vapor" + ] + }, + { + "identity": "vapor", + "name": "XCTVapor", + "type": "library", + "target_labels": [ + "@swiftpkg_vapor//:Sources_XCTVapor" + ] + }, + { + "identity": "websocket-kit", + "name": "WebSocketKit", + "type": "library", + "target_labels": [ + "@swiftpkg_websocket_kit//:Sources_WebSocketKit" + ] + } + ] +} \ No newline at end of file diff --git a/gazelle/config.go b/gazelle/config.go index 974409abc..67b0d1c39 100644 --- a/gazelle/config.go +++ b/gazelle/config.go @@ -16,9 +16,9 @@ func (*swiftLang) RegisterFlags(fs *flag.FlagSet, cmd string, c *config.Config) sc := swiftcfg.NewSwiftConfig() fs.StringVar( - &sc.DependencyIndexPath, - "dependency_index", - "", + &sc.DependencyIndexRel, + "swift_dependency_index", + swiftcfg.DefaultDependencyIndexBasename, "the location of the dependency index JSON file", ) @@ -49,7 +49,7 @@ func (sl *swiftLang) CheckFlags(fs *flag.FlagSet, c *config.Config) error { // Initialize the module index path. We cannot initialize this path until we get into // CheckFlags. if sc.DependencyIndexPath == "" { - sc.DependencyIndexPath = filepath.Join(c.RepoRoot, swiftcfg.DefaultDependencyIndexBasename) + sc.DependencyIndexPath = filepath.Join(c.RepoRoot, sc.DependencyIndexRel) } // Attempt to load the module index. This is created by update-repos if the client is using diff --git a/gazelle/internal/swift/repo_rule_from_bazel_repo.go b/gazelle/internal/swift/repo_rule_from_bazel_repo.go index 83b12ff69..6b63a8d47 100644 --- a/gazelle/internal/swift/repo_rule_from_bazel_repo.go +++ b/gazelle/internal/swift/repo_rule_from_bazel_repo.go @@ -14,7 +14,7 @@ type commitProvider interface { } // The pkgDir is the path to the Swift package that is referencing this Bazel repository. -func RepoRuleFromBazelRepo(bzlRepo *BazelRepo, miBasename string, pkgDir string) (*rule.Rule, error) { +func RepoRuleFromBazelRepo(bzlRepo *BazelRepo, diRel string, pkgDir string) (*rule.Rule, error) { var r *rule.Rule var err error if bzlRepo.Pin != nil { @@ -31,7 +31,13 @@ func RepoRuleFromBazelRepo(bzlRepo *BazelRepo, miBasename string, pkgDir string) } // The module index is located at the root of the parent workspace. - miLbl := label.New("@", "", miBasename) + dir := filepath.Dir(diRel) + if dir == "." { + dir = "" + } + lpath := filepath.ToSlash(dir) + base := filepath.Base(diRel) + miLbl := label.New("@", lpath, base) r.SetAttr("dependencies_index", miLbl.String()) return r, nil diff --git a/gazelle/internal/swiftcfg/swift_config.go b/gazelle/internal/swiftcfg/swift_config.go index 9dbec0514..2dc6115f6 100644 --- a/gazelle/internal/swiftcfg/swift_config.go +++ b/gazelle/internal/swiftcfg/swift_config.go @@ -19,9 +19,12 @@ type SwiftConfig struct { SwiftBinPath string ModuleFilesCollector ModuleFilesCollector DependencyIndex *swift.DependencyIndex - DependencyIndexPath string - PackageInfo *swiftpkg.PackageInfo - UpdatePkgsToLatest bool + // DependencyIndexRel is the path relative to the RepoRoot to the dependency index + DependencyIndexRel string + // DependencyIndexPath is the full path to the dependency index + DependencyIndexPath string + PackageInfo *swiftpkg.PackageInfo + UpdatePkgsToLatest bool } func NewSwiftConfig() *SwiftConfig { diff --git a/gazelle/update_repos.go b/gazelle/update_repos.go index d5502b53e..f0d1b8182 100644 --- a/gazelle/update_repos.go +++ b/gazelle/update_repos.go @@ -122,11 +122,10 @@ func importReposFromPackageManifest(args language.ImportReposArgs) language.Impo } // Generate the repository rules from the Bazel Repos - diBase := filepath.Base(sc.DependencyIndexPath) result.Gen = make([]*rule.Rule, len(bzlReposByIdentity)) idx := 0 for _, bzlRepo := range bzlReposByIdentity { - result.Gen[idx], err = swift.RepoRuleFromBazelRepo(bzlRepo, diBase, pkgDir) + result.Gen[idx], err = swift.RepoRuleFromBazelRepo(bzlRepo, sc.DependencyIndexRel, pkgDir) if err != nil { result.Error = err return result diff --git a/swiftpkg/internal/swift_update_packages.bzl b/swiftpkg/internal/swift_update_packages.bzl index 8ad7ed09c..10e6025dd 100644 --- a/swiftpkg/internal/swift_update_packages.bzl +++ b/swiftpkg/internal/swift_update_packages.bzl @@ -7,7 +7,8 @@ def swift_update_packages( gazelle, package_manifest = "Package.swift", swift_deps = "swift_deps.bzl", - swift_deps_fn = "swift_dependencies"): + swift_deps_fn = "swift_dependencies", + swift_deps_index = "swift_deps_index.json"): """Defines gazelle update-repos targets that are used to resolve and update \ Swift package dependencies. @@ -24,6 +25,9 @@ def swift_update_packages( swift_deps_fn: Optional. The name of the Starlark function in the `swift_deps` file that should be updated with the Swift package dependencies as a `string`. + swift_deps_index: Optional. The relative path to the Swift + dependencies index JSON file. This path is relative to the + repository root, not the location of this declaration. """ _SWIFT_UPDATE_REPOS_ARGS = [ "-from_file={}".format(package_manifest), @@ -32,6 +36,7 @@ def swift_update_packages( swift_deps_fn = swift_deps_fn, ), "-prune", + "-swift_dependency_index={}".format(swift_deps_index), ] _gazelle(