Skip to content

Commit

Permalink
Merge pull request #1 from zarunbal/master
Browse files Browse the repository at this point in the history
update new changes
  • Loading branch information
Hirogen authored Apr 22, 2020
2 parents f9c60c7 + e439e1a commit f6bec87
Show file tree
Hide file tree
Showing 81 changed files with 2,320 additions and 1,726 deletions.
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
!!! Change log for Logexpert !!!

Explanation:
Symbol | Description
--------|--------------------------------------
# | Fixed: for any Bugfix
* | Changed: for changes in existing functionality
+ | Added: for new features
- | Removed: for now removed features
~ | Deprecated: for soon to be removed features
! | Security: in case of vulnerabilities

================================================
Version: 1.7.2
Released: 2019-xx-xx

+ xxx | change log has been added
+ 115 | https://github.com/zarunbal/LogExpert/issues/115
| Inno Setup script has been added

============== Examples ========================
Version: 1.0.0
Released: 2018-xx-xx

# 1234 | Link to issue in on github
| description of issue
* | Changes of existing functionality without issue number
| Description of change

+ | new Feature added without issue number
| description of feature
- | Feature removed
| description of feature
~ | Feature deprecated
| description of feature

! | Security Problems please READ CAREFULLY
| description of of problem and fixes


8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

Clone from https://logexpert.codeplex.com/

