diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 46ee6a7..4e420c8 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -47,18 +47,18 @@ jobs: run: swift test --verbose --skip-build - name: Build WinRTComponent - working-directory: Generator/InteropTests + working-directory: InteropTests shell: pwsh run: | & .\SPMPrebuild.ps1 -SwiftWinRT "$Env:GITHUB_WORKSPACE\Generator\.build\debug\SwiftWinRT.exe" - name: Build InteropTests - working-directory: Generator/InteropTests + working-directory: InteropTests shell: pwsh run: swift build --verbose --build-tests - name: Run InteropTests - working-directory: Generator/InteropTests + working-directory: InteropTests shell: pwsh run: swift test --verbose --skip-build diff --git a/Building.md b/Building.md index 6adc0fa..185350a 100644 --- a/Building.md +++ b/Building.md @@ -38,4 +38,4 @@ Generator> swift build --build-tests Generator> swift test --skip-build ``` -The `/Generator/InteropTests` subdirectory requires building `WinRTComponent.winmd` and `WinRTComponent.dll`, which SPM cannot do. A helper script, `SPMPrebuild.ps1`, will do that using CMake, after which the package can be built and tested normally. +The `/InteropTests` subdirectory requires building `WinRTComponent.winmd` and `WinRTComponent.dll`, and invoking `SwiftWinRT.exe`, which SPM cannot do. A helper script, `SPMPrebuild.ps1`, will do that using CMake, after which the package can be built and tested normally. diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fb6542..b4e06d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,5 +2,26 @@ cmake_minimum_required(VERSION 3.21.0) project(SwiftWinRT LANGUAGES C Swift) +# Building InteropTests will require running the code generator, +# so we configure and build it as a subproject. +message(STATUS "Configuring Generator as subproject...") +execute_process( + COMMAND ${CMAKE_COMMAND} + -S "${CMAKE_CURRENT_SOURCE_DIR}/Generator" + -B "${CMAKE_CURRENT_BINARY_DIR}/Generator" + -G "${CMAKE_GENERATOR}" + -D "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" + -D "CMAKE_C_COMPILER=${CMAKE_C_COMPILER}" + -D "CMAKE_Swift_COMPILER=${CMAKE_Swift_COMPILER}" + COMMAND_ERROR_IS_FATAL ANY) + +message(STATUS "Building Generator as subproject...") +execute_process( + COMMAND ${CMAKE_COMMAND} --build "${CMAKE_CURRENT_BINARY_DIR}/Generator" + COMMAND_ERROR_IS_FATAL ANY) + add_subdirectory(Support) -add_subdirectory(Generator) + +# Now build InteropTests, which depends on SWIFTWINRT_EXE +set(SWIFTWINRT_EXE "${CMAKE_CURRENT_BINARY_DIR}/Generator/Sources/SwiftWinRT/SwiftWinRT.exe") +add_subdirectory(InteropTests) diff --git a/Generator/CMakeLists.txt b/Generator/CMakeLists.txt index f7f13c0..65f9496 100644 --- a/Generator/CMakeLists.txt +++ b/Generator/CMakeLists.txt @@ -1,34 +1,6 @@ -# This directory can be built in two modes: standalone or as a subdirectory. -if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") - # Standalone mode. Only build the code generator. - # We can't build InteropTests in this mode because it depends on SwiftWinRT.exe - cmake_minimum_required(VERSION 3.21.0) +cmake_minimum_required(VERSION 3.21.0) - project(SwiftWinRT LANGUAGES C Swift) +project(SwiftWinRT LANGUAGES C Swift) - add_subdirectory(Dependencies) - add_subdirectory(Sources) -else() - # Subdirectory mode. Build both the code generator and InteropTests. - # Recursively invoke this build in standalone mode so that the code generator is built first, - # and can be used when building InteropTests. - message(STATUS "Configuring Generator as subproject...") - execute_process( - COMMAND ${CMAKE_COMMAND} - -S "${CMAKE_CURRENT_SOURCE_DIR}" - -B "${CMAKE_CURRENT_BINARY_DIR}/Build" - -G "${CMAKE_GENERATOR}" - -D "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" - -D "CMAKE_C_COMPILER=${CMAKE_C_COMPILER}" - -D "CMAKE_Swift_COMPILER=${CMAKE_Swift_COMPILER}" - COMMAND_ERROR_IS_FATAL ANY) - - message(STATUS "Building Generator as subproject...") - execute_process( - COMMAND ${CMAKE_COMMAND} --build "${CMAKE_CURRENT_BINARY_DIR}/Build" - COMMAND_ERROR_IS_FATAL ANY) - - # Now build InteropTests, which depends on SWIFTWINRT_EXE - set(SWIFTWINRT_EXE "${CMAKE_CURRENT_BINARY_DIR}/Build/Sources/SwiftWinRT/SwiftWinRT.exe") - add_subdirectory(InteropTests) -endif() +add_subdirectory(Dependencies) +add_subdirectory(Sources) \ No newline at end of file diff --git a/Generator/InteropTests/.vscode/tasks.json b/InteropTests/.vscode/tasks.json similarity index 100% rename from Generator/InteropTests/.vscode/tasks.json rename to InteropTests/.vscode/tasks.json diff --git a/Generator/InteropTests/CMakeLists.txt b/InteropTests/CMakeLists.txt similarity index 100% rename from Generator/InteropTests/CMakeLists.txt rename to InteropTests/CMakeLists.txt diff --git a/Generator/InteropTests/CMakePresets.json b/InteropTests/CMakePresets.json similarity index 100% rename from Generator/InteropTests/CMakePresets.json rename to InteropTests/CMakePresets.json diff --git a/Generator/InteropTests/Package.swift b/InteropTests/Package.swift similarity index 95% rename from Generator/InteropTests/Package.swift rename to InteropTests/Package.swift index 5d069af..1dd706d 100644 --- a/Generator/InteropTests/Package.swift +++ b/InteropTests/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( name: "InteropTests", dependencies: [ - .package(name: "Support", path: "../.."), + .package(name: "Support", path: ".."), .package(name: "Projection", path: "WinRTComponent/Projection"), ], targets: [ diff --git a/Generator/InteropTests/SPMPrebuild.ps1 b/InteropTests/SPMPrebuild.ps1 similarity index 92% rename from Generator/InteropTests/SPMPrebuild.ps1 rename to InteropTests/SPMPrebuild.ps1 index bf028c9..c5dd5ea 100644 --- a/Generator/InteropTests/SPMPrebuild.ps1 +++ b/InteropTests/SPMPrebuild.ps1 @@ -17,7 +17,8 @@ $ErrorActionPreference = "Stop" if (-not $SwiftWinRT) { Write-Host -ForegroundColor Cyan "Building SwiftWinRT.exe with SPM..." $SwiftConfiguration = "debug" - $GeneratorProjectDir = "$PSScriptRoot\.." + $RepoRoot = (& git.exe -C "$PSScriptRoot" rev-parse --path-format=absolute --show-toplevel).Trim() + $GeneratorProjectDir = "$RepoRoot\Generator" & swift.exe build ` --package-path $GeneratorProjectDir ` --configuration $SwiftConfiguration ` diff --git a/Generator/InteropTests/Tests/ActivationFactoryResolutionTests.swift b/InteropTests/Tests/ActivationFactoryResolutionTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ActivationFactoryResolutionTests.swift rename to InteropTests/Tests/ActivationFactoryResolutionTests.swift diff --git a/Generator/InteropTests/Tests/ActivationFactoryTests.swift b/InteropTests/Tests/ActivationFactoryTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ActivationFactoryTests.swift rename to InteropTests/Tests/ActivationFactoryTests.swift diff --git a/Generator/InteropTests/Tests/ArrayTests.swift b/InteropTests/Tests/ArrayTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ArrayTests.swift rename to InteropTests/Tests/ArrayTests.swift diff --git a/Generator/InteropTests/Tests/Asserts.swift b/InteropTests/Tests/Asserts.swift similarity index 100% rename from Generator/InteropTests/Tests/Asserts.swift rename to InteropTests/Tests/Asserts.swift diff --git a/Generator/InteropTests/Tests/AsyncTests.swift b/InteropTests/Tests/AsyncTests.swift similarity index 100% rename from Generator/InteropTests/Tests/AsyncTests.swift rename to InteropTests/Tests/AsyncTests.swift diff --git a/Generator/InteropTests/Tests/BuiltInConformancesTests.swift b/InteropTests/Tests/BuiltInConformancesTests.swift similarity index 100% rename from Generator/InteropTests/Tests/BuiltInConformancesTests.swift rename to InteropTests/Tests/BuiltInConformancesTests.swift diff --git a/Generator/InteropTests/Tests/ByteBufferTests.swift b/InteropTests/Tests/ByteBufferTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ByteBufferTests.swift rename to InteropTests/Tests/ByteBufferTests.swift diff --git a/Generator/InteropTests/Tests/ClassInheritanceTests.swift b/InteropTests/Tests/ClassInheritanceTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ClassInheritanceTests.swift rename to InteropTests/Tests/ClassInheritanceTests.swift diff --git a/Generator/InteropTests/Tests/CollectionTests.swift b/InteropTests/Tests/CollectionTests.swift similarity index 100% rename from Generator/InteropTests/Tests/CollectionTests.swift rename to InteropTests/Tests/CollectionTests.swift diff --git a/Generator/InteropTests/Tests/DateTimeTests.swift b/InteropTests/Tests/DateTimeTests.swift similarity index 100% rename from Generator/InteropTests/Tests/DateTimeTests.swift rename to InteropTests/Tests/DateTimeTests.swift diff --git a/Generator/InteropTests/Tests/EnumTests.swift b/InteropTests/Tests/EnumTests.swift similarity index 100% rename from Generator/InteropTests/Tests/EnumTests.swift rename to InteropTests/Tests/EnumTests.swift diff --git a/Generator/InteropTests/Tests/ErrorTests.swift b/InteropTests/Tests/ErrorTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ErrorTests.swift rename to InteropTests/Tests/ErrorTests.swift diff --git a/Generator/InteropTests/Tests/EventTests.swift b/InteropTests/Tests/EventTests.swift similarity index 100% rename from Generator/InteropTests/Tests/EventTests.swift rename to InteropTests/Tests/EventTests.swift diff --git a/Generator/InteropTests/Tests/InspectableBoxingTests.swift b/InteropTests/Tests/InspectableBoxingTests.swift similarity index 100% rename from Generator/InteropTests/Tests/InspectableBoxingTests.swift rename to InteropTests/Tests/InspectableBoxingTests.swift diff --git a/Generator/InteropTests/Tests/InterfaceImplementationTests.swift b/InteropTests/Tests/InterfaceImplementationTests.swift similarity index 100% rename from Generator/InteropTests/Tests/InterfaceImplementationTests.swift rename to InteropTests/Tests/InterfaceImplementationTests.swift diff --git a/Generator/InteropTests/Tests/NullValueTests.swift b/InteropTests/Tests/NullValueTests.swift similarity index 100% rename from Generator/InteropTests/Tests/NullValueTests.swift rename to InteropTests/Tests/NullValueTests.swift diff --git a/Generator/InteropTests/Tests/NumbersTests.swift b/InteropTests/Tests/NumbersTests.swift similarity index 100% rename from Generator/InteropTests/Tests/NumbersTests.swift rename to InteropTests/Tests/NumbersTests.swift diff --git a/Generator/InteropTests/Tests/ObjectExportingTests.swift b/InteropTests/Tests/ObjectExportingTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ObjectExportingTests.swift rename to InteropTests/Tests/ObjectExportingTests.swift diff --git a/Generator/InteropTests/Tests/OverloadingTests.swift b/InteropTests/Tests/OverloadingTests.swift similarity index 100% rename from Generator/InteropTests/Tests/OverloadingTests.swift rename to InteropTests/Tests/OverloadingTests.swift diff --git a/Generator/InteropTests/Tests/PropertyTests.swift b/InteropTests/Tests/PropertyTests.swift similarity index 100% rename from Generator/InteropTests/Tests/PropertyTests.swift rename to InteropTests/Tests/PropertyTests.swift diff --git a/Generator/InteropTests/Tests/ReferenceBoxingTests.swift b/InteropTests/Tests/ReferenceBoxingTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ReferenceBoxingTests.swift rename to InteropTests/Tests/ReferenceBoxingTests.swift diff --git a/Generator/InteropTests/Tests/StringTests.swift b/InteropTests/Tests/StringTests.swift similarity index 100% rename from Generator/InteropTests/Tests/StringTests.swift rename to InteropTests/Tests/StringTests.swift diff --git a/Generator/InteropTests/Tests/StructTests.swift b/InteropTests/Tests/StructTests.swift similarity index 100% rename from Generator/InteropTests/Tests/StructTests.swift rename to InteropTests/Tests/StructTests.swift diff --git a/Generator/InteropTests/Tests/SwiftEnumTests.swift b/InteropTests/Tests/SwiftEnumTests.swift similarity index 100% rename from Generator/InteropTests/Tests/SwiftEnumTests.swift rename to InteropTests/Tests/SwiftEnumTests.swift diff --git a/Generator/InteropTests/Tests/ValueOutParamRoundtripTests.swift b/InteropTests/Tests/ValueOutParamRoundtripTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ValueOutParamRoundtripTests.swift rename to InteropTests/Tests/ValueOutParamRoundtripTests.swift diff --git a/Generator/InteropTests/Tests/ValueReturnRoundtripTests.swift b/InteropTests/Tests/ValueReturnRoundtripTests.swift similarity index 100% rename from Generator/InteropTests/Tests/ValueReturnRoundtripTests.swift rename to InteropTests/Tests/ValueReturnRoundtripTests.swift diff --git a/Generator/InteropTests/Tests/WeakReferenceTests.swift b/InteropTests/Tests/WeakReferenceTests.swift similarity index 100% rename from Generator/InteropTests/Tests/WeakReferenceTests.swift rename to InteropTests/Tests/WeakReferenceTests.swift diff --git a/Generator/InteropTests/Tests/WinRTTestCase.swift b/InteropTests/Tests/WinRTTestCase.swift similarity index 100% rename from Generator/InteropTests/Tests/WinRTTestCase.swift rename to InteropTests/Tests/WinRTTestCase.swift diff --git a/Generator/InteropTests/WinRTComponent/CMakeLists.txt b/InteropTests/WinRTComponent/CMakeLists.txt similarity index 100% rename from Generator/InteropTests/WinRTComponent/CMakeLists.txt rename to InteropTests/WinRTComponent/CMakeLists.txt diff --git a/Generator/InteropTests/WinRTComponent/CMakePresets.json b/InteropTests/WinRTComponent/CMakePresets.json similarity index 100% rename from Generator/InteropTests/WinRTComponent/CMakePresets.json rename to InteropTests/WinRTComponent/CMakePresets.json diff --git a/Generator/InteropTests/WinRTComponent/Clear-PEDateTimeStamp.ps1 b/InteropTests/WinRTComponent/Clear-PEDateTimeStamp.ps1 similarity index 100% rename from Generator/InteropTests/WinRTComponent/Clear-PEDateTimeStamp.ps1 rename to InteropTests/WinRTComponent/Clear-PEDateTimeStamp.ps1 diff --git a/Generator/InteropTests/WinRTComponent/Dll/Arrays.cpp b/InteropTests/WinRTComponent/Dll/Arrays.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Arrays.cpp rename to InteropTests/WinRTComponent/Dll/Arrays.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/Arrays.h b/InteropTests/WinRTComponent/Dll/Arrays.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Arrays.h rename to InteropTests/WinRTComponent/Dll/Arrays.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/ByteBuffers.cpp b/InteropTests/WinRTComponent/Dll/ByteBuffers.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ByteBuffers.cpp rename to InteropTests/WinRTComponent/Dll/ByteBuffers.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/ByteBuffers.h b/InteropTests/WinRTComponent/Dll/ByteBuffers.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ByteBuffers.h rename to InteropTests/WinRTComponent/Dll/ByteBuffers.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/CMakeLists.txt b/InteropTests/WinRTComponent/Dll/CMakeLists.txt similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/CMakeLists.txt rename to InteropTests/WinRTComponent/Dll/CMakeLists.txt diff --git a/Generator/InteropTests/WinRTComponent/Dll/Collections.cpp b/InteropTests/WinRTComponent/Dll/Collections.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Collections.cpp rename to InteropTests/WinRTComponent/Dll/Collections.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/Collections.h b/InteropTests/WinRTComponent/Dll/Collections.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Collections.h rename to InteropTests/WinRTComponent/Dll/Collections.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/DateTimes.cpp b/InteropTests/WinRTComponent/Dll/DateTimes.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/DateTimes.cpp rename to InteropTests/WinRTComponent/Dll/DateTimes.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/DateTimes.h b/InteropTests/WinRTComponent/Dll/DateTimes.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/DateTimes.h rename to InteropTests/WinRTComponent/Dll/DateTimes.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/Errors.cpp b/InteropTests/WinRTComponent/Dll/Errors.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Errors.cpp rename to InteropTests/WinRTComponent/Dll/Errors.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/Errors.h b/InteropTests/WinRTComponent/Dll/Errors.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Errors.h rename to InteropTests/WinRTComponent/Dll/Errors.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/Events.cpp b/InteropTests/WinRTComponent/Dll/Events.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Events.cpp rename to InteropTests/WinRTComponent/Dll/Events.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/Events.h b/InteropTests/WinRTComponent/Dll/Events.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Events.h rename to InteropTests/WinRTComponent/Dll/Events.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/ForCustomActivationFactoryResolution.cpp b/InteropTests/WinRTComponent/Dll/ForCustomActivationFactoryResolution.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ForCustomActivationFactoryResolution.cpp rename to InteropTests/WinRTComponent/Dll/ForCustomActivationFactoryResolution.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/ForCustomActivationFactoryResolution.h b/InteropTests/WinRTComponent/Dll/ForCustomActivationFactoryResolution.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ForCustomActivationFactoryResolution.h rename to InteropTests/WinRTComponent/Dll/ForCustomActivationFactoryResolution.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/InspectableBoxing.cpp b/InteropTests/WinRTComponent/Dll/InspectableBoxing.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/InspectableBoxing.cpp rename to InteropTests/WinRTComponent/Dll/InspectableBoxing.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/InspectableBoxing.h b/InteropTests/WinRTComponent/Dll/InspectableBoxing.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/InspectableBoxing.h rename to InteropTests/WinRTComponent/Dll/InspectableBoxing.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/Int32Wrapper.cpp b/InteropTests/WinRTComponent/Dll/Int32Wrapper.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Int32Wrapper.cpp rename to InteropTests/WinRTComponent/Dll/Int32Wrapper.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/Int32Wrapper.h b/InteropTests/WinRTComponent/Dll/Int32Wrapper.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Int32Wrapper.h rename to InteropTests/WinRTComponent/Dll/Int32Wrapper.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/InterfaceCasting.cpp b/InteropTests/WinRTComponent/Dll/InterfaceCasting.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/InterfaceCasting.cpp rename to InteropTests/WinRTComponent/Dll/InterfaceCasting.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/InterfaceCasting.h b/InteropTests/WinRTComponent/Dll/InterfaceCasting.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/InterfaceCasting.h rename to InteropTests/WinRTComponent/Dll/InterfaceCasting.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/ManualAsyncOperation.cpp b/InteropTests/WinRTComponent/Dll/ManualAsyncOperation.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ManualAsyncOperation.cpp rename to InteropTests/WinRTComponent/Dll/ManualAsyncOperation.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/ManualAsyncOperation.h b/InteropTests/WinRTComponent/Dll/ManualAsyncOperation.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ManualAsyncOperation.h rename to InteropTests/WinRTComponent/Dll/ManualAsyncOperation.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/MinimalTypes.cpp b/InteropTests/WinRTComponent/Dll/MinimalTypes.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/MinimalTypes.cpp rename to InteropTests/WinRTComponent/Dll/MinimalTypes.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/MinimalTypes.h b/InteropTests/WinRTComponent/Dll/MinimalTypes.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/MinimalTypes.h rename to InteropTests/WinRTComponent/Dll/MinimalTypes.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/MinimalUnsealedClasses.cpp b/InteropTests/WinRTComponent/Dll/MinimalUnsealedClasses.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/MinimalUnsealedClasses.cpp rename to InteropTests/WinRTComponent/Dll/MinimalUnsealedClasses.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/MinimalUnsealedClasses.h b/InteropTests/WinRTComponent/Dll/MinimalUnsealedClasses.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/MinimalUnsealedClasses.h rename to InteropTests/WinRTComponent/Dll/MinimalUnsealedClasses.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/NullValues.cpp b/InteropTests/WinRTComponent/Dll/NullValues.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/NullValues.cpp rename to InteropTests/WinRTComponent/Dll/NullValues.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/NullValues.h b/InteropTests/WinRTComponent/Dll/NullValues.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/NullValues.h rename to InteropTests/WinRTComponent/Dll/NullValues.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/Numbers.cpp b/InteropTests/WinRTComponent/Dll/Numbers.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Numbers.cpp rename to InteropTests/WinRTComponent/Dll/Numbers.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/Numbers.h b/InteropTests/WinRTComponent/Dll/Numbers.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Numbers.h rename to InteropTests/WinRTComponent/Dll/Numbers.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/ObjectReferencer.cpp b/InteropTests/WinRTComponent/Dll/ObjectReferencer.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ObjectReferencer.cpp rename to InteropTests/WinRTComponent/Dll/ObjectReferencer.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/ObjectReferencer.h b/InteropTests/WinRTComponent/Dll/ObjectReferencer.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ObjectReferencer.h rename to InteropTests/WinRTComponent/Dll/ObjectReferencer.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/OutputArgument.cpp b/InteropTests/WinRTComponent/Dll/OutputArgument.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/OutputArgument.cpp rename to InteropTests/WinRTComponent/Dll/OutputArgument.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/OutputArgument.h b/InteropTests/WinRTComponent/Dll/OutputArgument.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/OutputArgument.h rename to InteropTests/WinRTComponent/Dll/OutputArgument.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/OverloadedSum.cpp b/InteropTests/WinRTComponent/Dll/OverloadedSum.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/OverloadedSum.cpp rename to InteropTests/WinRTComponent/Dll/OverloadedSum.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/OverloadedSum.h b/InteropTests/WinRTComponent/Dll/OverloadedSum.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/OverloadedSum.h rename to InteropTests/WinRTComponent/Dll/OverloadedSum.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/ReferenceBoxing.cpp b/InteropTests/WinRTComponent/Dll/ReferenceBoxing.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ReferenceBoxing.cpp rename to InteropTests/WinRTComponent/Dll/ReferenceBoxing.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/ReferenceBoxing.h b/InteropTests/WinRTComponent/Dll/ReferenceBoxing.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ReferenceBoxing.h rename to InteropTests/WinRTComponent/Dll/ReferenceBoxing.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/ReturnArgument.cpp b/InteropTests/WinRTComponent/Dll/ReturnArgument.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ReturnArgument.cpp rename to InteropTests/WinRTComponent/Dll/ReturnArgument.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/ReturnArgument.h b/InteropTests/WinRTComponent/Dll/ReturnArgument.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/ReturnArgument.h rename to InteropTests/WinRTComponent/Dll/ReturnArgument.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/Strings.cpp b/InteropTests/WinRTComponent/Dll/Strings.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Strings.cpp rename to InteropTests/WinRTComponent/Dll/Strings.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/Strings.h b/InteropTests/WinRTComponent/Dll/Strings.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Strings.h rename to InteropTests/WinRTComponent/Dll/Strings.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/Structs.cpp b/InteropTests/WinRTComponent/Dll/Structs.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Structs.cpp rename to InteropTests/WinRTComponent/Dll/Structs.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/Structs.h b/InteropTests/WinRTComponent/Dll/Structs.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/Structs.h rename to InteropTests/WinRTComponent/Dll/Structs.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/SwiftAttributes.cpp b/InteropTests/WinRTComponent/Dll/SwiftAttributes.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/SwiftAttributes.cpp rename to InteropTests/WinRTComponent/Dll/SwiftAttributes.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/SwiftAttributes.h b/InteropTests/WinRTComponent/Dll/SwiftAttributes.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/SwiftAttributes.h rename to InteropTests/WinRTComponent/Dll/SwiftAttributes.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/WeakReferencer.cpp b/InteropTests/WinRTComponent/Dll/WeakReferencer.cpp similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/WeakReferencer.cpp rename to InteropTests/WinRTComponent/Dll/WeakReferencer.cpp diff --git a/Generator/InteropTests/WinRTComponent/Dll/WeakReferencer.h b/InteropTests/WinRTComponent/Dll/WeakReferencer.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/WeakReferencer.h rename to InteropTests/WinRTComponent/Dll/WeakReferencer.h diff --git a/Generator/InteropTests/WinRTComponent/Dll/WinRTComponent.def b/InteropTests/WinRTComponent/Dll/WinRTComponent.def similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/WinRTComponent.def rename to InteropTests/WinRTComponent/Dll/WinRTComponent.def diff --git a/Generator/InteropTests/WinRTComponent/Dll/pch.h b/InteropTests/WinRTComponent/Dll/pch.h similarity index 100% rename from Generator/InteropTests/WinRTComponent/Dll/pch.h rename to InteropTests/WinRTComponent/Dll/pch.h diff --git a/Generator/InteropTests/WinRTComponent/GenerateProjection.cmake b/InteropTests/WinRTComponent/GenerateProjection.cmake similarity index 100% rename from Generator/InteropTests/WinRTComponent/GenerateProjection.cmake rename to InteropTests/WinRTComponent/GenerateProjection.cmake diff --git a/Generator/InteropTests/WinRTComponent/GenerateWinMD.cmake b/InteropTests/WinRTComponent/GenerateWinMD.cmake similarity index 100% rename from Generator/InteropTests/WinRTComponent/GenerateWinMD.cmake rename to InteropTests/WinRTComponent/GenerateWinMD.cmake diff --git a/Generator/InteropTests/WinRTComponent/IDL/Arrays.idl b/InteropTests/WinRTComponent/IDL/Arrays.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/Arrays.idl rename to InteropTests/WinRTComponent/IDL/Arrays.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/ByteBuffers.idl b/InteropTests/WinRTComponent/IDL/ByteBuffers.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/ByteBuffers.idl rename to InteropTests/WinRTComponent/IDL/ByteBuffers.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/Collections.idl b/InteropTests/WinRTComponent/IDL/Collections.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/Collections.idl rename to InteropTests/WinRTComponent/IDL/Collections.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/DateTimes.idl b/InteropTests/WinRTComponent/IDL/DateTimes.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/DateTimes.idl rename to InteropTests/WinRTComponent/IDL/DateTimes.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/Enums.idl b/InteropTests/WinRTComponent/IDL/Enums.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/Enums.idl rename to InteropTests/WinRTComponent/IDL/Enums.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/Errors.idl b/InteropTests/WinRTComponent/IDL/Errors.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/Errors.idl rename to InteropTests/WinRTComponent/IDL/Errors.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/Events.idl b/InteropTests/WinRTComponent/IDL/Events.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/Events.idl rename to InteropTests/WinRTComponent/IDL/Events.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/ForCustomActivationFactoryResolution.idl b/InteropTests/WinRTComponent/IDL/ForCustomActivationFactoryResolution.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/ForCustomActivationFactoryResolution.idl rename to InteropTests/WinRTComponent/IDL/ForCustomActivationFactoryResolution.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/InspectableBoxing.idl b/InteropTests/WinRTComponent/IDL/InspectableBoxing.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/InspectableBoxing.idl rename to InteropTests/WinRTComponent/IDL/InspectableBoxing.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/Int32Wrapper.idl b/InteropTests/WinRTComponent/IDL/Int32Wrapper.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/Int32Wrapper.idl rename to InteropTests/WinRTComponent/IDL/Int32Wrapper.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/InterfaceCasting.idl b/InteropTests/WinRTComponent/IDL/InterfaceCasting.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/InterfaceCasting.idl rename to InteropTests/WinRTComponent/IDL/InterfaceCasting.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/ManualAsyncOperation.idl b/InteropTests/WinRTComponent/IDL/ManualAsyncOperation.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/ManualAsyncOperation.idl rename to InteropTests/WinRTComponent/IDL/ManualAsyncOperation.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/MinimalTypes.idl b/InteropTests/WinRTComponent/IDL/MinimalTypes.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/MinimalTypes.idl rename to InteropTests/WinRTComponent/IDL/MinimalTypes.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/MinimalUnsealedClasses.idl b/InteropTests/WinRTComponent/IDL/MinimalUnsealedClasses.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/MinimalUnsealedClasses.idl rename to InteropTests/WinRTComponent/IDL/MinimalUnsealedClasses.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/NullValues.idl b/InteropTests/WinRTComponent/IDL/NullValues.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/NullValues.idl rename to InteropTests/WinRTComponent/IDL/NullValues.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/Numbers.idl b/InteropTests/WinRTComponent/IDL/Numbers.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/Numbers.idl rename to InteropTests/WinRTComponent/IDL/Numbers.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/ObjectReferencer.idl b/InteropTests/WinRTComponent/IDL/ObjectReferencer.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/ObjectReferencer.idl rename to InteropTests/WinRTComponent/IDL/ObjectReferencer.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/OutputArgument.idl b/InteropTests/WinRTComponent/IDL/OutputArgument.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/OutputArgument.idl rename to InteropTests/WinRTComponent/IDL/OutputArgument.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/OverloadedSum.idl b/InteropTests/WinRTComponent/IDL/OverloadedSum.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/OverloadedSum.idl rename to InteropTests/WinRTComponent/IDL/OverloadedSum.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/ReferenceBoxing.idl b/InteropTests/WinRTComponent/IDL/ReferenceBoxing.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/ReferenceBoxing.idl rename to InteropTests/WinRTComponent/IDL/ReferenceBoxing.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/ReturnArgument.idl b/InteropTests/WinRTComponent/IDL/ReturnArgument.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/ReturnArgument.idl rename to InteropTests/WinRTComponent/IDL/ReturnArgument.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/Strings.idl b/InteropTests/WinRTComponent/IDL/Strings.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/Strings.idl rename to InteropTests/WinRTComponent/IDL/Strings.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/Structs.idl b/InteropTests/WinRTComponent/IDL/Structs.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/Structs.idl rename to InteropTests/WinRTComponent/IDL/Structs.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/SwiftAttributes.idl b/InteropTests/WinRTComponent/IDL/SwiftAttributes.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/SwiftAttributes.idl rename to InteropTests/WinRTComponent/IDL/SwiftAttributes.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/SwiftEnum.idl b/InteropTests/WinRTComponent/IDL/SwiftEnum.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/SwiftEnum.idl rename to InteropTests/WinRTComponent/IDL/SwiftEnum.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/WeakReferencer.idl b/InteropTests/WinRTComponent/IDL/WeakReferencer.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/WeakReferencer.idl rename to InteropTests/WinRTComponent/IDL/WeakReferencer.idl diff --git a/Generator/InteropTests/WinRTComponent/IDL/WinRTComponent.idl b/InteropTests/WinRTComponent/IDL/WinRTComponent.idl similarity index 100% rename from Generator/InteropTests/WinRTComponent/IDL/WinRTComponent.idl rename to InteropTests/WinRTComponent/IDL/WinRTComponent.idl diff --git a/Generator/InteropTests/WinRTComponent/projection.json b/InteropTests/WinRTComponent/projection.json similarity index 100% rename from Generator/InteropTests/WinRTComponent/projection.json rename to InteropTests/WinRTComponent/projection.json diff --git a/Readme.md b/Readme.md index dcfa072..5aa425c 100644 --- a/Readme.md +++ b/Readme.md @@ -24,7 +24,7 @@ Setup your project's build to: 1. Download the latest NuGet package from this repo's [Releases](https://github.com/tristanlabelle/swift-winrt/releases). Eventually those will be pushed to `nuget.org`. 2. Invoke the `SwiftWinRT.exe` located in the NuGet package, specifying: - The Windows SDK and WinMD files to be projected. - - A `projection.json` file to describe the modules to generate, which assemblies should contribute to each of them, and which types to include. Refer to [this example](https://github.com/tristanlabelle/swift-winrt/blob/main/InteropTests/projection.json). + - A `projection.json` file to describe the modules to generate, which assemblies should contribute to each of them, and which types to include. Refer to [this example](InteropTests/projection.json). - An output directory path. 3. Reference and build the support module under the `swift` subdirectory of the NuGet package. 4. Reference and build the generated code modules. For each module specified in `projection.json`, there should be an assembly module (with projected types), an ABI module (with C code) and any number of namespace modules (with type aliases for convenience).