Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
mastersign committed Dec 14, 2018
2 parents 7bdb668 + 2008562 commit 631ea89
Show file tree
Hide file tree
Showing 17 changed files with 208 additions and 23 deletions.
1 change: 1 addition & 0 deletions BenchManager/.nuget/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<packages>
<package id="EWSoftware.SHFB" version="2017.1.28.0" targetFramework="net20" />
<package id="EWSoftware.SHFB.NETFramework" version="4.6.2" targetFramework="net20" />
<package id="HtmlAgilityPack" version="1.8.11" targetFramework="net462" />
</packages>
4 changes: 2 additions & 2 deletions BenchManager/BenchCLI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.20.5.0")]
[assembly: AssemblyFileVersion("0.20.5.0")]
[assembly: AssemblyVersion("0.21.0.0")]
[assembly: AssemblyFileVersion("0.21.0.0")]
4 changes: 2 additions & 2 deletions BenchManager/BenchDashboard/BenchDashboard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\packages\ConEmu.Core.16.7.24.0\build\ConEmu.Core.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ConEmu.Core.16.7.24.0\build\ConEmu.Core.Targets'))" />
<Error Condition="!Exists('..\packages\ConEmu.Core.18.6.26\build\ConEmu.Core.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ConEmu.Core.18.6.26\build\ConEmu.Core.Targets'))" />
</Target>
<Import Project="..\packages\ConEmu.Core.16.7.24.0\build\ConEmu.Core.Targets" Condition="Exists('..\packages\ConEmu.Core.16.7.24.0\build\ConEmu.Core.Targets')" />
<PropertyGroup>
<PostBuildEvent>copy "$(TargetPath)" "$(SolutionDir)..\auto\bin\$(TargetFileName)"
copy "$(TargetPath).config" "$(SolutionDir)..\auto\bin\$(TargetFileName).config"</PostBuildEvent>
</PropertyGroup>
<Import Project="..\packages\ConEmu.Core.18.6.26\build\ConEmu.Core.Targets" Condition="Exists('..\packages\ConEmu.Core.18.6.26\build\ConEmu.Core.Targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
4 changes: 2 additions & 2 deletions BenchManager/BenchDashboard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.20.5.0")]
[assembly: AssemblyFileVersion("0.20.5.0")]
[assembly: AssemblyVersion("0.21.0.0")]
[assembly: AssemblyFileVersion("0.21.0.0")]
2 changes: 1 addition & 1 deletion BenchManager/BenchDashboard/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ConEmu.Control.WinForms" version="1.0.20160518.0" targetFramework="net45" />
<package id="ConEmu.Core" version="16.7.24.0" targetFramework="net45" />
<package id="ConEmu.Core" version="18.6.26" targetFramework="net462" />
</packages>
7 changes: 4 additions & 3 deletions BenchManager/BenchLib.Test/BenchLib.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.11.0\build\NUnit.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -36,9 +37,8 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
<Reference Include="nunit.framework, Version=3.11.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down Expand Up @@ -70,6 +70,7 @@
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props'))" />
<Error Condition="!Exists('..\packages\NUnit.3.11.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.11.0\build\NUnit.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
2 changes: 1 addition & 1 deletion BenchManager/BenchLib.Test/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.4.1" targetFramework="net45" />
<package id="NUnit" version="3.11.0" targetFramework="net462" />
</packages>
7 changes: 5 additions & 2 deletions BenchManager/BenchLib/BenchLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@
<DocumentationFile>bin\Release\BenchLib.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="DotNetZip, Version=1.11.0.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.11.0\lib\net20\DotNetZip.dll</HintPath>
<Reference Include="DotNetZip, Version=1.12.0.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
<HintPath>..\packages\DotNetZip.1.12.0\lib\net20\DotNetZip.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.8.11.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.8.11\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="Mastersign.Sequence, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Mastersign.Sequence.1.3.0\lib\net20\Mastersign.Sequence.dll</HintPath>
Expand Down
3 changes: 2 additions & 1 deletion BenchManager/BenchLib/BenchTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,8 @@ private static void ExtractMsiPackage(BenchConfiguration config, IProcessExecuti
throw new FileNotFoundException("Could not find the executable of LessMSI.");
}
var env = new BenchEnvironment(config);
var args = CommandLine.FormatArgumentList("x", archiveFile, @".\");

var args = CommandLine.FormatArgumentList("x", archiveFile, targetDir + "\\");
var result = execHost.RunProcess(env, targetDir, lessMsiExe, args,
ProcessMonitoring.ExitCodeAndOutput);
if (result.ExitCode != 0)
Expand Down
4 changes: 2 additions & 2 deletions BenchManager/BenchLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.20.5.0")]
[assembly: AssemblyFileVersion("0.20.5.0")]
[assembly: AssemblyVersion("0.21.0.0")]
[assembly: AssemblyFileVersion("0.21.0.0")]
2 changes: 1 addition & 1 deletion BenchManager/BenchLib/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DotNetZip" version="1.11.0" targetFramework="net462" />
<package id="DotNetZip" version="1.12.0" targetFramework="net462" />
<package id="Mastersign.Sequence" version="1.3.0" targetFramework="net20" />
</packages>
8 changes: 4 additions & 4 deletions BenchManager/BenchLibDocs/BenchLibDocs.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
<Preliminary>False</Preliminary>
<NamingMethod>MemberName</NamingMethod>
<HelpTitle>BenchLib .NET API</HelpTitle>
<DocumentationSources>
<DocumentationSource sourceFile="..\BenchLib\bin\$(Configuration)\BenchLib.dll" xmlns="" />
<DocumentationSource sourceFile="..\BenchLib\bin\$(Configuration)\BenchLib.xml" xmlns="" />
</DocumentationSources>
<FeedbackEMailLinkText>Tobias Kiertscher</FeedbackEMailLinkText>
<FeedbackEMailAddress>dev%40mastersign.de</FeedbackEMailAddress>
<ContentPlacement>AboveNamespaces</ContentPlacement>
<DocumentationSources>
<DocumentationSource sourceFile="..\BenchLib\bin\Debug\BenchLib.dll" xmlns="" />
<DocumentationSource sourceFile="..\BenchLib\bin\Debug\BenchLib.xml" xmlns="" />
</DocumentationSources>
<VisibleItems>InheritedMembers, InheritedFrameworkMembers, Protected, EditorBrowsableNever, NonBrowsable</VisibleItems>
<MissingTags>AutoDocumentCtors, AutoDocumentDispose</MissingTags>
<ComponentPath>..\packages\EWSoftware.SHFB.NETFramework.4.6.2\tools\</ComponentPath>
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Add a link to the GitHub diff like

[Unreleased]: https://github.com/winbench/bench/compare/master...dev

## [0.21.0] - 2018-12-14

[0.21.0]: https://github.com/winbench/bench/compare/v0.20.5...v0.21.0

### Added
* First draft of script for version check

### Changed
* LessMSI 1.6 required

## [0.20.5] - 2018-11-30

[0.20.5]: https://github.com/winbench/bench/compare/v0.20.4...v0.20.5
Expand Down
168 changes: 168 additions & 0 deletions auto/lib/Check-Apps.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
param (
[string]$GitHubUserName = $null,
[switch]$CheckVersion = $true,
[string[]]$Libraries = @("core", "default"),
[string[]]$Apps = @(),
[string]$ReportFile = "app-report.txt"
)

$Script:scriptsDir = [IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Definition)
. "$Script:scriptsDir\config.lib.ps1"

# $DebugPreference = "Continue"
# $InformationPreference = "Continue"

if ($GitHubUserName) {
$GitHubPassword = Read-Host "GitHub Password" -AsSecureString
$GitHubPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($GitHubPassword))
}

