Merge remote-tracking branch 'origin/dev' into explorer_plugin

This commit is contained in:
Jeremy Wu 2020-06-08 20:53:13 +10:00
commit eefe2b9ea9
45 changed files with 158 additions and 170 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

View file

@ -57,10 +57,7 @@
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="squirrel.windows" Version="1.5.2" />
<PackageReference Include="PropertyChanged.Fody" Version="3.2.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody" Version="2.5.13" />
<PackageReference Include="SharpZipLib" Version="1.2.0" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>

View file

@ -1,11 +1,12 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Loader;
using System.Threading.Tasks;
using System.Windows.Forms;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Exception;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
@ -29,6 +30,8 @@ namespace Flow.Launcher.Core.Plugin
public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
{
var erroredPlugins = new List<string>();
var plugins = new List<PluginPair>();
var metadatas = source.Where(o => AllowedLanguage.IsDotNet(o.Language));
@ -50,20 +53,34 @@ namespace Flow.Launcher.Core.Plugin
}
catch (Exception e)
{
Log.Exception($"|PluginsLoader.DotNetPlugins|Couldn't load assembly for {metadata.Name}", e);
erroredPlugins.Add(metadata.Name);
Log.Exception($"|PluginsLoader.DotNetPlugins|Couldn't load assembly for the plugin: {metadata.Name}", e);
return;
}
var types = assembly.GetTypes();
Type type;
try
{
var types = assembly.GetTypes();
type = types.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Contains(typeof(IPlugin)));
}
catch (InvalidOperationException e)
{
Log.Exception($"|PluginsLoader.DotNetPlugins|Can't find class implement IPlugin for <{metadata.Name}>", e);
erroredPlugins.Add(metadata.Name);
Log.Exception($"|PluginsLoader.DotNetPlugins|Can't find the required IPlugin interface for the plugin: <{metadata.Name}>", e);
return;
}
catch (ReflectionTypeLoadException e)
{
erroredPlugins.Add(metadata.Name);
Log.Exception($"|PluginsLoader.DotNetPlugins|The GetTypes method was unable to load assembly types for the plugin: <{metadata.Name}>", e);
return;
}
IPlugin plugin;
try
{
@ -71,7 +88,9 @@ namespace Flow.Launcher.Core.Plugin
}
catch (Exception e)
{
Log.Exception($"|PluginsLoader.DotNetPlugins|Can't create instance for <{metadata.Name}>", e);
erroredPlugins.Add(metadata.Name);
Log.Exception($"|PluginsLoader.DotNetPlugins|The following plugin has errored and can not be loaded: <{metadata.Name}>", e);
return;
}
#endif
@ -85,6 +104,26 @@ namespace Flow.Launcher.Core.Plugin
metadata.InitTime += milliseconds;
}
if (erroredPlugins.Count > 0)
{
var errorPluginString = "";
var errorMessage = "The following "
+ (erroredPlugins.Count > 1 ? "plugins have " : "plugin has ")
+ "errored and cannot be loaded:";
erroredPlugins.ForEach(x => errorPluginString += x + Environment.NewLine);
Task.Run(() =>
{
MessageBox.Show($"{errorMessage}{Environment.NewLine}{Environment.NewLine}" +
$"{errorPluginString}{Environment.NewLine}{Environment.NewLine}" +
$"Please refer to the logs for more information","",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
});
}
return plugins;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
@ -12,7 +12,26 @@
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup>
<Version>1.0.0</Version>
<PackageVersion>1.0.0-beta3</PackageVersion>
<AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion>
<PackageId>Flow.Launcher.Plugin</PackageId>
<Authors>Flow-Launcher</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/Flow-Launcher/Flow.Launcher</RepositoryUrl>
<PackageDescription>Reference this library if you want to develop a Flow Launcher plugin</PackageDescription>
<PackageTags>flowlauncher</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>
<PropertyGroup Condition="'$(APPVEYOR)' == 'True'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
@ -26,7 +45,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DebugType>embedded</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Output\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
@ -37,28 +56,15 @@
<ItemGroup>
<None Include="README.md" />
</ItemGroup>
<ItemGroup>
<None Remove="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SolutionAssemblyInfo.cs" Link="Properties\SolutionAssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="FodyWeavers.xml" />
<None Include="FodyWeavers.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="Mono.Cecil" Version="0.11.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="PropertyChanged.Fody" Version="3.2.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody" Version="2.5.13" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>

View file

@ -57,8 +57,4 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -64,7 +64,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
SolutionAssemblyInfo.cs = SolutionAssemblyInfo.cs
Scripts\flowlauncher.nuspec = Scripts\flowlauncher.nuspec
Scripts\flowlauncher.plugin.nuspec = Scripts\flowlauncher.plugin.nuspec
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorldCSharp", "Plugins\HelloWorldCSharp\HelloWorldCSharp.csproj", "{03FFA443-5F50-48D5-8869-F3DF316803AA}"

View file

@ -54,6 +54,22 @@
<Compile Include="..\SolutionAssemblyInfo.cs" Link="Properties\SolutionAssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Languages\*.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Themes\*.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="InputSimulator" Version="1.0.4" />
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
@ -66,10 +82,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody" Version="3.2.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody" Version="2.5.13" />
<PackageReference Include="System.Data.OleDb" Version="4.7.1" />
<PackageReference Include="System.Data.SQLite" Version="1.0.112" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.112" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -68,6 +68,9 @@
<system:String x:Key="add">Add</system:String>
<system:String x:Key="pleaseSelectAnItem">Please select an item</system:String>
<system:String x:Key="deleteCustomHotkeyWarning">Are you sure you want to delete {0} plugin hotkey?</system:String>
<system:String x:Key="queryWindowShadowEffect">Query window shadow effect</system:String>
<system:String x:Key="shadowEffectCPUUsage">Shadow effect has a substantial usage of GPU.</system:String>
<system:String x:Key="shadowEffectPerformance">Not recommended if you computer performance is limited.</system:String>
<!--Setting Proxy-->
<system:String x:Key="proxy">HTTP Proxy</system:String>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -41,7 +41,7 @@
<ColumnDefinition />
<ColumnDefinition Width="0" />
</Grid.ColumnDefinitions>
<Image x:Name="imgIco" Width="32" Height="32" HorizontalAlignment="Left"
<Image x:Name="ImageIcon" Width="32" Height="32" HorizontalAlignment="Left"
Source="{Binding Image ,IsAsync=True}" />
<Grid Margin="5 0 5 0" Grid.Column="1" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
@ -91,7 +91,7 @@
Value="True">
<Setter TargetName="Title" Property="Style" Value="{DynamicResource ItemTitleSelectedStyle}" />
<Setter TargetName="SubTitle" Property="Style" Value="{DynamicResource ItemSubTitleSelectedStyle}" />
<Setter TargetName="imgIco" Property="Style" Value="{DynamicResource ItemImageSelectedStyle}" />
<Setter TargetName="ImageIcon" Property="Style" Value="{DynamicResource ItemImageSelectedStyle}" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>

View file

@ -227,12 +227,12 @@
<RowDefinition Height="15"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Query window shadow effect" Margin="0 30 0 0" FontSize="14" />
<TextBlock Grid.Row="0" Text="{DynamicResource queryWindowShadowEffect}" Margin="0 30 0 0" FontSize="14" />
<ui:ToggleSwitch Grid.Row="0" IsOn="{Binding DropShadowEffect}" Margin="210 23 0 0" Width="80"/>
<TextBlock Grid.Row="1" Text="Shadow effect has a substantial usage of GPU."
<TextBlock Grid.Row="1" Text="{DynamicResource shadowEffectCPUUsage}"
Width="280"
FontSize="10" HorizontalAlignment="Left"/>
<TextBlock Grid.Row="2" Text="Not recommended if you computer performance is limited."
<TextBlock Grid.Row="2" Text="{DynamicResource shadowEffectPerformance}"
Width="320"
FontSize="10" HorizontalAlignment="Left"/>
</Grid>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View file

@ -80,8 +80,4 @@
<PackageReference Include="UnidecodeSharp" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -6,4 +6,10 @@
<system:String x:Key="flowlauncher_plugin_browserbookmark_plugin_name">Browser Bookmarks</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_plugin_description">Search your browser bookmarks</system:String>
<!--Settings-->
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_openBookmarks">Open bookmarks in:</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_newWindow">New window</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_newTab">New tab</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_setBrowserFromPath">Set browser from path:</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_choose">Choose</system:String>
</ResourceDictionary>

View file

@ -18,15 +18,22 @@
<ColumnDefinition Width="140"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<Label Content="Open bookmarks in:" FontSize="15" Grid.Column="0" Margin="0 5 0 0"/>
<RadioButton Name="NewWindowBrowser" GroupName="OpenSearchBehaviour" Content="New window" Click="OnNewBrowserWindowClick" Grid.Column="1"/>
<RadioButton Name="NewTabInBrowser" GroupName="OpenSearchBehaviour" Content="New tab" Click="OnNewTabClick" Grid.Column="2"/>
<Label Grid.Column="0" Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_openBookmarks}"
FontSize="15" Margin="0 5 0 0"/>
<RadioButton Grid.Column="1" Name="NewWindowBrowser" GroupName="OpenSearchBehaviour"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_newWindow}"
Click="OnNewBrowserWindowClick" />
<RadioButton Grid.Column="2" Name="NewTabInBrowser" GroupName="OpenSearchBehaviour"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_newTab}"
Click="OnNewTabClick" />
</Grid>
</StackPanel>
<StackPanel VerticalAlignment="Top" Grid.Row="1" Height="106" Margin="41,13,0,0">
<Label Content="Set browser from path:" Height="28" Margin="0,0,155,0" HorizontalAlignment="Left" Width="290"/>
<Label Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_setBrowserFromPath}"
Height="28" Margin="0,0,155,0" HorizontalAlignment="Left" Width="290"/>
<TextBox x:Name="browserPathBox" HorizontalAlignment="Left" Height="34" TextWrapping="Wrap" VerticalAlignment="Top" Width="311" RenderTransformOrigin="0.502,-1.668"/>
<Button x:Name="viewButton" HorizontalAlignment="Left" Margin="340,-33,-1,0" Width="100" Height="28" Click="OnChooseClick" FontSize="10" Content="Choose" />
<Button x:Name="viewButton" Content="{DynamicResource flowlauncher_plugin_browserbookmark_settings_choose}"
HorizontalAlignment="Left" Margin="340,-35,-1,0" Width="100" Height="34" Click="OnChooseClick" FontSize="14" />
</StackPanel>
</Grid>
</UserControl>

