diff --git a/Directory.Build.props b/Directory.Build.props index 8ce4053..1c5ba26 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - net6.0-windows + net8.0-windows latest $(NoWarn);1573;1591;1712 true diff --git a/Packages.props b/Packages.props index ca304bf..726578f 100644 --- a/Packages.props +++ b/Packages.props @@ -1,13 +1,13 @@ + - - - + + diff --git a/appveyor.yml b/appveyor.yml index f1b222a..df85ec1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,11 +3,16 @@ #---------------------------------# # version format -version: 2.1.0.{build} +version: 3.0.0.{build} # version suffix, if any (e.g. '-RC1', '-beta' otherwise '') environment: version_suffix: '' + # Disable the .NET logo in the console output. + DOTNET_NOLOGO: true + # Disable the .NET first time experience to skip caching NuGet packages and speed up the build. + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + # Do not build on tags (GitHub and BitBucket) skip_tags: true diff --git a/src/GitExtensions.PluginManager/GitExtensions.PluginManager.csproj b/src/GitExtensions.PluginManager/GitExtensions.PluginManager.csproj index 6159b4a..f5c7c6c 100644 --- a/src/GitExtensions.PluginManager/GitExtensions.PluginManager.csproj +++ b/src/GitExtensions.PluginManager/GitExtensions.PluginManager.csproj @@ -2,6 +2,7 @@ true + true NuGet-based Plugin Manager for Git Extensions GitExtensions https://github.com/gitextensions/gitextensions.pluginmanager @@ -18,7 +19,7 @@ - + @@ -27,15 +28,12 @@ - - $(GitExtensionsPath)\GitUI.dll + + $(GitExtensionsPath)\GitExtensions.Extensibility.dll $(GitExtensionsPath)\GitUIPluginInterfaces.dll - - $(GitExtensionsPath)\ResourceManager.dll - diff --git a/src/GitExtensions.PluginManager/GitExtensions.PluginManager.nuspec b/src/GitExtensions.PluginManager/GitExtensions.PluginManager.nuspec index 825c1f9..d6a7d5c 100644 --- a/src/GitExtensions.PluginManager/GitExtensions.PluginManager.nuspec +++ b/src/GitExtensions.PluginManager/GitExtensions.PluginManager.nuspec @@ -14,7 +14,7 @@ - - + + \ No newline at end of file diff --git a/src/GitExtensions.PluginManager/Plugin.cs b/src/GitExtensions.PluginManager/Plugin.cs index a0b93a4..ce70878 100644 --- a/src/GitExtensions.PluginManager/Plugin.cs +++ b/src/GitExtensions.PluginManager/Plugin.cs @@ -1,16 +1,15 @@ -using GitExtensions.PluginManager.Properties; +using GitExtensions.Extensibility.Git; +using GitExtensions.Extensibility.Plugins; +using GitExtensions.Extensibility.Settings; +using GitExtensions.PluginManager.Properties; using GitUIPluginInterfaces; using PackageManager; -using ResourceManager; using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Composition; using System.Diagnostics; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace GitExtensions.PluginManager @@ -24,7 +23,7 @@ public class Plugin : GitPluginBase public const string PackageId = @"GitExtensions.PluginManager"; public const string GitExtensionsRelativePath = @"GitExtensions.exe"; public const string PluginManagerRelativePath = @"PackageManager\PackageManager.UI.exe"; - public static readonly List FrameworkMonikers = new List() { "net5.0", "net6.0", "any", "netstandard2.0" }; + public static readonly List FrameworkMonikers = new List() { "net5.0", "net6.0", "net7.0", "net8.0", "any", "netstandard2.0" }; internal PluginSettings Configuration { get; private set; } diff --git a/src/GitExtensions.PluginManager/PluginSettings.cs b/src/GitExtensions.PluginManager/PluginSettings.cs index 5594bca..f857acc 100644 --- a/src/GitExtensions.PluginManager/PluginSettings.cs +++ b/src/GitExtensions.PluginManager/PluginSettings.cs @@ -1,10 +1,7 @@ -using GitUIPluginInterfaces; +using GitExtensions.Extensibility.Settings; using System; using System.Collections; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace GitExtensions.PluginManager { @@ -15,14 +12,14 @@ internal class PluginSettings : IEnumerable /// public static BoolSetting CloseInstancesProperty { get; } = new BoolSetting("CloseInstances", "Close all instances of Git Extensions before starting Plugin Manager", false); - private readonly ISettingsSource source; + private readonly SettingsSource source; /// /// Gets current value of . /// public bool CloseInstances => source.GetBool(CloseInstancesProperty.Name, CloseInstancesProperty.DefaultValue); - public PluginSettings(ISettingsSource source) + public PluginSettings(SettingsSource source) { this.source = source ?? throw new ArgumentNullException(nameof(source)); } diff --git a/src/PackageManager.NuGet/Models/InvalidPackageSourceImplementationException.cs b/src/PackageManager.NuGet/Models/InvalidPackageSourceImplementationException.cs index b5eef31..ced036c 100644 --- a/src/PackageManager.NuGet/Models/InvalidPackageSourceImplementationException.cs +++ b/src/PackageManager.NuGet/Models/InvalidPackageSourceImplementationException.cs @@ -10,7 +10,6 @@ namespace PackageManager.Models /// /// Raised when passed implementation of to not compatible with , /// - [Serializable] public class InvalidPackageSourceImplementationException : Exception { /// @@ -18,14 +17,5 @@ public class InvalidPackageSourceImplementationException : Exception /// public InvalidPackageSourceImplementationException() { } - - /// - /// Creates a new instance for deserialization. - /// - /// A serialization info. - /// A streaming context. - protected InvalidPackageSourceImplementationException(SerializationInfo info, StreamingContext context) - : base(info, context) - { } } } diff --git a/src/PackageManager.NuGet/Models/NuGetPackageContent.cs b/src/PackageManager.NuGet/Models/NuGetPackageContent.cs index a2cf23a..a663bf3 100644 --- a/src/PackageManager.NuGet/Models/NuGetPackageContent.cs +++ b/src/PackageManager.NuGet/Models/NuGetPackageContent.cs @@ -74,6 +74,10 @@ string ExtractFile(string sourceFile, string targetPath, Stream sourceContent) string result = MapPackageFilePath(path, content.frameworkFolderName, targetPath); log.Debug($"Extracting file '{result}'."); + string resultDirectory = Path.GetDirectoryName(result); + if (!Directory.Exists(resultDirectory)) + Directory.CreateDirectory(resultDirectory); + using (FileStream targetContent = new FileStream(result, FileMode.OpenOrCreate)) sourceContent.CopyTo(targetContent); diff --git a/src/PackageManager.NuGet/Services/NuGetPackageVersionService.cs b/src/PackageManager.NuGet/Services/NuGetPackageVersionService.cs index b2e8c33..d358337 100644 --- a/src/PackageManager.NuGet/Services/NuGetPackageVersionService.cs +++ b/src/PackageManager.NuGet/Services/NuGetPackageVersionService.cs @@ -56,7 +56,7 @@ public async Task> GetListAsync(int resultCount, IPackag catch (FatalProtocolException e) when (e.InnerException is TaskCanceledException) { cancellationToken.ThrowIfCancellationRequested(); - throw e; + throw; } } diff --git a/src/PackageManager.UI/Services/RestartAsAdministratorCancelledException.cs b/src/PackageManager.UI/Services/RestartAsAdministratorCancelledException.cs index 589127a..9992230 100644 --- a/src/PackageManager.UI/Services/RestartAsAdministratorCancelledException.cs +++ b/src/PackageManager.UI/Services/RestartAsAdministratorCancelledException.cs @@ -10,7 +10,6 @@ namespace PackageManager.Services /// /// An exception raised when attempt to restart the application as administrator was cancelled by the user. /// - [Serializable] public class RestartAsAdministratorCancelledException : Exception { /// @@ -20,14 +19,5 @@ public class RestartAsAdministratorCancelledException : Exception public RestartAsAdministratorCancelledException(Exception inner) : base("Attempt to restart the application as administrator was cancelled by the user.", inner) { } - - /// - /// Creates new instance for deserialization. - /// - /// The serialization info. - /// The streaming context. - protected RestartAsAdministratorCancelledException(SerializationInfo info, StreamingContext context) - : base(info, context) - { } } } diff --git a/src/PackageManager/Models/PackageFileExtractionException.cs b/src/PackageManager/Models/PackageFileExtractionException.cs index bba36ce..3093f42 100644 --- a/src/PackageManager/Models/PackageFileExtractionException.cs +++ b/src/PackageManager/Models/PackageFileExtractionException.cs @@ -10,7 +10,6 @@ namespace PackageManager.Models /// /// An exception raised when there was an extracting file from package content. /// - [Serializable] public class PackageFileExtractionException : Exception { /// @@ -28,14 +27,5 @@ public PackageFileExtractionException(string filePath, Exception inner) { FilePath = filePath; } - - /// - /// Creates a new instance for deserialization. - /// - /// The serialization info. - /// The streaming context. - protected PackageFileExtractionException(SerializationInfo info, StreamingContext context) - : base(info, context) - { } } } diff --git a/src/PackageManager/Models/PackageFileRemovalException.cs b/src/PackageManager/Models/PackageFileRemovalException.cs index 664cc52..7ca94ae 100644 --- a/src/PackageManager/Models/PackageFileRemovalException.cs +++ b/src/PackageManager/Models/PackageFileRemovalException.cs @@ -10,7 +10,6 @@ namespace PackageManager.Models /// /// An exception raised when there was an removing file from installed package. /// - [Serializable] public class PackageFileRemovalException : Exception { /// @@ -28,14 +27,5 @@ public PackageFileRemovalException(string filePath, Exception inner) { FilePath = filePath; } - - /// - /// Creates a new instance for deserialization. - /// - /// The serialization info. - /// The streaming context. - protected PackageFileRemovalException(SerializationInfo info, StreamingContext context) - : base(info, context) - { } } } diff --git a/tools/Prepare-Release.ps1 b/tools/Prepare-Release.ps1 index df83f24..f22f70e 100644 --- a/tools/Prepare-Release.ps1 +++ b/tools/Prepare-Release.ps1 @@ -20,12 +20,18 @@ function EnsureLastCommandSucceeded() } } +# Install the required .NET SDK +Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1" +./dotnet-install.ps1 -Channel LTS -InstallDir 'C:\Program Files\dotnet' +# Remove the script so it doesn't "pollute" the build +Remove-Item -Path .\dotnet-install.ps1 + Write-Host "Restore solution" dotnet restore ..\GitExtensions.PluginManager.sln -p:RuntimeIdentifier=win-x86 EnsureLastCommandSucceeded Write-Host "Publish PackageManager.UI" -dotnet publish ..\src\PackageManager.UI\PackageManager.UI.csproj -c Release -p:PublishDir=bin\Release\net6.0-windows\publish\ -bl:$targetPath\build-PackageManager.UI.binlog +dotnet publish ..\src\PackageManager.UI\PackageManager.UI.csproj -c Release -p:PublishDir=bin\Release\net8.0-windows\publish\ -bl:$targetPath\build-PackageManager.UI.binlog EnsureLastCommandSucceeded Write-Host "Publish GitExtensions.PluginManager" diff --git a/tools/Zip-GitExtensionsPlugin.ps1 b/tools/Zip-GitExtensionsPlugin.ps1 index 6f91ff5..46b53cb 100644 --- a/tools/Zip-GitExtensionsPlugin.ps1 +++ b/tools/Zip-GitExtensionsPlugin.ps1 @@ -17,8 +17,8 @@ $tempPmPath = Join-Path $tempPath -ChildPath "PackageManager"; New-Item -Force -ItemType Directory $tempPath | Out-Null; New-Item -Force -ItemType Directory $tempPmPath | Out-Null; -Copy-Item -Force ($sourceBasePath + "\net6.0-windows\GitExtensions.PluginManager.dll") $tempPath | Out-Null; -Copy-Item -Force ($sourceBasePath + "\net6.0-windows\PackageManager\PackageManager.UI.exe") $tempPmPath | Out-Null; +Copy-Item -Force ($sourceBasePath + "\net8.0-windows\GitExtensions.PluginManager.dll") $tempPath | Out-Null; +Copy-Item -Force ($sourceBasePath + "\net8.0-windows\PackageManager\PackageManager.UI.exe") $tempPmPath | Out-Null; Compress-Archive -Path ($tempPath + "\*") -DestinationPath $target -Force; Write-Host ("Created release zip at '" + $target + "'");