dotnet-installer/build/test/TestPackageProjects.targets
Justin Goshi 51562109ea Migrate test packages (#4720)
* Migrate TestPackages

* Add check for desktop available

* Revert previous change

* WIP try something for non-Windows

* Another attempt to pack properly on non-windows

* Another attempt to fix pack errors

* Remove spaces

* Another attempt to make pack work cross-platform
2016-11-15 12:12:28 -10:00

212 lines
No EOL
9.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="SetupTestPackageProjectData"
DependsOnTargets="AssociateSourceFilesWithProjects;
AssociateOutputsWithProjects;">
<ItemGroup>
<TestPackageProject>
<NuPkgName Condition=" '%(NuPkgName)' == '' ">%(Name)</NuPkgName>
</TestPackageProject>
<TestPackageProject>
<PackInputs>%(BuildOutputs)</PackInputs>
<PackOutputs>$(TestPackagesDir)%(NuPkgName).%(VersionPrefix)%(VersionSuffix).nupkg</PackOutputs>
</TestPackageProject>
</ItemGroup>
</Target>
<Target Name="AssociateOutputsWithProjects"
DependsOnTargets="SetupTestPackageProjectFrameworks"
Outputs="%(TestPackageProject.ProjectPath)">
<ItemGroup>
<TestPackageProject>
<BuildOutputs>%(TestPackageProject.OutputPath)%(TestPackageProject.Name).dll</BuildOutputs>
</TestPackageProject>
</ItemGroup>
</Target>
<Target Name="SetupTestPackageProjectFrameworks"
DependsOnTargets="SetupTestPackageProjectBaseData;
AssociateSourceFilesWithProjects;"
Outputs="%(TestPackageProjectFrameworks.Identity)">
<PropertyGroup>
<CurrentBuildFramework>%(TestPackageProjectFrameworks.Identity)</CurrentBuildFramework>
</PropertyGroup>
<ItemGroup>
<TestPackageProject Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(Frameworks)', '(^|;)$(CurrentBuildFramework)($|;)'))"
Include="@(BaseTestPackageProject)">
<Framework>$(CurrentBuildFramework)</Framework>
<Runtime Condition=" '$(CurrentBuildFramework)' == 'net45' Or '$(CurrentBuildFramework)' == 'net451' ">$(CoreCLRRid)</Runtime>
<OutputPath>%(OutputPath)$(CurrentBuildFramework)/</OutputPath>
</TestPackageProject>
</ItemGroup>
</Target>
<Target Name="AssociateSourceFilesWithProjects"
DependsOnTargets="FindSourceFiles"
Outputs="%(BaseTestPackageProject.ProjectPath)">
<PropertyGroup>
<CurrentProject>%(BaseTestPackageProject.ProjectPath)</CurrentProject>
</PropertyGroup>
<ItemGroup>
<BaseTestPackageProject Condition=" '%(ProjectPath)' == '$(CurrentProject)' ">
<BuildInputs>@(__TestPackageProjectInputs)</BuildInputs>
</BaseTestPackageProject>
</ItemGroup>
</Target>
<Target Name="FindSourceFiles"
DependsOnTargets="SetupTestPackageProjectBaseData;"
Outputs="%(BaseTestPackageProject.Identity)">
<ItemGroup>
<__TestPackageProjectInputs Include="%(BaseTestPackageProject.BuildInputIncludeFilter)"
Exclude="%(BaseTestPackageProject.BuildInputExcludeFilter)">
<ProjectPath>%(BaseTestPackageProject.ProjectPath)</ProjectPath>
</__TestPackageProjectInputs>
</ItemGroup>
</Target>
<Target Name="SetupTestPackageProjectBaseData">
<ItemGroup>
<BaseTestPackageProject Include="TestAssets/TestPackages/PackageWithFakeNativeDep">
<Name>PackageWithFakeNativeDep</Name>
<ProjectName>PackageWithFakeNativeDep.csproj</ProjectName>
<IsTool>False</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Clean>True</Clean>
<Frameworks>net45</Frameworks>
<PackRuntime>$(CoreCLRRid)</PackRuntime>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-dependency-context-test">
<Name>dotnet-dependency-context-test</Name>
<ProjectName>dotnet-dependency-context-test.csproj</ProjectName>
<IsTool>True</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0-rc-</VersionPrefix>
<VersionSuffix>rc-$(TestPackageBuildVersionSuffix)</VersionSuffix>
<Clean>True</Clean>
<Frameworks>netcoreapp1.0</Frameworks>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-dependency-tool-invoker">
<Name>dotnet-dependency-tool-invoker</Name>
<ProjectName>dotnet-dependency-tool-invoker.csproj</ProjectName>
<IsTool>True</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0-rc-</VersionPrefix>
<VersionSuffix>rc-$(TestPackageBuildVersionSuffix)</VersionSuffix>
<Clean>True</Clean>
<Frameworks>netcoreapp1.0</Frameworks>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-desktop-and-portable">
<Name>dotnet-desktop-and-portable</Name>
<ProjectName>dotnet-desktop-and-portable.csproj</ProjectName>
<IsTool>True</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0-rc-</VersionPrefix>
<VersionSuffix>rc-$(TestPackageBuildVersionSuffix)</VersionSuffix>
<Clean>True</Clean>
<Frameworks>net451;netcoreapp1.0</Frameworks>
<PackRuntime>$(CoreCLRRid)</PackRuntime>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-desktop-binding-redirects"
Condition=" '$(IsDesktopAvailable)' == 'True' ">
<Name>dotnet-desktop-binding-redirects</Name>
<ProjectName>dotnet-desktop-binding-redirects.csproj</ProjectName>
<IsTool>True</IsTool>
<IsMsbuild>True</IsMsbuild>
<IsApplicable>$(DesktopAvailable)</IsApplicable>
<VersionPrefix>1.0.0-rc-</VersionPrefix>
<VersionSuffix>rc-$(TestPackageBuildVersionSuffix)</VersionSuffix>
<Clean>True</Clean>
<Frameworks>net451</Frameworks>
<PackRuntime>$(CoreCLRRid)</PackRuntime>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello">
<Name>dotnet-hello</Name>
<ProjectName>dotnet-hello.csproj</ProjectName>
<IsTool>True</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Clean>True</Clean>
<Frameworks>netcoreapp1.0</Frameworks>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello">
<Name>dotnet-hello</Name>
<ProjectName>dotnet-hello.csproj</ProjectName>
<IsTool>True</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Clean>True</Clean>
<Frameworks>netcoreapp1.0</Frameworks>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-portable">
<Name>dotnet-portable</Name>
<ProjectName>dotnet-portable.csproj</ProjectName>
<IsTool>True</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Clean>True</Clean>
<Frameworks>netcoreapp1.0</Frameworks>
</BaseTestPackageProject>
<BaseTestPackageProject Include="TestAssets/TestPackages/ToolWithOutputName">
<Name>dotnet-tool-with-output-name</Name>
<ProjectName>ToolWithOutputName.csproj</ProjectName>
<NuPkgName>ToolWithOutputName</NuPkgName>
<IsTool>True</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Clean>True</Clean>
<Frameworks>netcoreapp1.0</Frameworks>
</BaseTestPackageProject>
<BaseTestPackageProject Include="src/Microsoft.DotNet.Cli.Utils">
<Name>Microsoft.DotNet.Cli.Utils</Name>
<ProjectName>Microsoft.DotNet.Cli.Utils.csproj</ProjectName>
<IsTool>True</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>1.0.0-preview4-</VersionPrefix>
<VersionSuffix>preview4-$(TestPackageBuildVersionSuffix)</VersionSuffix>
<Clean>False</Clean>
<Frameworks>netstandard1.5</Frameworks>
</BaseTestPackageProject>
<BaseTestPackageProject Include="src/Microsoft.DotNet.InternalAbstractions">
<Name>Microsoft.DotNet.InternalAbstractions</Name>
<ProjectName>Microsoft.DotNet.InternalAbstractions.csproj</ProjectName>
<IsTool>True</IsTool>
<IsApplicable>True</IsApplicable>
<VersionPrefix>2.0.0-beta-</VersionPrefix>
<VersionSuffix>beta-$(TestPackageBuildVersionSuffix)</VersionSuffix>
<Clean>False</Clean>
<Frameworks>netstandard1.3</Frameworks>
</BaseTestPackageProject>
<TestPackageProjectFrameworksExcludes Condition=" '$(IsDesktopAvailable)' != 'True' " Include="net45" />
<TestPackageProjectFrameworksExcludes Condition=" '$(IsDesktopAvailable)' != 'True' " Include="net451" />
<TestPackageProjectFrameworks Include="%(BaseTestPackageProject.Frameworks)" Exclude="@(TestPackageProjectFrameworksExcludes)" />
<BaseTestPackageProject>
<ProjectDir>$(RepoRoot)%(Identity)/</ProjectDir>
<OutputPath>$(TestPackagesBuildDir)%(Identity)/bin/$(Configuration)/</OutputPath>
</BaseTestPackageProject>
<BaseTestPackageProject>
<ProjectPath>%(ProjectDir)%(ProjectName)</ProjectPath>
<BuildInputIncludeFilter>%(ProjectDir)**/*.*</BuildInputIncludeFilter>
<BuildInputExcludeFilter>%(ProjectDir)bin/**/*.*;%(ProjectDir)obj/**/*.*</BuildInputExcludeFilter>
</BaseTestPackageProject>
</ItemGroup>
</Target>
<ItemDefinitionGroup>
<BaseTestPackageProject>
<NuPkgName>%(Name)</NuPkgName>
</BaseTestPackageProject>
</ItemDefinitionGroup>
</Project>