$_ = [Reflection.Assembly]::LoadFrom("$Script:scriptsDir\..\bin\HtmlAgilityPack.dll")

$Script:web = New-Object HtmlAgilityPack.HtmlWeb
[Net.ServicePointManager]::SecurityProtocol = 'Tls11,Tls12'

function AuthHeaders($user, $pass) {
if ($user) {
$pair = "${user}:${pass}"
$encodedCreds = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes($pair))
return @{ Authorization = "Basic $encodedCreds" }
} else {
return @{}
}
}

function findVersionsInNode($app, $node, $attr, $re) {
if ($attr) {
$text = $node.Attributes[$attr].Value
} else {
$text = $node.InnerText
}
if ($text) {
foreach ($m in $re.Matches($text)) {
$m.Groups["Version"].Value
}
} else {
Write-Debug "Empty text in node"
}
}

function findVersionsInDoc($app, $doc, $xpath, $re) {
$attrMatch = ([regex]"@\w+$").Match($xpath)
if ($attrMatch.Success) {
$attr = $attrMatch.Value.Substring(1)
$xpath = $xpath.Substring(0, $attrMatch.Index - 1)
}
if ($xpath) {
$nodes = $doc.DocumentNode.SelectNodes($xpath)
if ($nodes.Count -gt 0) {
Write-Debug "Found $($nodes.Count) nodes with XPath"
foreach ($n in $nodes) {
findVersionsInNode $app $n $attr $re
}
} else {
Write-Warning "No nodes found with XPath"
}
} else {
Write-Debug "Searching without XPath in whole document"
findVersionsInNode $app $doc.DocumentNode $re
}
}

function normalizeVersion($version) {
$parts = $version.Split('.')
$norms = $parts | % { $_.PadLeft(6, '0') }
return [string]::Join(".", $norms)
}

