diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2016-11-23 19:09:09 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2016-11-23 19:09:09 +0900 |
commit | 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (patch) | |
tree | 98110734c91668dfdbb126fcc0e15ddbd93738ca /tests/src/CLRTest.CrossGen.targets | |
parent | fa45f57ed55137c75ac870356a1b8f76c84b229c (diff) | |
download | coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.gz coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.bz2 coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.zip |
Imported Upstream version 1.1.0upstream/1.1.0
Diffstat (limited to 'tests/src/CLRTest.CrossGen.targets')
-rw-r--r-- | tests/src/CLRTest.CrossGen.targets | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/tests/src/CLRTest.CrossGen.targets b/tests/src/CLRTest.CrossGen.targets new file mode 100644 index 0000000000..d91bdcc7ea --- /dev/null +++ b/tests/src/CLRTest.CrossGen.targets @@ -0,0 +1,100 @@ +<!-- +*********************************************************************************************** +CLRTest.Execute.targets + +WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have + created a backup copy. Incorrect changes to this file will make it + impossible to load or build your projects from the command-line or the IDE. + +This file contains the logic for providing Execution Script generation. + +WARNING: When setting properties based on their current state (for example: + <Foo Condition="'$(Foo)'==''>Bar</Foo>). Be very careful. Another script generation + target might be trying to do the same thing. It's better to avoid this by instead setting a new property. + + Additionally, be careful with itemgroups. Include will propagate outside of the target too! + +*********************************************************************************************** +--> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + + <PropertyGroup> + <BashScriptSnippetGen>$(BashScriptSnippetGen);GetCrossgenBashScript</BashScriptSnippetGen> + <BatchScriptSnippetGen>$(BatchScriptSnippetGen);GetCrossgenBatchScript</BatchScriptSnippetGen> + </PropertyGroup> + <ItemGroup> + <CLRTestBashEnvironmentVariable Condition="'$(CrossGenTest)' == 'true'" Include = "export RunCrossGen=1"/> + <CLRTestBatchEnvironmentVariable Condition="'$(CrossGenTest)' == 'true'" Include = "set RunCrossGen=1"/> + </ItemGroup> + + <!-- + Target: GetCrossgenBatctchcript + This returns the portion of the execution script that generates the required lines to crossgen the test executable. + --> + <Target Name="GetCrossgenBashScript"> + + <PropertyGroup> + <CrossgenBashScript Condition="'$(CLRTestKind)' == 'BuildAndRun'"> + <![CDATA[ +# CrossGen Script +if [ ! -z ${RunCrossGen+x} ]%3B then + export COMPlus_ZapRequire=$(ZapRequire) + export COMPlus_ZapRequireList=$(MSBuildProjectName) + if [ ! -f $(MSBuildProjectName).ni.exe ]%3B then + TakeLock + if [ ! -f $(MSBuildProjectName).ni.exe ]%3B then + echo $_DebuggerFullPath "$CORE_ROOT/crossgen" /Platform_Assemblies_Paths $CORE_ROOT%3A$PWD $(MSBuildProjectName).exe + $_DebuggerFullPath "$CORE_ROOT/crossgen" /Platform_Assemblies_Paths $CORE_ROOT%3A$PWD $(MSBuildProjectName).exe + __cgExitCode=$? + if [ $__cgExitCode -ne 0 ] + then + echo Crossgen failed with exitcode: $__cgExitCode + ReleaseLock + exit 1 + fi + fi + ReleaseLock + fi +fi + ]]> + </CrossgenBashScript> + + <BashCLRTestPreCommands>$(BashCLRTestPreCommands);$(CrossgenBashScript)</BashCLRTestPreCommands> + </PropertyGroup> + </Target> + + <Target Name="GetCrossgenBatchScript"> + + <PropertyGroup> + <CrossgenBatchScript Condition="'$(CLRTestKind)' == 'BuildAndRun'"> + <![CDATA[ + +REM CrossGen Script +if defined RunCrossGen ( + set COMPlus_ZapRequire=$(ZapRequire) + set COMPlus_ZapRequireList=$(MSBuildProjectName) + if not exist "$(MSBuildProjectName).ni.exe" ( + call :TakeLock + set CrossGenStatus=0 + if not exist "$(MSBuildProjectName).ni.exe" ( + echo "%_DebuggerFullPath% %CORE_ROOT%\crossgen.exe" /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25 $(MSBuildProjectName).exe + %_DebuggerFullPath% "%CORE_ROOT%\crossgen.exe" /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25 $(MSBuildProjectName).exe + set CrossGenStatus=!ERRORLEVEL! + ) + call :ReleaseLock + IF NOT !CrossGenStatus!==0 ( + ECHO Crossgen failed with exitcode - !CrossGenStatus! + Exit /b 1 + ) + ) +) + ]]> + </CrossgenBatchScript> + + <CLRTestBatchPreCommands>$(CLRTestBatchPreCommands);$(CrossgenBatchScript)</CLRTestBatchPreCommands> + </PropertyGroup> + </Target> + + + +</Project> |