# Important
Please participate on this [#81](https://github.com/zarunbal/LogExpert/issues/81) which .NET version should be used in the future

# Overview
LogExpert is a Windows tail program (a GUI replacement for the Unix tail command).

Expand All @@ -26,14 +23,14 @@ Summary of (most) features:
* Serilog.Formatting.Compact format support (Experimental)

# Download
Follow the [Link](https://github.com/zarunbal/LogExpert/releases/latest) and download the latest package. Just extract it where you want and execute the application.
Follow the [Link](https://github.com/zarunbal/LogExpert/releases/latest) and download the latest package. Just extract it where you want and execute the application or download the Setup and install it

Or Install via chocolatey

```choco install logexpert```

Requirements
- .NET 4.0
- .NET 4.7.2

## CI
This is a continous integration build. So always the latest and greates changes. It should be stable but no promises. Can be viewed as Beta.
Expand All @@ -50,6 +47,7 @@ This is a continous integration build. So always the latest and greates changes.

Nuke.build Requirements
- Chocolatey must be installed
- Optional for Setup Inno Script 5 or 6

# Pull Request
- Use Development branch as target
Expand Down
11 changes: 3 additions & 8 deletions appveyor-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.7.{build}
version: 1.8.{build}
branches:
only:
- master
Expand All @@ -9,14 +9,9 @@ environment:
NugetApiKey:
secure: Ar6IQ+BxCwH6r8SgUB+6wzlWRD0Y+pkW+eFhZUTsF/yb5SyfEcDV7RNzzbGGe26Y
ChocolateyApiKey:
secure: klwi3/bn7RRe4vsqMat7GNNaD1kToVyewIAD5MPSptorqJZbySOF6wio/KW9SYza
secure: mXmzLqgFyDEjGRcE4UpqwqOXmdiCm9HwJ2V3LzSAz06GL1OaBDoTzidw7Rly+UHk
GitHubApiKey:
secure: N83nQZ/QQVqpRnl0D6F/xSbKjn062y07JdskpUpbWryMY2JDo4Be9lUXmob+xcOO
build_script:
- cmd: PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1' --target Clean Publish ChangeVersionNumber --Configuration Release"
- cmd: PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1' --target Clean Pack Publish CreateSetup PublishToAppveyor ChangeVersionNumber --Configuration Release"
test: off
artifacts:
- path: bin\Release\
name: Release-files
- path: bin\**\*.zip
- path: bin\**\*.nupkg
9 changes: 2 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@ environment:
my_variable:
secure: Qpq/4cyuTUzmt/r4HsQxioG6WXrZSK3mzVq5iUJC2RI=
build_script:
- cmd: PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1' --target Clean Pack ChangeVersionNumber --Configuration Release"
test: off
artifacts:
- path: bin\Release\
name: ci-Development
- path: bin\**\*.zip
- path: bin\**\*.nupkg
- cmd: PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '.\build.ps1' --target Clean Pack CreateSetup PublishToAppveyor ChangeVersionNumber --Configuration Release"
test: off
137 changes: 121 additions & 16 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
using static Nuke.Common.IO.TextTasks;
using static Nuke.Common.IO.CompressionTasks;
using static Nuke.GitHub.GitHubTasks;
using static Nuke.GitHub.ChangeLogExtensions;
using static Nuke.Common.ControlFlow;

[CheckBuildProjectConfigurations]
[UnsetVisualStudioEnvironmentVariables]
Expand Down Expand Up @@ -63,6 +63,12 @@ class Build : NukeBuild
AbsolutePath SftpFileSystemPackagex86 => BinDirectory / "SftpFileSystemx86/";
AbsolutePath SftpFileSystemPackagex64 => BinDirectory / "SftpFileSystemx64/";

AbsolutePath SetupDirectory => BinDirectory / "SetupFiles";

AbsolutePath InnoSetupScript => SourceDirectory / "setup" / "LogExpertInstaller.iss";

string SetupCommandLineParameter => $"/dAppVersion=\"{VersionString}\" /O\"{BinDirectory}\" /F\"LogExpert-Setup-{VersionString}\"";

Version Version
{
get
Expand All @@ -74,7 +80,7 @@ Version Version
patch = AppVeyor.Instance.BuildNumber;
}

return new Version(1, 7, patch);
return new Version(1, 8, patch);
}
}

Expand All @@ -88,7 +94,7 @@ Version Version
string VersionFileString => $"{Version.Major}.{Version.Minor}.0";

[Parameter("Exclude file globs")]
string[] ExcludeFileGlob => new[] {"**/*.xml", "**/*.XML", "**/*.pdb", "**/ChilkatDotNet4.dll", "**/SftpFileSystem.dll"};
string[] ExcludeFileGlob => new[] {"**/*.xml", "**/*.XML", "**/*.pdb", "**/ChilkatDotNet4.dll", "**/ChilkatDotNet47.dll", "**/SftpFileSystem.dll"};

[PathExecutable("choco.exe")] readonly Tool Chocolatey;

Expand All @@ -103,6 +109,17 @@ Version Version

[Parameter("GitHub Api key")] string GitHubApiKey = null;

AbsolutePath[] AppveyorArtifacts => new[]
{
(BinDirectory / $"LogExpert-Setup-{VersionString}.exe"),
BinDirectory / $"LogExpert-CI-{VersionString}.zip",
BinDirectory / $"LogExpert.{VersionString}.zip",
BinDirectory / $"LogExpert.ColumnizerLib.{VersionString}.nupkg",
BinDirectory / $"SftpFileSystem.x64.{VersionString}.zip",
BinDirectory / $"SftpFileSystem.x86.{VersionString}.zip",
ChocolateyDirectory / $"logexpert.{VersionString}.nupkg"
};

protected override void OnBuildInitialized()
{
SetVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1");
Expand All @@ -118,6 +135,9 @@ protected override void OnBuildInitialized()

if (DirectoryExists(BinDirectory))
{
BinDirectory.GlobFiles("*", "*.*", ".*").ForEach(DeleteFile);
BinDirectory.GlobDirectories("*").ForEach(DeleteDirectory);

DeleteDirectory(BinDirectory);

EnsureCleanDirectory(BinDirectory);
Expand Down Expand Up @@ -174,16 +194,11 @@ protected override void OnBuildInitialized()
.DependsOn(Compile)
.Executes(() =>
{
Parallel.ForEach(SourceDirectory.GlobFiles("**/*Tests.csproj"), path =>
{
DotNetTest(c =>
{
c = c.SetProjectFile(path)
.SetConfiguration(Configuration)
.EnableNoBuild();
return c;
});
});
DotNetTest(c =>c
.SetConfiguration(Configuration)
.EnableNoBuild()
.CombineWith(SourceDirectory.GlobFiles("**/*Tests.csproj"), (settings, path) =>
settings.SetProjectFile(path)), degreeOfParallelism: 4, completeOnFailure: true);
});

Target PrepareChocolateyTemplates => _ => _
Expand Down Expand Up @@ -271,7 +286,7 @@ protected override void OnBuildInitialized()
.DependsOn(Compile, Test)
.Executes(() =>
{
string[] files = new[] {"SftpFileSystem.dll", "ChilkatDotNet4.dll"};
string[] files = new[] {"SftpFileSystem.dll", "ChilkatDotNet4.dll", "ChilkatDotNet47.dll" };

OutputDirectory.GlobFiles(files.Select(a => $"plugins/{a}").ToArray()).ForEach(file => CopyFileToDirectory(file, SftpFileSystemPackagex64, FileExistsPolicy.Overwrite));
OutputDirectory.GlobFiles(files.Select(a => $"pluginsx86/{a}").ToArray()).ForEach(file => CopyFileToDirectory(file, SftpFileSystemPackagex86, FileExistsPolicy.Overwrite));
Expand Down Expand Up @@ -301,6 +316,47 @@ protected override void OnBuildInitialized()
Target Pack => _ => _
.DependsOn(BuildChocolateyPackage, CreatePackage, PackageSftpFileSystem, ColumnizerLibCreateNuget);

Target CopyFilesForSetup => _ => _
.DependsOn(Compile)
.After(Test)
.Executes(() =>
{
CopyDirectoryRecursively(OutputDirectory, SetupDirectory, DirectoryExistsPolicy.Merge);
SetupDirectory.GlobFiles(ExcludeFileGlob).ForEach(DeleteFile);

SetupDirectory.GlobDirectories(ExcludeDirectoryGlob).ForEach(DeleteDirectory);
});

Target CreateSetup => _ => _
.DependsOn(CopyFilesForSetup)
.Before(Publish)
.OnlyWhenStatic(() => Configuration == "Release")
.Executes(() =>
{
var publishCombinations =
from framework in new[] {(AbsolutePath) SpecialFolder(SpecialFolders.ProgramFilesX86), (AbsolutePath) SpecialFolder(SpecialFolders.LocalApplicationData) / "Programs"}
from version in new[] {"5", "6"}
select framework / $"Inno Setup {version}" / "iscc.exe";
bool executed = false;
foreach (var setupCombinations in publishCombinations)
{
if (!FileExists(setupCombinations))
{
//Search for next combination
continue;
}

ExecuteInnoSetup(setupCombinations);
executed = true;
break;
}

if (!executed)
{
Fail("Inno setup was not found");
}
});

Target PublishColumnizerNuget => _ => _
.DependsOn(ColumnizerLibCreateNuget)
.Requires(() => NugetApiKey)
Expand Down Expand Up @@ -343,8 +399,8 @@ protected override void OnBuildInitialized()
{
var repositoryInfo = GetGitHubRepositoryInfo(GitRepository);

PublishRelease(s => s
.SetArtifactPaths(BinDirectory.GlobFiles("**/*.zip", "**/*.nupkg").Select(a => a.ToString()).ToArray())
Task task = PublishRelease(s => s
.SetArtifactPaths(BinDirectory.GlobFiles("**/*.zip", "**/*.nupkg", "**/LogExpert-Setup*.exe").Select(a => a.ToString()).ToArray())
.SetCommitSha(GitVersion.Sha)
.SetReleaseNotes($"# Changes\r\n" +
$"# Bugfixes\r\n" +
Expand All @@ -358,11 +414,38 @@ protected override void OnBuildInitialized()
.SetToken(GitHubApiKey)
.SetName(VersionString)
);

task.Wait();
});

Target Publish => _ => _
.DependsOn(PublishChocolatey, PublishColumnizerNuget, PublishGithub);

Target PublishToAppveyor => _ => _
.After(Publish, CreateSetup)
.OnlyWhenDynamic(() => AppVeyor.Instance != null)
.Executes(() =>
{
CompressZip(BinDirectory / Configuration, BinDirectory / $"LogExpert-CI-{VersionString}.zip");

AppveyorArtifacts.ForEach((artifact) =>
{
Process proc = new Process();
proc.StartInfo = new ProcessStartInfo("appveyor", $"PushArtifact \"{artifact}\"");
if (!proc.Start())
{
Fail("Failed to start appveyor pushartifact");
}

proc.WaitForExit();

if (proc.ExitCode != 0)
{
Fail($"Exit code is {proc.ExitCode}");
}
});
});

Target CleanupAppDataLogExpert => _ => _
.Executes(() =>
{
Expand All @@ -383,6 +466,28 @@ protected override void OnBuildInitialized()
DeleteDirectory(logExpertDocuments);
});

private void ExecuteInnoSetup(AbsolutePath innoPath)
{
Process proc = new Process();

Logger.Info($"Start '{innoPath}' {SetupCommandLineParameter} \"{InnoSetupScript}\"");

proc.StartInfo = new ProcessStartInfo(innoPath, $"{SetupCommandLineParameter} \"{InnoSetupScript}\"");
if (!proc.Start())
{
Fail($"Failed to start {innoPath} with \"{SetupCommandLineParameter}\" \"{InnoSetupScript}\"");
}

proc.WaitForExit();

Logger.Info($"Executed '{innoPath}' with exit code {proc.ExitCode}");

if (proc.ExitCode != 0)
{
Fail($"Error during execution of {innoPath}, exitcode {proc.ExitCode}");
}
}

private string ReplaceVersionMatch(Match match, string replacement)
{
return $"{match.Groups[1]}{replacement}{match.Groups[3]}";
Expand Down
11 changes: 7 additions & 4 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="chocolatey" Version="0.10.13" />
<PackageReference Include="GitVersion.CommandLine.DotNetCore" Version="4.0.0" />
<PackageReference Include="NuGet.CommandLine" Version="4.9.4">
<PackageReference Include="chocolatey" Version="0.10.14" />
<PackageReference Include="GitVersion.CommandLine.DotNetCore" Version="5.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NuGet.CommandLine" Version="5.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Nuke.Common" Version="0.19.1" />
<PackageReference Include="Nuke.Common" Version="0.21.2" />
<PackageReference Include="Nuke.GitHub" Version="1.5.0" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.10.0" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion chocolatey/logexpert.portable.nuspec.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<authors>Zarunbal Previous:Hagen Raab</authors>
<owners>Zarunbal</owners>
<licenseUrl>https://cdn.rawgit.com/zarunbal/LogExpert/v##version##/LICENSE</licenseUrl>
<projectSourceUrl>https://github.com/zarunbal/LogExpert</projectSourceUrl>
<packageSourceUrl>https://github.com/zarunbal/LogExpert/tree/master/chocolatey</packageSourceUrl>
<projectUrl>https://github.com/zarunbal/LogExpert</projectUrl>
<bugTrackerUrl>https://github.com/zarunbal/LogExpert/issues</bugTrackerUrl>
Expand Down
Loading

0 comments on commit f6bec87

Please sign in to comment.