Skip to content

Commit

Permalink
📦 Struct: Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynesshely committed Jun 17, 2024
1 parent 3d110d1 commit fa61da3
Show file tree
Hide file tree
Showing 22 changed files with 43 additions and 490 deletions.
6 changes: 6 additions & 0 deletions Cheese.Contract/Providers/ILocalizationProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Cheese.Contract.Providers;

public interface ILocalizationProvider : IProvider
{
void Execute(string target);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Cheese.Shared.References;

namespace Cheese.Contract.References;
namespace Cheese.Contract.Providers;

public interface IReferencesProvider : IProvider
{
Expand Down
9 changes: 0 additions & 9 deletions Cheese.Data/Cheese.Data.csproj

This file was deleted.

8 changes: 0 additions & 8 deletions Cheese.Data/RepoMaintainer.cs

This file was deleted.

4 changes: 4 additions & 0 deletions Cheese.Shared/Cheese.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Common.BasicHelper" Version="1.3.584.228" />
</ItemGroup>

</Project>
8 changes: 0 additions & 8 deletions Cheese.Shared/I18n/I18nUtil.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Cheese.Shared/I18n/I18nUtilsList.cs

This file was deleted.

27 changes: 24 additions & 3 deletions Cheese.Shared/PipeLine/CoreProcess.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
namespace Cheese.Shared;
namespace Cheese.Shared.PipeLine;

public class CoreProcess
{
/// <summary>
/// The root path of current project, if not in any cheese project, you get null
/// </summary>
public string? ProjectRootPath { get; set; }

/// <summary>
/// Where cheese startup
/// For example:
/// $ cd */xxx
/// $ cheese ...
/// Then, `StartupPath` will be "*/xxx"
/// </summary>
public string? StartupPath { get; set; }

/// <summary>
/// The absolute path for `.cheese` folder in current project
/// If not in any cheese project, you get null
/// </summary>
public string? CheeseDataPath { get; set; }


public RepoInfo? RepoInfo;
/// <summary>
/// Basic information for current repo/project
/// </summary>
public RepoInfo? RepoInfo { get; set; }
}
2 changes: 1 addition & 1 deletion Cheese.Shared/RepoInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ namespace Cheese.Shared;

public class RepoInfo
{
public string? WorkBase;

}
6 changes: 0 additions & 6 deletions Cheese.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cheese.Contract", "Cheese.C
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cheese.Shared", "Cheese.Shared\Cheese.Shared.csproj", "{D78E8C97-0107-4A7F-9566-2DFF092E6048}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cheese.Data", "Cheese.Data\Cheese.Data.csproj", "{D65210EE-F9AC-43D1-AD1A-8943C8E4EFAD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cheese.UnitTests", "Cheese.UnitTests\Cheese.UnitTests.csproj", "{CD298668-B6AB-4166-A537-94316F947BC9}"
EndProject
Global
Expand All @@ -34,10 +32,6 @@ Global
{D78E8C97-0107-4A7F-9566-2DFF092E6048}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D78E8C97-0107-4A7F-9566-2DFF092E6048}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D78E8C97-0107-4A7F-9566-2DFF092E6048}.Release|Any CPU.Build.0 = Release|Any CPU
{D65210EE-F9AC-43D1-AD1A-8943C8E4EFAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D65210EE-F9AC-43D1-AD1A-8943C8E4EFAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D65210EE-F9AC-43D1-AD1A-8943C8E4EFAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D65210EE-F9AC-43D1-AD1A-8943C8E4EFAD}.Release|Any CPU.Build.0 = Release|Any CPU
{CD298668-B6AB-4166-A537-94316F947BC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CD298668-B6AB-4166-A537-94316F947BC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD298668-B6AB-4166-A537-94316F947BC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
1 change: 0 additions & 1 deletion Cheese/Cheese.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Common.BasicHelper" Version="1.3.584.228" />
<PackageReference Include="Csharpell.Core" Version="0.5.225.17" />
<PackageReference Include="Spectre.Console" Version="0.49.1" />
</ItemGroup>
Expand Down
21 changes: 0 additions & 21 deletions Cheese/Options/I18nOptions.cs

This file was deleted.

21 changes: 0 additions & 21 deletions Cheese/Options/InitializeOptions.cs

This file was deleted.

24 changes: 0 additions & 24 deletions Cheese/Options/PublishOptions.cs

This file was deleted.

11 changes: 1 addition & 10 deletions Cheese/Options/ReferenceOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,14 @@ public class ReferenceOptions : Options
[Option('s', "setup", Group = "act", HelpText = "Setup references.")]
public bool Setup { get; set; }

[Option("convert-ssl-link-to-https-link", HelpText = "Indicate will cheese convert ssl link to https link.")]
[Option('h', "convert-ssl-link-to-https-link", HelpText = "Indicate will cheese convert ssl link to https link.")]
public bool ConvertSslLinkToHttpsLink { get; set; }

[Option('g', "gen", Group = "act", HelpText = "Generate references with flavor.")]
public bool Generate { get; set; }

[Option("flavor", Default = null, HelpText = "Select a reference flavor.")]
public string? Flavor { get; set; }
}

public static class ReferenceOptionsExtensions
{
public static ReferenceOptions Execute(this ReferenceOptions options)
{
if (options.Generate)
ReferencesManager.Instance.GenerateWithFlavor(options);

if (options.Setup)
ReferencesManager.Instance.SetupAll(options);

Expand Down
8 changes: 1 addition & 7 deletions Cheese/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@

var versionText = $"v{version?.Major}.{version?.Minor}.{version?.Build} ({version?.MinorRevision})";

Parser.Default.ParseArguments<Options, InitializeOptions, SetupOptions, ReferenceOptions, PublishOptions, I18nOptions, object>(args)
Parser.Default.ParseArguments<Options, SetupOptions, ReferenceOptions, object>(args)
.WithParsed<Options>(options => options.Execute())
// Parse command "init"
.WithParsed<InitializeOptions>(options => options.Execute())
// Parse command "setup"
.WithParsed<SetupOptions>(options => options.Execute())
// Parse command "reference"
.WithParsed<ReferenceOptions>(options => options.Execute())
// Parse command "publish"
.WithParsed<PublishOptions>(options => options.Execute())
// Parse command "i18n"
.WithParsed<I18nOptions>(options => options.Execute())
;

// In debug mode, read the console output before closing the app
Expand Down
59 changes: 0 additions & 59 deletions Cheese/Utils/I18n/I18nManager.cs

This file was deleted.

17 changes: 0 additions & 17 deletions Cheese/Utils/Initializer/Initializer.cs

This file was deleted.

16 changes: 0 additions & 16 deletions Cheese/Utils/Publisher/Defines.cs

This file was deleted.

Loading

0 comments on commit fa61da3

Please sign in to comment.