134 lines
7.4 KiB
XML
134 lines
7.4 KiB
XML
<Project>
|
|
<PropertyGroup>
|
|
<UnitTestFxProject>$(RepositoryRoot)src\Framework\Framework.UnitTests\Framework.UnitTests.csproj</UnitTestFxProject>
|
|
<UnitTestFxProject>$([MSBuild]::NormalizePath($(UnitTestFxProject)))</UnitTestFxProject>
|
|
<CodeSignDependsOn Condition="'$(_ProjectsOnly)' != 'true'">$(CodeSignDependsOn);GetSharedFxFilesToSign</CodeSignDependsOn>
|
|
<BuildSharedFxDependsOn>_BuildSharedFxProjects;TestSharedFx</BuildSharedFxDependsOn>
|
|
<BuildSharedFxDependsOn Condition="'$(TestOnly)' != 'true'">$(BuildSharedFxDependsOn);CodeSign</BuildSharedFxDependsOn>
|
|
<RedistNetCorePath>$(IntermediateDir)ar\$(SharedFxRid)\</RedistNetCorePath>
|
|
<GetArtifactInfoDependsOn>$(GetArtifactInfo);GetFxProjectArtifactInfo</GetArtifactInfoDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<FxProjectToBuild Include="$(RepositoryRoot)src\Framework\**\*.pkgproj" />
|
|
<FxProjectToBuild Include="$(RepositoryRoot)src\Framework\**\*.shfxproj" />
|
|
<FxProjectToBuild Include="$(UnitTestFxProject)" />
|
|
<FxProjectToBuild Condition=" '$(BuildRuntimeArchive)' != 'false' " Include="$(RepositoryRoot)src\Installers\Archive\*.*proj" />
|
|
<FxProjectToBuild Condition=" '$(SharedFxRid)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'deb' " Include="$(RepositoryRoot)src\Installers\Debian\*.*proj" />
|
|
<FxProjectToBuild Condition=" '$(SharedFxRid)' == 'linux-x64' AND '$(LinuxInstallerType)' == 'rpm' " Include="$(RepositoryRoot)src\Installers\Rpm\*.*proj" />
|
|
</ItemGroup>
|
|
|
|
<Target Name="BuildSharedFx" DependsOnTargets="$(BuildSharedFxDependsOn)" />
|
|
|
|
<Target Name="GetSharedFxFilesToSign">
|
|
<ItemGroup>
|
|
<FilesToSign Include="$(ArtifactsDir)$(Configuration)\installers\aspnetcore-runtime-$(PackageVersion)-$(SharedFxRid).zip" Certificate="None" />
|
|
<FilesToSign Include="$(ArtifactsDir)$(Configuration)\installers\aspnetcore-runtime-internal-$(PackageVersion)-$(SharedFxRid).zip" Certificate="None" />
|
|
<FilesToSign Include="$(BuildDir)Microsoft.AspNetCore.App.$(PackageVersion).nupkg" Certificate="$(PackageSigningCertName)" />
|
|
<FilesToSign Include="$(BuildDir)Microsoft.AspNetCore.All.$(PackageVersion).nupkg" Certificate="$(PackageSigningCertName)" />
|
|
<FilesToSign Include="$(BuildDir)runtime.$(SharedFxRid).Microsoft.AspNetCore.App.$(PackageVersion).nupkg" Certificate="$(PackageSigningCertName)" />
|
|
<FilesToSign Include="$(BuildDir)runtime.$(SharedFxRid).Microsoft.AspNetCore.All.$(PackageVersion).nupkg" Certificate="$(PackageSigningCertName)" />
|
|
<FilesToSign Include="$(BuildDir)runtime.$(SharedFxRid).Microsoft.AspNetCore.App.$(PackageVersion).symbols.nupkg" Certificate="$(PackageSigningCertName)" />
|
|
<FilesToSign Include="$(BuildDir)runtime.$(SharedFxRid).Microsoft.AspNetCore.All.$(PackageVersion).symbols.nupkg" Certificate="$(PackageSigningCertName)" />
|
|
</ItemGroup>
|
|
|
|
<!-- These files should already be signed by the .NET Core team. They have to be listed again here because we recreate a redistributable which includes the Microsoft.NETCore.App runtime. -->
|
|
<ItemGroup>
|
|
<FilesToExcludeFromSigning Include="$(RedistNetCorePath)shared\Microsoft.NETCore.App\**\*.dll" />
|
|
<FilesToExcludeFromSigning Include="$(RedistNetCorePath)host\**\*.dll" />
|
|
<FilesToExcludeFromSigning Include="$(RedistNetCorePath)dotnet.exe" />
|
|
</ItemGroup>
|
|
|
|
</Target>
|
|
|
|
<Target Name="_BuildSharedFxProjects" DependsOnTargets="GeneratePropsFiles;ResolveCommitHash">
|
|
|
|
<PropertyGroup>
|
|
<_RestoreGraphProjectInput>@(FxProjectToBuild)</_RestoreGraphProjectInput>
|
|
<SharedFxBuildProperties>
|
|
$(BuildProperties);
|
|
SharedFxRid=$(SharedFxRid);
|
|
DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath);
|
|
DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath)
|
|
</SharedFxBuildProperties>
|
|
</PropertyGroup>
|
|
|
|
<MSBuild Projects="$(MSBuildToolsPath)\NuGet.targets"
|
|
Targets="Restore"
|
|
Properties="$(SharedFxBuildProperties);RestoreGraphProjectInput=$(_RestoreGraphProjectInput);_DummyTarget=Restore" />
|
|
|
|
<MSBuild Projects="@(FxProjectToBuild)"
|
|
Properties="$(SharedFxBuildProperties)"
|
|
BuildInParallel="true" />
|
|
|
|
<MSBuild Projects="@(FxProjectToBuild)"
|
|
Targets="Pack"
|
|
Properties="$(SharedFxBuildProperties);NoBuild=true"
|
|
BuildInParallel="true"
|
|
SkipNonexistentTargets="true" />
|
|
</Target>
|
|
|
|
<Target Name="TestSharedFx" DependsOnTargets="GeneratePropsFiles;InstallDotNet">
|
|
|
|
<PropertyGroup>
|
|
<!-- The file path to the log file, from within the container -->
|
|
<UnitTestFxTrxLogFile>$(LogOutputDir)SharedFx-UnitTests-$(Version).trx</UnitTestFxTrxLogFile>
|
|
<!-- The trx file path from the perspective of the TeamCity agent -->
|
|
<UnitTestFxTrxPhysicalFilePath>$(UnitTestFxTrxLogFile)</UnitTestFxTrxPhysicalFilePath>
|
|
<UnitTestFxTrxPhysicalFilePath Condition="'$(HostMachineRepositoryRoot)' != ''">$(HostMachineRepositoryRoot)/artifacts/logs/SharedFx-UnitTests.trx</UnitTestFxTrxPhysicalFilePath>
|
|
</PropertyGroup>
|
|
|
|
<MSBuild Projects="$(UnitTestFxProject)" Targets="GetTargetPath" Properties="$(BuildProperties)">
|
|
<Output TaskParameter="TargetOutputs" ItemName="SharedFxTestAssembly" />
|
|
</MSBuild>
|
|
|
|
<RunDotNet
|
|
IgnoreStandardErrorWarningFormat="true"
|
|
IgnoreExitCode="true"
|
|
Arguments="vstest;
|
|
--Framework:%(TargetFrameworkIdentifier),Version=v%(TargetFrameworkVersion);
|
|
--Logger:$([MSBuild]::Escape('trx;LogFileName=$(UnitTestFxTrxLogFile)'));
|
|
%(SharedFxTestAssembly.Identity);
|
|
--;RunConfiguration.NoAutoReporters=true">
|
|
<Output TaskParameter="ExitCode" PropertyName="VsTestExitCode" />
|
|
</RunDotNet>
|
|
|
|
<Message Text="##teamcity[importData type='vstest' path='$(UnitTestFxTrxPhysicalFilePath)']"
|
|
Importance="High"
|
|
Condition="'$(TEAMCITY_VERSION)' != '' AND Exists('$(UnitTestFxTrxLogFile)')" />
|
|
<Error Text="SharedFx.UnitTests failed with exit code '$(VsTestExitCode)'." Condition=" $(VsTestExitCode) != 0 " />
|
|
</Target>
|
|
|
|
<Target Name="GetFxProjectArtifactInfo" Returns="@(ArtifactInfo)">
|
|
<PropertyGroup>
|
|
<_InspectionTargetsFile>$(MSBuildProjectDirectory)\Project.Inspection.targets</_InspectionTargetsFile>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<_Temp Remove="@(_Temp)" />
|
|
</ItemGroup>
|
|
|
|
<MSBuild Targets="GetArtifactInfo"
|
|
Projects="@(FxProjectToBuild)"
|
|
Condition="@(FxProjectToBuild->Count()) != 0"
|
|
Properties="$(BuildProperties);DesignTimeBuild=true;EnableApiCheck=false;NoBuild=true;CustomAfterMicrosoftCommonTargets=$(_InspectionTargetsFile);CustomAfterMicrosoftCommonCrossTargetingTargets=$(_InspectionTargetsFile)"
|
|
BuildInParallel="$(BuildInParallel)"
|
|
RemoveProperties="$(_BuildPropertiesToRemove)">
|
|
|
|
<Output TaskParameter="TargetOutputs" ItemName="_Temp" />
|
|
</MSBuild>
|
|
|
|
<ItemGroup>
|
|
<!-- Output from this target may include items representing assemblies inside the nupkg. -->
|
|
<ArtifactInfo Include="@(_Temp)" Condition="'%(_Temp.Container)' == ''" />
|
|
|
|
<!-- Nupkgs or assemblies in the nupkg that should be signed -->
|
|
<FilesToSign Include="@(_Temp)" Condition=" '%(_Temp.ShouldBeSigned)' == 'true' " />
|
|
|
|
<!-- Nupkgs or assemblies in the nupkg that should not be signed -->
|
|
<FilesToExcludeFromSigning Include="@(_Temp)" Condition=" '%(_Temp.ShouldBeSigned)' != 'true' " />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
</Project>
|