|
9 | 9 | <DotNetExec Condition="'$(DotNetExec)' == ''">dotnet</DotNetExec>
|
10 | 10 | <LocalDotnetDir>..\..\.dotnet</LocalDotnetDir>
|
11 | 11 | <LocalDotnet>$(LocalDotnetDir)\$(DotNetExec)</LocalDotnet>
|
| 12 | + <LocalMonoDotnetDir>..\..\.dotnet-mono</LocalMonoDotnetDir> |
| 13 | + <LocalMonoDotnet>$(LocalMonoDotnetDir)\$(DotNetExec)</LocalMonoDotnet> |
12 | 14 | <ScriptExt Condition="'$(OS)' == 'Windows_NT'">.cmd</ScriptExt>
|
13 | 15 | <ScriptExt Condition="'$(OS)' != 'Windows_NT'">.sh</ScriptExt>
|
14 | 16 | <_CoreClrFileName Condition="'$(TargetsWindows)' == 'true'">coreclr.dll</_CoreClrFileName>
|
|
56 | 58 | <Exec Command="msvc\run-msbuild.bat build $(_MonoBuildPlatform) $(Configuration) sgen "$(_MonoBuildParams)" msvc\mono-netcore.sln" IgnoreStandardErrorWarningFormat="true" />
|
57 | 59 | </Target>
|
58 | 60 |
|
| 61 | + <Target Name="BuildCoreLib"> |
| 62 | + <MSBuild Projects="$(MonoProjectRoot)netcore\System.Private.CoreLib\System.Private.CoreLib.csproj" |
| 63 | + Properties="Configuration=$(Configuration)" |
| 64 | + Targets="Build" /> |
| 65 | + </Target> |
| 66 | + |
59 | 67 | <!-- General targets -->
|
60 | 68 | <Target Name="Build" DependsOnTargets="BuildMonoRuntimeUnix;BuildMonoRuntimeWindows">
|
61 | 69 | <PropertyGroup>
|
|
88 | 96 |
|
89 | 97 | <Target Name="Test" />
|
90 | 98 |
|
91 |
| - <!-- Copy Mono runtime bits to the local .dotnet dir for local experiments (temp solution) --> |
92 |
| - <Target Name="PatchLocalDotnet" DependsOnTargets="ValidateLocalDotnet"> |
93 |
| - <PropertyGroup> |
94 |
| - <LocalDotnetRuntimeDir>$([System.IO.Directory]::GetDirectories("$(LocalDotnetDir)\shared\Microsoft.NETCore.App")[0])</LocalDotnetRuntimeDir> |
95 |
| - </PropertyGroup> |
| 99 | + <!-- Copy Mono runtime bits to the local .dotnet-mono (clone of .dotnet) dir for local experiments (temp solution) --> |
| 100 | + <Target Name="PatchLocalMonoDotnet" DependsOnTargets="ValidateLocalDotnet"> |
96 | 101 | <ItemGroup>
|
| 102 | + <_LocalDotnetFiles Include="$(LocalDotnetDir)\**\*.*" /> |
97 | 103 | <_MonoRuntimeArtifacts Include="$(BinDir)\*.*" />
|
98 | 104 | </ItemGroup>
|
99 |
| - <Copy SourceFiles="$(_MonoRuntimeArtifacts)" |
100 |
| - DestinationFolder="$(LocalDotnetRuntimeDir)" |
| 105 | + <Error Condition="@(_MonoRuntimeArtifacts->Count()) < 2" Text="Mono artifacts were not found at $(BinDir)" /> |
| 106 | + <!-- copy .dotnet to .dotnet-mono if it doesn't exist --> |
| 107 | + <Copy SourceFiles="@(_LocalDotnetFiles)" |
| 108 | + DestinationFolder="$(LocalMonoDotnetDir)\%(RecursiveDir)" |
101 | 109 | SkipUnchangedFiles="true" />
|
102 |
| - </Target> |
103 |
| - |
104 |
| - <!-- Copy Coreclr runtime bits to the local .dotnet dir --> |
105 |
| - <Target Name="RestoreLocalDotnet" DependsOnTargets="ValidateLocalDotnet"> |
106 |
| - <Copy SourceFiles="$(CoreCLRArtifactsPath)\System.Private.CoreLib.dll" |
107 |
| - DestinationFiles="$(LocalDotnetRuntimeDir)\System.Private.CoreLib.dll" /> |
108 |
| - <Copy SourceFiles="$(CoreCLRArtifactsPath)\$(_CoreClrFileName)" |
109 |
| - DestinationFiles="$(LocalDotnetRuntimeDir)\$(_CoreClrFileName)" /> |
| 110 | + <Copy SourceFiles="@(_MonoRuntimeArtifacts)" |
| 111 | + DestinationFolder="$([System.IO.Directory]::GetDirectories('$(LocalMonoDotnetDir)\shared\Microsoft.NETCore.App')[0])" /> |
110 | 112 | </Target>
|
111 | 113 |
|
112 | 114 | <!-- Copy Mono runtime bits to the coreclr's Core_Root in order to run runtime tests -->
|
|
115 | 117 | <ItemGroup>
|
116 | 118 | <_MonoRuntimeArtifacts Include="$(BinDir)\*.*" />
|
117 | 119 | </ItemGroup>
|
| 120 | + <Error Condition="@(_MonoRuntimeArtifacts->Count()) < 2" Text="Mono artifacts were not found at $(BinDir)" /> |
118 | 121 | <Copy SourceFiles="@(_MonoRuntimeArtifacts)"
|
119 |
| - DestinationFolder="$(CoreClrTestCoreRoot)" |
120 |
| - SkipUnchangedFiles="true"/> |
| 122 | + DestinationFolder="$(CoreClrTestCoreRoot)" /> |
121 | 123 | </Target>
|
122 | 124 |
|
123 | 125 | <!-- Copy Coreclr runtime bits back to Core_Root -->
|
|
129 | 131 | </Target>
|
130 | 132 |
|
131 | 133 | <!-- Run netcore\sample\HelloWorld sample using Mono Runtime -->
|
132 |
| - <Target Name="RunSample" DependsOnTargets="PatchLocalDotnet"> |
133 |
| - <Exec Command="$(LocalDotnet) run -c Release -f $(NetCoreAppCurrent) -p $(MonoProjectRoot)netcore\sample\HelloWorld" /> |
| 134 | + <Target Name="RunSample" DependsOnTargets="PatchLocalMonoDotnet"> |
| 135 | + <PropertyGroup> |
| 136 | + <EnvVars Condition="'$(OS)' != 'Windows_NT'"><![CDATA[ |
| 137 | + COMPlus_DebugWriteToStdErr=1 \ |
| 138 | + MONO_ENV_OPTIONS="" \ |
| 139 | + ]]> |
| 140 | + </EnvVars> |
| 141 | + </PropertyGroup> |
| 142 | + <Exec Condition="'$(OS)' == 'Windows_NT'" Command="$(EnvVars) $(LocalMonoDotnet) run -c $(Configuration) -p $(MonoProjectRoot)netcore/sample/HelloWorld" /> |
| 143 | + <Exec Condition="'$(OS)' != 'Windows_NT'" Command="$(EnvVars) $(LocalMonoDotnet) run -c $(Configuration) -p $(MonoProjectRoot)netcore\sample\HelloWorld" /> |
134 | 144 | </Target>
|
135 | 145 |
|
136 | 146 | <!-- Run CoreCLR runtime test using testhost -->
|
|
139 | 149 | <Exec Command="$(CoreClrTest) -coreroot="$(CoreClrTestCoreRoot)""/>
|
140 | 150 | </Target>
|
141 | 151 |
|
142 |
| - <!-- Make sure coreclr tests are built (in $(CoreClrTestConfig) configuration), e.g. |
143 |
| - *nix: `cd ../coreclr && ./build.sh -release && ./build-testh.sh -release` |
144 |
| - Windows: `cd ../coreclr && build.cmd -release` --> |
| 152 | + <!-- Run coreclr tests using runtest.py --> |
145 | 153 | <Target Name="RunCoreClrTests" DependsOnTargets="ValidateLocalDotnet;PatchCoreClrCoreRoot">
|
146 |
| - <ItemGroup> |
147 |
| - <CoreClrTests Include="$(ArtifactsDir)tests\coreclr\$(OSGroup).$(Platform).$(CoreClrTestConfig)\**\*$(ScriptExt)" /> |
148 |
| - </ItemGroup> |
149 |
| - <Exec Condition="'$(OS)' == 'Windows_NT'" Command=""%(CoreClrTests.Identity)" -coreroot "$(CoreClrTestCoreRoot)"" ContinueOnError="WarnAndContinue" /> |
150 |
| - <Exec Condition="'$(OS)' != 'Windows_NT'" Command="bash "%(CoreClrTests.Identity)" -coreroot="$(CoreClrTestCoreRoot)"" ContinueOnError="WarnAndContinue" /> |
151 |
| - </Target> |
152 |
| - |
153 |
| - <!-- Show summary for coreclr tests --> |
154 |
| - <Target Name="CoreClrTestsSummary"> |
155 |
| - <Exec Command="python $(MonoProjectRoot)..\coreclr\tests\runtest.py --analyze_results_only -test_location $(ArtifactsDir)tests\coreclr\$(OSGroup).$(Platform).$(CoreClrTestConfig) -build_type $(CoreClrTestConfig)" /> |
| 154 | + <Exec Condition="'$(OS)' == 'Windows_NT'" Command="$(MonoProjectRoot)..\coreclr\tests\runtest.cmd $(CoreClrTestConfig)" ContinueOnError="ErrorAndContinue" /> |
| 155 | + <Exec Condition="'$(OS)' != 'Windows_NT'" Command="$(MonoProjectRoot)../coreclr/tests/./runtest.sh $(CoreClrTestConfig)" ContinueOnError="ErrorAndContinue" /> |
156 | 156 | </Target>
|
157 | 157 |
|
158 |
| - <Target Name="RunBenchmarks"> |
| 158 | + <Target Name="RunBenchmarks" DependsOnTargets="PatchLocalMonoDotnet"> |
159 | 159 | <Error Condition="$(BenchmarksRepo) == ''" Text="BenchmarksRepo variable is not set" />
|
160 |
| - <Exec WorkingDirectory="$(BenchmarksRepo)\src\benchmarks\micro" Command="$(LocalDotnet) run -c Release -f $(NetCoreAppCurrent) --cli $(LocalDotnet)" /> |
| 160 | + <Exec WorkingDirectory="$(BenchmarksRepo)\src\benchmarks\micro" Command="$(LocalDotnet) run -c Release -f $(NetCoreAppCurrent) --cli $(LocalMonoDotnet)" /> |
161 | 161 | </Target>
|
162 | 162 |
|
163 | 163 | <Target Name="ValidateLocalDotnet">
|
|
0 commit comments