1 <Project Sdk="Microsoft.NET.Sdk">
3 <OutputType>exe</OutputType>
4 <CLRTestKind>BuildAndRun</CLRTestKind>
5 <!-- Running Crossgen2 under GCStress takes too long -->
6 <GCStressIncompatible>true</GCStressIncompatible>
7 <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
8 <CLRTestPriority>0</CLRTestPriority>
10 <!-- Crossgen2 currently targets x64 and ARM64 only -->
11 <DisableProjectBuild Condition="'$(TargetArchitecture)' != 'x64' and '$(TargetArchitecture)' != 'arm64'">true</DisableProjectBuild>
13 <!-- This is an explicit crossgen test -->
14 <CrossGenTest>false</CrossGenTest>
18 <Compile Include="Root.cs" />
22 <ProjectReference Include="FolderA/FolderA.csproj" />
23 <ProjectReference Include="FolderB/FolderB.csproj" />
27 <CLRTestBatchPreCommands><![CDATA[
28 $(CLRTestBatchPreCommands)
30 set __ResponseFile=%scriptPath%\multifolder.rsp
32 echo --composite>>%__ResponseFile%
33 echo -r:%21CORE_ROOT%21\System.*.dll>>%__ResponseFile%
34 echo -r:%21CORE_ROOT%21\Microsoft.*.dll>>%__ResponseFile%
35 echo -r:%21CORE_ROOT%21\mscorlib.dll>>%__ResponseFile%
36 echo -r:%21CORE_ROOT%21\netstandard.dll>>%__ResponseFile%
37 echo -o:%scriptPath%\multifolder-composite.dll>>%__ResponseFile%
38 echo --crp:%scriptPath%\..>>%__ResponseFile%
39 echo --targetarch:$(TargetArchitecture)>>%__ResponseFile%
40 echo %scriptPath%\multifolder.dll>>%__ResponseFile%
41 echo %scriptPath%\..\FolderA\FolderA\FolderA.dll>>%__ResponseFile%
42 echo %scriptPath%\..\FolderB\FolderB\FolderB.dll>>%__ResponseFile%
44 REM Suppress GC stand alone mode for the duration of Crossgen2 execution
45 set __gcStandaloneModeToRestore=!COMPlus_GCName!
48 set __Command=%_DebuggerFullPath%
49 REM Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path
50 if defined __TestDotNetCmd (
51 set __Command=!__Command! "!__TestDotNetCmd!"
53 set __Command=!__Command! "dotnet"
55 set __Command=%__Command% "%CORE_ROOT%\crossgen2\crossgen2.dll"
56 set __Command=%__Command% @"%__ResponseFile%"
58 echo Response file: %__ResponseFile%
60 echo ------------------
61 echo Running crossgen2: %__Command%
65 dir %scriptPath%\multifolder
67 set ExePath=multifolder\multifolder.dll
68 set COMPlus_NativeImageSearchPaths=%scriptPath%
69 set COMPlus_GCName=!__gcStandaloneModeToRestore!
71 ]]></CLRTestBatchPreCommands>
72 <BashCLRTestPreCommands><![CDATA[
73 $(BashCLRTestPreCommands)
76 __ResponseFile=$__OutputDir/multifolder.rsp
78 echo --composite>>$__ResponseFile
79 echo -r:$CORE_ROOT/System.*.dll>>$__ResponseFile
80 echo -r:$CORE_ROOT/Microsoft.*.dll>>$__ResponseFile
81 echo -r:$CORE_ROOT/mscorlib.dll>>$__ResponseFile
82 echo -r:$CORE_ROOT/netstandard.dll>>$__ResponseFile
83 echo -o:$__OutputDir/multifolder-composite.dll>>$__ResponseFile
84 echo --crp:$__OutputDir/..>>$__ResponseFile
85 echo --targetarch:$(TargetArchitecture)>>$__ResponseFile
86 echo $__OutputDir/multifolder.dll>>$__ResponseFile
87 echo $__OutputDir/../FolderA/FolderA/FolderA.dll>>$__ResponseFile
88 echo $__OutputDir/../FolderB/FolderB/FolderB.dll>>$__ResponseFile
90 # Suppress GC standalone mode for the duration of Crossgen2 execution
91 local gcstandaloneModeToRestore=$COMPlus_GCName;
94 __Command=$_DebuggerFullPath
95 # Tests run locally need __TestDotNetCmd (set by runtest.py) or a compatible 5.0 dotnet runtime in the path
96 if [ ! -z ${__TestDotNetCmd+x} ] %3B then
97 __Command+=" $__TestDotNetCmd"
99 __Command+=" $CORE_ROOT/corerun"
101 __Command+=" $CORE_ROOT/crossgen2/crossgen2.dll $CrossGen2Options"
102 __Command+=" @$__ResponseFile"
104 echo Response file: $__ResponseFile
106 echo ------------------
107 echo Running crossgen2: $__Command
110 ExePath=multifolder/multifolder.dll
111 export COMPlus_NativeImageSearchPaths=$__OutputDir
112 export COMPlus_GCName=$gcstandaloneModeToRestore
114 ]]></BashCLRTestPreCommands>