* Use powershell global tool

* better way of finding dotnet
This commit is contained in:
Jared Parsons 2023-03-31 11:56:35 -07:00 коммит произвёл GitHub
Родитель 0653fb8900
Коммит 449680893b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 18 добавлений и 14 удалений

12
.config/dotnet-tools.json Normal file
Просмотреть файл

@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"powershell": {
"version": "7.3.3",
"commands": [
"pwsh"
]
}
}
}

Просмотреть файл

@ -119,6 +119,7 @@
<package pattern="omnisharp.roslyn.csharp" />
<package pattern="omnisharp.shared" />
<package pattern="perfolizer" />
<package pattern="powershell" />
<package pattern="roslyn.diagnostics.analyzers" />
<package pattern="runtime.*" />
<package pattern="streamjsonrpc" />

Просмотреть файл

@ -1,4 +1,5 @@
<Project>
<Target Name="_EnsureVSIXWasGenerated" AfterTargets="GenerateVisualStudioInsertionManifests" Condition="'$(OS)'=='WINDOWS_NT' AND '$(ArcadeBuildFromSource)' != 'true'">
<PropertyGroup>
<VSSetupDir>$(ArtifactsDir)VSSetup\</VSSetupDir>
@ -22,6 +23,8 @@
<RidsPublishDir>$(ArtifactsDir)LanguageServer\$(Configuration)\</RidsPublishDir>
<ZipOutputDir>$(RidsPublishDir)</ZipOutputDir>
<_PackageVersion>@(_ResolvedPackageVersionInfo->'%(PackageVersion)')</_PackageVersion>
<_DotNetPath>$(DOTNET_HOST_PATH)</_DotNetPath>
<_DotNetPath Condition="'$(_DotNetPath)' == ''">dotnet</_DotNetPath>
</PropertyGroup>
<ItemGroup>
@ -36,19 +39,7 @@
<Delete Files="%(LanguageServiceBinary.ZipFile)" />
<!-- Build a .zip file from each platform's directory and write it to 'artifacts' -->
<!-- Mac -->
<Exec Command="pwsh -NonInteractive -command &quot;&amp;{ Write-Host &quot;Writing %(LanguageServiceBinary.ZipFile)...&quot; ; Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::CreateFromDirectory('%(LanguageServiceBinary.SourceDir)', '%(LanguageServiceBinary.ZipFile)') }&quot;"
Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
<!-- Windows -->
<Exec Command="powershell.exe -NonInteractive -command &quot;&amp;{ Write-Host &quot;Writing %(LanguageServiceBinary.ZipFile)...&quot; ; Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::CreateFromDirectory('%(LanguageServiceBinary.SourceDir)', '%(LanguageServiceBinary.ZipFile)') }&quot;"
Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<!-- Linux -->
<Exec Command="curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<Exec Command="sudo yum install -y powershell 2>/dev/null" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<Exec Command="pwsh -NonInteractive -command &quot;&amp;{ Write-Host &quot;Writing %(LanguageServiceBinary.ZipFile)...&quot; ; Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::CreateFromDirectory('%(LanguageServiceBinary.SourceDir)', '%(LanguageServiceBinary.ZipFile)') }&quot;"
Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<Exec Command="$(_DotNetPath) pwsh -NonInteractive -command &quot;&amp;{ Write-Host &quot;Writing %(LanguageServiceBinary.ZipFile)...&quot; ; Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::CreateFromDirectory('%(LanguageServiceBinary.SourceDir)', '%(LanguageServiceBinary.ZipFile)') }&quot;"
WorkingDirectory="$(MSBuildThisFileDirectory)..\" />
</Target>
</Project>