Clean up
authorEgorBo <egorbo@gmail.com>
Tue, 4 Feb 2020 12:07:07 +0000 (15:07 +0300)
committerEgorBo <egorbo@gmail.com>
Tue, 4 Feb 2020 12:07:07 +0000 (15:07 +0300)
src/mono/mono.proj
src/mono/netcore/Makefile

index 451cd8c..6b00636 100644 (file)
@@ -15,6 +15,7 @@
     <_CoreClrFileName Condition="'$(TargetsOSX)' == 'true'">libcoreclr.dylib</_CoreClrFileName>
     <_CoreClrFileName Condition="'$(_CoreClrFileName)' == ''">libcoreclr.so</_CoreClrFileName>
     <CoreClrTestConfig Condition="'$(CoreClrTestConfig)' == ''">$(Configuration)</CoreClrTestConfig>
+    <CoreClrTestCoreRoot>$(ArtifactsDir)tests\coreclr\$(OSGroup).$(Platform).$(CoreClrTestConfig)\Tests\Core_Root</CoreClrTestCoreRoot>
   </PropertyGroup>
 
   <!-- OSX/Linux Mono runtime build -->
@@ -62,8 +63,6 @@
       <_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x86'">$(MonoObjDir)Win32\Bin\$(Configuration)\mono-2.0-sgen.dll</_MonoRuntimeFilePath>
       <_MonoRuntimeFilePath Condition="'$(TargetsOSX)' == 'true'">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
       <_MonoRuntimeFilePath Condition="'$(_MonoRuntimeFilePath)' == ''">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.so</_MonoRuntimeFilePath>
-
-
     </PropertyGroup>
 
     <!-- Copy Mono runtime files to artifacts directory -->
   </Target>
 
   <Target Name="RestoreLocalDotnet" DependsOnTargets="ValidateLocalDotnet">
-    <Move SourceFiles="@(LocalDotnetRuntimeDir)\System.Private.CoreLib.dll-coreclr"
+    <Move SourceFiles="$(LocalDotnetRuntimeDir)\System.Private.CoreLib.dll-coreclr"
           DestinationFiles="$(LocalDotnetRuntimeDir)\System.Private.CoreLib.dll" />
-
-    <Move SourceFiles="@(LocalDotnetRuntimeDir)\$(_CoreClrFileName)-coreclr"
+    <Move SourceFiles="$(LocalDotnetRuntimeDir)\$(_CoreClrFileName)-coreclr"
           DestinationFiles="$(LocalDotnetRuntimeDir)\$(_CoreClrFileName)" />
   </Target>
 
   <!-- Copy Mono runtime bits to the coreclr's Core_Root in order to run runtime tests -->
   <Target Name="PatchCoreClrCoreRoot" DependsOnTargets="ValidateLocalDotnet">
-    <Error Condition="!Exists('$(ArtifactsDir)\tests\coreclr\$(OSGroup).$(Platform).$(CoreClrTestConfig)\Tests\Core_Root')" Text="Core_Root doesn't exist. Have you built coreclr tests in $(CoreClrTestConfig) configuration?" />
+    <Error Condition="!Exists('$(CoreClrTestCoreRoot)')" Text="Core_Root ($(CoreClrTestCoreRoot)) doesn't exist. Have you built coreclr tests in $(CoreClrTestConfig) configuration?" />
     <ItemGroup>
       <_MonoRuntimeArtifacts Include="$(BinDir)\*.*" />
     </ItemGroup>
     <Copy SourceFiles="@(_MonoRuntimeArtifacts)"
-          DestinationFolder="$(ArtifactsDir)\tests\coreclr\$(OSGroup).$(Platform).$(CoreClrTestConfig)\Tests\Core_Root
+          DestinationFolder="$(CoreClrTestCoreRoot)
           SkipUnchangedFiles="true"/>
   </Target>
 
