Skip to content

Commit

Permalink
release 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetsu committed Jan 16, 2023
1 parent 2f456e0 commit 32b10a9
Show file tree
Hide file tree
Showing 113 changed files with 2,823 additions and 570 deletions.
Binary file added ExternalResources/DonutCore.1.0.1.nupkg
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OffensivePipeline", "OffensivePipeline.csproj", "{35E4CDCF-59AD-4946-A9E6-3DDF6661F537}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OffensivePipeline", "OffensivePipeline\OffensivePipeline.csproj", "{102D65B0-DE68-4FBB-A34F-867CD97CB35F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35E4CDCF-59AD-4946-A9E6-3DDF6661F537}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35E4CDCF-59AD-4946-A9E6-3DDF6661F537}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35E4CDCF-59AD-4946-A9E6-3DDF6661F537}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35E4CDCF-59AD-4946-A9E6-3DDF6661F537}.Release|Any CPU.Build.0 = Release|Any CPU
{102D65B0-DE68-4FBB-A34F-867CD97CB35F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{102D65B0-DE68-4FBB-A34F-867CD97CB35F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{102D65B0-DE68-4FBB-A34F-867CD97CB35F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{102D65B0-DE68-4FBB-A34F-867CD97CB35F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BAE47189-32EF-4809-A5EB-9271AAB5DF89}
SolutionGuid = {376489D4-29A0-4690-AD99-53919C4BD329}
EndGlobalSection
EndGlobal
10 changes: 10 additions & 0 deletions OffensivePipeline/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Version" value="2.0.0"/>
<add key="NugetUrl" value="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"/>
<add key="BuildCsharpOptions" value="/p:LangVersion=latest /p:Platform=&quot;Any CPU&quot; /p:Configuration=Release /p:AllowUnsafeBlocks=true"/>
<add key="BuildCSharpTools" value="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\VsDevCmd.bat"/>
<add key="ConfuserExUrl" value="https://github.com/mkaring/ConfuserEx/releases/download/v1.6.0/ConfuserEx-CLI.zip"/>
</appSettings>
</configuration>
146 changes: 0 additions & 146 deletions OffensivePipeline/Build.cs

This file was deleted.

25 changes: 25 additions & 0 deletions OffensivePipeline/Conf.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OffensivePipeline
{
public static class Conf
{
public static string gitToolsPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Git");
public static string outputPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Output");
public static string modulesPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Modules");
public static string ymlsPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"Tools");
public static string logFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"log.txt");
public static string resourcesPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"Resources");
//BuildPath
public static string nugetPath = Path.Combine(resourcesPath, "nuget.exe");
public static string templateBuildPath = Path.Combine(resourcesPath, "template_build.bat");
//ConfuserEx
public static string confuserExFolder = Path.Combine(resourcesPath, "ConfuserEx");
public static string confuserExFile = Path.Combine(confuserExFolder, "Confuser.CLI.exe");
public static string confuserTemplateFile = Path.Combine(resourcesPath, "template_confuserEx.crproj.template");
}
}
110 changes: 110 additions & 0 deletions OffensivePipeline/GitHelpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using LibGit2Sharp;



namespace OffensivePipeline
{
internal class GitHelpers
{
public static bool CloneLocalTool(ToolConfig tool)
{
bool status = CloneChecks(tool);
if (status)
{
string toolPath = Path.Combine(Conf.gitToolsPath, tool.name);
status = Helpers.CopyDirectory(tool.gitLink, toolPath, true);
if (status)
{
if (!File.Exists(Path.Combine(Conf.gitToolsPath, tool.solutionPath)))
{
status = false;
LogHelpers.PrintError($"CloneLocalTool: Folder not found {toolPath}");
}
else
{
LogHelpers.PrintOk($"\t\t Repository {tool.name} copied into {toolPath}");
}
}
}
return status;
}
public static bool CloneChecks(ToolConfig tool)
{
bool status = true;
try
{
if (!Directory.Exists(Conf.gitToolsPath))
{
DirectoryInfo di = Directory.CreateDirectory(Conf.gitToolsPath);
}
}
catch (Exception e)
{
LogHelpers.PrintError($"DownloadRepository - Creating {Conf.gitToolsPath} folder - {e}");
status = false;
}
if (status)
{
string toolPath = Path.Combine(Conf.gitToolsPath, tool.name);
try
{
if (Directory.Exists(toolPath))
{
Helpers.DeleteReadOnlyDirectory(toolPath);
}
}
catch (Exception e)
{
LogHelpers.PrintError($"CloneChecks - Deleting {toolPath} folder - {e}");
status = false;
}
}

return status;
}
public static bool DownloadRepository(ToolConfig tool)
{
bool status = CloneChecks(tool);
if (status)
{
try
{
string toolPath = Path.Combine(Conf.gitToolsPath, tool.name);
if (!Directory.Exists(toolPath))
{
LogHelpers.PrintYellow($" Clonnig repository: {tool.name} into {toolPath}");
CloneOptions co = new CloneOptions();
if (tool.authToken != "")
{
string gitUser = tool.authUser, gitToken = tool.authToken;
co.CredentialsProvider = (_url, _user, _cred) => new UsernamePasswordCredentials { Username = gitUser, Password = gitToken };
}
co.RecurseSubmodules = true;
_ = Repository.Clone(tool.gitLink, toolPath, co);
if (!File.Exists(Path.Combine(Conf.gitToolsPath, tool.solutionPath)))
{
status = false;
LogHelpers.PrintError($"DownloadRepository: Solution not found {Path.Combine(Conf.gitToolsPath, tool.solutionPath)}");
}
else
{
LogHelpers.PrintOk($"\t\t Repository {tool.name} cloned into {toolPath}");
}
}
}
catch (Exception e)
{
LogHelpers.PrintError($"DownloadRepository: {tool.name} - {e}");
status = false;
}
}
return status;
}
}
}
Loading

0 comments on commit 32b10a9

Please sign in to comment.