|
7 | 7 | </PropertyGroup>
|
8 | 8 |
|
9 | 9 | <Target Name="PublishPackagingTestProject" BeforeTargets="BeforeBuild">
|
10 |
| - <ItemGroup> |
11 |
| - <PackagingTestProject Include="PackagingTests/PackagingTestProject.csproj" /> |
12 |
| - |
13 |
| - <PackagingTestProject> |
14 |
| - <TestOutputPath>$(OutputPath)%(FileName)</TestOutputPath> |
15 |
| - </PackagingTestProject> |
16 |
| - </ItemGroup> |
17 |
| - |
18 | 10 | <PropertyGroup>
|
19 | 11 | <Test_Configuration>$(Configuration)</Test_Configuration>
|
20 | 12 | <Test_TargetFramework>$(NetCoreAppCurrent)</Test_TargetFramework>
|
21 | 13 | <Test_RuntimeIdentifier>$(TargetOS)-$(TargetArchitecture)</Test_RuntimeIdentifier>
|
22 | 14 | <Test_RestoreSource>$(ArtifactsShippingPackagesDir)</Test_RestoreSource>
|
23 | 15 | <Test_RestorePackagesPath>$([MSBuild]::NormalizeDirectory('$(PackageOutputPath)', 'packages', '$(Configuration)'))</Test_RestorePackagesPath>
|
| 16 | + <Test_HostPackageRuntimeIdentifier>$(NETCoreSdkPortableRuntimeIdentifier.Replace('-$(BuildArchitecture)', '-$(IlcHostArch)'))</Test_HostPackageRuntimeIdentifier> |
24 | 17 | </PropertyGroup>
|
25 | 18 |
|
| 19 | + <ItemGroup> |
| 20 | + <PackagingTestProject Include="PackagingTests/PackagingTestProject.csproj"> |
| 21 | + <BuildProperties> |
| 22 | + Test_Configuration=$(Test_Configuration); |
| 23 | + Test_TargetFramework=$(Test_TargetFramework); |
| 24 | + Test_RuntimeIdentifier=$(Test_RuntimeIdentifier); |
| 25 | + Test_PackageVersion=$(NetCoreAppCurrentVersion).0-*; |
| 26 | + Test_RestoreSource=$(Test_RestoreSource); |
| 27 | + Test_RestorePackagesPath=$(Test_RestorePackagesPath); |
| 28 | + Test_HostPackageRuntimeIdentifier=$(Test_HostPackageRuntimeIdentifier); |
| 29 | + _hostArchitecture=$(IlcHostArch); <!-- Override host package resolution in ILC targets. --> |
| 30 | + </BuildProperties> |
| 31 | + </PackagingTestProject> |
| 32 | + <PackagingTestProject OutputPathRoot="$(OutputPath)%(FileName)/" /> |
| 33 | + <PackagingTestProject BuildProperties="Test_TestOutputPath=%(OutputPathRoot);%(BuildProperties)" /> |
| 34 | + |
| 35 | + <SampleProject Include="$(RepoRoot)samples/HelloWorld/HelloWorld.csproj; |
| 36 | + $(RepoRoot)samples/NativeLibrary/NativeLibrary.csproj"> |
| 37 | + <BuildProperties> |
| 38 | + Configuration=$(Test_Configuration); |
| 39 | + RuntimeIdentifier=$(Test_RuntimeIdentifier); |
| 40 | + </BuildProperties> |
| 41 | + </SampleProject> |
| 42 | + <SampleProject OutputPathRoot="%(RootDir)%(Directory)" /> |
| 43 | + |
| 44 | + <PackagingTestProject Include="@(SampleProject)" |
| 45 | + Condition="'$(Test_HostPackageRuntimeIdentifier)' == '$(NETCoreSdkPortableRuntimeIdentifier)'" /> |
| 46 | + </ItemGroup> |
| 47 | + |
26 | 48 | <Error Condition="!Exists($(Test_RestoreSource))"
|
27 | 49 | Text="The 'nativeaot.packages' subset must be built before building this project" />
|
28 | 50 |
|
|
35 | 57 | before "./build nativeaot.packages" because the pkgproj targets do
|
36 | 58 | not declare their inputs properly. -->
|
37 | 59 | <RemoveDir Directories="$(Test_RestorePackagesPath)" />
|
38 |
| - <RemoveDir Directories="@(PackagingTestProject->'%(TestOutputPath)')" /> |
39 |
| - |
40 |
| - <PropertyGroup> |
41 |
| - <PackagingTestProjectProperties> |
42 |
| - Test_Configuration=$(Test_Configuration); |
43 |
| - Test_TargetFramework=$(Test_TargetFramework); |
44 |
| - Test_RuntimeIdentifier=$(Test_RuntimeIdentifier); |
45 |
| - Test_PackageVersion=$(NetCoreAppCurrentVersion).0-*; |
46 |
| - Test_RestoreSource=$(Test_RestoreSource); |
47 |
| - Test_RestorePackagesPath=$(Test_RestorePackagesPath); |
48 |
| - Test_HostPackageRuntimeIdentifier=$(NETCoreSdkPortableRuntimeIdentifier.Replace('-$(BuildArchitecture)', '-$(IlcHostArch)')); |
49 |
| - _hostArchitecture=$(IlcHostArch); <!-- Override host package resolution in ILC targets. --> |
50 |
| - </PackagingTestProjectProperties> |
51 |
| - </PropertyGroup> |
| 60 | + <RemoveDir Directories="%(PackagingTestProject.OutputPathRoot)bin; |
| 61 | + %(PackagingTestProject.OutputPathRoot)obj" /> |
52 | 62 |
|
53 | 63 | <MSBuild Projects="@(PackagingTestProject)"
|
54 | 64 | Targets="Restore"
|
55 |
| - Properties="$(PackagingTestProjectProperties); |
56 |
| - Test_TestOutputPath=%(TestOutputPath); |
| 65 | + Properties="%(BuildProperties); |
57 | 66 | MSBuildRestoreSessionId=$([System.Guid]::NewGuid())" />
|
58 | 67 |
|
59 | 68 | <MSBuild Projects="@(PackagingTestProject)"
|
60 | 69 | Targets="Publish"
|
61 |
| - Properties="$(PackagingTestProjectProperties); |
62 |
| - Test_TestOutputPath=%(TestOutputPath)" /> |
| 70 | + Properties="%(BuildProperties)" /> |
63 | 71 |
|
64 |
| - <Error Condition="!Exists('%(TestOutputPath)/bin/$(Test_Configuration)/$(Test_TargetFramework)/$(Test_RuntimeIdentifier)/publish/%(FileName).wasm')" |
| 72 | + <Error Condition="!Exists('%(OutputPathRoot)/bin/$(Test_Configuration)/$(Test_TargetFramework)/$(Test_RuntimeIdentifier)/publish/%(FileName).wasm')" |
65 | 73 | Text="%(PackagingTestProject.FullPath) did not produce the expected native artifacts" />
|
66 | 74 | </Target>
|
67 | 75 | </Project>
|
0 commit comments