+  <Target Name="RestoreCoreClrCoreRoot" DependsOnTargets="ValidateLocalDotnet">
+    <Move SourceFiles="$(CoreClrTestCoreRoot)\System.Private.CoreLib.dll-coreclr"
+          DestinationFiles="$(CoreClrTestCoreRoot)\System.Private.CoreLib.dll" />
+    <Move SourceFiles="$(CoreClrTestCoreRoot)\$(_CoreClrFileName)-coreclr"
+          DestinationFiles="$(CoreClrTestCoreRoot)\$(_CoreClrFileName)" />
+  </Target>
+
   <!-- Run netcore\sample\HelloWorld sample using Mono Runtime -->
   <Target Name="RunSample" DependsOnTargets="PatchLocalDotnet">
     <Exec Command="$(LocalDotnet) run -c Release -f $(NetCoreAppCurrent) -p $(MonoProjectRoot)netcore\sample\HelloWorld" />
   <!-- Run CoreCLR runtime test using testhost -->
   <Target Name="RunCoreClrTest" DependsOnTargets="ValidateLocalDotnet;PatchCoreClrCoreRoot">
     <Error Condition="$(CoreClrTest) == ''" Text="'CoreClrTest' is not set. E.g. set it to `$(ArtifactsDir)tests/coreclr/$(OSGroup).$(Platform).$(CoreClrTestConfig)/JIT/opt/InstructionCombining/DivToMul/DivToMul$(ScriptExt)` in order to run DivToMul test." />
-    <Exec Command="$(CoreClrTest) -coreroot=&quot;$(ArtifactsDir)tests/coreclr/$(OSGroup).$(Platform).$(CoreClrTestConfig)/Tests/Core_Root&quot;"/>
+    <Exec Command="$(CoreClrTest) -coreroot=&quot;$(CoreClrTestCoreRoot)&quot;"/>
   </Target>
 
   <!-- Make sure coreclr tests are built (in $(CoreClrTestConfig) configuration), e.g. 
     <ItemGroup>        
         <CoreClrTests Include="$(ArtifactsDir)tests\coreclr\$(OSGroup).$(Platform).$(CoreClrTestConfig)\**\*$(ScriptExt)" />   
     </ItemGroup>       
-    <Exec Condition="'$(OS)' == 'Windows_NT'" Command="&quot;%(CoreClrTests.Identity)&quot; -coreroot &quot;$(ArtifactsDir)tests\coreclr\$(OSGroup).$(Platform).$(CoreClrTestConfig)\Tests\Core_Root&quot;" ContinueOnError="WarnAndContinue" />
-    <Exec Condition="'$(OS)' != 'Windows_NT'" Command="bash &quot;%(CoreClrTests.Identity)&quot; -coreroot=&quot;$(ArtifactsDir)tests/coreclr/$(OSGroup).$(Platform).$(CoreClrTestConfig)/Tests/Core_Root&quot;" ContinueOnError="WarnAndContinue" />
+    <Exec Condition="'$(OS)' == 'Windows_NT'" Command="&quot;%(CoreClrTests.Identity)&quot; -coreroot &quot;$(CoreClrTestCoreRoot)&quot;" ContinueOnError="WarnAndContinue" />
+    <Exec Condition="'$(OS)' != 'Windows_NT'" Command="bash &quot;%(CoreClrTests.Identity)&quot; -coreroot=&quot;$(CoreClrTestCoreRoot)&quot;" ContinueOnError="WarnAndContinue" />
   </Target>
 
   <!-- Show summary for coreclr tests -->
index a103e21..47e3252 100644 (file)
@@ -15,6 +15,9 @@ runtime:
 patch-local-dotnet:
        $(DOTNET) msbuild /t:PatchLocalDotnet ../mono.proj
 
+restore-local-dotnet:
+       $(DOTNET) msbuild /t:RestoreLocalDotnet ../mono.proj
+
 # run specific coreclr test, e.g.:
 # make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Checked/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh"
 run-tests-coreclr: