Skip to content

Commit

Permalink
feat: win gui, pub xml
Browse files Browse the repository at this point in the history
  • Loading branch information
trueai-org committed Jun 26, 2024
1 parent e2b7374 commit fa6e7f6
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 14 deletions.
6 changes: 6 additions & 0 deletions MDriveSync.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{3CE27DBE
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MDriveSync.Client.WinFormAPI", "src\MDriveSync.Client.WinFormAPI\MDriveSync.Client.WinFormAPI.csproj", "{585E1ED7-B1D9-4EEE-AF65-32853A05FA9E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MDriveSync.Client.App", "src\MDriveSync.Client.App\MDriveSync.Client.App.csproj", "{F648E4A2-E525-426F-A12C-F9ADAF8E211D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -67,6 +69,10 @@ Global
{585E1ED7-B1D9-4EEE-AF65-32853A05FA9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{585E1ED7-B1D9-4EEE-AF65-32853A05FA9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{585E1ED7-B1D9-4EEE-AF65-32853A05FA9E}.Release|Any CPU.Build.0 = Release|Any CPU
{F648E4A2-E525-426F-A12C-F9ADAF8E211D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F648E4A2-E525-426F-A12C-F9ADAF8E211D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F648E4A2-E525-426F-A12C-F9ADAF8E211D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F648E4A2-E525-426F-A12C-F9ADAF8E211D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions src/MDriveSync.Client.API/MDriveSync.Client.API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MDriveSync.Client.App\MDriveSync.Client.App.csproj" />
<ProjectReference Include="..\MDriveSync.Core\MDriveSync.Core.csproj" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions src/MDriveSync.Client.API/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using MDriveSync.Client.App;
using MDriveSync.Infrastructure;
using Quartz.Logging;
using Serilog;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
using MDriveSync.Core.ViewModels;
using MDriveSync.Infrastructure;
using MDriveSync.Security;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Net.Http.Headers;
using Newtonsoft.Json;
using System.Text;

namespace MDriveSync.Client.API.Controllers
namespace MDriveSync.Client.App.Controllers
{
/// <summary>
/// 阿里云盘存储控制器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using MDriveSync.Infrastructure;
using Microsoft.AspNetCore.Mvc;

namespace MDriveSync.Client.API.Controllers
namespace MDriveSync.Client.App.Controllers
{
/// <summary>
/// 本地存储控制器
Expand Down
12 changes: 12 additions & 0 deletions src/MDriveSync.Client.App/MDriveSync.Client.App.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\MDriveSync.Core\MDriveSync.Core.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
using MDriveSync.Core.Filters;
using MDriveSync.Core.Middlewares;
using MDriveSync.Infrastructure;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;

namespace MDriveSync.Client.API
namespace MDriveSync.Client.App
{
public class Startup
{
Expand Down Expand Up @@ -49,7 +53,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddHostedService(provider => provider.GetRequiredService<LocalStorageHostedService>());
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
public void Configure(IApplicationBuilder app, IHostEnvironment env)
{
if (env.IsDevelopment())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,45 @@
<TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>zh</SatelliteResourceLanguages>
<InvariantGlobalization>true</InvariantGlobalization>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MDriveSync.Client.API\MDriveSync.Client.API.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="appsettings.Development.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

<!-- 排除它们从单文件发布 -->
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</None>
</ItemGroup>

<ItemGroup>
<Content Include="..\MDriveSync.Client.API\wwwroot\**\*">
<Link>wwwroot\%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

<!-- 排除它们从单文件发布 -->
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
</ItemGroup>

<ItemGroup>
<None Remove="Resources\logo.png" />
<None Remove="Resources\logo.png" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\logo.png" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\logo.png" />
<ProjectReference Include="..\MDriveSync.Client.App\MDriveSync.Client.App.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/MDriveSync.Client.WinFormAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static IHostBuilder CreateHostBuilder() =>
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<MDriveSync.Client.API.Startup>();
webBuilder.UseStartup<App.Startup>();
})
.UseSerilog((context, services, configuration) =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net8.0-windows\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net8.0-windows</TargetFramework>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net8.0-windows\publish\win-x86\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net8.0-windows</TargetFramework>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
</Project>

0 comments on commit fa6e7f6

Please sign in to comment.