diff --git a/.editorconfig b/.editorconfig index 92f475bca..108d2a4ba 100644 --- a/.editorconfig +++ b/.editorconfig @@ -73,3 +73,5 @@ csharp_style_pattern_matching_over_as_with_null_check = true:suggestion csharp_style_inlined_variable_declaration = true:suggestion csharp_style_throw_expression = true:suggestion csharp_style_conditional_delegate_call = true:suggestion +dotnet_diagnostic.RS0030.severity = error +dotnet_diagnostic.RS0031.severity = error diff --git a/.teamcity/settings.kts b/.teamcity/settings.kts index 990e59465..c734b6517 100644 --- a/.teamcity/settings.kts +++ b/.teamcity/settings.kts @@ -3,10 +3,9 @@ import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.script import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.powerShell import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.pullRequests import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs +import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.schedule import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot -version = "2021.2" - project { buildType(ChocolateyGUI) } @@ -62,7 +61,10 @@ object ChocolateyGUI : BuildType({ script { name = "Call Cake" - scriptContent = "call build.official.bat" + scriptContent = """ + IF "%teamcity.build.triggeredBy%" == "Schedule Trigger" (SET TestType=all) ELSE (SET TestType=unit) + call build.official.bat --verbosity=diagnostic --target=CI --testExecutionType=%%TestType%% --shouldRunOpenCover=false + """.trimIndent() } } @@ -70,6 +72,17 @@ object ChocolateyGUI : BuildType({ vcs { branchFilter = "" } + schedule { + schedulingPolicy = daily { + hour = 2 + minute = 0 + } + branchFilter = """ + +: + """.trimIndent() + triggerBuild = always() + withPendingChangesOnly = false + } } features { diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml index e1d1067c1..1f8c78c2d 100644 --- a/GitReleaseManager.yaml +++ b/GitReleaseManager.yaml @@ -8,7 +8,7 @@ issue-labels-include: - Documentation issue-labels-exclude: - Internal Refactoring -- Build +- BuildAutomation - NO RELEASE NOTES issue-labels-alias: - name: Documentation diff --git a/Source/ChocolateyGui.Common.Windows/ChocolateyGui.Common.Windows.csproj b/Source/ChocolateyGui.Common.Windows/ChocolateyGui.Common.Windows.csproj index 7067166d5..511069137 100644 --- a/Source/ChocolateyGui.Common.Windows/ChocolateyGui.Common.Windows.csproj +++ b/Source/ChocolateyGui.Common.Windows/ChocolateyGui.Common.Windows.csproj @@ -1,4 +1,4 @@ - + @@ -68,7 +68,7 @@ ..\packages\Caliburn.Micro.3.2.0\lib\net45\Caliburn.Micro.Platform.Core.dll - ..\packages\chocolatey.lib.2.0.0\lib\net48\chocolatey.dll + ..\packages\chocolatey.lib.2.1.0\lib\net48\chocolatey.dll False False @@ -235,6 +235,7 @@ + @@ -422,9 +423,16 @@ + + + + + BannedSymbols.txt + + diff --git a/Source/ChocolateyGui.Common.Windows/Services/ChocolateyService.cs b/Source/ChocolateyGui.Common.Windows/Services/ChocolateyService.cs index de9df8649..86058ab6e 100644 --- a/Source/ChocolateyGui.Common.Windows/Services/ChocolateyService.cs +++ b/Source/ChocolateyGui.Common.Windows/Services/ChocolateyService.cs @@ -132,6 +132,11 @@ public async Task> GetOutdatedPackages(bool inclu config.RegularOutput = false; config.QuietOutput = true; config.Prerelease = false; + + if (forceCheckForOutdatedPackages) + { + config.SetCacheExpirationInMinutes(0); + } }); var chocoConfig = choco.GetConfiguration(); @@ -195,7 +200,7 @@ public async Task InstallPackage( if (version != null) { - config.Version = version.ToString(); + config.Version = version; } if (source != null) @@ -248,6 +253,11 @@ public async Task InstallPackage( config.DownloadChecksum64 = advancedInstallOptions.DownloadChecksum64bit; config.DownloadChecksumType = advancedInstallOptions.DownloadChecksumType; config.DownloadChecksumType64 = advancedInstallOptions.DownloadChecksumType64bit; + + if (advancedInstallOptions.IgnoreHttpCache) + { + config.SetCacheExpirationInMinutes(0); + } } }); diff --git a/Source/ChocolateyGui.Common.Windows/Utilities/Converters/NuGetVersionToString.cs b/Source/ChocolateyGui.Common.Windows/Utilities/Converters/NuGetVersionToString.cs new file mode 100644 index 000000000..8137dda5e --- /dev/null +++ b/Source/ChocolateyGui.Common.Windows/Utilities/Converters/NuGetVersionToString.cs @@ -0,0 +1,43 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright 2017 - Present Chocolatey Software, LLC +// Copyright 2014 - 2017 Rob Reynolds, the maintainers of Chocolatey, and RealDimensions Software, LLC +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace ChocolateyGui.Common.Windows.Utilities.Converters +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using System.Windows; + using System.Windows.Data; + using chocolatey; + using NuGet.Versioning; + + public class NuGetVersionToString : DependencyObject, IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is NuGetVersion version) + { + return version.ToNormalizedStringChecked(); + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is string sValue && NuGetVersion.TryParse(sValue, out var version)) + { + return version; + } + + throw new InvalidOperationException("The passed in value is not a parseable string version!"); + } + } +} \ No newline at end of file diff --git a/Source/ChocolateyGui.Common.Windows/ViewModels/AdvancedInstallViewModel.cs b/Source/ChocolateyGui.Common.Windows/ViewModels/AdvancedInstallViewModel.cs index 524a88e14..6fd8fe461 100644 --- a/Source/ChocolateyGui.Common.Windows/ViewModels/AdvancedInstallViewModel.cs +++ b/Source/ChocolateyGui.Common.Windows/ViewModels/AdvancedInstallViewModel.cs @@ -42,6 +42,7 @@ public class AdvancedInstallViewModel : ObservableBase, IClosableChildWindow + 0 0 @@ -247,6 +248,9 @@