Addressing code review comments and making incremental build work.
This commit is contained in:
parent
52e9475be8
commit
9135be75f4
14 changed files with 458 additions and 481 deletions
|
@ -14,11 +14,6 @@
|
|||
<NoRunArg Condition=" '$(OS)' == 'Windows_NT' ">-NoRun</NoRunArg>
|
||||
<NoRunArg Condition=" '$(OS)' != 'Windows_NT' ">--norun</NoRunArg>
|
||||
|
||||
<CR>%0D</CR>
|
||||
<LF>%0A</LF>
|
||||
<NewLine Condition=" '$(OSName)' == 'win' ">$(LF)</NewLine>
|
||||
<NewLine Condition=" '$(OSName)' != 'win' ">$(CR)$(LF)</NewLine>
|
||||
|
||||
<CLITargets Condition=" '$(CLITargets)' == '' ">Prepare;Compile;Test;Package;Publish</CLITargets>
|
||||
<CLIBuildFileName>$(MSBuildThisFileDirectory)/build_projects/dotnet-cli-build/bin/dotnet-cli-build</CLIBuildFileName>
|
||||
<CLIBuildDll>$(CLIBuildFileName).dll</CLIBuildDll>
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="compile/Microsoft.DotNet.Cli.Archive.targets" />
|
||||
<Import Project="compile/Microsoft.DotNet.Cli.LzmaArchive.targets" />
|
||||
|
||||
<UsingTask TaskName="FixModeFlags" AssemblyFile="$(CLIBuildDll)" />
|
||||
<UsingTask TaskName="ChangeEntryPointLibraryName" AssemblyFile="$(CLIBuildDll)" />
|
||||
<UsingTask TaskName="RemoveAssetFromDepsPackages" AssemblyFile="$(CLIBuildDll)" />
|
||||
<UsingTask TaskName="CleanPublishOutput" AssemblyFile="$(CLIBuildDll)" />
|
||||
<UsingTask TaskName="SharedFrameworkNameVersionPath" AssemblyFile="$(CLIBuildDll)" />
|
||||
<UsingTask TaskName="CrossgenDirectory" AssemblyFile="$(CLIBuildDll)" />
|
||||
|
||||
<Target Name="Compile" DependsOnTargets="BuildDotnetCliBuildFramework;
|
||||
Init;
|
||||
<Target Name="Compile" DependsOnTargets="Init;
|
||||
SetupStage;
|
||||
CompileStage;
|
||||
BuildProjectsForNuGetPackages;
|
||||
|
@ -17,9 +15,13 @@
|
|||
</Target>
|
||||
|
||||
<Target Name="SetupStage">
|
||||
<PropertyGroup>
|
||||
<SrcDirectory>$(RepoRoot)/src</SrcDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CompileStageInputs Include="$(RepoRoot)/src/**/*.cs" Exclude="$(RepoRoot)/src/**/obj/**/*.cs" />
|
||||
<CompileStageInputs Include="$(RepoRoot)/src/**/project.json;$(RepoRoot)/src/**/project.lock.json" />
|
||||
<CompileStageInputs Include="$(SrcDirectory)/**/*.cs" Exclude="$(SrcDirectory)/**/obj/**/*.cs" />
|
||||
<CompileStageInputs Include="$(SrcDirectory)/**/project.json;$(SrcDirectory)/**/project.lock.json" />
|
||||
|
||||
<Stage Include="Stage1">
|
||||
<Inputs>@(CompileStageInputs)</Inputs>
|
||||
|
@ -37,11 +39,9 @@
|
|||
</Target>
|
||||
|
||||
<Target Name="CompileStage"
|
||||
Inputs="%(Stage.Identity);%(Stage.Inputs)"
|
||||
Outputs="%(StageDirectory)/sdk/$(NugetVersion)/dotnet.dll">
|
||||
Inputs="%(Stage.Inputs)"
|
||||
Outputs="%(StageDirectory)/sdk/$(SdkVersion)/dotnet.dll">
|
||||
<PropertyGroup>
|
||||
<SrcDirectory>$(RepoRoot)/src</SrcDirectory>
|
||||
|
||||
<ExeSuffix Condition=" '$(OSName)' == 'win' ">.exe</ExeSuffix>
|
||||
<ExeSuffix Condition=" '$(OSName)' != 'win' "></ExeSuffix>
|
||||
|
||||
|
@ -58,10 +58,16 @@
|
|||
|
||||
<StageDirectory>%(Stage.StageDirectory)</StageDirectory>
|
||||
<StageSymbolsDirectory>%(Stage.StageSymbolsDirectory)</StageSymbolsDirectory>
|
||||
<SdkOutputDirectory>$(StageDirectory)/sdk/$(NugetVersion)</SdkOutputDirectory>
|
||||
<SdkOutputDirectory>$(StageDirectory)/sdk/$(SdkVersion)</SdkOutputDirectory>
|
||||
<BinaryToCorehostifyRelDir>runtimes/any/native</BinaryToCorehostifyRelDir>
|
||||
<BinaryToCorehostifyOutDir>$(SdkOutputDirectory)/$(BinaryToCorehostifyRelDir)</BinaryToCorehostifyOutDir>
|
||||
<MSBuildTargetsDirectory>$(SdkOutputDirectory)/runtimes/any/native</MSBuildTargetsDirectory>
|
||||
|
||||
<SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
|
||||
<SharedFrameworkNuGetVersion>1.0.0</SharedFrameworkNuGetVersion>
|
||||
<SharedFrameworkNameVersionPath>
|
||||
$(StageDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkNuGetVersion)
|
||||
</SharedFrameworkNameVersionPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -69,7 +75,7 @@
|
|||
<BinObj Include="$(SrcDirectory)/**/obj/**/*" />
|
||||
<FilesToRemoveFromStageDirectory Include="$(StageDirectory)/**/*" />
|
||||
|
||||
<SharedFramework Include="$(IntermediateDirectory)/sharedFrameworkPublish/**/*.*" />
|
||||
<SharedFramework Include="$(IntermediateDirectory)/sharedFrameworkPublish/**/*" />
|
||||
|
||||
<BinariesToRemove Include="csc" />
|
||||
<BinariesToRemove Include="vbc" />
|
||||
|
@ -81,10 +87,6 @@
|
|||
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.tasks" />
|
||||
</ItemGroup>
|
||||
|
||||
<SharedFrameworkNameVersionPath RootOutputDirectory="$(StageDirectory)">
|
||||
<Output TaskParameter="OutputSharedFrameworkNameVersionPath" PropertyName="SharedFrameworkNameVersionPath" />
|
||||
</SharedFrameworkNameVersionPath>
|
||||
|
||||
<Delete Files="@(BinObj)" />
|
||||
|
||||
<Delete Files="@(FilesToRemoveFromStageDirectory)" />
|
||||
|
@ -150,12 +152,14 @@
|
|||
<Copy SourceFiles="$(SharedFrameworkNameVersionPath)/$(HostPolicyBaseName)"
|
||||
DestinationFiles="$(SdkOutputDirectory)/$(HostPolicyBaseName)" />
|
||||
|
||||
<CrossgenDirectory SharedFrameworkNameVersionPath="$(SharedFrameworkNameVersionPath)"
|
||||
<CrossgenDirectory CoreCLRVersion="$(CoreCLRVersion)"
|
||||
JitVersion="$(JitVersion)"
|
||||
SharedFrameworkNameVersionPath="$(SharedFrameworkNameVersionPath)"
|
||||
SdkOutputDirectory="$(SdkOutputDirectory)" />
|
||||
|
||||
<!-- Generate .version file -->
|
||||
<WriteLinesToFile File="$(SdkOutputDirectory)/.version"
|
||||
Lines="$(CommitHash)$(NewLine)$(NugetVersion)$(NewLine)"
|
||||
Lines="$(CommitHash);$(SdkVersion)"
|
||||
Overwrite="true" />
|
||||
|
||||
<Copy SourceFiles="@(MSBuildTargetsToCopy)"
|
||||
|
@ -168,7 +172,7 @@
|
|||
<Delete Files="@(FilesToClean)" />
|
||||
|
||||
<ItemGroup>
|
||||
<FilesToCopy Include="$(StageDirectory)/**/*.*" />
|
||||
<FilesToCopy Include="$(StageDirectory)/**/*" />
|
||||
<PdbsToClean Include="$(StageDirectory)/sdk/**/*.pdb" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
<Stage2CompilationDirectory>$(BaseOutputDirectory)/stage2compilation</Stage2CompilationDirectory>
|
||||
<IntermediateDirectory>$(BaseOutputDirectory)/intermediate</IntermediateDirectory>
|
||||
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>
|
||||
<SymbolsOutputDirectory>$(BaseOutputDirectory)/stage2symbols</SymbolsOutputDirectory>
|
||||
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -68,6 +67,9 @@
|
|||
<ProjectModelNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-rc4-$(CommitCount)</ProjectModelNugetVersion>
|
||||
<DependencyModelAndInternalAbstractionsNugetVersion>$(VersionMajor).$(VersionMinor).1-beta-$(CommitCount)</DependencyModelAndInternalAbstractionsNugetVersion>
|
||||
|
||||
<CoreCLRVersion>1.0.2</CoreCLRVersion>
|
||||
<JitVersion>1.0.2</JitVersion>
|
||||
|
||||
<ArchiveExtension Condition=" '$(OSName)' == 'win' ">.zip</ArchiveExtension>
|
||||
<ArchiveExtension Condition=" '$(OSName)' != 'win' ">.tar.gz</ArchiveExtension>
|
||||
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="GenerateNuGetPackagesArchive"
|
||||
DependsOnTargets="RestoreNuGetPackagesArchive;
|
||||
CompressNuGetPackagesArchive"
|
||||
Inputs="$(Stage2Directory)/sdk/**/dotnet.dll"
|
||||
DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs"
|
||||
Inputs="$(Stage2Directory)/sdk/$(SdkVersion)/dotnet.dll"
|
||||
Outputs="$(FinalArchive)">
|
||||
<Message Text="Generating NuGet Packages Archive" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestoreNuGetPackagesArchive"
|
||||
DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs">
|
||||
<ItemGroup>
|
||||
<FilesToClean Include="$(NuGetPackagesArchiveProject)/**/*" />
|
||||
<FilesToClean Include="$(NuGetPackagesArchiveFolder)/**/*" />
|
||||
|
@ -21,10 +15,7 @@
|
|||
<Exec Command="$(DotnetStage2) new" WorkingDirectory="$(NuGetPackagesArchiveProject)" />
|
||||
<Exec Command="$(DotnetStage2) restore --packages $(NuGetPackagesArchiveFolder)"
|
||||
WorkingDirectory="$(NuGetPackagesArchiveProject)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="CompressNuGetPackagesArchive"
|
||||
DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs">
|
||||
<Delete Files="$(IntermediateArchive);$(IntermediateArchive).zip" />
|
||||
|
||||
<Message Text="Publishing Archiver" />
|
||||
|
@ -43,7 +34,7 @@
|
|||
<NuGetPackagesArchiveFolder>$(IntermediateDirectory)/NuGetPackagesArchiveFolder</NuGetPackagesArchiveFolder>
|
||||
<ArchiverExe>$(ToolsOutputDirectory)/Archiver</ArchiverExe>
|
||||
<IntermediateArchive>$(IntermediateDirectory)/nuGetPackagesArchive.lzma</IntermediateArchive>
|
||||
<FinalArchive>$(Stage2Directory)/nuGetPackagesArchive.lzma</FinalArchive>
|
||||
<FinalArchive>$(Stage2Directory)/sdk/$(SdkVersion)/nuGetPackagesArchive.lzma</FinalArchive>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -11,7 +11,7 @@
|
|||
<!-- Set up Items with Layout Input Files -->
|
||||
<ItemGroup>
|
||||
<SdkLayoutInput Include="$(OutputDirectory)/sdk/**/*" />
|
||||
<SdkDebugLayoutInput Include="$(SymbolsOutputDirectory)/sdk/**/*" />
|
||||
<SdkDebugLayoutInput Include="$(Stage2SymbolsDirectory)/sdk/**/*" />
|
||||
<CombinedHostHostFxrFrameworkSdkInput Include="$(OutputDirectory)/**/*" />
|
||||
<CombinedFrameworkSdkInput Include="$(OutputDirectory)/shared/**/*" />
|
||||
<CombinedFrameworkSdkInput Include="$(OutputDirectory)/sdk/**/*" />
|
||||
|
@ -56,7 +56,11 @@
|
|||
|
||||
<LayoutDefinition Include="Debug">
|
||||
<InputFiles>@(SdkDebugLayoutInput)</InputFiles>
|
||||
<<<<<<< 52e9475be8e9dd9d6715a1f0787da3faa1137f8a
|
||||
<OutputFiles>@(SdkDebugRelativeOutputFiles -> '$(SdkDebugLayoutOutputDirectory)/%(Identity)')</OutputFiles>
|
||||
=======
|
||||
<OutputFiles>@(SdkDebugLayoutInput -> '$(SdkDebugLayoutOutputDirectory)/$([MSBuild]::MakeRelative($(Stage2SymbolsDirectory), '%(Identity)'))')</OutputFiles>
|
||||
>>>>>>> Addressing code review comments and making incremental build work.
|
||||
<NameWithVersion>$(ArtifactNameWithVersionSdkDebug)</NameWithVersion>
|
||||
<Name>$(ArtifactNameSdkDebug)</Name>
|
||||
</LayoutDefinition>
|
||||
|
|
|
@ -16,8 +16,10 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
public class ChangeEntryPointLibraryName : Task
|
||||
{
|
||||
[Required]
|
||||
public string DepsFile { get; set; }
|
||||
|
||||
[Required]
|
||||
public string NewName { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
|
|
|
@ -16,12 +16,16 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
public class CleanPublishOutput : Task
|
||||
{
|
||||
[Required]
|
||||
public string Path { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
public bool DeleteRuntimeConfigJson { get; set; }
|
||||
|
||||
[Required]
|
||||
public bool DeleteDepsJson { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Microsoft.Build.Utilities;
|
||||
|
@ -220,9 +220,14 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
foreach (var binaryToRemove in new string[] { "csc", "vbc" })
|
||||
{
|
||||
var assetPath = Path.Combine(binaryToCorehostifyRelDir, $"{binaryToRemove}.exe").Replace(Path.DirectorySeparatorChar, '/');
|
||||
RemoveAssetFromDepsPackages(binaryToCoreHostifyDeps, "runtimeTargets", assetPath);
|
||||
RemoveAssetFromDepsPackages(
|
||||
Path.Combine(sdkOutputDirectory, "dotnet.deps.json"), "runtimeTargets", assetPath);
|
||||
RemoveAssetFromDepsPackages.DoRemoveAssetFromDepsPackages(
|
||||
binaryToCoreHostifyDeps,
|
||||
"runtimeTargets",
|
||||
assetPath);
|
||||
RemoveAssetFromDepsPackages.DoRemoveAssetFromDepsPackages(
|
||||
Path.Combine(sdkOutputDirectory, "dotnet.deps.json"),
|
||||
"runtimeTargets",
|
||||
assetPath);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -360,40 +365,6 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
File.Copy(intermediateArchive, finalArchive);
|
||||
}
|
||||
|
||||
private static void RemoveAssetFromDepsPackages(string depsFile, string sectionName, string assetPath)
|
||||
{
|
||||
JToken deps;
|
||||
using (var file = File.OpenText(depsFile))
|
||||
using (JsonTextReader reader = new JsonTextReader(file))
|
||||
{
|
||||
deps = JObject.ReadFrom(reader);
|
||||
}
|
||||
|
||||
foreach (JProperty target in deps["targets"])
|
||||
{
|
||||
foreach (JProperty pv in target.Value.Children<JProperty>())
|
||||
{
|
||||
var section = pv.Value[sectionName];
|
||||
if (section != null)
|
||||
{
|
||||
foreach (JProperty relPath in section)
|
||||
{
|
||||
if (assetPath.Equals(relPath.Name))
|
||||
{
|
||||
relPath.Remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using (var file = File.CreateText(depsFile))
|
||||
using (var writer = new JsonTextWriter(file) { Formatting = Formatting.Indented })
|
||||
{
|
||||
deps.WriteTo(writer);
|
||||
}
|
||||
}
|
||||
|
||||
private static void CopySharedFramework(string sharedFrameworkPublish, string rootOutputDirectory)
|
||||
{
|
||||
CopyRecursive(sharedFrameworkPublish, rootOutputDirectory);
|
||||
|
|
|
@ -16,15 +16,23 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
public class CrossgenDirectory : Task
|
||||
{
|
||||
private static Crossgen CrossgenUtil = new Crossgen(DependencyVersions.CoreCLRVersion, DependencyVersions.JitVersion);
|
||||
[Required]
|
||||
public string CoreCLRVersion { get; set; }
|
||||
|
||||
[Required]
|
||||
public string JitVersion { get; set; }
|
||||
|
||||
[Required]
|
||||
public string SharedFrameworkNameVersionPath { get; set; }
|
||||
|
||||
[Required]
|
||||
public string SdkOutputDirectory { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
CrossgenUtil.CrossgenDirectory(SharedFrameworkNameVersionPath, SdkOutputDirectory);
|
||||
var crossgenUtil = new Crossgen(DependencyVersions.CoreCLRVersion, DependencyVersions.JitVersion);
|
||||
|
||||
crossgenUtil.CrossgenDirectory(SharedFrameworkNameVersionPath, SdkOutputDirectory);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
public class FixModeFlags : Task
|
||||
{
|
||||
[Required]
|
||||
public string Dir { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
|
|
|
@ -18,10 +18,13 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
public class RemoveAssetFromDepsPackages : Task
|
||||
{
|
||||
[Required]
|
||||
public string DepsFile { get; set; }
|
||||
|
||||
[Required]
|
||||
public string SectionName { get; set; }
|
||||
|
||||
[Required]
|
||||
public string AssetPath { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
|
@ -31,7 +34,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
return true;
|
||||
}
|
||||
|
||||
private static void DoRemoveAssetFromDepsPackages(string depsFile, string sectionName, string assetPath)
|
||||
public static void DoRemoveAssetFromDepsPackages(string depsFile, string sectionName, string assetPath)
|
||||
{
|
||||
JToken deps;
|
||||
using (var file = File.OpenText(depsFile))
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Net.Http;
|
||||
using Microsoft.Build.Utilities;
|
||||
using Microsoft.DotNet.Cli.Build.Framework;
|
||||
using Microsoft.DotNet.InternalAbstractions;
|
||||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
|
||||
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public class SharedFrameworkNameVersionPath : Task
|
||||
{
|
||||
public string RootOutputDirectory { get; set; }
|
||||
|
||||
[Output]
|
||||
public string OutputSharedFrameworkNameVersionPath { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
var sharedFrameworkNugetVersion = CliDependencyVersions.SharedFrameworkVersion;
|
||||
OutputSharedFrameworkNameVersionPath = SharedFrameworkPublisher.GetSharedFrameworkPublishPath(
|
||||
RootOutputDirectory,
|
||||
sharedFrameworkNugetVersion);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,5 +16,18 @@
|
|||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {}
|
||||
},
|
||||
"runtimes": {
|
||||
"win7-x64": {},
|
||||
"win7-x86": {},
|
||||
"osx.10.10-x64": {},
|
||||
"osx.10.11-x64": {},
|
||||
"ubuntu.14.04-x64": {},
|
||||
"ubuntu.16.04-x64": {},
|
||||
"centos.7-x64": {},
|
||||
"rhel.7.2-x64": {},
|
||||
"debian.8-x64": {},
|
||||
"fedora.23-x64": {},
|
||||
"opensuse.13.2-x64": {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,5 +19,18 @@
|
|||
"dnxcore50"
|
||||
]
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
"win7-x64": {},
|
||||
"win7-x86": {},
|
||||
"osx.10.10-x64": {},
|
||||
"osx.10.11-x64": {},
|
||||
"ubuntu.14.04-x64": {},
|
||||
"ubuntu.16.04-x64": {},
|
||||
"centos.7-x64": {},
|
||||
"rhel.7.2-x64": {},
|
||||
"debian.8-x64": {},
|
||||
"fedora.23-x64": {},
|
||||
"opensuse.13.2-x64": {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue