Improve error for missing Python (#81202)
* add error * Fix a case were missing VC components didn't error * handle non empty stdout * Remove self assignment
This commit is contained in:
Родитель
8ba2ad4f46
Коммит
d021235cde
|
@ -61,6 +61,7 @@ exit /b 1
|
|||
if "%__VCBuildArch%"=="" exit /b 0
|
||||
|
||||
:: Set the environment for the native build
|
||||
if not exist "%VCINSTALLDIR%Auxiliary\Build\vcvarsall.bat" goto :VSMissing
|
||||
call "%VCINSTALLDIR%Auxiliary\Build\vcvarsall.bat" %__VCBuildArch%
|
||||
if not "%ErrorLevel%"=="0" exit /b 1
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<Project>
|
||||
<Target Name="FindPythonWindows"
|
||||
<Target Name="_FindPythonWindows"
|
||||
Condition="$([MSBuild]::IsOSPlatform(Windows)) and '$(PYTHON)' == ''"
|
||||
Returns="$(PYTHON)">
|
||||
<PropertyGroup>
|
||||
|
@ -8,25 +8,24 @@
|
|||
<Exec Command="py -3 $(_PythonLocationScript) 2> nul || python3 $(_PythonLocationScript) 2> nul || python $(_PythonLocationScript) 2> nul"
|
||||
StandardOutputImportance="Low"
|
||||
EchoOff="true"
|
||||
ContinueOnError="ErrorAndContinue"
|
||||
ConsoleToMsBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="PYTHON" />
|
||||
</Exec>
|
||||
<PropertyGroup>
|
||||
<PYTHON>"$(PYTHON)"</PYTHON>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="FindPythonUnix"
|
||||
<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"
|
||||
ContinueOnError="ErrorAndContinue"
|
||||
ConsoleToMsBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="PYTHON" />
|
||||
</Exec>
|
||||
<PropertyGroup>
|
||||
<PYTHON>"$(PYTHON)"</PYTHON>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="FindPython" DependsOnTargets="FindPythonWindows;FindPythonUnix" />
|
||||
<Target Name="FindPython" DependsOnTargets="_FindPythonWindows;_FindPythonUnix">
|
||||
<Error Condition="'$(PYTHON)' == ''"
|
||||
Text="Python not found. Please add Python 3 to your path and try again."/>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -337,7 +337,7 @@
|
|||
|
||||
</PropertyGroup>
|
||||
|
||||
<Exec Command="$(PYTHON) -B $(_PythonWarningParameter) "@(EventingGenerationScript)" --man "@(EventManifestFile)" --intermediate "$(_EventingSourceFileDirectory)"" />
|
||||
<Exec Command=""$(PYTHON)" -B $(_PythonWarningParameter) "@(EventingGenerationScript)" --man "@(EventManifestFile)" --intermediate "$(_EventingSourceFileDirectory)"" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="@(EventingSourceFile)" />
|
||||
|
|
|
@ -341,7 +341,7 @@
|
|||
<_EventingSourceFileDirectory Condition="HasTrailingSlash('$(_EventingSourceFileDirectory)')">$(_EventingSourceFileDirectory.TrimEnd('\'))</_EventingSourceFileDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<Exec Command="$(PYTHON) -B $(_PythonWarningParameter) "@(EventingGenerationScript)" --man "@(EventManifestFile)" --intermediate "$(_EventingSourceFileDirectory)" --runtimeflavor mono" />
|
||||
<Exec Command=""$(PYTHON)" -B $(_PythonWarningParameter) "@(EventingGenerationScript)" --man "@(EventManifestFile)" --intermediate "$(_EventingSourceFileDirectory)" --runtimeflavor mono" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="@(EventingSourceFile)" />
|
||||
|
|
Загрузка…
Ссылка в новой задаче