-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from sunnamed434/dev
Bump new version 0.10.0-alpha.19
- Loading branch information
Showing
52 changed files
with
362 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace BitMono.CLI.Modules; | ||
|
||
[SuppressMessage("ReSharper", "InconsistentNaming")] | ||
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Global")] | ||
public class CLIOptions | ||
{ | ||
[Option('f', "file", Required = true, HelpText = "Set file path.")] | ||
public string? File { get; set; } | ||
|
||
[Option('l', "libraries", Required = false, HelpText = "Set libraries path.")] | ||
public string? Libraries { get; set; } | ||
|
||
[Option('o', "output", Required = false, HelpText = "Set output path.")] | ||
public string? Output { get; set; } | ||
} |
50 changes: 50 additions & 0 deletions
50
src/BitMono.CLI/Modules/CLIOptionsObfuscationNeedsFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#pragma warning disable CS8604 | ||
namespace BitMono.CLI.Modules; | ||
|
||
[SuppressMessage("ReSharper", "InconsistentNaming")] | ||
public class CLIOptionsObfuscationNeedsFactory : IObfuscationNeedsFactory | ||
{ | ||
private readonly string[] m_Args; | ||
|
||
public CLIOptionsObfuscationNeedsFactory(string[] args) | ||
{ | ||
m_Args = args; | ||
} | ||
|
||
[SuppressMessage("ReSharper", "AssignNullToNotNullAttribute")] | ||
public ObfuscationNeeds? Create() | ||
{ | ||
var parser = new Parser(with => | ||
{ | ||
with.EnableDashDash = true; | ||
with.HelpWriter = Console.Error; | ||
}); | ||
var parserResult = parser.ParseArguments<CLIOptions>(m_Args); | ||
if (parserResult.Errors.IsEmpty() == false) | ||
{ | ||
return null; | ||
} | ||
var options = parserResult.Value; | ||
if (File.Exists(options.File) == false) | ||
{ | ||
Console.WriteLine("File cannot be found, please, try again!"); | ||
return null; | ||
} | ||
var fileBaseDirectory = Path.GetDirectoryName(options.File); | ||
var needs = new ObfuscationNeeds | ||
{ | ||
FileName = options.File, | ||
FileBaseDirectory = fileBaseDirectory, | ||
DependenciesDirectoryName = options.Libraries.IsNullOrEmpty() == false | ||
? options.Libraries | ||
: Path.Combine(fileBaseDirectory, "libs"), | ||
OutputDirectoryName = options.Output.IsNullOrEmpty() == false | ||
? options.Output | ||
: Path.Combine(fileBaseDirectory, "output") | ||
}; | ||
|
||
Directory.CreateDirectory(needs.OutputDirectoryName); | ||
Directory.CreateDirectory(needs.DependenciesDirectoryName); | ||
return needs; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
src/BitMono.Core/Extensions/SerilogContextCallerExtensions.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.