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\BundledTools.props = build\BundledTools.props
build\Compile.targets = build\Compile.targets
build\CrossGen.props = build\CrossGen.props
build\DependencyVersions.props = build\DependencyVersions.props
build\FileExtensions.props = build\FileExtensions.props
build\GitCommitInfo.targets = build\GitCommitInfo.targets

View file

@ -2,13 +2,6 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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>
<PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" />
</ItemGroup>
@ -34,107 +27,47 @@
Configuration="$(Configuration)"
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />
<!-- copy core sdk -->
<Copy SourceFiles="@(MSBuildImportsContent)"
DestinationFolder="$(SdkOutputDirectory)/%(RecursiveDir)" />
<!-- Corehostify Binaries -->
<ItemGroup Condition=" '$(OSName)' != 'win' ">
<SdkOutputChmodTargets Remove="*" />
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.exe;
$(SdkOutputDirectory)/**/*.dll" >
<!-- Managed assemblies do not need execute -->
<Mode>u=rw,g=r,o=r</Mode>
</SdkOutputChmodTargets>
<ItemGroup>
<NETCore10Assemblies Include="$(SdkOutputDirectory)/System.ComponentModel.Primitives.dll;
$(SdkOutputDirectory)/System.Collections.Specialized.dll;
$(SdkOutputDirectory)/System.Collections.NonGeneric.dll;
$(SdkOutputDirectory)/System.Private.DataContractSerialization.dll" />
</ItemGroup>
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.dylib;
$(SdkOutputDirectory)/**/*.so" >
<!-- Generally, dylibs and sos have 'x' -->
<Mode>u=rwx,g=rx,o=rx</Mode>
</SdkOutputChmodTargets>
<!-- 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')" />
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*"
Exclude="$(SdkOutputDirectory)/**/*.*" >
<!-- Executables need x -->
<Mode>u=rwx,g=rx,o=rx</Mode>
</SdkOutputChmodTargets>
</ItemGroup>
<!-- Crossgen the CLI -->
<ItemGroup>
<SdkFiles Remove="*" />
<Chmod Condition=" '$(OSName)' != 'win' "
File="%(SdkOutputChModTargets.FullPath)"
Mode="%(SdkOutputChModTargets.Mode)" />
<!-- 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>
<ItemGroup>
<FilesToClean Include="$(OutputDirectory)/sdk/**/vbc.exe" />
</ItemGroup>
<AddMetadataIsPE Items="@(SdkFiles)">
<Output TaskParameter="ResultItems" ItemName="SdkFilesWithPEMarker" />
</AddMetadataIsPE>
<Delete Files="@(FilesToClean)" />
<ItemGroup>
<CrossgenTargets Remove="*" />
<CrossgenTargets Include="%(SdkFilesWithPEMarker.FullPath)" Condition=" '%(SdkFilesWithPEMarker.IsPE)' == 'True' " />
<ItemGroup>
<FilesToCopy Include="$(OutputDirectory)/**/*" />
<PdbsToClean Include="$(OutputDirectory)/sdk/**/*.pdb" />
</ItemGroup>
<CompileStageSdkDirectories Remove="*" />
</ItemGroup>
<Copy SourceFiles="@(FilesToCopy)"
DestinationFiles="@(FilesToCopy->'$(SymbolsDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
<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 -->
<ItemGroup Condition=" '$(OSName)' != 'win' ">
<SdkOutputChmodTargets Remove="*" />
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.exe;
$(SdkOutputDirectory)/**/*.dll" >
<!-- Managed assemblies do not need execute -->
<Mode>u=rw,g=r,o=r</Mode>
</SdkOutputChmodTargets>
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.dylib;
$(SdkOutputDirectory)/**/*.so" >
<!-- Generally, dylibs and sos have 'x' -->
<Mode>u=rwx,g=rx,o=rx</Mode>
</SdkOutputChmodTargets>
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*"
Exclude="$(SdkOutputDirectory)/**/*.*" >
<!-- Executables need x -->
<Mode>u=rwx,g=rx,o=rx</Mode>
</SdkOutputChmodTargets>
</ItemGroup>
<Chmod Condition=" '$(OSName)' != 'win' "
File="%(SdkOutputChModTargets.FullPath)"
Mode="%(SdkOutputChModTargets.Mode)" />
<!-- Move the "1.0" assemblies back -->
<Move SourceFiles="@(NETCore10Assemblies->'$(SdkOutputDirectory)/%(Filename)%(Extension).bak')"
DestinationFiles="@(NETCore10Assemblies)" />
<ItemGroup>
<FilesToClean Include="$(OutputDirectory)/sdk/**/vbc.exe" />
</ItemGroup>
<Delete Files="@(FilesToClean)" />
<ItemGroup>
<FilesToCopy Include="$(OutputDirectory)/**/*" />
<PdbsToClean Include="$(OutputDirectory)/sdk/**/*.pdb" />
</ItemGroup>
<Copy SourceFiles="@(FilesToCopy)"
DestinationFiles="@(FilesToCopy->'$(SymbolsDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Delete Files="@(PdbsToClean)" />
<Delete Files="@(PdbsToClean)" />
</Target>
<Target Name="PublishSdks"

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/BuildDefaults.props" />
<Import Project="build/Stage0.props" />
<Import Project="build/Crossgen.props" />
<Import Project="build/VersionBadge.props" />
<Import Project="build/BundledRuntimes.props" />

View file

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