Use ILAsm from buildtools (#15172)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Wed, 29 Nov 2017 18:16:18 +0000 (19:16 +0100)
committerGitHub <noreply@github.com>
Wed, 29 Nov 2017 18:16:18 +0000 (19:16 +0100)
* Use ILAsm from buildtools

On Windows: this stops using the ILASM that ships with Windows in favor
of CoreCLR ILASM
On Unix: this stops using the live built ILASM.

I image this fixes some issues in crossbuild on both platforms but I
can't find where the workarounds for that are.

Necessary prerequisite for being able to build tests for the default
interfaces feature.

tests/dir.props
tests/src/IL.targets [deleted file]
tests/src/dir.targets

index 0d00f65..f65af48 100644 (file)
@@ -43,7 +43,6 @@
     <_TargetFrameworkDirectories Condition="'$(BuildToolsTargetsDesktop)' != 'true'">$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
     <_FullFrameworkReferenceAssemblyPaths Condition="'$(BuildToolsTargetsDesktop)' != 'true'">$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
     <ExcludeSigningImport>true</ExcludeSigningImport>
-    <SkipImportILTargets>true</SkipImportILTargets>
   </PropertyGroup>
 
   <!-- Common properties -->
diff --git a/tests/src/IL.targets b/tests/src/IL.targets
deleted file mode 100644 (file)
index d1075e5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
-  <!-- Required by Microsoft.Common.targets -->
-  <Target Name="CreateManifestResourceNames" Condition="'@(EmbeddedResource)' != ''" />
-
-  <Target Name="CoreCompile"
-          Inputs="$(MSBuildAllProjects);
-                  @(Compile)"
-          Outputs="@(IntermediateAssembly);"
-          Returns=""
-          DependsOnTargets="$(CoreCompileDependsOn)">
-    <PropertyGroup>
-      <_ShellKeyMarker Condition="'$(RunningOnUnix)' == 'true'">-</_ShellKeyMarker>  <!-- Work around ilasm comandline parser bugs... -->
-      <_ShellKeyMarker Condition="'$(RunningOnUnix)' != 'true'">/</_ShellKeyMarker>
-      <_ilasm>ilasm</_ilasm>
-      <_ilasm Condition="'$(RunningOnUnix)' == 'true'">$(CoreCLRBinDir)ilasm</_ilasm>
-      <_OutputTypeArgument Condition="'$(OutputType)' == 'Library'">$(_ShellKeyMarker)DLL</_OutputTypeArgument>
-      <_OutputTypeArgument Condition="'$(OutputType)' == 'Exe'">$(_ShellKeyMarker)EXE</_OutputTypeArgument>
-      <_IlasmSwitches>-QUIET -NOLOGO</_IlasmSwitches>
-      <_IlasmSwitches Condition="'$(FoldIdenticalMethods)' == 'True'">$(_IlasmSwitches) -FOLD</_IlasmSwitches>
-      <_IlasmSwitches Condition="'$(SizeOfStackReserve)' != ''">$(_IlasmSwitches) -STACK=$(SizeOfStackReserve)</_IlasmSwitches>
-      <_IlasmSwitches Condition="'$(DebugType)' == 'Full'">$(_IlasmSwitches) -DEBUG</_IlasmSwitches>
-      <_IlasmSwitches Condition="'$(DebugType)' == 'Impl'">$(_IlasmSwitches) -DEBUG=IMPL</_IlasmSwitches>
-      <_IlasmSwitches Condition="'$(DebugType)' == 'PdbOnly'">$(_IlasmSwitches) -DEBUG=OPT</_IlasmSwitches>
-      <_IlasmSwitches Condition="'$(Optimize)' == 'True'">$(_IlasmSwitches) -OPTIMIZE</_IlasmSwitches>
-    </PropertyGroup>
-
-    <Exec Command="$(_ilasm) $(_OutputTypeArgument) $(_ShellKeyMarker)OUTPUT=@(IntermediateAssembly) $(_IlasmSwitches) @(Compile)">
-      <Output TaskParameter="ExitCode" PropertyName="_ILAsmExitCode" />
-    </Exec>
-    <Error Text="ILAsm failed" Condition="'$(_ILAsmExitCode)' != '0'" />
-  </Target>
-
-  <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
-
-</Project>
index 4aa925f..e6845e0 100644 (file)
   <PropertyGroup Condition="'$(ProjectLanguage)' == ''">
     <ProjectLanguage Condition="'$(MSBuildProjectExtension)' == '.ilproj' OR '$(Language)' == 'IL'">IL</ProjectLanguage>
     <ProjectLanguage Condition="'$(MSBuildProjectExtension)' == '.csproj' OR '$(Language)' == 'C#' OR '$(ProjectLanguage)'==''">CSharp</ProjectLanguage>
-  </PropertyGroup>
-  
-  <Import Project="$(ProjectDir)src\IL.targets" Condition="'$(ProjectLanguage)' == 'IL' And '$(CLRTestPriority)' &lt;= '$(CLRTestPriorityToBuild)'" />
 
+    <SkipImportILTargets Condition="'$(CLRTestPriority)' &gt; '$(CLRTestPriorityToBuild)'">true</SkipImportILTargets>
+  </PropertyGroup>
 
   <Import Project="CLRTest.Execute.targets" />
   <Target Name="CreateExecuteScript"