diff --git a/Package.swift b/Package.swift index e8292a38f0f..900ea807457 100644 --- a/Package.swift +++ b/Package.swift @@ -185,20 +185,6 @@ let package = Package( ), ], targets: [ - // The `PackageDescription` target provides the API that is available - // to `Package.swift` manifests. Here we build a debug version of the - // library; the bootstrap scripts build the deployable version. - .target( - name: "PackageDescription", - exclude: ["CMakeLists.txt"], - swiftSettings: commonExperimentalFeatures + [ - .define("USE_IMPL_ONLY_IMPORTS"), - .unsafeFlags(["-package-description-version", "999.0"]), - .unsafeFlags(["-enable-library-evolution"]), - ], - linkerSettings: packageLibraryLinkSettings - ), - // The `AppleProductTypes` target provides additional product types // to `Package.swift` manifests. Here we build a debug version of the // library; the bootstrap scripts build the deployable version. @@ -214,19 +200,6 @@ let package = Package( .unsafeFlags(["-Xfrontend", "-module-link-name", "-Xfrontend", "AppleProductTypes"]) ]), - // The `PackagePlugin` target provides the API that is available to - // plugin scripts. Here we build a debug version of the library; the - // bootstrap scripts build the deployable version. - .target( - name: "PackagePlugin", - exclude: ["CMakeLists.txt"], - swiftSettings: commonExperimentalFeatures + [ - .unsafeFlags(["-package-description-version", "999.0"]), - .unsafeFlags(["-enable-library-evolution"]), - ], - linkerSettings: packageLibraryLinkSettings - ), - .target( name: "SourceKitLSPAPI", dependencies: [ @@ -776,11 +749,41 @@ let package = Package( ] ), + // The `PackageDescription` target provides the API that is available + // to `Package.swift` manifests. Here we build a debug version of the + // library; the bootstrap scripts build the deployable version. + .target( + name: "PackageDescription", + path: "Sources/Runtime/PackageDescription", + exclude: ["CMakeLists.txt"], + swiftSettings: commonExperimentalFeatures + [ + .define("USE_IMPL_ONLY_IMPORTS"), + .unsafeFlags(["-package-description-version", "999.0"]), + .unsafeFlags(["-enable-library-evolution"]), + ], + linkerSettings: packageLibraryLinkSettings + ), + + // The `PackagePlugin` target provides the API that is available to + // plugin scripts. Here we build a debug version of the library; the + // bootstrap scripts build the deployable version. + .target( + name: "PackagePlugin", + path: "Sources/Runtime/PackagePlugin", + exclude: ["CMakeLists.txt"], + swiftSettings: commonExperimentalFeatures + [ + .unsafeFlags(["-package-description-version", "999.0"]), + .unsafeFlags(["-enable-library-evolution"]), + ], + linkerSettings: packageLibraryLinkSettings + ), + // MARK: Support for Swift macros, should eventually move to a plugin-based solution .target( name: "CompilerPluginSupport", dependencies: ["PackageDescription"], + path: "Sources/Runtime/CompilerPluginSupport", exclude: ["CMakeLists.txt"], swiftSettings: commonExperimentalFeatures + [ .unsafeFlags(["-package-description-version", "999.0"]), diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 0cfc57b2e4a..cc375a8a09f 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -13,19 +13,16 @@ add_subdirectory(Basics) add_subdirectory(BinarySymbols) add_subdirectory(Build) add_subdirectory(Commands) -add_subdirectory(CompilerPluginSupport) add_subdirectory(CoreCommands) add_subdirectory(DriverSupport) add_subdirectory(LLBuildManifest) add_subdirectory(PackageCollections) add_subdirectory(PackageCollectionsModel) add_subdirectory(PackageCollectionsSigning) -add_subdirectory(PackageDescription) add_subdirectory(PackageFingerprint) add_subdirectory(PackageGraph) add_subdirectory(PackageLoading) add_subdirectory(PackageModel) -add_subdirectory(PackagePlugin) add_subdirectory(PackageRegistry) add_subdirectory(PackageRegistryCommand) add_subdirectory(PackageSigning) diff --git a/Sources/CompilerPluginSupport/CMakeLists.txt b/Sources/CompilerPluginSupport/CMakeLists.txt deleted file mode 100644 index d54ff20186b..00000000000 --- a/Sources/CompilerPluginSupport/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -# This source file is part of the Swift open source project -# -# Copyright (c) 2023 Apple Inc. and the Swift project authors -# Licensed under Apache License v2.0 with Runtime Library Exception -# -# See http://swift.org/LICENSE.txt for license information -# See http://swift.org/CONTRIBUTORS.txt for Swift project authors - -add_library(CompilerPluginSupport - TargetExtensions.swift) -target_link_libraries(CompilerPluginSupport PRIVATE - PackageDescription) - -target_compile_options(CompilerPluginSupport PUBLIC - $<$:-package-description-version$999.0>) - -if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) - target_link_options(CompilerPluginSupport PRIVATE - "SHELL:-Xlinker -install_name -Xlinker @rpath/CompilerPluginSupport.dylib") -endif() - -set_target_properties(CompilerPluginSupport PROPERTIES - Swift_MODULE_NAME CompilerPluginSupport - Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI - INSTALL_NAME_DIR \\@rpath - OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI - OUTPUT_NAME CompilerPluginSupport - ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI -) - -if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) - target_link_libraries(CompilerPluginSupport PRIVATE - Foundation) - target_link_options(CompilerPluginSupport PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(CompilerPluginSupport PROPERTIES - BUILD_WITH_INSTALL_RPATH TRUE - INSTALL_RPATH "$ORIGIN/../../$") -endif() - -install(FILES - ${CMAKE_BINARY_DIR}/pm/ManifestAPI/CompilerPluginSupport.swiftmodule - ${CMAKE_BINARY_DIR}/pm/ManifestAPI/CompilerPluginSupport.swiftdoc - DESTINATION lib/swift/pm/ManifestAPI -) - -install(TARGETS CompilerPluginSupport - DESTINATION lib/swift/pm/ManifestAPI) diff --git a/Sources/PackageDescription/CMakeLists.txt b/Sources/PackageDescription/CMakeLists.txt deleted file mode 100644 index 9d417490d55..00000000000 --- a/Sources/PackageDescription/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -# This source file is part of the Swift open source project -# -# Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors -# Licensed under Apache License v2.0 with Runtime Library Exception -# -# See http://swift.org/LICENSE.txt for license information -# See http://swift.org/CONTRIBUTORS.txt for Swift project authors - -add_library(PackageDescription - BuildSettings.swift - Context.swift - ContextModel.swift - LanguageStandardSettings.swift - PackageDescription.swift - PackageDescriptionSerialization.swift - PackageDescriptionSerializationConversion.swift - PackageDependency.swift - PackageDependencyTrait.swift - PackageRequirement.swift - Product.swift - Resource.swift - SupportedPlatforms.swift - Target.swift - Trait.swift - Version.swift - Version+StringLiteralConvertible.swift - WarningLevel.swift) - -target_compile_options(PackageDescription PUBLIC - $<$:-package-description-version$999.0>) - -if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) - target_link_options(PackageDescription PRIVATE - "SHELL:-Xlinker -install_name -Xlinker @rpath/libPackageDescription.dylib") -endif() - -set_target_properties(PackageDescription PROPERTIES - Swift_MODULE_NAME PackageDescription - Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI - INSTALL_NAME_DIR \\@rpath - OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI - OUTPUT_NAME PackageDescription - ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/ManifestAPI -) - -if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) - target_link_libraries(PackageDescription PRIVATE - Foundation) - target_link_options(PackageDescription PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(PackageDescription PROPERTIES - BUILD_WITH_INSTALL_RPATH TRUE - INSTALL_RPATH "$ORIGIN/../../$") -endif() - -install(FILES - ${CMAKE_BINARY_DIR}/pm/ManifestAPI/PackageDescription.swiftmodule - ${CMAKE_BINARY_DIR}/pm/ManifestAPI/PackageDescription.swiftdoc - DESTINATION lib/swift/pm/ManifestAPI -) - -install(TARGETS PackageDescription - DESTINATION lib/swift/pm/ManifestAPI) diff --git a/Sources/PackageDescription/ContextModel.swift b/Sources/PackageDescription/ContextModel.swift deleted file mode 120000 index ac70ad44ea5..00000000000 --- a/Sources/PackageDescription/ContextModel.swift +++ /dev/null @@ -1 +0,0 @@ -../PackageLoading/ContextModel.swift \ No newline at end of file diff --git a/Sources/PackageLoading/PackageDescriptionSerialization.swift b/Sources/PackageLoading/PackageDescriptionSerialization.swift index cb6421bd3f8..9336724b486 120000 --- a/Sources/PackageLoading/PackageDescriptionSerialization.swift +++ b/Sources/PackageLoading/PackageDescriptionSerialization.swift @@ -1 +1 @@ -../PackageDescription/PackageDescriptionSerialization.swift \ No newline at end of file +../Runtime/PackageDescription/PackageDescriptionSerialization.swift \ No newline at end of file diff --git a/Sources/PackagePlugin/CMakeLists.txt b/Sources/PackagePlugin/CMakeLists.txt deleted file mode 100644 index ac30db77e1a..00000000000 --- a/Sources/PackagePlugin/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -# This source file is part of the Swift open source project -# -# Copyright (c) 2021-2022 Apple Inc. and the Swift project authors -# Licensed under Apache License v2.0 with Runtime Library Exception -# -# See http://swift.org/LICENSE.txt for license information -# See http://swift.org/CONTRIBUTORS.txt for Swift project authors - -add_library(PackagePlugin SHARED - ArgumentExtractor.swift - Command.swift - Context.swift - Diagnostics.swift - Errors.swift - PackageManagerProxy.swift - PackageModel.swift - Path.swift - Plugin.swift - PluginContextDeserializer.swift - PluginMessages.swift - Protocols.swift - Utilities.swift) - -target_compile_options(PackagePlugin PUBLIC - $<$:-package-description-version$999.0>) -target_compile_options(PackagePlugin PUBLIC - $<$:-enable-library-evolution>) - -if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) - set(SWIFT_INTERFACE_PATH ${CMAKE_BINARY_DIR}/pm/PluginAPI/PackagePlugin.swiftinterface) - target_compile_options(PackagePlugin PUBLIC - $<$:-emit-module-interface-path$${SWIFT_INTERFACE_PATH}>) - target_link_options(PackagePlugin PRIVATE - "SHELL:-Xlinker -install_name -Xlinker @rpath/libPackagePlugin.dylib") -endif() - -set_target_properties(PackagePlugin PROPERTIES - Swift_MODULE_NAME PackagePlugin - Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI - INSTALL_NAME_DIR \\@rpath - OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI - OUTPUT_NAME PackagePlugin - ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI - LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/pm/PluginAPI -) - -if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) - target_link_libraries(PackagePlugin PRIVATE - Foundation) - target_link_options(PackagePlugin PRIVATE - "SHELL:-no-toolchain-stdlib-rpath") - set_target_properties(PackagePlugin PROPERTIES - BUILD_WITH_INSTALL_RPATH TRUE - INSTALL_RPATH "$ORIGIN/../../$") -endif() - -if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) - install(FILES - ${CMAKE_BINARY_DIR}/pm/PluginAPI/PackagePlugin.swiftinterface - ${CMAKE_BINARY_DIR}/pm/PluginAPI/PackagePlugin.swiftdoc - DESTINATION lib/swift/pm/PluginAPI - ) -else() - install(FILES - ${CMAKE_BINARY_DIR}/pm/PluginAPI/PackagePlugin.swiftmodule - ${CMAKE_BINARY_DIR}/pm/PluginAPI/PackagePlugin.swiftdoc - DESTINATION lib/swift/pm/PluginAPI - ) -endif() - -install(TARGETS PackagePlugin - DESTINATION lib/swift/pm/PluginAPI) diff --git a/Sources/Runtime/CMakeLists.txt b/Sources/Runtime/CMakeLists.txt new file mode 100644 index 00000000000..68e20ef7e5f --- /dev/null +++ b/Sources/Runtime/CMakeLists.txt @@ -0,0 +1,43 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +cmake_minimum_required(VERSION 3.29) + +if(POLICY CMP0157 AND CMAKE_Swift_COMPILER_USE_OLD_DRIVER) + cmake_policy(SET CMP0157 OLD) +endif() + +project(SwiftPMRuntime + LANGUAGES Swift) + +# TODO(compnerd) C is being enabled as a workaround for `GNUInstallDirs` not +# being aware of Swift-only projects. Remove this once that is updated and we +# have updated to a newer CMake minimum version. +enable_language(C) +include(GNUInstallDirs) + +set(CMAKE_INSTALL_NAME_DIR "@rpath") +set(CMAKE_INSTALL_RPATH "$ORIGIN/../../$") +set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL) +set(CMAKE_POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}) +set(CMAKE_Swift_LANGUAGE_VERSION 5) +set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY MultiThreadedDLL) + +set(SwiftPMRuntime_ENABLE_LIBRARY_EVOLUTION YES) +add_compile_options(-enable-library-evolution) + +add_compile_options(-package-description-version 999.0) + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) +include(PlatformInfo) +include(EmitSwiftInterface) +include(InstallSwiftInterface) + +add_subdirectory(PackageDescription) +add_subdirectory(CompilerPluginSupport) +add_subdirectory(PackagePlugin) diff --git a/Sources/Runtime/CompilerPluginSupport/CMakeLists.txt b/Sources/Runtime/CompilerPluginSupport/CMakeLists.txt new file mode 100644 index 00000000000..e83bf247171 --- /dev/null +++ b/Sources/Runtime/CompilerPluginSupport/CMakeLists.txt @@ -0,0 +1,29 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2023 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +add_library(CompilerPluginSupport SHARED + TargetExtensions.swift) + +target_link_libraries(CompilerPluginSupport PRIVATE + PackageDescription) + +if(APPLE) + target_link_options(CompilerPluginSupport PRIVATE + "SHELL:-Xlinker -install_name -Xlinker @rpath/CompilerPluginSupport.dylib") +else() + target_link_libraries(CompilerPluginSupport PRIVATE + Foundation) +endif() + +install(TARGETS CompilerPluginSupport + DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift/pm/ManifestAPI) + +set(SwiftPMRuntime_INSTALL_SWIFTMODULEDIR + ${CMAKE_INSTALL_LIBDIR}/swift/pm/ManifestAPI) +emit_swift_interface(CompilerPluginSupport) +install_swift_interface(CompilerPluginSupport) diff --git a/Sources/CompilerPluginSupport/TargetExtensions.swift b/Sources/Runtime/CompilerPluginSupport/TargetExtensions.swift similarity index 100% rename from Sources/CompilerPluginSupport/TargetExtensions.swift rename to Sources/Runtime/CompilerPluginSupport/TargetExtensions.swift diff --git a/Sources/PackageDescription/BuildSettings.swift b/Sources/Runtime/PackageDescription/BuildSettings.swift similarity index 100% rename from Sources/PackageDescription/BuildSettings.swift rename to Sources/Runtime/PackageDescription/BuildSettings.swift diff --git a/Sources/Runtime/PackageDescription/CMakeLists.txt b/Sources/Runtime/PackageDescription/CMakeLists.txt new file mode 100644 index 00000000000..b3fd89fd193 --- /dev/null +++ b/Sources/Runtime/PackageDescription/CMakeLists.txt @@ -0,0 +1,48 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +add_library(PackageDescription SHARED + BuildSettings.swift + Context.swift + ContextModel.swift + LanguageStandardSettings.swift + PackageDescription.swift + PackageDescriptionSerialization.swift + PackageDescriptionSerializationConversion.swift + PackageDependency.swift + PackageDependencyTrait.swift + PackageRequirement.swift + Product.swift + Resource.swift + SupportedPlatforms.swift + Target.swift + Trait.swift + Version.swift + Version+StringLiteralConvertible.swift + WarningLevel.swift) + +set_target_properties(PackageDescription PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}) +target_compile_definitions(PackageDescription PRIVATE + USE_IMPL_ONLY_IMPORTS) + +if(APPLE) + target_link_options(PackageDescription PRIVATE + "SHELL:-Xlinker -install_name -Xlinker @rpath/libPackageDescription.dylib") +else() + target_link_directories(PackageDescription PRIVATE + Foundation) +endif() + +install(TARGETS PackageDescription + DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift/pm/ManifestAPI) + +set(SwiftPMRuntime_INSTALL_SWIFTMODULEDIR + ${CMAKE_INSTALL_LIBDIR}/swift/pm/ManifestAPI) +emit_swift_interface(PackageDescription) +install_swift_interface(PackageDescription) diff --git a/Sources/PackageDescription/Context.swift b/Sources/Runtime/PackageDescription/Context.swift similarity index 100% rename from Sources/PackageDescription/Context.swift rename to Sources/Runtime/PackageDescription/Context.swift diff --git a/Sources/Runtime/PackageDescription/ContextModel.swift b/Sources/Runtime/PackageDescription/ContextModel.swift new file mode 120000 index 00000000000..0e5bb34288f --- /dev/null +++ b/Sources/Runtime/PackageDescription/ContextModel.swift @@ -0,0 +1 @@ +../../PackageLoading/ContextModel.swift \ No newline at end of file diff --git a/Sources/PackageDescription/LanguageStandardSettings.swift b/Sources/Runtime/PackageDescription/LanguageStandardSettings.swift similarity index 100% rename from Sources/PackageDescription/LanguageStandardSettings.swift rename to Sources/Runtime/PackageDescription/LanguageStandardSettings.swift diff --git a/Sources/PackageDescription/PackageDependency.swift b/Sources/Runtime/PackageDescription/PackageDependency.swift similarity index 100% rename from Sources/PackageDescription/PackageDependency.swift rename to Sources/Runtime/PackageDescription/PackageDependency.swift diff --git a/Sources/PackageDescription/PackageDependencyTrait.swift b/Sources/Runtime/PackageDescription/PackageDependencyTrait.swift similarity index 100% rename from Sources/PackageDescription/PackageDependencyTrait.swift rename to Sources/Runtime/PackageDescription/PackageDependencyTrait.swift diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/BuildConfiguration.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/BuildConfiguration.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/BuildConfiguration.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/BuildConfiguration.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/BuildSettingCondition.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/BuildSettingCondition.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/BuildSettingCondition.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/BuildSettingCondition.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/CLanguageStandard.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/CLanguageStandard.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/CLanguageStandard.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/CLanguageStandard.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/CSetting.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/CSetting.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/CSetting.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/CSetting.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/CXXLanguageStandard.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/CXXLanguageStandard.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/CXXLanguageStandard.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/CXXLanguageStandard.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/CXXSetting.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/CXXSetting.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/CXXSetting.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/CXXSetting.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Dependency.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Dependency.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Dependency.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Dependency.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-hash.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-hash.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-hash.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-hash.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-hashValue.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-hashValue.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-hashValue.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-hashValue.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-notEqual.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-notEqual.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-notEqual.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-notEqual.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-hash.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-hash.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-hash.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-hash.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-hashValue.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-hashValue.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-hashValue.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-hashValue.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-notEqual.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-notEqual.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-notEqual.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-notEqual.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-hash.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-hash.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-hash.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-hash.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-hashValue.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-hashValue.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-hashValue.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-hashValue.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-initRawValue.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-initRawValue.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-initRawValue.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-initRawValue.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-notEqual.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-notEqual.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-notEqual.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-notEqual.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-rawValue.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-rawValue.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-rawValue.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-rawValue.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-hash.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-hash.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-hash.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-hash.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-hashValue.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-hashValue.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-hashValue.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-hashValue.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-initRawValue.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-initRawValue.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-initRawValue.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-initRawValue.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-notEqual.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-notEqual.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-notEqual.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-notEqual.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Product-Executable.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Product-Executable.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Product-Executable.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Product-Executable.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-hash.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-hash.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-hash.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-hash.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-hashValue.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-hashValue.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-hashValue.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-hashValue.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-notEqual.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-notEqual.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-notEqual.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-notEqual.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-hash.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-hash.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-hash.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-hash.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-hashValue.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-hashValue.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-hashValue.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-hashValue.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-notEqual.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-notEqual.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-notEqual.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-notEqual.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/LanguageTag.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/LanguageTag.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/LanguageTag.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/LanguageTag.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Library.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Library.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Library.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Library.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/LinkerSetting.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/LinkerSetting.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/LinkerSetting.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/LinkerSetting.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Package.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Package.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Package.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Package.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Platform-notEqual.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Platform-notEqual.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Platform-notEqual.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Platform-notEqual.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Platform.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Platform.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Platform.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Platform.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Plugin.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Plugin.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Plugin.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Plugin.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/PluginCapability.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/PluginCapability.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/PluginCapability.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/PluginCapability.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/PluginCommandIntent.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/PluginCommandIntent.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/PluginCommandIntent.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/PluginCommandIntent.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/PluginPermission.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/PluginPermission.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/PluginPermission.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/PluginPermission.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/PluginUsage.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/PluginUsage.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/PluginUsage.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/PluginUsage.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Product.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Product.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Product.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Product.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Resource-Localization.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Resource-Localization.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Resource-Localization.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Resource-Localization.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Resource.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Resource.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Resource.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Resource.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/SupportedPlatforms-notEqual.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SupportedPlatforms-notEqual.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/SupportedPlatforms-notEqual.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SupportedPlatforms-notEqual.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/SupportedPlatforms.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SupportedPlatforms.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/SupportedPlatforms.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SupportedPlatforms.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/SwiftLanguageMode.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SwiftLanguageMode.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/SwiftLanguageMode.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SwiftLanguageMode.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/SwiftSetting.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SwiftSetting.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/SwiftSetting.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SwiftSetting.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/SystemPackageProvider.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SystemPackageProvider.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/SystemPackageProvider.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/SystemPackageProvider.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Target-Dependency.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Target-Dependency.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Target-Dependency.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Target-Dependency.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Target-TargetDependencyCondition.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Target-TargetDependencyCondition.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Target-TargetDependencyCondition.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Target-TargetDependencyCondition.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Target-TargetType.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Target-TargetType.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Target-TargetType.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Target-TargetType.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Target.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Target.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Target.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Target.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Curation/Version.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Version.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Curation/Version.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Curation/Version.md diff --git a/Sources/PackageDescription/PackageDescription.docc/Info.plist b/Sources/Runtime/PackageDescription/PackageDescription.docc/Info.plist similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/Info.plist rename to Sources/Runtime/PackageDescription/PackageDescription.docc/Info.plist diff --git a/Sources/PackageDescription/PackageDescription.docc/PackageDescription.md b/Sources/Runtime/PackageDescription/PackageDescription.docc/PackageDescription.md similarity index 100% rename from Sources/PackageDescription/PackageDescription.docc/PackageDescription.md rename to Sources/Runtime/PackageDescription/PackageDescription.docc/PackageDescription.md diff --git a/Sources/PackageDescription/PackageDescription.swift b/Sources/Runtime/PackageDescription/PackageDescription.swift similarity index 100% rename from Sources/PackageDescription/PackageDescription.swift rename to Sources/Runtime/PackageDescription/PackageDescription.swift diff --git a/Sources/PackageDescription/PackageDescriptionSerialization.swift b/Sources/Runtime/PackageDescription/PackageDescriptionSerialization.swift similarity index 100% rename from Sources/PackageDescription/PackageDescriptionSerialization.swift rename to Sources/Runtime/PackageDescription/PackageDescriptionSerialization.swift diff --git a/Sources/PackageDescription/PackageDescriptionSerializationConversion.swift b/Sources/Runtime/PackageDescription/PackageDescriptionSerializationConversion.swift similarity index 100% rename from Sources/PackageDescription/PackageDescriptionSerializationConversion.swift rename to Sources/Runtime/PackageDescription/PackageDescriptionSerializationConversion.swift diff --git a/Sources/PackageDescription/PackageRequirement.swift b/Sources/Runtime/PackageDescription/PackageRequirement.swift similarity index 100% rename from Sources/PackageDescription/PackageRequirement.swift rename to Sources/Runtime/PackageDescription/PackageRequirement.swift diff --git a/Sources/PackageDescription/Product.swift b/Sources/Runtime/PackageDescription/Product.swift similarity index 100% rename from Sources/PackageDescription/Product.swift rename to Sources/Runtime/PackageDescription/Product.swift diff --git a/Sources/PackageDescription/Resource.swift b/Sources/Runtime/PackageDescription/Resource.swift similarity index 100% rename from Sources/PackageDescription/Resource.swift rename to Sources/Runtime/PackageDescription/Resource.swift diff --git a/Sources/PackageDescription/SupportedPlatforms.swift b/Sources/Runtime/PackageDescription/SupportedPlatforms.swift similarity index 100% rename from Sources/PackageDescription/SupportedPlatforms.swift rename to Sources/Runtime/PackageDescription/SupportedPlatforms.swift diff --git a/Sources/PackageDescription/Target.swift b/Sources/Runtime/PackageDescription/Target.swift similarity index 100% rename from Sources/PackageDescription/Target.swift rename to Sources/Runtime/PackageDescription/Target.swift diff --git a/Sources/PackageDescription/Trait.swift b/Sources/Runtime/PackageDescription/Trait.swift similarity index 100% rename from Sources/PackageDescription/Trait.swift rename to Sources/Runtime/PackageDescription/Trait.swift diff --git a/Sources/PackageDescription/Version+StringLiteralConvertible.swift b/Sources/Runtime/PackageDescription/Version+StringLiteralConvertible.swift similarity index 100% rename from Sources/PackageDescription/Version+StringLiteralConvertible.swift rename to Sources/Runtime/PackageDescription/Version+StringLiteralConvertible.swift diff --git a/Sources/PackageDescription/Version.swift b/Sources/Runtime/PackageDescription/Version.swift similarity index 100% rename from Sources/PackageDescription/Version.swift rename to Sources/Runtime/PackageDescription/Version.swift diff --git a/Sources/PackageDescription/WarningLevel.swift b/Sources/Runtime/PackageDescription/WarningLevel.swift similarity index 100% rename from Sources/PackageDescription/WarningLevel.swift rename to Sources/Runtime/PackageDescription/WarningLevel.swift diff --git a/Sources/PackagePlugin/ArgumentExtractor.swift b/Sources/Runtime/PackagePlugin/ArgumentExtractor.swift similarity index 100% rename from Sources/PackagePlugin/ArgumentExtractor.swift rename to Sources/Runtime/PackagePlugin/ArgumentExtractor.swift diff --git a/Sources/Runtime/PackagePlugin/CMakeLists.txt b/Sources/Runtime/PackagePlugin/CMakeLists.txt new file mode 100644 index 00000000000..87e7b0f253c --- /dev/null +++ b/Sources/Runtime/PackagePlugin/CMakeLists.txt @@ -0,0 +1,38 @@ +# This source file is part of the Swift open source project +# +# Copyright (c) 2021-2022 Apple Inc. and the Swift project authors +# Licensed under Apache License v2.0 with Runtime Library Exception +# +# See http://swift.org/LICENSE.txt for license information +# See http://swift.org/CONTRIBUTORS.txt for Swift project authors + +add_library(PackagePlugin SHARED + ArgumentExtractor.swift + Command.swift + Context.swift + Diagnostics.swift + Errors.swift + PackageManagerProxy.swift + PackageModel.swift + Path.swift + Plugin.swift + PluginContextDeserializer.swift + PluginMessages.swift + Protocols.swift + Utilities.swift) + +if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) + target_link_options(PackagePlugin PRIVATE + "SHELL:-Xlinker -install_name -Xlinker @rpath/libPackagePlugin.dylib") +else() + target_link_libraries(PackagePlugin PRIVATE + Foundation) +endif() + +install(TARGETS PackagePlugin + DESTINATION ${CMAKE_INSTALL_LIBDIR}/swift/pm/PluginAPI) + +set(SwiftPMRuntime_INSTALL_SWIFTMODULEDIR + ${CMAKE_INSTALL_LIBDIR}/swift/pm/PluginAPI) +emit_swift_interface(PackagePlugin) +install_swift_interface(PackagePlugin) diff --git a/Sources/PackagePlugin/Command.swift b/Sources/Runtime/PackagePlugin/Command.swift similarity index 100% rename from Sources/PackagePlugin/Command.swift rename to Sources/Runtime/PackagePlugin/Command.swift diff --git a/Sources/PackagePlugin/Context.swift b/Sources/Runtime/PackagePlugin/Context.swift similarity index 100% rename from Sources/PackagePlugin/Context.swift rename to Sources/Runtime/PackagePlugin/Context.swift diff --git a/Sources/PackagePlugin/Diagnostics.swift b/Sources/Runtime/PackagePlugin/Diagnostics.swift similarity index 100% rename from Sources/PackagePlugin/Diagnostics.swift rename to Sources/Runtime/PackagePlugin/Diagnostics.swift diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/ArgumentExtractor.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ArgumentExtractor.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/ArgumentExtractor.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ArgumentExtractor.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/BinaryArtifactTarget.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/BinaryArtifactTarget.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/BinaryArtifactTarget.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/BinaryArtifactTarget.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/BuildToolPlugin.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/BuildToolPlugin.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/BuildToolPlugin.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/BuildToolPlugin.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/ClangSourceModuleTarget.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ClangSourceModuleTarget.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/ClangSourceModuleTarget.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ClangSourceModuleTarget.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/Command.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Command.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/Command.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Command.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/CommandPlugin.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/CommandPlugin.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/CommandPlugin.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/CommandPlugin.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/Diagnostics.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Diagnostics.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/Diagnostics.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Diagnostics.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/ExecutableProduct.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ExecutableProduct.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/ExecutableProduct.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ExecutableProduct.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/File.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/File.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/File.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/File.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/FileList.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/FileList.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/FileList.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/FileList.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/FileType.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/FileType.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/FileType.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/FileType.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/LibraryProduct.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/LibraryProduct.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/LibraryProduct.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/LibraryProduct.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/LibraryProduct_Kind.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/LibraryProduct_Kind.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/LibraryProduct_Kind.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/LibraryProduct_Kind.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/ModuleKind.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ModuleKind.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/ModuleKind.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ModuleKind.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/Package.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Package.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/Package.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Package.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageDependency.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageDependency.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageDependency.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageDependency.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManagerProxyError.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManagerProxyError.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManagerProxyError.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManagerProxyError.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildConfiguration.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildConfiguration.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildConfiguration.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildConfiguration.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildLogVerbosity.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildLogVerbosity.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildLogVerbosity.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildLogVerbosity.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildParameters.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildParameters.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildParameters.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildParameters.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildResult.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildResult.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildResult.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildResult.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildResult_BuiltArtifact.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildResult_BuiltArtifact.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildResult_BuiltArtifact.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildResult_BuiltArtifact.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildSubset.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildSubset.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildSubset.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_BuildSubset.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphOptions.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphOptions.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphOptions.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphOptions.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphOptions_AccessLevel.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphOptions_AccessLevel.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphOptions_AccessLevel.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphOptions_AccessLevel.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphResult.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphResult.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphResult.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_SymbolGraphResult.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestParameters.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestParameters.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestParameters.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestParameters.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase_Test.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase_Test.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase_Test.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase_Test.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase_Test_Result.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase_Test_Result.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase_Test_Result.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestResult_TestTarget_TestCase_Test_Result.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestSubset.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestSubset.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageManager_TestSubset.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageManager_TestSubset.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PackageOrigin.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageOrigin.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PackageOrigin.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PackageOrigin.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/Path.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Path.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/Path.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Path.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PathList.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PathList.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PathList.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PathList.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/Plugin.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Plugin.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/Plugin.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Plugin.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PluginContext.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PluginContext.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PluginContext.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PluginContext.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PluginContextError.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PluginContextError.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PluginContextError.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PluginContextError.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/PluginDeserializationError.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PluginDeserializationError.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/PluginDeserializationError.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/PluginDeserializationError.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/Product.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Product.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/Product.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Product.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/SourceModuleTarget.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/SourceModuleTarget.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/SourceModuleTarget.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/SourceModuleTarget.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/SwiftSourceModuleTarget.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/SwiftSourceModuleTarget.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/SwiftSourceModuleTarget.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/SwiftSourceModuleTarget.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/SystemLibraryTarget.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/SystemLibraryTarget.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/SystemLibraryTarget.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/SystemLibraryTarget.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/Target.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Target.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/Target.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/Target.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/TargetDependency.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/TargetDependency.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/TargetDependency.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/TargetDependency.md diff --git a/Sources/PackagePlugin/Documentation.docc/Curation/ToolsVersion.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ToolsVersion.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Curation/ToolsVersion.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Curation/ToolsVersion.md diff --git a/Sources/PackagePlugin/Documentation.docc/Documentation.md b/Sources/Runtime/PackagePlugin/Documentation.docc/Documentation.md similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Documentation.md rename to Sources/Runtime/PackagePlugin/Documentation.docc/Documentation.md diff --git a/Sources/PackagePlugin/Documentation.docc/Info.plist b/Sources/Runtime/PackagePlugin/Documentation.docc/Info.plist similarity index 100% rename from Sources/PackagePlugin/Documentation.docc/Info.plist rename to Sources/Runtime/PackagePlugin/Documentation.docc/Info.plist diff --git a/Sources/PackagePlugin/Errors.swift b/Sources/Runtime/PackagePlugin/Errors.swift similarity index 100% rename from Sources/PackagePlugin/Errors.swift rename to Sources/Runtime/PackagePlugin/Errors.swift diff --git a/Sources/PackagePlugin/PackageManagerProxy.swift b/Sources/Runtime/PackagePlugin/PackageManagerProxy.swift similarity index 100% rename from Sources/PackagePlugin/PackageManagerProxy.swift rename to Sources/Runtime/PackagePlugin/PackageManagerProxy.swift diff --git a/Sources/PackagePlugin/PackageModel.swift b/Sources/Runtime/PackagePlugin/PackageModel.swift similarity index 100% rename from Sources/PackagePlugin/PackageModel.swift rename to Sources/Runtime/PackagePlugin/PackageModel.swift diff --git a/Sources/PackagePlugin/Path.swift b/Sources/Runtime/PackagePlugin/Path.swift similarity index 100% rename from Sources/PackagePlugin/Path.swift rename to Sources/Runtime/PackagePlugin/Path.swift diff --git a/Sources/PackagePlugin/Plugin.swift b/Sources/Runtime/PackagePlugin/Plugin.swift similarity index 100% rename from Sources/PackagePlugin/Plugin.swift rename to Sources/Runtime/PackagePlugin/Plugin.swift diff --git a/Sources/PackagePlugin/PluginContextDeserializer.swift b/Sources/Runtime/PackagePlugin/PluginContextDeserializer.swift similarity index 100% rename from Sources/PackagePlugin/PluginContextDeserializer.swift rename to Sources/Runtime/PackagePlugin/PluginContextDeserializer.swift diff --git a/Sources/PackagePlugin/PluginMessages.swift b/Sources/Runtime/PackagePlugin/PluginMessages.swift similarity index 100% rename from Sources/PackagePlugin/PluginMessages.swift rename to Sources/Runtime/PackagePlugin/PluginMessages.swift diff --git a/Sources/PackagePlugin/Protocols.swift b/Sources/Runtime/PackagePlugin/Protocols.swift similarity index 100% rename from Sources/PackagePlugin/Protocols.swift rename to Sources/Runtime/PackagePlugin/Protocols.swift diff --git a/Sources/PackagePlugin/Utilities.swift b/Sources/Runtime/PackagePlugin/Utilities.swift similarity index 100% rename from Sources/PackagePlugin/Utilities.swift rename to Sources/Runtime/PackagePlugin/Utilities.swift diff --git a/Sources/Runtime/cmake/modules/EmitSwiftInterface.cmake b/Sources/Runtime/cmake/modules/EmitSwiftInterface.cmake new file mode 100644 index 00000000000..8a3540dd55e --- /dev/null +++ b/Sources/Runtime/cmake/modules/EmitSwiftInterface.cmake @@ -0,0 +1,54 @@ +# Generate and install swift interface files + +# TODO: CMake should learn how to model library evolution and generate this +# stuff automatically. + + +# Generate a swift interface file for the target if library evolution is enabled +function(emit_swift_interface target) + # Generate the target-variant binary swift module when performing zippered + # build + # Clean this up once CMake has nested swiftmodules in the build directory: + # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10664 + # https://cmake.org/cmake/help/git-stage/policy/CMP0195.html + + # We can't expand the Swift_MODULE_NAME target property in a generator + # expression or it will fail saying that the target doesn't exist. + get_target_property(module_name ${target} Swift_MODULE_NAME) + if(NOT module_name) + set(module_name ${target}) + endif() + # Account for an existing swiftmodule file + # generated with the previous logic + if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule" + AND NOT IS_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule") + message(STATUS "Removing regular file ${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule to support nested swiftmodule generation") + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule") + endif() + target_compile_options(${target} PRIVATE + "$<$:SHELL:-emit-module-path ${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule/${${PROJECT_NAME}_MODULE_TRIPLE}.swiftmodule>") + if(${PROJECT_NAME}_VARIANT_MODULE_TRIPLE) + target_compile_options(${target} PRIVATE + "$<$:SHELL:-emit-variant-module-path ${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule/${${PROJECT_NAME}_VARIANT_MODULE_TRIPLE}.swiftmodule>") + endif() + add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule/${${PROJECT_NAME}_MODULE_TRIPLE}.swiftmodule" + DEPENDS ${target}) + target_sources(${target} + INTERFACE + $) + + # Generate textual swift interfaces is library-evolution is enabled + if(${PROJECT_NAME}_ENABLE_LIBRARY_EVOLUTION) + target_compile_options(${target} PRIVATE + $<$:-emit-module-interface-path$${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule/${${PROJECT_NAME}_MODULE_TRIPLE}.swiftinterface> + $<$:-emit-private-module-interface-path$${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule/${${PROJECT_NAME}_MODULE_TRIPLE}.private.swiftinterface>) + if(${PROJECT_NAME}_VARIANT_MODULE_TRIPLE) + target_compile_options(${target} PRIVATE + "$<$:SHELL:-emit-variant-module-interface-path ${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule/${${PROJECT_NAME}_VARIANT_MODULE_TRIPLE}.swiftinterface>" + "$<$:SHELL:-emit-variant-private-module-interface-path ${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule/${${PROJECT_NAME}_VARIANT_MODULE_TRIPLE}.private.swiftinterface>") + endif() + target_compile_options(${target} PRIVATE + $<$:-library-level$api> + $<$:-Xfrontend$-require-explicit-availability=ignore>) + endif() +endfunction() diff --git a/Sources/Runtime/cmake/modules/InstallSwiftInterface.cmake b/Sources/Runtime/cmake/modules/InstallSwiftInterface.cmake new file mode 100644 index 00000000000..e8f5fb20215 --- /dev/null +++ b/Sources/Runtime/cmake/modules/InstallSwiftInterface.cmake @@ -0,0 +1,13 @@ + +# Install the generated swift interface files for the target. +function(install_swift_interface target) + # Swiftmodules are already in the directory structure + get_target_property(module_name ${target} Swift_MODULE_NAME) + if(NOT module_name) + set(module_name ${target}) + endif() + + install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${module_name}.swiftmodule" + DESTINATION "${${PROJECT_NAME}_INSTALL_SWIFTMODULEDIR}" + COMPONENT ${PROJECT_NAME}_development) +endfunction() diff --git a/Sources/Runtime/cmake/modules/PlatformInfo.cmake b/Sources/Runtime/cmake/modules/PlatformInfo.cmake new file mode 100644 index 00000000000..ebe92e0af78 --- /dev/null +++ b/Sources/Runtime/cmake/modules/PlatformInfo.cmake @@ -0,0 +1,24 @@ +include_guard(GLOBAL) + +if(NOT ${PROJECT_NAME}_SIZEOF_POINTER) + set(${PROJECT_NAME}_SIZEOF_POINTER "${CMAKE_SIZEOF_VOID_P}" CACHE STRING "Size of a pointer in bytes") + message(CONFIGURE_LOG "Stdlib Pointer size: ${CMAKE_SIZEOF_VOID_P}") + mark_as_advanced(${PROJECT_NAME}_SIZEOF_POINTER) +endif() + +# TODO: This logic should migrate to CMake once CMake supports installing swiftmodules +set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info) +if(CMAKE_Swift_COMPILER_TARGET) + list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET}) +endif() +execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json) +message(CONFIGURE_LOG "Swift target info: ${module_triple_command}\n" +"${target_info_json}") + +if(NOT ${PROJECT_NAME}_MODULE_TRIPLE) + string(JSON module_triple GET "${target_info_json}" "target" "moduleTriple") + set(${PROJECT_NAME}_MODULE_TRIPLE "${module_triple}" CACHE STRING "Triple used for installed swift{doc,module,interface} files") + mark_as_advanced(${PROJECT_NAME}_MODULE_TRIPLE) + + message(CONFIGURE_LOG "Swift module triple: ${module_triple}") +endif() diff --git a/Sources/SPMBuildCore/Plugins/PluginMessages.swift b/Sources/SPMBuildCore/Plugins/PluginMessages.swift index c5846bb658f..cde6d2506e2 120000 --- a/Sources/SPMBuildCore/Plugins/PluginMessages.swift +++ b/Sources/SPMBuildCore/Plugins/PluginMessages.swift @@ -1 +1 @@ -../../PackagePlugin/PluginMessages.swift \ No newline at end of file +../../Runtime/PackagePlugin/PluginMessages.swift \ No newline at end of file