function findHighestAppVersion($app) {
$checkUrl = Get-AppConfigValue $app.ID "VersionCheckUrl"
if (!$checkUrl) { return $false }
$checkPattern = Get-AppConfigValue $app.ID "VersionCheckPattern"
if (!$checkPattern) { return $false }
$checkXPath = Get-AppConfigValue $app.ID "VersionCheckXPath"
Write-Host ""
Write-Host "Checking $($app.AppLibrary.ID):$($app.ID) ..."
[regex]$checkRe = $checkPattern
Write-Debug "Version Check Pattern: $checkRe"
$doc = $Script:web.Load($checkUrl)
$versions = findVersionsInDoc $app $doc $checkXPath $checkRe `
| sort -Descending -Property { normalizeVersion $_ }
if ($versions -is [string]) {
$version = $versions
Write-Information "Found one version: $version"
return $version
}
if ($versions) {
Write-Information "Found versions: $([string]::Join(", ", $versions))"
return $versions[0]
}
return $null
}

function findLatestGitHubRelease($app) {
$url = Get-AppConfigValue $app.ID "Url"
if (!$url) { return $false }
[regex]$p = "^https?\://github\.com/(?<Owner>[^/]+)/(?<Project>[^/]+)/releases/download/"
$m = $p.Match($url)
if (!$m.Success) { return $false }
$owner = $m.Groups["Owner"].Value
$project = $m.Groups["Project"].Value
Write-Host ""
Write-Host "Checking $($app.AppLibrary.ID):$($app.ID) on GitHub $owner/$project ..."
$apiUrl = "https://api.github.com/repos/$owner/$project/releases"
$authHeaders = AuthHeaders $Script:GitHubUserName $Script:GitHubPassword
$releases = Invoke-WebRequest $apiUrl -Headers $authHeaders | ConvertFrom-Json
$tags = $releases `
| ? { !$_.draft -and !$_.prerelease } `
| % { $_.tag_name } `
| % { if ($_.StartsWith("v")) { $_.Substring(1) } else { $_ } } `
| sort -Descending -Property { normalizeVersion $_ }
if ($tags -is [string]) {
$tag = $tags
Write-Information "Found one release: $tag"
return $tag
}
if ($tags) {
Write-Information "Found releases: $([string]::Join(", ", $tags))"
return $tags[0]
}
return $null
}

function report($msg) {
$msg | Out-File $Script:ReportFile -Append
}

# ---------------------------------------------------------------------------------------

report "[$([DateTime]::Now.ToString("yyyy-MM-dd HH:mm:ss"))]"
report "Check Version: $CheckVersion"

foreach ($app in $global:BenchConfig.Apps) {
if ($Libraries -and ($app.AppLibrary.ID -notin $Libraries)) { continue }
if ($Apps -and ($app.ID -notin $Apps)) { continue }

if ($CheckVersion -and $app.IsVersioned) {
$currentVersion = Get-AppConfigValue $app.ID "VersionCheckString"
if (!$currentVersion) {
$currentVersion = $app.Version
}
$latestVersion = findHighestAppVersion $app
if ($latestVersion -eq $false) {
$latestVersion = findLatestGitHubRelease $app
}
if ($latestVersion -eq $null) {
Write-Warning "Version: $currentVersion -> ???"
report "Version: $($app.AppLibrary.ID) $($app.ID) $currentVersion -> ???"
} elseif ($latestVersion) {
if ($currentVersion -ne $latestVersion) {
Write-Warning "$currentVersion -> $latestVersion"
report "Version: $($app.AppLibrary.ID) $($app.ID) $currentVersion -> $latestVersion"
} else {
Write-Host "$latestVersion (unchanged)"
}
}
}

}
1 change: 1 addition & 0 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ $buildArtifacts = @(
"BenchDashboard\bin\$mode\BenchDashboard.exe",
"BenchDashboard\bin\$mode\BenchDashboard.exe.config",
"BenchDashboard\bin\$mode\ConEmu.WinForms.dll",
"packages\HtmlAgilityPack.1.8.11\lib\Net45\HtmlAgilityPack.dll",
"scripts\bench-cmd.cmd",
"scripts\bench-ps.cmd",
"scripts\bench-bash.cmd",
Expand Down
2 changes: 1 addition & 1 deletion res/bench-install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SetLocal
:: https://winbench.org/guide/setup/
::

SET VERSION=0.20.5
SET VERSION=0.21.0
SET TAG=v%VERSION%
SET ROOT=%~dp0
IF [%1] NEQ [] SET ROOT=%~dpnx1\
Expand Down
2 changes: 1 addition & 1 deletion res/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.20.5
0.21.0

0 comments on commit 631ea89

Please sign in to comment.