Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f66971919 | |||
| 49cde9bdd9 |
@@ -52,7 +52,7 @@ jobs:
|
|||||||
"version=$v" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
|
"version=$v" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
|
||||||
|
|
||||||
- name: Build ${{ matrix.config }}
|
- name: Build ${{ matrix.config }}
|
||||||
run: python build_plugin.py --config ${{ matrix.config }} --verbose
|
run: python build_plugin.py --config ${{ matrix.config }} --verbosity minimal
|
||||||
|
|
||||||
- name: Upload DLL
|
- name: Upload DLL
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
+12
-3
@@ -168,7 +168,7 @@ def _find_msbuild_vswhere(vs_version: str) -> Optional[Tuple[Path, str, str]]:
|
|||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
[str(_VSWHERE), '-version', _VS_RANGES[ver], '-latest',
|
[str(_VSWHERE), '-products', '*', '-version', _VS_RANGES[ver], '-latest',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe'],
|
'-find', r'MSBuild\**\Bin\MSBuild.exe'],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -184,15 +184,24 @@ def _find_msbuild_vswhere(vs_version: str) -> Optional[Tuple[Path, str, str]]:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
_VS_NUMERIC_FOLDER = {'2026': '18', '2022': '2022'}
|
||||||
|
|
||||||
|
|
||||||
def find_msbuild(vs_version: str = 'auto') -> Optional[Tuple[Path, str, str]]:
|
def find_msbuild(vs_version: str = 'auto') -> Optional[Tuple[Path, str, str]]:
|
||||||
result = _find_msbuild_vswhere(vs_version)
|
result = _find_msbuild_vswhere(vs_version)
|
||||||
if result:
|
if result:
|
||||||
return result
|
return result
|
||||||
# Fallback: well-known paths
|
# Fallback: well-known paths (incl. BuildTools and VS2026 numeric folder)
|
||||||
to_try = ['2026', '2022'] if vs_version == 'auto' else [vs_version]
|
to_try = ['2026', '2022'] if vs_version == 'auto' else [vs_version]
|
||||||
for ver in to_try:
|
for ver in to_try:
|
||||||
|
numeric = _VS_NUMERIC_FOLDER.get(ver, ver)
|
||||||
|
base_paths = [
|
||||||
|
Path(rf'C:\Program Files (x86)\Microsoft Visual Studio\{numeric}'),
|
||||||
|
Path(rf'C:\Program Files\Microsoft Visual Studio\{ver}'),
|
||||||
|
]
|
||||||
|
for base in base_paths:
|
||||||
for edition in ('Community', 'Professional', 'Enterprise', 'BuildTools'):
|
for edition in ('Community', 'Professional', 'Enterprise', 'BuildTools'):
|
||||||
p = Path(rf'C:\Program Files\Microsoft Visual Studio\{ver}\{edition}\MSBuild\Current\Bin\MSBuild.exe')
|
p = base / edition / 'MSBuild' / 'Current' / 'Bin' / 'MSBuild.exe'
|
||||||
if p.exists():
|
if p.exists():
|
||||||
return p, _VS_TOOLSETS[ver], ver
|
return p, _VS_TOOLSETS[ver], ver
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user