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