mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-09 17:44:48 +09:00
32 lines
1.3 KiB
XML
32 lines
1.3 KiB
XML
<Project>
|
|
<Target Name="FindPythonWindows"
|
|
Condition="$([MSBuild]::IsOSPlatform(Windows)) and '$(PYTHON)' == ''"
|
|
Returns="$(PYTHON)">
|
|
<PropertyGroup>
|
|
<_PythonLocationScript>-c "import sys; sys.stdout.write(sys.executable)"</_PythonLocationScript>
|
|
</PropertyGroup>
|
|
<Exec Command="py -3 $(_PythonLocationScript) 2> nul || python3 $(_PythonLocationScript) 2> nul || python $(_PythonLocationScript) 2> nul"
|
|
StandardOutputImportance="Low"
|
|
EchoOff="true"
|
|
ConsoleToMsBuild="true">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="PYTHON" />
|
|
</Exec>
|
|
<PropertyGroup>
|
|
<PYTHON>"$(PYTHON)"</PYTHON>
|
|
</PropertyGroup>
|
|
</Target>
|
|
<Target Name="FindPythonUnix"
|
|
Condition="!$([MSBuild]::IsOSPlatform(Windows)) and '$(PYTHON)' == ''"
|
|
Returns="$(PYTHON)">
|
|
<Exec Command="command -v python3 || command -v python || command -v py"
|
|
StandardOutputImportance="Low"
|
|
EchoOff="true"
|
|
ConsoleToMsBuild="true">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="PYTHON" />
|
|
</Exec>
|
|
<PropertyGroup>
|
|
<PYTHON>"$(PYTHON)"</PYTHON>
|
|
</PropertyGroup>
|
|
</Target>
|
|
<Target Name="FindPython" DependsOnTargets="FindPythonWindows;FindPythonUnix" />
|
|
</Project>
|