View file

@ -99,7 +99,6 @@
<ItemGroup>
<Folder Include="Images\" />
<Folder Include="ViewModels\" />
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>

View file

@ -101,8 +101,4 @@
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -101,8 +101,4 @@
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -128,8 +128,4 @@
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -104,8 +104,4 @@
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -101,9 +101,5 @@
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -103,8 +103,4 @@
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -113,8 +113,5 @@
<PackageReference Include="NLog" Version="4.7.0" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -99,8 +99,4 @@
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -124,7 +124,6 @@
<ItemGroup>
<Folder Include="Images\Images\" />
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

@ -93,9 +93,5 @@
<PackageReference Include="JetBrains.Annotations" Version="2019.1.3" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -151,8 +151,4 @@
<ProjectReference Include="..\..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

View file

@ -75,7 +75,7 @@
Content="{DynamicResource flowlauncher_plugin_websearch_delete}" />
<Button Click="OnEditSearchSourceClick" Width="100" Margin="10"
Content="{DynamicResource flowlauncher_plugin_websearch_edit}" />
<Button Click="OnAddSearchSearchClick" Width="100" Margin="10 10 0 10"
<Button Click="OnAddSearchSearchClick" Width="100" Margin="10 10 10 10"
Content="{DynamicResource flowlauncher_plugin_websearch_add}" />
</StackPanel>
</Grid>

