|
105 | 105 | already publishing the project, so we just need to copy the .dll to the output. |
106 | 106 | --> |
107 | 107 | <PropertyGroup Condition="'$(Configuration)' == 'Release' and '$(Platform)' == 'x64'"> |
108 | | - <PropertyGroup> |
109 | | - <NativeLibraryProjectName>AuthoringTest</NativeLibraryProjectName> |
110 | | - <NativeLibraryProjectDirectory>$(MSBuildThisFileDirectory)..\$(NativeLibraryProjectName)\</NativeLibraryProjectDirectory> |
111 | | - <NativeLibraryProjectFilePath>$(NativeLibraryProjectDirectory)$(NativeLibraryProjectName).csproj</NativeLibraryProjectFilePath> |
112 | | - <NativeLibraryPublishFolder>$(NativeLibraryProjectDirectory)bin\$(Configuration)\net8.0\win-$(Platform)\publish\</NativeLibraryPublishFolder> |
113 | | - <NativeLibraryPublishedDllPath>$(NativeLibraryPublishFolder)$(NativeLibraryProjectName).dll</NativeLibraryPublishedDllPath> |
114 | | - </PropertyGroup> |
| 108 | + <NativeLibraryProjectName>AuthoringTest</NativeLibraryProjectName> |
| 109 | + <NativeLibraryProjectDirectory>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\$(NativeLibraryProjectName)'))\</NativeLibraryProjectDirectory> |
| 110 | + <NativeLibraryProjectFilePath>$(NativeLibraryProjectDirectory)$(NativeLibraryProjectName).csproj</NativeLibraryProjectFilePath> |
| 111 | + <NativeLibraryOutputFolder>$(NativeLibraryProjectDirectory)bin\$(Platform)\$(Configuration)\net8.0\</NativeLibraryOutputFolder> |
| 112 | + <NativeLibraryDllPath>$(NativeLibraryOutputFolder)$(NativeLibraryProjectName).dll</NativeLibraryDllPath> |
| 113 | + <NativeLibraryPublishFolder>$(NativeLibraryProjectDirectory)bin\$(Platform)\$(Configuration)\net8.0\win-$(Platform)\publish\</NativeLibraryPublishFolder> |
| 114 | + <NativeLibraryPublishedDllPath>$(NativeLibraryPublishFolder)$(NativeLibraryProjectName).dll</NativeLibraryPublishedDllPath> |
| 115 | + </PropertyGroup> |
| 116 | + |
| 117 | + <Target Name="CsWinRTLink" DependsOnTargets="ComputeLinkSwitches" BeforeTargets="Link" |
| 118 | + Condition="'$(Configuration)' == 'Release' and '$(Platform)' == 'x64'" |
| 119 | + Inputs="$(NativeLibraryDllPath)" |
| 120 | + Outputs="@(ReferenceCopyLocalPaths)"> |
| 121 | + <!-- Publish the managed library with NativeAOT --> |
| 122 | + <MSBuild Projects="$(NativeLibraryProjectFilePath)" Targets="Publish" Properties="Configuration=$(Configuration);Platform=$(Platform);RuntimeIdentifier=win-$(Platform);TargetFramework=net8.0" /> |
115 | 123 |
|
116 | 124 | <!-- Copy the .dll to our output folder --> |
117 | | - <Copy SourceFiles="$(NativeLibraryPublishedDllPath)" DestinationFolder="$(OutputPath)" /> |
118 | | - </PropertyGroup> |
| 125 | + <ItemGroup> |
| 126 | + <ReferenceCopyLocalPaths Remove="$(NativeLibraryDllPath)"/> |
| 127 | + <ReferenceCopyLocalPaths Include="$(NativeLibraryPublishedDllPath)"/> |
| 128 | + </ItemGroup> |
| 129 | + |
| 130 | + </Target> |
119 | 131 |
|
120 | 132 | <ItemGroup> |
121 | 133 | <Reference Include="AuthoringTest"> |
|
0 commit comments