Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Merge branch 'bugfix/V0.4.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jibedoubleve committed Mar 27, 2020
2 parents b28957c + b68adaa commit 064901d
Show file tree
Hide file tree
Showing 28 changed files with 426 additions and 116 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
assembly-versioning-scheme: MajorMinorPatchTag
next-version: 0.4.0
next-version: 0.4.1
branches:
master:
mode: ContinuousDeployment
Expand Down
3 changes: 2 additions & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ Task("Build")
.Does(() => {
var msBuildSettings = new MSBuildSettings {
Verbosity = verbosity,
Configuration = configuration
Configuration = configuration,
PlatformTarget = PlatformTarget.x64
};
MSBuild(solution, msBuildSettings
Expand Down
27 changes: 27 additions & 0 deletions sql/scripts/update-0.1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Create tables and value to manage dabatase version.
* This data is used to know whether to make an update
* of the database
*/
create table settings (
id integer primary key,
s_key text,
s_value text
);

insert into settings (s_key, s_value) values ('db_version','0.1');

/*
* Fix history issue in the view
*/
drop view if exists stat_history;
create view stat_history as
select
s.id as id_keyword,
group_concat(sn.name, ', ') as keywords,
su.time_stamp as time_stamp
from
alias_usage su
inner join alias s on su.id_alias = s.id
inner join alias_name sn on s.id = sn.id_alias
group by su.time_stamp;
6 changes: 0 additions & 6 deletions sql/views/statistics.sql

This file was deleted.

30 changes: 15 additions & 15 deletions src/Probel.Lanceur.Core/Constants/Enums.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
namespace Probel.Lanceur.Core.Constants
{
public enum Keywords
{
Add,
Corner,
Help,
Hide,
Jot,
Quit,
Savepos,
Setup,
Import,
Clear,
Echo,
Version,
}
//public enum Keywords
//{
// Add,
// Corner,
// Help,
// Hide,
// Jot,
// Quit,
// Savepos,
// Setup,
// Import,
// Clear,
// Echo,
// Version,
//}

public enum RunAs
{
Expand Down
2 changes: 2 additions & 0 deletions src/Probel.Lanceur.Core/Probel.Lanceur.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<Link>Properties\Version.cs</Link>
</Compile>
<Compile Include="ServicesImpl\MacroManagement\IMacroAction.cs" />
<Compile Include="Services\IKeywordLoader.cs" />
<Compile Include="Services\IMacroService.cs" />
<Compile Include="ServicesImpl\MacroManagement\MacroAttribute.cs" />
<Compile Include="ServicesImpl\MacroManagement\MacroService.cs" />
Expand Down Expand Up @@ -91,6 +92,7 @@
<Compile Include="Services\IClipboardService.cs" />
<Compile Include="Services\IAliasService.cs" />
<Compile Include="Services\ISlickRunImporterService.cs" />
<Compile Include="Services\IUpdateService.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
15 changes: 15 additions & 0 deletions src/Probel.Lanceur.Core/Services/IKeywordLoader.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections.Generic;

namespace Probel.Lanceur.Core.Services
{
public interface IKeywordLoader
{
#region Methods

bool Contains(string keyword);

IEnumerable<string> GetDefinedKeywords();

#endregion Methods
}
}
4 changes: 4 additions & 0 deletions src/Probel.Lanceur.Core/Services/ILogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public interface ILogService

void Fatal(string message, Exception ex = null);

void Error(string message, Exception ex = null);

void Info(string message);

void Trace(string message);

void Warning(string message, Exception ex = null);
Expand Down
6 changes: 3 additions & 3 deletions src/Probel.Lanceur.Core/Services/IReservedKeywordService.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using Probel.Lanceur.Core.Constants;
using System;
using System;
using System.Collections.Generic;

namespace Probel.Lanceur.Core.Services
{

public interface IReservedKeywordService
{
#region Methods

void Bind(Keywords cmd, Action<string> bindedAction);
void Bind(string keyword, Action<string> bindedAction);

void ExecuteActionFor(string name, string arg);

Expand Down
13 changes: 13 additions & 0 deletions src/Probel.Lanceur.Core/Services/IUpdateService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Probel.Lanceur.Core.Services
{
public interface IUpdateService
{
#region Methods

bool DoNeedUpdate();

void Update();

#endregion Methods
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

namespace Probel.Lanceur.Core.ServicesImpl.MacroManagement
{
internal class MacroAttribute : Attribute
/// <summary>
/// A macro if a list of alias to be run sequentially.
/// </summary>
internal sealed class MacroAttribute : Attribute
{
#region Fields

private readonly string _name;

#endregion Fields

#region Constructors

public MacroAttribute(string name)
Expand Down
24 changes: 14 additions & 10 deletions src/Probel.Lanceur.Core/ServicesImpl/TraceLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,30 @@ private enum Level

#region Methods

private void WriteLine(Level level, string message, Exception ex = null)
{
var msg = string.Format(TEMPLATE, level.ToString().ToUpper(), message);
if (ex != null)
{
msg += Environment.NewLine + ex.ToString();
}
OutputTrace.WriteLine(msg);
}

public void Debug(string message) => WriteLine(Level.Debug, message);

public void Debug(Exception ex) => Debug(ex.ToString());

public void Error(string message, Exception ex = null) => WriteLine(Level.Warning, message, ex);

public void Fatal(string message, Exception ex = null) => WriteLine(Level.Warning, message, ex);

public void Info(string message) => WriteLine(Level.Info, message);

public void Trace(string message) => WriteLine(Level.Trace, message);

public void Warning(string message, Exception ex = null) => WriteLine(Level.Warning, message, ex);

private void WriteLine(Level level, string message, Exception ex = null)
{
var msg = string.Format(TEMPLATE, level.ToString().ToUpper(), message);
if (ex != null)
{
msg += Environment.NewLine + ex.ToString();
}
OutputTrace.WriteLine(msg);
}

#endregion Methods
}
}
12 changes: 11 additions & 1 deletion src/Probel.Lanceur.SQLiteDb/EmbeddedResourceManager.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using System.Reflection;

namespace Probel.Lanceur.SQLiteDb
{
public class EmbeddedResourceManager
internal class EmbeddedResourceManager
{
#region Fields

Expand Down Expand Up @@ -52,6 +54,14 @@ public void ReadResourceAsString(string resourceName, Action<string> OnResource)
}
}

public IEnumerable<string> ListResources(string pattern)
{
var result = (from s in ExecutingAssembly.GetManifestResourceNames()
where s.Contains(pattern)
select s);
return result;
}

#endregion Methods
}
}
8 changes: 7 additions & 1 deletion src/Probel.Lanceur.SQLiteDb/Probel.Lanceur.SQLiteDb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
<Compile Include="ConnectionStringManager.cs" />
<Compile Include="Services\SQLiteDatabaseService.cs" />
<Compile Include="Services\SQLiteSlickRunImporterService.cs" />
<Compile Include="Services\SQLiteUpdateService.cs" />
<Compile Include="Services\UpdateManager.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Assets\data.db" />
Expand All @@ -75,7 +77,11 @@
<Name>Probel.Lanceur.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="..\..\sql\scripts\update-0.1.sql">
<Link>Assets\Scripts\update-0.1.sql</Link>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.112.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.112.0\build\net46\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
Loading

0 comments on commit 064901d

Please sign in to comment.