Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<MonoLLVMDir Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == ''">$(MonoObjDir)llvm</MonoLLVMDir>
<DotNetExec Condition="'$(OS)' == 'Windows_NT'">dotnet.exe</DotNetExec>
<DotNetExec Condition="'$(DotNetExec)' == ''">dotnet</DotNetExec>
<LocalDotnetDir>..\..\.dotnet</LocalDotnetDir>
<LocalDotnetDir>$(RepoRoot).dotnet</LocalDotnetDir>
<LocalDotnet>$(LocalDotnetDir)\$(DotNetExec)</LocalDotnet>
<LocalMonoDotnetDir>..\..\.dotnet-mono</LocalMonoDotnetDir>
<LocalMonoDotnetDir>$(RepoRoot).dotnet-mono</LocalMonoDotnetDir>
<LocalMonoDotnet>$(LocalMonoDotnetDir)\$(DotNetExec)</LocalMonoDotnet>
<ScriptExt Condition="'$(OS)' == 'Windows_NT'">.cmd</ScriptExt>
<ScriptExt Condition="'$(OS)' != 'Windows_NT'">.sh</ScriptExt>
Expand Down Expand Up @@ -119,30 +119,42 @@

<Target Name="Test" />

<!-- Copy Mono runtime bits to the local .dotnet-mono (clone of .dotnet) dir for local experiments (temp solution) -->
<Target Name="PatchLocalMonoDotnet" DependsOnTargets="ValidateLocalDotnet">
<!-- Copy Mono runtime bits to $(Destination) -->
<Target Name="CopyMonoRuntimeFilesFromArtifactsToDestination">
<ItemGroup>
<_LocalDotnetFiles Include="$(LocalDotnetDir)\**\*.*" />
<_MonoRuntimeArtifacts Include="$(BinDir)\*.*" />
</ItemGroup>
<Error Condition="'$(Destination)' == ''" Text="Destination should not be empty" />
<Error Condition="@(_MonoRuntimeArtifacts->Count()) &lt; 2" Text="Mono artifacts were not found at $(BinDir)" />
<Message Text="Copying Mono Runtime artifacts from '$(BinDir)' to '$(Destination)'.'" Importance="High" />
<Copy SourceFiles="@(_MonoRuntimeArtifacts)"
DestinationFolder="$(Destination)"
OverwriteReadOnlyFiles="true" />
</Target>

<Target Name="CloneLocalDotnet" DependsOnTargets="ValidateLocalDotnet">
<ItemGroup>
<_LocalDotnetFiles Include="$(LocalDotnetDir)\**\*.*" />
</ItemGroup>
<!-- copy .dotnet to .dotnet-mono if it doesn't exist -->
<Copy SourceFiles="@(_LocalDotnetFiles)"
DestinationFolder="$(LocalMonoDotnetDir)\%(RecursiveDir)"
SkipUnchangedFiles="true" />
<Copy SourceFiles="@(_MonoRuntimeArtifacts)"
DestinationFolder="$([System.IO.Directory]::GetDirectories('$(LocalMonoDotnetDir)\shared\Microsoft.NETCore.App')[0])" />
</Target>

<!-- Copy Mono runtime bits to the local .dotnet-mono (clone of .dotnet) dir for local experiments (temp solution) -->
<Target Name="PatchLocalMonoDotnet" DependsOnTargets="CloneLocalDotnet">
<MSBuild Projects ="$(MSBuildProjectFullPath)"
Properties="Destination=$([System.IO.Directory]::GetDirectories('$(LocalMonoDotnetDir)\shared\Microsoft.NETCore.App')[0])"
Targets="CopyMonoRuntimeFilesFromArtifactsToDestination" />
</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('$(CoreClrTestCoreRoot)')" Text="Core_Root ($(CoreClrTestCoreRoot)) doesn't exist. Have you built coreclr tests in $(CoreClrTestConfig) configuration?" />
<ItemGroup>
<_MonoRuntimeArtifacts Include="$(BinDir)\*.*" />
</ItemGroup>
<Error Condition="@(_MonoRuntimeArtifacts->Count()) &lt; 2" Text="Mono artifacts were not found at $(BinDir)" />
<Copy SourceFiles="@(_MonoRuntimeArtifacts)"
DestinationFolder="$(CoreClrTestCoreRoot)" />
<PropertyGroup>
<Destination>$(CoreClrTestCoreRoot)</Destination>
</PropertyGroup>
<CallTarget Targets="CopyMonoRuntimeFilesFromArtifactsToDestination" />
</Target>

<!-- Copy Coreclr runtime bits back to Core_Root -->
Expand Down
3 changes: 2 additions & 1 deletion src/mono/msvc/mono.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
<!-- When true, mono binaries will link and include BTLS. When false, mono binaries will not link and include BTLS. -->
<MONO_ENABLE_BTLS>false</MONO_ENABLE_BTLS>
<!-- When true, mono binaries will be compiled for use as a .NET Core runtime. -->
<MONO_ENABLE_NETCORE>false</MONO_ENABLE_NETCORE>
<MONO_ENABLE_NETCORE Condition="Exists('..\mono.proj')">true</MONO_ENABLE_NETCORE>
<MONO_ENABLE_NETCORE Condition="!Exists('..\mono.proj')">false</MONO_ENABLE_NETCORE>
</PropertyGroup>
<PropertyGroup Label="MonoDirectories">
<MonoSourceLocation Condition="'$(MonoSourceLocation)' == '' ">..</MonoSourceLocation>
Expand Down
4 changes: 4 additions & 0 deletions src/mono/netcore/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ runtime:
patch-mono-dotnet:
$(DOTNET) msbuild /t:PatchLocalMonoDotnet $(MONO_PROJ)

# copy mono runtime bits from artifacts to $(DST)
copy-runtime-files-to:
$(DOTNET) msbuild /t:CopyMonoRuntimeFilesFromArtifactsToDestination /p:Destination=$(DST) $(MONO_PROJ)

# run specific coreclr test, e.g.:
# make run-tests-coreclr CoreClrTest="bash ../../artifacts/tests/coreclr/OSX.x64.Release/JIT/opt/InstructionCombining/DivToMul/DivToMul.sh"
run-tests-coreclr:
Expand Down