Skip to content

Commit fed56d2

Browse files
committed
update the post build script
* use dotnet pack for the plugin project * refactor Zip-Release and Pack-Squirrel-Installer functions * remove reference to NuGet.CommandLine - no longer needed
1 parent 85d2b3f commit fed56d2

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

Flow.Launcher/Flow.Launcher.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@
6161
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
6262
<PackageReference Include="NHotkey.Wpf" Version="1.2.1" />
6363
<PackageReference Include="NLog.Web.AspNetCore" Version="4.9.0" />
64-
<PackageReference Include="NuGet.CommandLine" Version="5.4.0">
65-
<PrivateAssets>all</PrivateAssets>
66-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
67-
</PackageReference>
6864
<PackageReference Include="PropertyChanged.Fody" Version="3.2.8">
6965
<PrivateAssets>all</PrivateAssets>
7066
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

Scripts/flowlauncher.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<description>Flow Launcher - a launcher for windows</description>
1212
</metadata>
1313
<files>
14-
<file src="**\*.*" target="lib\net45\" exclude="Flow.Launcher.vshost.exe;Flow.Launcher.vshost.exe.config;Flow.Launcher.vshost.exe.manifest;*.nupkg;Setup.exe;RELEASES"/>
14+
<file src="**\*.*" target="lib\netcoreapp3.1\" exclude="Flow.Launcher.vshost.exe;Flow.Launcher.vshost.exe.config;Flow.Launcher.vshost.exe.manifest;*.nupkg;Setup.exe;RELEASES"/>
1515
</files>
1616
</package>

Scripts/post_build.ps1

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,26 @@ function Validate-Directory ($output) {
5757
New-Item $output -ItemType Directory -Force
5858
}
5959

60-
function Pack-Nuget ($path, $version, $output) {
60+
function Pack-Plugin ($path, $output) {
6161
Write-Host "Begin build nuget library"
6262

63-
$spec = "$path\Scripts\flowlauncher.plugin.nuspec"
64-
Write-Host "nuspec path: $spec"
63+
$project = "$path\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj"
64+
65+
Write-Host "Packing: $project"
6566
Write-Host "Output path: $output"
6667

67-
Nuget pack $spec -Version $version -OutputDirectory $output
68+
dotnet pack $project --include-symbols --configuration Release --output $output
6869

6970
Write-Host "End build nuget library"
7071
}
7172

7273
function Zip-Release ($path, $version, $output) {
7374
Write-Host "Begin zip release"
7475

75-
$input = "$path\Output\Release"
76-
Write-Host "Input path: $input"
77-
$file = "$output\Flow.Launcher-$version.zip"
78-
Write-Host "Filename: $file"
76+
$content = "$path\Output\Release\*"
77+
$zipFile = "$output\Flow.Launcher-$version.zip"
7978

80-
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem")
81-
[System.IO.Compression.ZipFile]::CreateFromDirectory($input, $file)
79+
Compress-Archive -Force -Path $content -DestinationPath $zipFile
8280

8381
Write-Host "End zip release"
8482
}
@@ -88,10 +86,12 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
8886
Write-Host "Begin pack squirrel installer"
8987

9088
$spec = "$path\Scripts\flowlauncher.nuspec"
91-
Write-Host "nuspec path: $spec"
9289
$input = "$path\Output\Release"
90+
91+
Write-Host "Packing: $spec"
9392
Write-Host "Input path: $input"
94-
Nuget pack $spec -Version $version -Properties Configuration=Release -BasePath $input -OutputDirectory $output
93+
# TODO: can we use dotnet pack here?
94+
nuget pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release
9595

9696
$nupkg = "$output\FlowLauncher.$version.nupkg"
9797
Write-Host "nupkg path: $nupkg"
@@ -139,12 +139,11 @@ function Main {
139139
$o = "$p\Output\Packages"
140140
Validate-Directory $o
141141
# making version static as multiple versions can exist in the nuget folder and in the case a breaking change is introduced.
142-
New-Alias Nuget $env:USERPROFILE\.nuget\packages\NuGet.CommandLine\5.4.0\tools\NuGet.exe -Force
143142
Pack-Squirrel-Installer $p $v $o
144143

145144
$isInCI = $env:APPVEYOR
146145
if ($isInCI) {
147-
Pack-Nuget $p $v $o
146+
Pack-Plugin $p $o
148147
Zip-Release $p $v $o
149148
}
150149

0 commit comments

Comments
 (0)