Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);1573;1591;1712</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
6 changes: 3 additions & 3 deletions Packages.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>

<ItemGroup>
<PackageReference Update="Microsoft.VisualStudio.Composition" Version="17.2.41" />
<PackageReference Update="GitExtensions.Extensibility" Version="0.3.*" />
<PackageReference Update="Neptuo" Version="6.0.2" />
<PackageReference Update="Neptuo.Exceptions" Version="1.2.2" />
<PackageReference Update="Neptuo.Observables" Version="2.1.1" />
<PackageReference Update="NuGet.PackageManagement" Version="6.3.1" />
<PackageReference Update="System.ComponentModel.Composition" Version="6.0.0" />
<PackageReference Update="System.Resources.Extensions" Version="6.0.0" />
<PackageReference Update="NuGet.PackageManagement" Version="6.8.0" />
<PackageReference Update="System.Resources.Extensions" Version="8.0.0" />
</ItemGroup>

<!-- Test-related -->
Expand Down
7 changes: 6 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
<Description>NuGet-based Plugin Manager for Git Extensions</Description>
<PackageTags>GitExtensions</PackageTags>
<PackageProjectUrl>https://github.com/gitextensions/gitextensions.pluginmanager</PackageProjectUrl>
Expand All @@ -18,7 +19,7 @@

<ItemGroup>
<PackageReference Include="GitExtensions.Extensibility" />
<PackageReference Include="System.ComponentModel.Composition" />
<PackageReference Include="Microsoft.VisualStudio.Composition" />
<PackageReference Include="System.Resources.Extensions" />
</ItemGroup>

Expand All @@ -27,15 +28,12 @@
</ItemGroup>

<ItemGroup>
<Reference Include="GitUI">
<HintPath>$(GitExtensionsPath)\GitUI.dll</HintPath>
<Reference Include="GitExtensions.Extensibility">
<HintPath>$(GitExtensionsPath)\GitExtensions.Extensibility.dll</HintPath>
</Reference>
<Reference Include="GitUIPluginInterfaces">
<HintPath>$(GitExtensionsPath)\GitUIPluginInterfaces.dll</HintPath>
</Reference>
<Reference Include="ResourceManager">
<HintPath>$(GitExtensionsPath)\ResourceManager.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</metadata>
<files>
<file src="../../LICENSE.md" target="/" />
<file src="bin/$configuration$/net6.0-windows/GitExtensions.PluginManager.dll" target="lib/" />
<file src="bin/$configuration$/net6.0-windows/PackageManager/PackageManager.UI.exe" target="lib/PackageManager/" />
<file src="bin/$configuration$/net8.0-windows/GitExtensions.PluginManager.dll" target="lib/" />
<file src="bin/$configuration$/net8.0-windows/PackageManager/PackageManager.UI.exe" target="lib/PackageManager/" />
</files>
</package>
11 changes: 5 additions & 6 deletions src/GitExtensions.PluginManager/Plugin.cs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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<string> FrameworkMonikers = new List<string>() { "net5.0", "net6.0", "any", "netstandard2.0" };
public static readonly List<string> FrameworkMonikers = new List<string>() { "net5.0", "net6.0", "net7.0", "net8.0", "any", "netstandard2.0" };

internal PluginSettings Configuration { get; private set; }

Expand Down
9 changes: 3 additions & 6 deletions src/GitExtensions.PluginManager/PluginSettings.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -15,14 +12,14 @@ internal class PluginSettings : IEnumerable<ISetting>
/// </summary>
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;

/// <summary>
/// Gets current value of <see cref="CloseInstancesProperty"/>.
/// </summary>
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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,12 @@ namespace PackageManager.Models
/// <summary>
/// Raised when passed implementation of <see cref="IPackageSource"/> to not compatible with <see cref="NuGetPackageSourceCollection"/>,
/// </summary>
[Serializable]
public class InvalidPackageSourceImplementationException : Exception
{
/// <summary>
/// Creates a new empty instance.
/// </summary>
public InvalidPackageSourceImplementationException()
{ }

/// <summary>
/// Creates a new instance for deserialization.
/// </summary>
/// <param name="info">A serialization info.</param>
/// <param name="context">A streaming context.</param>
protected InvalidPackageSourceImplementationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
}
}
4 changes: 4 additions & 0 deletions src/PackageManager.NuGet/Models/NuGetPackageContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public async Task<IReadOnlyList<IPackage>> GetListAsync(int resultCount, IPackag
catch (FatalProtocolException e) when (e.InnerException is TaskCanceledException)
{
cancellationToken.ThrowIfCancellationRequested();
throw e;
throw;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace PackageManager.Services
/// <summary>
/// An exception raised when attempt to restart the application as administrator was cancelled by the user.
/// </summary>
[Serializable]
public class RestartAsAdministratorCancelledException : Exception
{
/// <summary>
Expand All @@ -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)
{ }

/// <summary>
/// Creates new instance for deserialization.
/// </summary>
/// <param name="info">The serialization info.</param>
/// <param name="context">The streaming context.</param>
protected RestartAsAdministratorCancelledException(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
}
}
10 changes: 0 additions & 10 deletions src/PackageManager/Models/PackageFileExtractionException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace PackageManager.Models
/// <summary>
/// An exception raised when there was an extracting file from package content.
/// </summary>
[Serializable]
public class PackageFileExtractionException : Exception
{
/// <summary>
Expand All @@ -28,14 +27,5 @@ public PackageFileExtractionException(string filePath, Exception inner)
{
FilePath = filePath;
}

/// <summary>
/// Creates a new instance for deserialization.
/// </summary>
/// <param name="info">The serialization info.</param>
/// <param name="context">The streaming context.</param>
protected PackageFileExtractionException(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
}
}
10 changes: 0 additions & 10 deletions src/PackageManager/Models/PackageFileRemovalException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace PackageManager.Models
/// <summary>
/// An exception raised when there was an removing file from installed package.
/// </summary>
[Serializable]
public class PackageFileRemovalException : Exception
{
/// <summary>
Expand All @@ -28,14 +27,5 @@ public PackageFileRemovalException(string filePath, Exception inner)
{
FilePath = filePath;
}

/// <summary>
/// Creates a new instance for deserialization.
/// </summary>
/// <param name="info">The serialization info.</param>
/// <param name="context">The streaming context.</param>
protected PackageFileRemovalException(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
}
}
8 changes: 7 additions & 1 deletion tools/Prepare-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tools/Zip-GitExtensionsPlugin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "'");
Expand Down