Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3077c95

Browse files
committed
Adding the Microsoft.NET.Sdk.IL pkgproj
1 parent ccf735e commit 3077c95

File tree

6 files changed

+165
-0
lines changed

6 files changed

+165
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
5+
<PropertyGroup>
6+
<PackageType>MSBuildSdk</PackageType>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<File Include="sdk/**/*">
11+
<TargetPath>sdk</TargetPath>
12+
</File>
13+
<File Include="targets/**/*">
14+
<TargetPath>targets</TargetPath>
15+
</File>
16+
</ItemGroup>
17+
18+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
19+
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
***********************************************************************************************
4+
Sdk.props
5+
6+
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
7+
created a backup copy. Incorrect changes to this file will make it
8+
impossible to load or build your projects from the command-line or the IDE.
9+
10+
Copyright (c) .NET Foundation. All rights reserved.
11+
***********************************************************************************************
12+
-->
13+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
14+
15+
<PropertyGroup>
16+
<MSBuildAllProjects>$(MSBuildThisFileFullPath);$(MSBuildAllProjects)</MSBuildAllProjects>
17+
</PropertyGroup>
18+
19+
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
20+
21+
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
***********************************************************************************************
4+
Sdk.targets
5+
6+
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
7+
created a backup copy. Incorrect changes to this file will make it
8+
impossible to load or build your projects from the command-line or the IDE.
9+
10+
Copyright (c) .NET Foundation. All rights reserved.
11+
***********************************************************************************************
12+
-->
13+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
14+
15+
<PropertyGroup>
16+
<MSBuildAllProjects>$(MSBuildThisFileFullPath);$(MSBuildAllProjects)</MSBuildAllProjects>
17+
<LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.ilproj'">$(MSBuildThisFileDirectory)..\targets\Microsoft.NET.Sdk.IL.targets</LanguageTargets>
18+
</PropertyGroup>
19+
20+
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
21+
22+
</Project>
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
***********************************************************************************************
4+
Microsoft.NET.Sdk.IL.targets
5+
6+
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
7+
created a backup copy. Incorrect changes to this file will make it
8+
impossible to load or build your projects from the command-line or the IDE.
9+
10+
Copyright (c) .NET Foundation. All rights reserved.
11+
***********************************************************************************************
12+
-->
13+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
14+
15+
<PropertyGroup>
16+
<MSBuildAllProjects>$(MSBuildThisFileFullPath);$(MSBuildAllProjects)</MSBuildAllProjects>
17+
<DefaultLanguageSourceExtension>.il</DefaultLanguageSourceExtension>
18+
<Language>IL</Language>
19+
<TargetRuntime>Managed</TargetRuntime>
20+
</PropertyGroup>
21+
22+
<PropertyGroup>
23+
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('windows'))">win</_OSPlatform>
24+
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('linux'))">linux</_OSPlatform>
25+
<_OSPlatform Condition="$([MSBuild]::IsOSPlatform('osx'))">osx</_OSPlatform>
26+
<_OSArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</_OSArchitecture>
27+
28+
<MicrosoftNetCoreIlasmPackageRuntimeId Condition="'$(MicrosoftNetCoreIlasmPackageRuntimeId)' == ''">$(_OSPlatform)-$(_OSArchitecture.ToLower())</MicrosoftNetCoreIlasmPackageRuntimeId>
29+
<MicrosoftNetCoreIlasmPackageVersion Condition="'$(MicrosoftNetCoreIlasmPackageVersion)' == ''">3.0.0</MicrosoftNetCoreIlasmPackageVersion>
30+
<MicrosoftNetCoreIlasmPackageName>runtime.$(MicrosoftNetCoreIlasmPackageRuntimeId).microsoft.netcore.ilasm</MicrosoftNetCoreIlasmPackageName>
31+
<MicrosoftNetCoreRuntimeCoreClrPackageName>runtime.$(MicrosoftNetCoreIlasmPackageRuntimeId).microsoft.netcore.runtime.coreclr</MicrosoftNetCoreRuntimeCoreClrPackageName>
32+
33+
<ToolsDir Condition="'$(ToolsDir)' == ''">$([System.IO.Path]::Combine($([System.IO.Path]::GetTempPath()), $([System.IO.Path]::GetRandomFileName())))</ToolsDir>
34+
</PropertyGroup>
35+
36+
<ItemGroup>
37+
<PackageReference Include="$(MicrosoftNetCoreIlasmPackageName)" Version="$(MicrosoftNetCoreIlasmPackageVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
38+
<PackageReference Include="$(MicrosoftNetCoreRuntimeCoreClrPackageName)" Version="$(MicrosoftNetCoreIlasmPackageVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
39+
</ItemGroup>
40+
41+
<PropertyGroup>
42+
<CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn>
43+
</PropertyGroup>
44+
45+
<Target Name="CreateManifestResourceNames"
46+
Condition="'@(EmbeddedResource)' != ''"
47+
DependsOnTargets="$(CreateManifestResourceNamesDependsOn)">
48+
<!-- Required by Microsoft.Common.targets -->
49+
</Target>
50+
51+
<Target Name="CoreCompile"
52+
Inputs="$(MSBuildAllProjects);
53+
@(Compile)"
54+
Outputs="@(IntermediateAssembly)"
55+
Returns=""
56+
DependsOnTargets="$(CoreCompileDependsOn)">
57+
<ItemGroup>
58+
<_IlasmSourceFiles Include="$(NuGetPackageRoot)\$(MicrosoftNetCoreIlasmPackageName)\$(MicrosoftNetCoreIlasmPackageVersion)\runtimes\$(MicrosoftNetCoreIlasmPackageRuntimeId)\native\**\*" />
59+
<_IlasmSourceFiles Include="$(NuGetPackageRoot)\$(MicrosoftNetCoreRuntimeCoreClrPackageName)\$(MicrosoftNetCoreIlasmPackageVersion)\runtimes\$(MicrosoftNetCoreIlasmPackageRuntimeId)\native\**\*" />
60+
</ItemGroup>
61+
62+
<PropertyGroup>
63+
<_IlasmDir>$(ToolsDir)\ilasm</_IlasmDir>
64+
65+
<_OutputTypeArgument Condition="'$(OutputType)' == 'Library'">-DLL</_OutputTypeArgument>
66+
<_OutputTypeArgument Condition="'$(OutputType)' == 'Exe'">-EXE</_OutputTypeArgument>
67+
68+
<_KeyFileArgument Condition="'$(KeyOriginatorFile)' != ''">-KEY=$(KeyOriginatorFile)</_KeyFileArgument>
69+
70+
<_IlasmSwitches>-QUIET -NOLOGO</_IlasmSwitches>
71+
<_IlasmSwitches Condition="'$(FoldIdenticalMethods)' == 'True'">$(_IlasmSwitches) -FOLD</_IlasmSwitches>
72+
<_IlasmSwitches Condition="'$(SizeOfStackReserve)' != ''">$(_IlasmSwitches) -STACK=$(SizeOfStackReserve)</_IlasmSwitches>
73+
<_IlasmSwitches Condition="'$(DebugType)' == 'Full'">$(_IlasmSwitches) -DEBUG</_IlasmSwitches>
74+
<_IlasmSwitches Condition="'$(DebugType)' == 'Impl'">$(_IlasmSwitches) -DEBUG=IMPL</_IlasmSwitches>
75+
<_IlasmSwitches Condition="'$(DebugType)' == 'PdbOnly'">$(_IlasmSwitches) -DEBUG=OPT</_IlasmSwitches>
76+
<_IlasmSwitches Condition="'$(Optimize)' == 'True'">$(_IlasmSwitches) -OPTIMIZE</_IlasmSwitches>
77+
</PropertyGroup>
78+
79+
<!-- Having to copy these binaries is really inefficient. https://github.com/dotnet/coreclr/issues/18892 tracks making the ilasm tool self-contained -->
80+
<MakeDir Directories="$(_IlasmDir)" />
81+
<Copy DestinationFolder="$(_IlasmDir)" SourceFiles="@(_IlasmSourceFiles)" />
82+
83+
<Exec Command="$(_IlasmDir)\ilasm $(_IlasmSwitches) $(_OutputTypeArgument) $(IlasmFlags) -OUTPUT=@(IntermediateAssembly) $(_KeyFileArgument) @(Compile, ' ')">
84+
<Output TaskParameter="ExitCode" PropertyName="_ILAsmExitCode" />
85+
</Exec>
86+
87+
<Error Text="ILAsm failed" Condition="'$(_ILAsmExitCode)' != '0'" />
88+
89+
<CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''"/>
90+
</Target>
91+
92+
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
93+
94+
</Project>

src/.nuget/descriptions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"Description": "CoreCLR application host for test applications",
4040
"CommonTypes": [ ]
4141
},
42+
{
43+
"Name": "Microsoft.NET.Sdk.IL",
44+
"Description": "Provides support for building IL projects.",
45+
"CommonTypes": [ ]
46+
},
4247
{
4348
"Name": "Microsoft.NETCore.Native",
4449
"Description": "Native shims for .NET Core runtime",

src/.nuget/packages.builds

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
<Project Include="Microsoft.NETCore.ILDAsm\Microsoft.NETCore.ILDAsm.builds" />
2626
</ItemGroup>
2727

28+
<ItemGroup Condition="'$(BuildIdentityPackage)' == 'true'">
29+
<Project Include="Microsoft.NET.Sdk.IL\Microsoft.NET.Sdk.IL.pkgproj" />
30+
</ItemGroup>
31+
2832
<Import Project="$(ToolsDir)versioning.targets" />
2933
<!-- Make sure we create version.txt file since it will be packaged -->
3034
<Target Name="EnsureVersionInfoFileExists" BeforeTargets="Build" DependsOnTargets="CreateVersionInfoFile" />

0 commit comments

Comments
 (0)