Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Merge main into release/6.2 #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2327cdc
Implement Statistic with atomics so it's thread safe
jakepetroules May 2, 2025
7cd307d
Remove `compiler` build setting conditional (#481)
neonichu May 5, 2025
ef21a84
build: attempt to bundle files for the modules
compnerd Mar 3, 2025
de9a45a
Introduce a ByteCount abstraction for representing bytes
jakepetroules May 2, 2025
e39832f
Turn on the inclusive language soundness check
owenv May 5, 2025
f267224
Merge pull request #489 from swiftlang/owenv/language-check
owenv May 5, 2025
5f4041c
[Explicit Module Builds] Add support for Swift incremental dependency…
artemcm May 6, 2025
fce47fd
Continue bundling xcspec resources used by Swift Build
owenv May 5, 2025
bb91a15
Remove blocking_sync usages from TaskProducerContext
jakepetroules May 5, 2025
524037f
Remove more blocking_sync calls
jakepetroules May 5, 2025
6eed033
Improve validation of task action implementation tool identifier types
jakepetroules May 6, 2025
bed73bb
Merge pull request #492 from artemcm/IncrementalScanOptional
artemcm May 7, 2025
382fba5
[Swift] Add migrate mode to a few upcoming flags that currently suppo…
xedin May 7, 2025
4ade115
[Swift] NFC: Change display name for `NonisolatedNonsendingByDefault`…
xedin May 7, 2025
a4dc5bb
Merge pull request #496 from xedin/add-migrate-option-to-features-tha…
xedin May 8, 2025
579aa20
Add plugin to autogenerate windows installer content
owenv May 8, 2025
36e8b25
Merge pull request #497 from swiftlang/owenv/gen-windows-installer
owenv May 8, 2025
fe6f10f
Merge pull request #488 from swiftlang/owenv/bundling-continued
owenv May 8, 2025
edda59f
Fix xcbuildrules typo
owenv May 9, 2025
ed66ddc
Merge pull request #500 from swiftlang/owenv/resource-fixes
owenv May 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Continue bundling xcspec resources used by Swift Build
- Handle all the remaining xcspecs
- centralize resource accessor generation alongside the bundling
  • Loading branch information
owenv committed May 6, 2025
commit fce47fd6c15def9c394cae3b21767e431d380c8d
31 changes: 29 additions & 2 deletions 31 Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,38 @@ function(SwiftBuild_Bundle)
cmake_parse_arguments(PARSE_ARGV 0 BundleXCSpecs
"${Options}" "${OneValueArguments}" "${MultiValueArguments}")

list(TRANSFORM BundleXCSpecs_FILES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/")
add_custom_command(TARGET ${BundleXCSpecs_MODULE} POST_BUILD
COMMAND
${CMAKE_COMMAND} -E make_directory "$<TARGET_PROPERTY:${BundleXCSpecs_MODULE},LOCATION>/SwiftBuild_${BundleXCSpecs_MODULE}.resources"
${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/share/pm/SwiftBuild_${BundleXCSpecs_MODULE}.resources"
COMMAND
${CMAKE_COMMAND} -E copy_if_different ${BundleXCSpecs_FILES} "$<TARGET_PROPERTY:${BundleXCSpecs_MODULE},LOCATION>/SwiftBuild_${BundleXCSpecs_MODULE}.resources/")
${CMAKE_COMMAND} -E copy_if_different ${BundleXCSpecs_FILES} "${CMAKE_BINARY_DIR}/share/pm/SwiftBuild_${BundleXCSpecs_MODULE}.resources/")

file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/share/pm/SwiftBuild_${BundleXCSpecs_MODULE}.resources" _SWIFT_BUILD_RESOURCE_BUNDLE_BUILD_PATH)
file(CONFIGURE
OUTPUT "${CMAKE_BINARY_DIR}/resource_accessors/SwiftBuild_${BundleXCSpecs_MODULE}_resource_bundle_accessor.swift"
CONTENT [[
import Foundation
extension Foundation.Bundle {
static let module: Bundle = {
let mainPath = Bundle.main.bundleURL.appendingPathComponent("SwiftBuild_@BundleXCSpecs_MODULE@.resources").path
let buildPath = #"@_SWIFT_BUILD_RESOURCE_BUNDLE_BUILD_PATH@"#
let preferredBundle = Bundle(path: mainPath)
guard let bundle = preferredBundle ?? Bundle(path: buildPath) else {
Swift.fatalError("could not load resource bundle: from \(mainPath) or \(buildPath)")
}
return bundle
}()
}
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)

target_sources("${BundleXCSpecs_MODULE}" PRIVATE
"${CMAKE_BINARY_DIR}/resource_accessors/SwiftBuild_${BundleXCSpecs_MODULE}_resource_bundle_accessor.swift")

install(DIRECTORY
"${CMAKE_BINARY_DIR}/share/pm/SwiftBuild_${BundleXCSpecs_MODULE}.resources/"
DESTINATION share/pm/SwiftBuild_${BundleXCSpecs_MODULE}.resources/)
endfunction()

add_subdirectory(SWBCSupport)
Expand Down
27 changes: 2 additions & 25 deletions 27 Sources/SWBAndroidPlatform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,15 @@ See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
]]

file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}"
_SWBAndroidPlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR)
file(CONFIGURE
OUTPUT resource_bundle_accessor.swift
CONTENT [[
import Foundation
extension Foundation.Bundle {
static let module: Bundle = {
let mainPath = Bundle.main.bundleURL.appendingPathComponent("SwiftBuild_SWBAndroidPlatform.resources").path
let buildPath = #"@_SWBAndroidPlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR@\SwiftBuild_SWBAndroidPlatform.resources"#
let preferredBundle = Bundle(path: mainPath)
guard let bundle = preferredBundle ?? Bundle(path: buildPath) else {
Swift.fatalError("could not load resource bundle: from \(mainPath) or \(buildPath)")
}
return bundle
}()
}
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)

add_library(SWBAndroidPlatform
AndroidSDK.swift
Plugin.swift)
SwiftBuild_Bundle(MODULE SWBAndroidPlatform FILES
Specs/Android.xcspec)
target_link_libraries(SWBAndroidPlatform PUBLIC
SWBCore
SWBMacro
SWBUtil)
target_sources(SWBAndroidPlatform PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")

set_target_properties(SWBAndroidPlatform PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
Expand All @@ -45,6 +25,3 @@ set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBAndroidPlatform)

install(TARGETS SWBAndroidPlatform
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

SwiftBuild_Bundle(MODULE SWBAndroidPlatform FILES
Android.xcspec)
93 changes: 71 additions & 22 deletions 93 Sources/SWBApplePlatform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
]]

file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}"
_SWBApplePlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR)
file(CONFIGURE
OUTPUT resource_bundle_accessor.swift
CONTENT [[
import Foundation
extension Foundation.Bundle {
static let module: Bundle = {
let mainPath = Bundle.main.bundleURL.appendingPathComponent("SwiftBuild_SWBApplePlatform.resources").path
let buildPath = #"@_SWBApplePlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR@\SwiftBuild_SWBApplePlatform.resources"#
let preferredBundle = Bundle(path: mainPath)
guard let bundle = preferredBundle ?? Bundle(path: buildPath) else {
Swift.fatalError("could not load resource bundle: from \(mainPath) or \(buildPath)")
}
return bundle
}()
}
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)

add_library(SWBApplePlatform
AppIntentsMetadataCompiler.swift
AppIntentsMetadataTaskProducer.swift
Expand Down Expand Up @@ -65,6 +45,77 @@ add_library(SWBApplePlatform
StringCatalogCompilerOutputParser.swift
StubBinaryTaskProducer.swift
XCStringsInputFileGroupingStrategy.swift)
SwiftBuild_Bundle(MODULE SWBApplePlatform FILES
Specs/AppIntentsMetadata.xcspec
Specs/AppIntentsNLTraining.xcspec
Specs/AppShortcutStringsMetadata.xcspec
Specs/AssetCatalogCompiler.xcspec
Specs/CompileSkybox.xcspec
Specs/CopyPNGFile.xcspec
Specs/CopyTiffFile.xcspec
"Specs/Core Data.xcspec"
Specs/CoreML.xcspec
"Specs/Darwin Package Types.xcspec"
"Specs/Darwin Product Types.xcspec"
Specs/DriverKit.xcspec
Specs/DTrace.xcspec
Specs/Embedded-Device.xcspec
Specs/Embedded-Shared.xcspec
Specs/Embedded-Simulator.xcspec
Specs/EmbeddedBinaryValidationUtility.xcspec
Specs/GenerateAppPlaygroundAssetCatalog.xcspec
Specs/GenerateTextureAtlas.xcspec
Specs/IBCompiler.xcspec
Specs/IBPostprocessor.xcspec
Specs/IBStoryboardCompiler.xcspec
Specs/IBStoryboardLinker.xcspec
Specs/IBStoryboardPostprocessor.xcspec
Specs/Iconutil.xcspec
Specs/Iig.xcspec
Specs/InfoPlistUtility.xcspec
Specs/InstrumentsPackage.xcspec
Specs/Intents.xcspec
"Specs/Interface Builder File Types.xcspec"
"Specs/iOS Device.xcspec"
"Specs/iOS Shared.xcspec"
"Specs/iOS Simulator.xcspec"
Specs/KernelExtension.xcspec
Specs/Lipo.xcspec
Specs/LSRegisterURL.xcspec
"Specs/MacOSX Architectures.xcspec"
"Specs/MacOSX Core Build System.xcspec"
"Specs/MacOSX Native Build System.xcspec"
"Specs/MacOSX Package Types.xcspec"
"Specs/MacOSX Product Types.xcspec"
Specs/MetalCompiler.xcspec
Specs/MetalFileTypes.xcspec
Specs/MetalLinker.xcspec
Specs/MetalPackageTypes.xcspec
Specs/MetalProductTypes.xcspec
Specs/MiG.xcspec
Specs/OpenCL.xcspec
Specs/OSACompile.xcspec
Specs/RCFileTypes.xcspec
Specs/RealityAssets.xcspec
Specs/ReferenceObject.xcspec
Specs/ResMerger.xcspec
Specs/Rez.xcspec
"Specs/SceneKit FileTypes.xcspec"
"Specs/SceneKit Tools.xcspec"
Specs/SpriteKitFileTypes.xcspec
Specs/TiffUtil.xcspec
"Specs/tvOS Device.xcspec"
"Specs/tvOS Shared.xcspec"
"Specs/tvOS Simulator.xcspec"
Specs/WatchKit1ProductTypes.xcspec
"Specs/watchOS Device.xcspec"
"Specs/watchOS Shared.xcspec"
"Specs/watchOS Simulator.xcspec"
Specs/XCAppExtensionPoints.xcspec
Specs/XCStrings.xcspec
"Specs/xrOS Device.xcspec"
"Specs/xrOS Shared.xcspec"
"Specs/xrOS Simulator.xcspec")
set_target_properties(SWBApplePlatform PROPERTIES
Swift_LANGUAGE_VERSION 6)
target_link_libraries(SWBApplePlatform PUBLIC
Expand All @@ -73,8 +124,6 @@ target_link_libraries(SWBApplePlatform PUBLIC
SWBUtil
SWBProtocol
SWBTaskConstruction)
target_sources(SWBApplePlatform PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")

set_target_properties(SWBApplePlatform PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
Expand Down
26 changes: 4 additions & 22 deletions 26 Sources/SWBCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
]]

file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}"
_SWBCore_NATIVE_CMAKE_CURRENT_BINARY_DIR)
file(CONFIGURE
OUTPUT resource_bundle_accessor.swift
CONTENT [[
import Foundation
extension Foundation.Bundle {
static let module: Bundle = {
let mainPath = Bundle.main.bundleURL.appendingPathComponent("SwiftBuild_SWBCore.resources").path
let buildPath = #"@_SWBCore_NATIVE_CMAKE_CURRENT_BINARY_DIR@\SwiftBuild_SWBCore.resources"#
let preferredBundle = Bundle(path: mainPath)
guard let bundle = preferredBundle ?? Bundle(path: buildPath) else {
Swift.fatalError("could not load resource bundle: from \(mainPath) or \(buildPath)")
}
return bundle
}()
}
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)

add_library(SWBCore
ActivityReporting.swift
Apple/DeviceFamily.swift
Expand Down Expand Up @@ -195,6 +175,10 @@ add_library(SWBCore
WorkspaceContext.swift
WorkspaceSettingsCache.swift
XCFramework.swift)
SwiftBuild_Bundle(MODULE SWBCore FILES
Specs/CoreBuildSystem.xcspec
Specs/ExternalBuildSystem.xcspec
Specs/NativeBuildSystem.xcspec)
set_target_properties(SWBCore PROPERTIES
Swift_LANGUAGE_VERSION 5)
target_link_libraries(SWBCore PUBLIC
Expand All @@ -205,8 +189,6 @@ target_link_libraries(SWBCore PUBLIC
SWBCAS
SWBLLBuild
SwiftDriver)
target_sources(SWBCore PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")

set_target_properties(SWBCore PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
Expand Down
33 changes: 5 additions & 28 deletions 33 Sources/SWBGenericUnixPlatform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,16 @@ See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
]]

file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}"
_SWBGenericUnixPlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR)
file(CONFIGURE
OUTPUT resource_bundle_accessor.swift
CONTENT [[
import Foundation
extension Foundation.Bundle {
static let module: Bundle = {
let mainPath = Bundle.main.bundleURL.appendingPathComponent("SwiftBuild_SWBGenericUnixPlatform.resources").path
let buildPath = #"@_SWBGenericUnixPlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR@\SwiftBuild_SWBGenericUnixPlatform.resources"#
let preferredBundle = Bundle(path: mainPath)
guard let bundle = preferredBundle ?? Bundle(path: buildPath) else {
Swift.fatalError("could not load resource bundle: from \(mainPath) or \(buildPath)")
}
return bundle
}()
}
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)

add_library(SWBGenericUnixPlatform
Plugin.swift)
SwiftBuild_Bundle(MODULE SWBGenericUnixPlatform FILES
Specs/Unix.xcspec
Specs/UnixCompile.xcspec
Specs/UnixLd.xcspec
Specs/UnixLibtool.xcspec)
target_link_libraries(SWBGenericUnixPlatform PUBLIC
SWBCore
SWBUtil)
target_sources(SWBGenericUnixPlatform PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")

set_target_properties(SWBGenericUnixPlatform PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
Expand All @@ -43,9 +26,3 @@ set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBGenericUnixPlatform)

install(TARGETS SWBGenericUnixPlatform
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

SwiftBuild_Bundle(MODULE SWBGenericUnixPlatform FILES
Unix.xcspec
UnixCompile.xcspec
UnixLd.xcspec
UnixLibtool.xcspec)
32 changes: 5 additions & 27 deletions 32 Sources/SWBQNXPlatform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,18 @@ See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
]]

file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}"
_SWBQNXPlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR)
file(CONFIGURE
OUTPUT resource_bundle_accessor.swift
CONTENT [[
import Foundation
extension Foundation.Bundle {
static let module: Bundle = {
let mainPath = Bundle.main.bundleURL.appendingPathComponent("SwiftBuild_SWBQNXPlatform.resources").path
let buildPath = #"@_SWBQNXPlatform_NATIVE_CMAKE_CURRENT_BINARY_DIR@\SwiftBuild_SWBQNXPlatform.resources"#
let preferredBundle = Bundle(path: mainPath)
guard let bundle = preferredBundle ?? Bundle(path: buildPath) else {
Swift.fatalError("could not load resource bundle: from \(mainPath) or \(buildPath)")
}
return bundle
}()
}
]]
ESCAPE_QUOTES @ONLY NEWLINE_STYLE LF)

add_library(SWBQNXPlatform
Plugin.swift
QNXSDP.swift)
SwiftBuild_Bundle(MODULE SWBQNXPlatform FILES
Specs/QNX.xcspec
Specs/QNXCompile.xcspec
Specs/QNXLd.xcspec
Specs/QNXLibtool.xcspec)
target_link_libraries(SWBQNXPlatform PUBLIC
SWBCore
SWBMacro
SWBUtil)
target_sources(SWBQNXPlatform PRIVATE
"${CMAKE_CURRENT_BINARY_DIR}/resource_bundle_accessor.swift")

set_target_properties(SWBQNXPlatform PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
Expand All @@ -45,8 +28,3 @@ set_property(GLOBAL APPEND PROPERTY SWIFTBUILD_EXPORTS SWBQNXPlatform)

install(TARGETS SWBQNXPlatform
ARCHIVE DESTINATION "${SwiftBuild_INSTALL_LIBDIR}")

SwiftBuild_Bundle(MODULE SWBQNXPlatform FILES
QNX.xcspec
QNXCompile.xcspec
QNXLibtool.xcspec)
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.