View file

@ -51,9 +51,5 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

@ -12,6 +12,7 @@ Flow Launcher. Dedicated to make your workflow flow more seamlessly. Aimed at be
<sub>Remember to star it, flow will love you more :)</sub>
## Features
![The Flow](https://user-images.githubusercontent.com/26427004/82151677-fa9c7100-989f-11ea-9143-81de60aaf07d.gif)
- Search everything from applications, folders, bookmarks, YouTube, Twitter and more. All from the comfort of your keyboard without ever touching the mouse.
- Run batch and PowerShell commands as Administrator or a different user.

View file

@ -11,6 +11,6 @@
<description>Flow Launcher - a launcher for windows</description>
</metadata>
<files>
<file src="**\*.*" target="lib\net45\" exclude="Flow.Launcher.vshost.exe;Flow.Launcher.vshost.exe.config;Flow.Launcher.vshost.exe.manifest;*.nupkg;Setup.exe;RELEASES"/>
<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"/>
</files>
</package>

View file

@ -1,16 +0,0 @@
<?xml version="1.0"?>
<package>
<metadata>
<id>Flow.Launcher.Plugin</id>
<version>$version$</version>
<authors>qianlifeng, Jeremy Wu</authors>
<licenseUrl>https://github.com/Flow-Launcher/Flow.Launcher/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/Flow-Launcher/Flow.Launcher</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Reference this library if you want to develop a Flow Launcher plugin</description>
<tags>flowlauncher</tags>
</metadata>
<files>
<file src="..\Output\Release\Flow.Launcher.Plugin.dll" target="lib\net452" />
</files>
</package>

View file

@ -1,15 +1,15 @@
param(
[string]$config = "Release",
[string]$solution,
[string]$targetpath
[string]$targetpath
)
Write-Host "Config: $config"
function Build-Version {
if ([string]::IsNullOrEmpty($env:APPVEYOR_BUILD_VERSION)) {
$v = (Get-Command ${TargetPath}).FileVersionInfo.FileVersion
} else {
$v = $env:APPVEYOR_BUILD_VERSION
if ([string]::IsNullOrEmpty($env:flowVersion)) {
$v = (Get-Command ${TargetPath}).FileVersionInfo.FileVersion
} else {
$v = $env:flowVersion
}
Write-Host "Build Version: $v"
@ -35,7 +35,6 @@ function Copy-Resources ($path, $config) {
$project = "$path\Flow.Launcher"
$output = "$path\Output"
$target = "$output\$config"
Copy-Item -Recurse -Force $project\Themes\* $target\Themes\
Copy-Item -Recurse -Force $project\Images\* $target\Images\
Copy-Item -Recurse -Force $path\Plugins\HelloWorldPython $target\Plugins\HelloWorldPython
Copy-Item -Recurse -Force $path\JsonRPC $target\JsonRPC
@ -57,28 +56,13 @@ function Validate-Directory ($output) {
New-Item $output -ItemType Directory -Force
}
function Pack-Nuget ($path, $version, $output) {
Write-Host "Begin build nuget library"
$spec = "$path\Scripts\flowlauncher.plugin.nuspec"
Write-Host "nuspec path: $spec"
Write-Host "Output path: $output"
Nuget pack $spec -Version $version -OutputDirectory $output
Write-Host "End build nuget library"
}
function Zip-Release ($path, $version, $output) {
Write-Host "Begin zip release"
$input = "$path\Output\Release"
Write-Host "Input path: $input"
$file = "$output\Flow.Launcher-$version.zip"
Write-Host "Filename: $file"
$content = "$path\Output\Release\*"
$zipFile = "$output\Flow-Launcher-v$version.zip"
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem")
[System.IO.Compression.ZipFile]::CreateFromDirectory($input, $file)
Compress-Archive -Force -Path $content -DestinationPath $zipFile
Write-Host "End zip release"
}
@ -88,10 +72,12 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
Write-Host "Begin pack squirrel installer"
$spec = "$path\Scripts\flowlauncher.nuspec"
Write-Host "nuspec path: $spec"
$input = "$path\Output\Release"
Write-Host "Packing: $spec"
Write-Host "Input path: $input"
Nuget pack $spec -Version $version -Properties Configuration=Release -BasePath $input -OutputDirectory $output
# TODO: can we use dotnet pack here?
nuget pack $spec -Version $version -BasePath $input -OutputDirectory $output -Properties Configuration=Release
$nupkg = "$output\FlowLauncher.$version.nupkg"
Write-Host "nupkg path: $nupkg"
@ -107,7 +93,7 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
Move-Item $temp\* $output -Force
Remove-Item $temp
$file = "$output\Flow Launcher-$version.exe"
$file = "$output\Flow-Launcher-v$version.exe"
Write-Host "Filename: $file"
Move-Item "$output\Setup.exe" $file -Force
@ -133,7 +119,7 @@ function Main {
if(IsDotNetCoreAppSelfContainedPublishEvent) {
FixPublishLastWriteDateTimeError $p
}
}
Delete-Unused $p $config
$o = "$p\Output\Packages"
@ -144,7 +130,6 @@ function Main {
$isInCI = $env:APPVEYOR
if ($isInCI) {
Pack-Nuget $p $v $o
Zip-Release $p $v $o
}

View file

@ -1,31 +1,32 @@
version: 1.3.{build}
image: Visual Studio 2017
configuration: Release
platform: Any CPU
version: '0.9.0.{build}'
init:
- ps: |
$version = new-object System.Version $env:APPVEYOR_BUILD_VERSION
$env:flowVersion = "{0}.{1}.{2}" -f $version.Major, $version.Minor, $version.Build
assembly_info:
patch: true
file: AssemblyInfo.*
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'
file: SolutionAssemblyInfo.cs
assembly_version: $(flowVersion)
assembly_file_version: $(flowVersion)
assembly_informational_version: $(flowVersion)
skip_commits:
files:
- '*.md'
image: Visual Studio 2019
platform: Any CPU
configuration: Release
before_build:
- ps: nuget restore
build:
project: Flow.Launcher.sln
after_test:
verbosity: minimal
artifacts:
- path: 'Output\Packages\Flow.Launcher-*.zip'
name: zipped_binary
- path: 'Output\Packages\Flow.Launcher.Plugin.*.nupkg'
name: nuget_package
- path: 'Output\Packages\Flow.Launcher-*.*'
name: installer
- path: 'Output\Packages\RELEASES'
name: installer
deploy:
provider: NuGet
api_key:
secure: yybUOFgBuGVpbmOVZxsurC8OpkClzt9dR+/54WpMWcq6b6oyMatciaelRPnXsjRn
artifact: nuget_package
on:
branch: api
- path: 'Output\Packages\Flow-Launcher-*.zip'
name: Zip
- path: 'Output\Release\Flow.Launcher.Plugin.*.nupkg'
name: Plugin nupkg