Start setting up for build and update

This commit is contained in:
2018-02-21 17:12:06 -05:00
parent 1dadbd3950
commit c9fd79e4db
7 changed files with 84 additions and 17 deletions

4
.gitignore vendored
View File

@@ -154,4 +154,6 @@ $RECYCLE.BIN/
# Mac desktop service store files # Mac desktop service store files
.DS_Store .DS_Store
.vs .vs
*.nupkg
Releases/

View File

@@ -76,7 +76,9 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="appveyor.yml" />
<None Include="LICENSE.md" /> <None Include="LICENSE.md" />
<None Include="ProcessCpuUsageStatusWindow.nuspec" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -94,6 +96,16 @@
<PackageReference Include="FloatingStatusWindow"> <PackageReference Include="FloatingStatusWindow">
<Version>1.0.0.7</Version> <Version>1.0.0.7</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Squirrel.Windows">
<Version>1.7.9</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>ProcessCpuUsageStatusWindow</id>
<version>$version$</version>
<authors>Chris Kaczor</authors>
<description>A "floating" status window that shows the top X processes by CPU usage.</description>
<projectUrl>https://github.com/ckaczor/ProcessCpuUsageStatusWindow</projectUrl>
<licenseUrl>https://raw.githubusercontent.com/ckaczor/ProcessCpuUsageStatusWindow/master/LICENSE.md</licenseUrl>
<tags>cpu</tags>
</metadata>
<files>
<file src="bin\$configuration$\**\*" target="lib\net45" exclude="*.pdb;*.nupkg;*.vshost.*" />
</files>
</package>

View File

@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.34014 // Runtime Version:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@@ -19,7 +19,7 @@ namespace ProcessCpuUsageStatusWindow.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@@ -70,6 +70,15 @@ namespace ProcessCpuUsageStatusWindow.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Process CPU Usage.
/// </summary>
internal static string ApplicationName {
get {
return ResourceManager.GetString("ApplicationName", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to CPU: {0,4:f1}% - Total. /// Looks up a localized string similar to CPU: {0,4:f1}% - Total.
/// </summary> /// </summary>

View File

@@ -121,6 +121,9 @@
<data name="ApplicationIcon" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="ApplicationIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ApplicationIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\ApplicationIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="ApplicationName" xml:space="preserve">
<value>Process CPU Usage</value>
</data>
<data name="FooterLine" xml:space="preserve"> <data name="FooterLine" xml:space="preserve">
<value>CPU: {0,4:f1}% - Total</value> <value>CPU: {0,4:f1}% - Total</value>
</data> </data>

View File

@@ -6,6 +6,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Squirrel;
namespace ProcessCpuUsageStatusWindow namespace ProcessCpuUsageStatusWindow
{ {
@@ -23,8 +24,18 @@ namespace ProcessCpuUsageStatusWindow
var dispatcher = Dispatcher.CurrentDispatcher; var dispatcher = Dispatcher.CurrentDispatcher;
Task.Factory.StartNew(() => _processCpuUsageWatcher.Initialize(Settings.Default.UpdateInterval, UpdateDisplay, dispatcher)); Task.Factory.StartNew(() => _processCpuUsageWatcher.Initialize(Settings.Default.UpdateInterval, UpdateDisplay, dispatcher));
//CheckUpdate();
} }
//private static async void CheckUpdate()
//{
// using (var updateManager = UpdateManager.GitHubUpdateManager("https://github.com/ckaczor/ProcessCpuUsageStatusWindow"))
// {
// await updateManager.Result.UpdateApp();
// }
//}
public void Dispose() public void Dispose()
{ {
_processCpuUsageWatcher.Terminate(); _processCpuUsageWatcher.Terminate();
@@ -35,33 +46,22 @@ namespace ProcessCpuUsageStatusWindow
public void ShowSettings() public void ShowSettings()
{ {
throw new NotImplementedException();
} }
public void Refresh() public void Refresh()
{ {
throw new NotImplementedException();
} }
public string Name public string Name => Resources.ApplicationName;
{
get { return "Process CPU Usage"; }
}
public System.Drawing.Icon Icon public System.Drawing.Icon Icon => Resources.ApplicationIcon;
{
get { return Resources.ApplicationIcon; }
}
public bool HasSettingsMenu => false; public bool HasSettingsMenu => false;
public bool HasRefreshMenu => false; public bool HasRefreshMenu => false;
public string WindowSettings public string WindowSettings
{ {
get get => Settings.Default.WindowSettings;
{
return Settings.Default.WindowSettings;
}
set set
{ {
Settings.Default.WindowSettings = value; Settings.Default.WindowSettings = value;

26
appveyor.yml Normal file
View File

@@ -0,0 +1,26 @@
version: 1.0.{build}
pull_requests:
do_not_increment_build_number: true
skip_tags: true
image: Visual Studio 2017
configuration: Release
assembly_info:
patch: true
file: 'Library\Properties\AssemblyInfo.cs'
assembly_version: '{version}'
assembly_file_version: '{version}'
build:
project: ProcessCpuUsageStatusWindow.sln
verbosity: minimal
after_build:
- cmd: nuget pack ProcessCpuUsageStatusWindow.nuspec -Version %appveyor_build_version% -Properties Configuration=Release -OutputDirectory bin\Release\
artifacts:
- path: bin\$(configuration)\ProcessCpuUsageStatusWindow.*.nupkg
name: NuGet
deploy:
- provider: Environment
name: GitHub
install:
- cmd: git submodule update --init --recursive
before_build:
- cmd: msbuild /t:restore