mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
upgrade<Project>: retargets to .net framework 4.8
This commit is contained in:
parent
476c23f9d2
commit
5d71e54547
10 changed files with 35 additions and 31 deletions
|
@ -29,11 +29,6 @@ Opensouce Git GUI client for Windows.
|
||||||
|
|
||||||
Pre-build Binaries:[Releases](https://github.com/sourcegit-scm/sourcegit/releases)
|
Pre-build Binaries:[Releases](https://github.com/sourcegit-scm/sourcegit/releases)
|
||||||
|
|
||||||
| File | .NET runtime | Description |
|
|
||||||
| ------------------------ | ------------------ | --------------------------------- |
|
|
||||||
| SourceGit.exe | .NET 6 x64 | Need to be installed by user. |
|
|
||||||
| SourceGit.bundle.exe | Self-contained | - |
|
|
||||||
|
|
||||||
> NOTE: You need install Git first.
|
> NOTE: You need install Git first.
|
||||||
|
|
||||||
## Screen Shots
|
## Screen Shots
|
||||||
|
|
15
build.bat
15
build.bat
|
@ -3,10 +3,15 @@
|
||||||
rmdir /s /q publish
|
rmdir /s /q publish
|
||||||
|
|
||||||
cd src
|
cd src
|
||||||
dotnet publish SourceGit.csproj --nologo -c Release -r win-x64 -f net6.0-windows -p:PublishSingleFile=true --no-self-contained -o ..\publish
|
|
||||||
dotnet publish SourceGit.csproj --nologo -c Release -r win-x64 -f net6.0-windows -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishReadyToRun=true --self-contained -o ..\publish\tmp
|
rmdir /s /q bin
|
||||||
move ..\publish\tmp\SourceGit.exe ..\publish\SourceGit.bundle.exe
|
rmdir /s /q obj
|
||||||
rmdir /s /q ..\publish\tmp
|
|
||||||
del /f /s /q ..\publish\SourceGit.pdb
|
dotnet publish SourceGit.csproj --nologo -c Release -r win-x86 -f net48 -o ..\publish\net48
|
||||||
|
ilrepack /ndebug /wildcards /out:..\publish\SourceGit.exe ..\publish\net48\SourceGit.exe ..\publish\net48\*.dll
|
||||||
|
|
||||||
|
cd ..\publish
|
||||||
|
|
||||||
|
rmdir /s /q net48
|
||||||
|
|
||||||
cd ..
|
cd ..
|
|
@ -85,7 +85,7 @@ namespace SourceGit.Commands {
|
||||||
isCancelled = true;
|
isCancelled = true;
|
||||||
proc.CancelErrorRead();
|
proc.CancelErrorRead();
|
||||||
proc.CancelOutputRead();
|
proc.CancelOutputRead();
|
||||||
if (!proc.HasExited) proc.Kill(true);
|
if (!proc.HasExited) proc.Kill();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ namespace SourceGit.Commands {
|
||||||
isCancelled = true;
|
isCancelled = true;
|
||||||
proc.CancelErrorRead();
|
proc.CancelErrorRead();
|
||||||
proc.CancelOutputRead();
|
proc.CancelOutputRead();
|
||||||
if (!proc.HasExited) proc.Kill(true);
|
if (!proc.HasExited) proc.Kill();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
<TargetFrameworks>net48</TargetFrameworks>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<ApplicationIcon>App.ico</ApplicationIcon>
|
<ApplicationIcon>App.ico</ApplicationIcon>
|
||||||
|
@ -17,4 +17,7 @@
|
||||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||||
<SatelliteResourceLanguages>none</SatelliteResourceLanguages>
|
<SatelliteResourceLanguages>none</SatelliteResourceLanguages>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="System.Text.Json" Version="6.0.6" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -45,13 +45,13 @@ namespace SourceGit.Views {
|
||||||
var extras = string.IsNullOrEmpty(ExtraArgs) ? "" : ExtraArgs;
|
var extras = string.IsNullOrEmpty(ExtraArgs) ? "" : ExtraArgs;
|
||||||
if (!string.IsNullOrEmpty(RemoteName)) extras += $" --origin {RemoteName}";
|
if (!string.IsNullOrEmpty(RemoteName)) extras += $" --origin {RemoteName}";
|
||||||
|
|
||||||
var succ = new Commands.Clone(Folder, Uri, LocalName, sshKey, extras, msg => {
|
var cloneRs = new Commands.Clone(Folder, Uri, LocalName, sshKey, extras, msg => {
|
||||||
Dispatcher.Invoke(() => txtProgress.Text = msg);
|
Dispatcher.Invoke(() => txtProgress.Text = msg);
|
||||||
}, err => {
|
}, err => {
|
||||||
Dispatcher.Invoke(() => txtError.Text = err);
|
Dispatcher.Invoke(() => txtError.Text = err);
|
||||||
}).Exec();
|
}).Exec();
|
||||||
|
|
||||||
if (!succ) return false;
|
if (!cloneRs) return false;
|
||||||
|
|
||||||
var path = Folder;
|
var path = Folder;
|
||||||
if (!string.IsNullOrEmpty(LocalName)) {
|
if (!string.IsNullOrEmpty(LocalName)) {
|
||||||
|
|
|
@ -10,7 +10,6 @@ using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Net.Http;
|
|
||||||
|
|
||||||
namespace SourceGit.Views.Controls {
|
namespace SourceGit.Views.Controls {
|
||||||
|
|
||||||
|
@ -193,14 +192,16 @@ namespace SourceGit.Views.Controls {
|
||||||
if (!requesting.ContainsKey(email)) return;
|
if (!requesting.ContainsKey(email)) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var req = new HttpClient().GetAsync($"https://www.gravatar.com/avatar/{md5}?d=404");
|
var req = WebRequest.CreateHttp($"https://www.gravatar.com/avatar/{md5}?d=404");
|
||||||
req.Wait();
|
req.Timeout = 2000;
|
||||||
|
req.Method = "GET";
|
||||||
|
|
||||||
var rsp = req.Result;
|
var rsp = req.GetResponse() as HttpWebResponse;
|
||||||
if (rsp != null && rsp.StatusCode == HttpStatusCode.OK) {
|
if (rsp != null && rsp.StatusCode == HttpStatusCode.OK) {
|
||||||
var writer = File.OpenWrite(filePath);
|
using (var reader = rsp.GetResponseStream())
|
||||||
rsp.Content.CopyToAsync(writer).Wait();
|
using (var writer = File.OpenWrite(filePath)) {
|
||||||
writer.Close();
|
reader.CopyTo(writer);
|
||||||
|
}
|
||||||
|
|
||||||
a.Dispatcher.Invoke(() => {
|
a.Dispatcher.Invoke(() => {
|
||||||
var img = new BitmapImage(new Uri(filePath));
|
var img = new BitmapImage(new Uri(filePath));
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace SourceGit.Views {
|
||||||
GPGExec = cmd.Get("gpg.program");
|
GPGExec = cmd.Get("gpg.program");
|
||||||
if (string.IsNullOrEmpty(GPGExec)) {
|
if (string.IsNullOrEmpty(GPGExec)) {
|
||||||
string gitInstallFolder = Path.GetDirectoryName(Models.Preference.Instance.Git.Path);
|
string gitInstallFolder = Path.GetDirectoryName(Models.Preference.Instance.Git.Path);
|
||||||
string defaultGPG = Path.GetFullPath(Path.Join(gitInstallFolder, "..", "usr", "bin", "gpg.exe"));
|
string defaultGPG = Path.GetFullPath(gitInstallFolder + "/../usr/bin/gpg.exe");
|
||||||
if (File.Exists(defaultGPG)) GPGExec = defaultGPG;
|
if (File.Exists(defaultGPG)) GPGExec = defaultGPG;
|
||||||
}
|
}
|
||||||
GPGSigningEnabled = cmd.Get("commit.gpgsign") == "true";
|
GPGSigningEnabled = cmd.Get("commit.gpgsign") == "true";
|
||||||
|
|
|
@ -74,11 +74,11 @@ namespace SourceGit.Views.Widgets {
|
||||||
} else {
|
} else {
|
||||||
searching = true;
|
searching = true;
|
||||||
foreach (var c in cachedCommits) {
|
foreach (var c in cachedCommits) {
|
||||||
if (c.SHA.Contains(filter, StringComparison.Ordinal)
|
if (c.SHA.IndexOf(filter, StringComparison.Ordinal) >= 0
|
||||||
|| c.Subject.Contains(filter, StringComparison.Ordinal)
|
|| c.Subject.IndexOf(filter, StringComparison.Ordinal) >= 0
|
||||||
|| c.Message.Contains(filter, StringComparison.Ordinal)
|
|| c.Message.IndexOf(filter, StringComparison.Ordinal) >= 0
|
||||||
|| c.Author.Name.Contains(filter, StringComparison.Ordinal)
|
|| c.Author.Name.IndexOf(filter, StringComparison.Ordinal) >= 0
|
||||||
|| c.Committer.Name.Contains(filter, StringComparison.Ordinal)) {
|
|| c.Committer.Name.IndexOf(filter, StringComparison.Ordinal) >= 0) {
|
||||||
visible.Add(c);
|
visible.Add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,8 +171,8 @@ namespace SourceGit.Views.Widgets {
|
||||||
visibles.AddRange(Models.Preference.Instance.Repositories);
|
visibles.AddRange(Models.Preference.Instance.Repositories);
|
||||||
} else {
|
} else {
|
||||||
foreach (var repo in Models.Preference.Instance.Repositories) {
|
foreach (var repo in Models.Preference.Instance.Repositories) {
|
||||||
if (repo.Name.ToLower().Contains(curFilter, StringComparison.Ordinal) ||
|
if (repo.Name.ToLower().IndexOf(curFilter, StringComparison.Ordinal) >= 0 ||
|
||||||
repo.Path.ToLower().Contains(curFilter, StringComparison.Ordinal)) {
|
repo.Path.ToLower().IndexOf(curFilter, StringComparison.Ordinal) >= 0) {
|
||||||
visibles.Add(repo);
|
visibles.Add(repo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ namespace SourceGit.Views.Widgets {
|
||||||
|
|
||||||
if (!added) Changes.Add(c);
|
if (!added) Changes.Add(c);
|
||||||
|
|
||||||
int sepIdx = c.Path.IndexOf('/', StringComparison.Ordinal);
|
int sepIdx = c.Path.IndexOf("/", StringComparison.Ordinal);
|
||||||
if (sepIdx < 0) {
|
if (sepIdx < 0) {
|
||||||
GetOrAddTreeNode(Nodes, c.Path, c, false);
|
GetOrAddTreeNode(Nodes, c.Path, c, false);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue