This commit is contained in:
Piotr Puszkiewicz 2017-02-28 00:38:27 -08:00
parent c8e1a52b01
commit 9bdd38cc19
5 changed files with 98 additions and 104 deletions

View file

@ -35,6 +35,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4
build\BundledTemplates.props = build\BundledTemplates.props build\BundledTemplates.props = build\BundledTemplates.props
build\BundledTools.props = build\BundledTools.props build\BundledTools.props = build\BundledTools.props
build\Compile.targets = build\Compile.targets build\Compile.targets = build\Compile.targets
build\CrossGen.props = build\CrossGen.props
build\DependencyVersions.props = build\DependencyVersions.props build\DependencyVersions.props = build\DependencyVersions.props
build\FileExtensions.props = build\FileExtensions.props build\FileExtensions.props = build\FileExtensions.props
build\GitCommitInfo.targets = build\GitCommitInfo.targets build\GitCommitInfo.targets = build\GitCommitInfo.targets

View file

@ -2,13 +2,6 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="compile/LzmaArchive.targets" /> <Import Project="compile/LzmaArchive.targets" />
<PropertyGroup>
<RuntimeNETCoreAppPackageName>runtime.$(CoreCLRRid).microsoft.netcore.app</RuntimeNETCoreAppPackageName>
<CrossgenPath>$(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/tools/crossgen$(ExeExtension)</CrossgenPath>
<LibCLRJitPath>$(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/runtimes/$(CoreCLRRid)/native/$(DynamicLibPrefix)clrjit$(DynamicLibExtension)</LibCLRJitPath>
<SharedFrameworkNameVersionPath>$(OutputDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkVersion)</SharedFrameworkNameVersionPath>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" /> <PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" />
</ItemGroup> </ItemGroup>
@ -34,62 +27,6 @@
Configuration="$(Configuration)" Configuration="$(Configuration)"
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" /> ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />
<!-- copy core sdk -->
<Copy SourceFiles="@(MSBuildImportsContent)"
DestinationFolder="$(SdkOutputDirectory)/%(RecursiveDir)" />
<ItemGroup>
<NETCore10Assemblies Include="$(SdkOutputDirectory)/System.ComponentModel.Primitives.dll;
$(SdkOutputDirectory)/System.Collections.Specialized.dll;
$(SdkOutputDirectory)/System.Collections.NonGeneric.dll;
$(SdkOutputDirectory)/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->'$(SdkOutputDirectory)/%(Filename)%(Extension).bak')" />
<!-- Crossgen the CLI -->
<ItemGroup>
<SdkFiles Remove="*" />
<!-- Removing Full CLR built TestHost assemblies from getting Crossgen as it is throwing error -->
<SdkFilesExclude Include="$(SdkOutputDirectory)/TestHost*/**/*" />
<SdkFiles Include="$(SdkOutputDirectory)/**/*" Exclude="@(SdkFilesExclude)" />
<SdkFilesWithPEMarker Remove="*" />
</ItemGroup>
<AddMetadataIsPE Items="@(SdkFiles)">
<Output TaskParameter="ResultItems" ItemName="SdkFilesWithPEMarker" />
</AddMetadataIsPE>
<ItemGroup>
<CrossgenTargets Remove="*" />
<CrossgenTargets Include="%(SdkFilesWithPEMarker.FullPath)" Condition=" '%(SdkFilesWithPEMarker.IsPE)' == 'True' " />
<CompileStageSdkDirectories Remove="*" />
</ItemGroup>
<RemoveDuplicates Inputs="@(SdkFiles->'%(RootDir)%(Directory)')">
<Output TaskParameter="Filtered" ItemName="CompileStageSdkDirectories" />
</RemoveDuplicates>
<!-- Ensure crossgen tool is executable. See https://github.com/NuGet/Home/issues/4424 -->
<Chmod Condition=" '$(OSName)' != 'win' And '$(DISABLE_CROSSGEN)' != '1' "
File="$(CrossgenPath)"
Mode="u+x" />
<Crossgen Condition=" '$(DISABLE_CROSSGEN)' != '1' "
SourceAssembly="%(CrossgenTargets.FullPath)"
DestinationPath="%(CrossgenTargets.FullPath)"
JITPath="$(LibCLRJitPath)"
CrossgenPath="$(CrossgenPath)"
ReadyToRun="True"
PlatformAssemblyPaths="@(PlatformAssemblies);
@(CompileStageSdkDirectories);
$(SharedFrameworkNameVersionPath)" />
<!-- Corehostify Binaries --> <!-- Corehostify Binaries -->
<ItemGroup Condition=" '$(OSName)' != 'win' "> <ItemGroup Condition=" '$(OSName)' != 'win' ">
<SdkOutputChmodTargets Remove="*" /> <SdkOutputChmodTargets Remove="*" />
@ -116,10 +53,6 @@
File="%(SdkOutputChModTargets.FullPath)" File="%(SdkOutputChModTargets.FullPath)"
Mode="%(SdkOutputChModTargets.Mode)" /> Mode="%(SdkOutputChModTargets.Mode)" />
<!-- Move the "1.0" assemblies back -->
<Move SourceFiles="@(NETCore10Assemblies->'$(SdkOutputDirectory)/%(Filename)%(Extension).bak')"
DestinationFiles="@(NETCore10Assemblies)" />
<ItemGroup> <ItemGroup>
<FilesToClean Include="$(OutputDirectory)/sdk/**/vbc.exe" /> <FilesToClean Include="$(OutputDirectory)/sdk/**/vbc.exe" />
</ItemGroup> </ItemGroup>

8
build/CrossGen.props Normal file
View file

@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<RuntimeNETCoreAppPackageName>runtime.$(CoreCLRRid).microsoft.netcore.app</RuntimeNETCoreAppPackageName>
<CrossgenPath>$(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/tools/crossgen$(ExeExtension)</CrossgenPath>
<LibCLRJitPath>$(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/runtimes/$(CoreCLRRid)/native/$(DynamicLibPrefix)clrjit$(DynamicLibExtension)</LibCLRJitPath>
<SharedFrameworkNameVersionPath>$(OutputDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkVersion)</SharedFrameworkNameVersionPath>
</PropertyGroup>
</Project>

View file

@ -31,6 +31,7 @@
<Import Project="build/OutputDirectories.props" /> <Import Project="build/OutputDirectories.props" />
<Import Project="build/BuildDefaults.props" /> <Import Project="build/BuildDefaults.props" />
<Import Project="build/Stage0.props" /> <Import Project="build/Stage0.props" />
<Import Project="build/Crossgen.props" />
<Import Project="build/VersionBadge.props" /> <Import Project="build/VersionBadge.props" />
<Import Project="build/BundledRuntimes.props" /> <Import Project="build/BundledRuntimes.props" />

View file

@ -48,7 +48,7 @@
<Target Name="PublishVersionFile" <Target Name="PublishVersionFile"
BeforeTargets="Publish"> BeforeTargets="Publish">
<WriteLinesToFile File="$(SdkOutputDirectory)/.version" <WriteLinesToFile File="$(PublishDir)/.version"
Lines="$(CommitHash);$(SdkVersion);$(Rid)" Lines="$(CommitHash);$(SdkVersion);$(Rid)"
Overwrite="true" /> Overwrite="true" />
</Target> </Target>
@ -60,17 +60,17 @@
AssetPath="%(BundledToolProjects.Identity).dll" /> AssetPath="%(BundledToolProjects.Identity).dll" />
<Copy SourceFiles="$(PublishDir)/$(TargetName).deps.json" <Copy SourceFiles="$(PublishDir)/$(TargetName).deps.json"
DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json" /> DestinationFiles="$(PublishDir)/%(BundledTools.Identity).deps.json" />
<Copy SourceFiles="$(PublishDir)/$(TargetName).runtimeconfig.json" <Copy SourceFiles="$(PublishDir)/$(TargetName).runtimeconfig.json"
DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).runtimeconfig.json" /> DestinationFiles="$(PublishDir)/%(BundledTools.Identity).runtimeconfig.json" />
<Delete Files="$(PublishDir)/$(TargetName).deps.json; <Delete Files="$(PublishDir)/$(TargetName).deps.json;
$(PublishDir)/$(TargetName).runtimeconfig.json; $(PublishDir)/$(TargetName).runtimeconfig.json;
$(PublishDir)/%(BundledToolProjects.Identity).dll" /> $(PublishDir)/%(BundledToolProjects.Identity).dll" />
<ChangeEntryPointLibraryName <ChangeEntryPointLibraryName
DepsFile="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json" DepsFile="$(PublishDir)/%(BundledTools.Identity).deps.json"
NewName="%(BundledTools.Identity).deps.json" /> NewName="%(BundledTools.Identity).deps.json" />
</Target> </Target>
@ -101,4 +101,55 @@
SectionName="runtimeTargets" SectionName="runtimeTargets"
AssetPath="%(NuPkgContentForMSBuildExtensionsRelativePaths.Identity)" /> AssetPath="%(NuPkgContentForMSBuildExtensionsRelativePaths.Identity)" />
</Target> </Target>
<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' "
File="$(CrossgenPath)"
Mode="u+x" />
<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>
</Project> </Project>