dotnet-installer/src/redist/redist.csproj

247 lines
10 KiB
XML
Raw Normal View History

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
<Import Project="$(RepoRoot)/build/compile/LzmaArchive.targets" />
<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
2017-01-26 03:19:44 +00:00
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
2017-01-26 03:19:44 +00:00
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.4</PackageTargetFallback>
2017-02-27 19:06:44 +00:00
<PublishDir>$(SdkOutputDirectory)</PublishDir>
<VersionSuffix>$(CommitCount)</VersionSuffix>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />
<PackageReference Include="Microsoft.Build.Runtime" Version="$(CLI_MSBuild_Version)" />
<PackageReference Include="NuGet.Build.Tasks" Version="$(CLI_NuGet_Version)" />
<PackageReference Include="Microsoft.TestPlatform.CLI" Version="$(CLI_TestPlatform_Version)" />
<PackageReference Include="Microsoft.TestPlatform.Build" Version="$(CLI_TestPlatform_Version)" />
</ItemGroup>
2017-01-26 03:19:44 +00:00
<ItemGroup>
<ProjectReference Include="..\dotnet\dotnet.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Archive\Microsoft.DotNet.Archive.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Cli.Sln.Internal\Microsoft.DotNet.Cli.Sln.Internal.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Configurer\Microsoft.DotNet.Configurer.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.ProjectJsonMigration\Microsoft.DotNet.ProjectJsonMigration.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.TestFramework\Microsoft.DotNet.TestFramework.csproj" />
<ProjectReference Include="..\tool_msbuild\tool_msbuild.csproj" />
<ProjectReference Include="..\tool_nuget\tool_nuget.csproj" />
</ItemGroup>
<Target Name="PublishSharedFramework"
BeforeTargets="Publish">
<ItemGroup>
<SharedFramework Remove="*" />
<SharedFramework Include="$(SharedFrameworkPublishDirectory)/**/*" />
</ItemGroup>
<Copy SourceFiles="@(SharedFramework)"
2017-02-27 19:06:44 +00:00
DestinationFiles="@(SharedFramework->'$(OutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<Target Name="PublishVersionFile"
BeforeTargets="Publish">
2017-02-28 08:38:27 +00:00
<WriteLinesToFile File="$(PublishDir)/.version"
Lines="$(CommitHash);$(SdkVersion);$(Rid)"
Overwrite="true" />
</Target>
<Target Name="PublishRoslyn"
BeforeTargets="Publish">
<DotNetPublish ToolPath="$(Stage0Directory)"
Configuration="$(Configuration)"
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />
</Target>
<Target Name="GenerateCliRuntimeConfigurationFiles"
AfterTargets="Publish">
<RemoveAssetFromDepsPackages DepsFile="$(PublishDir)/$(TargetName).deps.json"
SectionName="runtime"
AssetPath="%(BundledToolProjects.Identity).dll" />
<Copy SourceFiles="$(PublishDir)/$(TargetName).deps.json"
2017-02-28 08:38:27 +00:00
DestinationFiles="$(PublishDir)/%(BundledTools.Identity).deps.json" />
<Copy SourceFiles="$(PublishDir)/$(TargetName).runtimeconfig.json"
2017-02-28 08:38:27 +00:00
DestinationFiles="$(PublishDir)/%(BundledTools.Identity).runtimeconfig.json" />
<Delete Files="$(PublishDir)/$(TargetName).deps.json;
$(PublishDir)/$(TargetName).runtimeconfig.json;
$(PublishDir)/%(BundledToolProjects.Identity).dll" />
<ChangeEntryPointLibraryName
2017-02-28 08:38:27 +00:00
DepsFile="$(PublishDir)/%(BundledTools.Identity).deps.json"
NewName="%(BundledTools.Identity).deps.json" />
</Target>
<Target Name="PublishMSBuildExtensions"
2017-02-23 18:25:28 +00:00
AfterTargets="Publish"
BeforeTargets="GenerateCliRuntimeConfigurationFiles">
<Copy SourceFiles="@(MSBuildExtensionsContent)"
2017-02-28 02:48:05 +00:00
DestinationFolder="$(PublishDir)/%(RecursiveDir)" />
2017-02-23 10:46:05 +00:00
2017-02-27 23:40:11 +00:00
<PropertyGroup>
2017-02-28 02:48:05 +00:00
<MSBuildTargetsDirectory>$(PublishDir)/runtimes/any/native</MSBuildTargetsDirectory>
2017-02-27 23:40:11 +00:00
</PropertyGroup>
2017-02-23 10:46:05 +00:00
<ItemGroup>
<NuPkgContentForMSBuildExtensions Include="$(MSBuildTargetsDirectory)/**/*.targets;
$(MSBuildTargetsDirectory)/**/*.props;
$(MSBuildTargetsDirectory)/**/*.overridetasks;
$(MSBuildTargetsDirectory)/**/*.tasks" />
<NuPkgContentForMSBuildExtensionsRelativePaths Include="@(NuPkgContentForMSBuildExtensions->'runtimes/any/native/%(RecursiveDir)%(Filename)%(Extension)')" />
2017-02-23 10:46:05 +00:00
</ItemGroup>
2017-02-28 02:19:06 +00:00
<Move SourceFiles="@(NuPkgContentForMSBuildExtensions)"
2017-02-28 02:48:05 +00:00
DestinationFiles="@(NuPkgContentForMSBuildExtensions->'$(PublishDir)/%(RecursiveDir)%(Filename)%(Extension)')" />
2017-02-28 02:19:06 +00:00
2017-02-23 18:25:28 +00:00
<RemoveAssetFromDepsPackages DepsFile="$(PublishDir)/$(TargetName).deps.json"
2017-02-27 18:20:01 +00:00
SectionName="runtimeTargets"
AssetPath="%(NuPkgContentForMSBuildExtensionsRelativePaths.Identity)" />
</Target>
2017-02-28 08:38:27 +00:00
<Target Name="PublishSdks"
AfterTargets="Publish">
<ItemGroup>
<SdksToBundle Include="$(RepoRoot)/build/BundledSdks.proj">
<Properties>
CLIBuildDll=$(CLIBuildDll);
NuGetPackagesDir=$(NuGetPackagesDir);
SdkLayoutDirectory=$(SdkOutputDirectory)/Sdks/%(BundledSdk.Identity);
SdkPackageName=%(BundledSdk.Identity);
SdkPackageVersion=%(BundledSdk.Version);
2017-03-01 08:46:13 +00:00
Stage0Directory=$(Stage0Directory)
</Properties>
</SdksToBundle>
</ItemGroup>
<MSBuild
BuildInParallel="False"
Projects="@(SdksToBundle)">
</MSBuild>
</Target>
<Target Name="PublishTemplates"
AfterTargets="Publish">
<ItemGroup>
<TemplatesToBundle Include="$(RepoRoot)/build/BundledTemplates.proj">
<Properties>
TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates;
TemplatePackageName=%(BundledTemplate.Identity);
TemplatePackageVersion=%(BundledTemplate.Version);
2017-03-01 08:46:13 +00:00
Stage0Directory=$(Stage0Directory)
</Properties>
</TemplatesToBundle>
</ItemGroup>
<MSBuild
BuildInParallel="False"
Projects="@(TemplatesToBundle)">
</MSBuild>
</Target>
<Target Name="PublishLzmaArchive"
DependsOnTargets="GetNuGetPackagesArchive"
AfterTargets="Publish">
</Target>
2017-02-28 08:38:27 +00:00
<Target Name="CrossgenPublishDir"
Condition=" '$(DISABLE_CROSSGEN)' == '' "
AfterTargets="PublishMSBuildExtensions">
<ItemGroup>
<NETCore10Assemblies Include="$(PublishDir)/System.ComponentModel.Primitives.dll;
$(PublishDir)/System.Collections.Specialized.dll;
$(PublishDir)/System.Collections.NonGeneric.dll;
$(PublishDir)/System.Private.DataContractSerialization.dll" />
</ItemGroup>
<!-- Move these "1.0" assemblies that TestPlatform lays down out of the way so crossgen doesn't pick them up.
We need https://github.com/dotnet/cli/issues/5464 fixed, so test platform is in a separate directory -->
<Move SourceFiles="@(NETCore10Assemblies)"
DestinationFiles="@(NETCore10Assemblies->'$(PublishDir)/%(Filename)%(Extension).bak')" />
<ItemGroup>
<!-- Removing Full CLR built TestHost assemblies from getting Crossgen as it is throwing error -->
<SdkFiles Include="$(PublishDir)/**/*" Exclude="$(PublishDir)/TestHost*/**/*;$(PublishDir)/Sdks/**/*" />
</ItemGroup>
<AddMetadataIsPE Items="@(SdkFiles)">
<Output TaskParameter="ResultItems" ItemName="SdkFilesWithPEMarker" />
</AddMetadataIsPE>
<ItemGroup>
<CrossgenTargets Include="%(SdkFilesWithPEMarker.FullPath)" Condition=" '%(SdkFilesWithPEMarker.IsPE)' == 'True' " />
</ItemGroup>
<RemoveDuplicates Inputs="@(SdkFiles->'%(RootDir)%(Directory)')">
<Output TaskParameter="Filtered" ItemName="PublishDirSubDirectories" />
</RemoveDuplicates>
<!-- Ensure crossgen tool is executable. See https://github.com/NuGet/Home/issues/4424 -->
<Chmod Condition=" '$(OSName)' != 'win' "
2017-03-01 02:16:51 +00:00
Glob="$(CrossgenPath)"
Mode="u+x" />
2017-02-28 08:38:27 +00:00
<Crossgen SourceAssembly="%(CrossgenTargets.FullPath)"
DestinationPath="%(CrossgenTargets.FullPath)"
JITPath="$(LibCLRJitPath)"
CrossgenPath="$(CrossgenPath)"
ReadyToRun="True"
PlatformAssemblyPaths="@(PlatformAssemblies);
@(PublishDirSubDirectories);
$(SharedFrameworkNameVersionPath)" />
<!-- Move the "1.0" assemblies back -->
<Move SourceFiles="@(NETCore10Assemblies->'$(PublishDir)/%(Filename)%(Extension).bak')"
DestinationFiles="@(NETCore10Assemblies)" />
</Target>
2017-03-01 02:16:51 +00:00
2017-03-01 03:04:47 +00:00
<Target Name="RemoveVbc"
AfterTargets="CrossgenPublishDir">
<ItemGroup>
<_VbcPath Include="$(PublishDir)/**/vbc.exe" />
2017-03-01 03:04:47 +00:00
</ItemGroup>
<Delete Files="@(_VbcPath)" />
</Target>
2017-03-01 06:52:08 +00:00
<Target Name="ChmodPublishDir"
AfterTargets="RemoveVbc"
Condition=" '$(OSName)' != 'win' ">
<Exec Command="find $(SdkOutputDirectory) -type d -exec chmod 755 {} \;" />
<Exec Command="find $(SdkOutputDirectory) -type f -exec chmod 644 {} \;" />
<Chmod Mode="755" Glob="$(SdkOutputDirectory)/Roslyn/RunCsc.sh" />
</Target>
<Target Name="CreateSymbolsDirectory"
AfterTargets="RemoveVbc">
<ItemGroup>
<_AllSdkFiles Include="$(PublishDir)/**/*" />
</ItemGroup>
<Copy SourceFiles="@(_AllSdkFiles)"
DestinationFiles="@(_AllSdkFiles->'$(SymbolsDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<Target Name="RemovePdbsFromPublishDir"
AfterTargets="CreateSymbolsDirectory">
<ItemGroup>
2017-03-01 06:52:08 +00:00
<PdbsToClean Include="$(PublishDir)/**/*.pdb" />
</ItemGroup>
<Delete Files="@(PdbsToClean)" />
</Target>
</Project>