2017-02-16 22:15:05 +00:00
|
|
|
|
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
2016-12-02 04:10:42 +00:00
|
|
|
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
2017-02-23 06:44:52 +00:00
|
|
|
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
|
2017-03-01 08:30:02 +00:00
|
|
|
|
<Import Project="$(RepoRoot)/build/compile/LzmaArchive.targets" />
|
|
|
|
|
|
2016-10-29 08:04:20 +00:00
|
|
|
|
<PropertyGroup>
|
2017-01-10 23:31:43 +00:00
|
|
|
|
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
2017-01-26 03:19:44 +00:00
|
|
|
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
|
|
|
|
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
|
2016-10-29 08:04:20 +00:00
|
|
|
|
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
2017-02-23 06:44:52 +00:00
|
|
|
|
<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>
|
2017-02-16 22:15:05 +00:00
|
|
|
|
<VersionSuffix>$(CommitCount)</VersionSuffix>
|
2016-10-29 08:04:20 +00:00
|
|
|
|
</PropertyGroup>
|
2017-02-16 22:15:05 +00:00
|
|
|
|
|
2016-10-29 08:04:20 +00:00
|
|
|
|
<ItemGroup>
|
2017-02-16 22:15:05 +00:00
|
|
|
|
<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)" />
|
2016-10-29 08:04:20 +00:00
|
|
|
|
</ItemGroup>
|
2017-02-23 06:44:52 +00:00
|
|
|
|
|
2017-01-26 03:19:44 +00:00
|
|
|
|
<ItemGroup>
|
2016-10-29 08:04:20 +00:00
|
|
|
|
<ProjectReference Include="..\dotnet\dotnet.csproj" />
|
|
|
|
|
<ProjectReference Include="..\Microsoft.DotNet.Archive\Microsoft.DotNet.Archive.csproj" />
|
2016-12-07 21:49:15 +00:00
|
|
|
|
<ProjectReference Include="..\Microsoft.DotNet.Cli.Sln.Internal\Microsoft.DotNet.Cli.Sln.Internal.csproj" />
|
2016-10-29 08:04:20 +00:00
|
|
|
|
<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>
|
2017-02-23 06:44:52 +00:00
|
|
|
|
|
2017-02-23 09:12:32 +00:00
|
|
|
|
<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)')" />
|
2017-02-23 09:12:32 +00:00
|
|
|
|
</Target>
|
|
|
|
|
|
2017-02-23 10:33:00 +00:00
|
|
|
|
<Target Name="PublishVersionFile"
|
|
|
|
|
BeforeTargets="Publish">
|
|
|
|
|
|
2017-02-28 08:38:27 +00:00
|
|
|
|
<WriteLinesToFile File="$(PublishDir)/.version"
|
2017-02-23 10:33:00 +00:00
|
|
|
|
Lines="$(CommitHash);$(SdkVersion);$(Rid)"
|
|
|
|
|
Overwrite="true" />
|
|
|
|
|
</Target>
|
|
|
|
|
|
2017-02-28 09:39:45 +00:00
|
|
|
|
<Target Name="PublishRoslyn"
|
|
|
|
|
BeforeTargets="Publish">
|
|
|
|
|
|
|
|
|
|
<DotNetPublish ToolPath="$(Stage0Directory)"
|
|
|
|
|
Configuration="$(Configuration)"
|
|
|
|
|
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />
|
|
|
|
|
</Target>
|
|
|
|
|
|
2017-02-23 06:44:52 +00:00
|
|
|
|
<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" />
|
2017-02-23 06:44:52 +00:00
|
|
|
|
|
|
|
|
|
<Copy SourceFiles="$(PublishDir)/$(TargetName).runtimeconfig.json"
|
2017-02-28 08:38:27 +00:00
|
|
|
|
DestinationFiles="$(PublishDir)/%(BundledTools.Identity).runtimeconfig.json" />
|
2017-02-23 06:44:52 +00:00
|
|
|
|
|
|
|
|
|
<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"
|
2017-02-23 06:44:52 +00:00
|
|
|
|
NewName="%(BundledTools.Identity).deps.json" />
|
|
|
|
|
</Target>
|
2017-02-23 10:13:04 +00:00
|
|
|
|
|
|
|
|
|
<Target Name="PublishMSBuildExtensions"
|
2017-02-23 18:25:28 +00:00
|
|
|
|
AfterTargets="Publish"
|
|
|
|
|
BeforeTargets="GenerateCliRuntimeConfigurationFiles">
|
2017-02-23 10:13:04 +00:00
|
|
|
|
|
|
|
|
|
<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" />
|
2017-02-28 01:10:33 +00:00
|
|
|
|
|
|
|
|
|
<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"
|
2017-02-28 01:10:33 +00:00
|
|
|
|
AssetPath="%(NuPkgContentForMSBuildExtensionsRelativePaths.Identity)" />
|
2017-02-23 10:13:04 +00:00
|
|
|
|
</Target>
|
2017-02-28 08:38:27 +00:00
|
|
|
|
|
2017-03-01 08:30:02 +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)
|
2017-03-01 08:30:02 +00:00
|
|
|
|
</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)
|
2017-03-01 08:30:02 +00:00
|
|
|
|
</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>
|
2017-03-01 08:30:02 +00:00
|
|
|
|
<_VbcPath Include="$(PublishDir)/**/vbc.exe" />
|
2017-03-01 03:04:47 +00:00
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<Delete Files="@(_VbcPath)" />
|
|
|
|
|
</Target>
|
2017-03-01 03:10:49 +00:00
|
|
|
|
|
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>
|
|
|
|
|
|
2017-03-01 03:10:49 +00:00
|
|
|
|
<Target Name="CreateSymbolsDirectory"
|
2017-03-01 03:16:55 +00:00
|
|
|
|
AfterTargets="RemoveVbc">
|
2017-03-01 03:10:49 +00:00
|
|
|
|
<ItemGroup>
|
2017-03-01 03:16:55 +00:00
|
|
|
|
<_AllSdkFiles Include="$(PublishDir)/**/*" />
|
2017-03-01 03:10:49 +00:00
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<Copy SourceFiles="@(_AllSdkFiles)"
|
|
|
|
|
DestinationFiles="@(_AllSdkFiles->'$(SymbolsDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
|
|
|
|
</Target>
|
2017-03-01 03:16:55 +00:00
|
|
|
|
|
|
|
|
|
<Target Name="RemovePdbsFromPublishDir"
|
|
|
|
|
AfterTargets="CreateSymbolsDirectory">
|
|
|
|
|
<ItemGroup>
|
2017-03-01 06:52:08 +00:00
|
|
|
|
<PdbsToClean Include="$(PublishDir)/**/*.pdb" />
|
2017-03-01 03:16:55 +00:00
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
<Delete Files="@(PdbsToClean)" />
|
|
|
|
|
</Target>
|
2017-02-23 06:44:52 +00:00
|
|
|
|
</Project>
|