diff --git a/README.md b/README.md index ce63a7e..d6683d4 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,8 @@ Copy-paste Live EFT's `EscapeFromTarkov_Data/Managed/` folder to into this proje ## Build (VS 2022) 1. Open solution 2. Restore nuget packages -3. Run `dotnet new tool-manifest` -4. Sometimes you need to run `dotnet tool restore` -5. Run `dotnet tool install Cake.Tool` -6. Build solution -7. Copy contents of `/Build` into SPT game folder and overwrite +3. Build solution +4. Copy contents of `/Build` into SPT game folder and overwrite ## Game Setup 1. Copy Live EFT files into a separate directory (from now on this will be referred to as the "SPT directory") diff --git a/project/.config/dotnet-tools.json b/project/.config/dotnet-tools.json deleted file mode 100644 index da200cd..0000000 --- a/project/.config/dotnet-tools.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "cake.tool": { - "version": "4.0.0", - "commands": [ - "dotnet-cake" - ] - } - } -} \ No newline at end of file diff --git a/project/Aki.Build/Aki.Build.csproj b/project/Aki.Build/Aki.Build.csproj index 5c1b1b5..4c6472b 100644 --- a/project/Aki.Build/Aki.Build.csproj +++ b/project/Aki.Build/Aki.Build.csproj @@ -2,11 +2,12 @@ net471 + Release SPT Aki - Copyright @ SPT Aki 2023 + Copyright @ SPT Aki 2024 @@ -19,11 +20,13 @@ - + + + - + diff --git a/project/Aki.Common/Aki.Common.csproj b/project/Aki.Common/Aki.Common.csproj index d23bb96..8826398 100644 --- a/project/Aki.Common/Aki.Common.csproj +++ b/project/Aki.Common/Aki.Common.csproj @@ -3,11 +3,12 @@ 1.0.0.0 net471 + Release Aki - Copyright @ Aki 2022 + Copyright @ Aki 2024 diff --git a/project/Aki.Core/Aki.Core.csproj b/project/Aki.Core/Aki.Core.csproj index 7d7fd63..f762b57 100644 --- a/project/Aki.Core/Aki.Core.csproj +++ b/project/Aki.Core/Aki.Core.csproj @@ -1,13 +1,14 @@  - net471 + net471 aki-core + Release Aki - Copyright @ Aki 2022 + Copyright @ Aki 2024 diff --git a/project/Aki.Custom/Aki.Custom.csproj b/project/Aki.Custom/Aki.Custom.csproj index f927622..03ebf3c 100644 --- a/project/Aki.Custom/Aki.Custom.csproj +++ b/project/Aki.Custom/Aki.Custom.csproj @@ -1,13 +1,14 @@  - net471 + net471 aki-custom + Release Aki - Copyright @ Aki 2022 + Copyright @ Aki 2024 diff --git a/project/Aki.Debugging/Aki.Debugging.csproj b/project/Aki.Debugging/Aki.Debugging.csproj index a8c129e..ae60ee6 100644 --- a/project/Aki.Debugging/Aki.Debugging.csproj +++ b/project/Aki.Debugging/Aki.Debugging.csproj @@ -1,20 +1,19 @@  - net471 + net471 aki-debugging + Release Aki - Copyright @ Aki 2022 + Copyright @ Aki 2024 - - ..\Shared\Managed\bsg.console.core.dll - + diff --git a/project/Aki.PrePatch/Aki.PrePatch.csproj b/project/Aki.PrePatch/Aki.PrePatch.csproj index d909db1..6d84740 100644 --- a/project/Aki.PrePatch/Aki.PrePatch.csproj +++ b/project/Aki.PrePatch/Aki.PrePatch.csproj @@ -4,11 +4,12 @@ net471 aki_PrePatch + Release Aki - Copyright @ Aki 2022 + Copyright @ Aki 2024 diff --git a/project/Aki.Reflection/Aki.Reflection.csproj b/project/Aki.Reflection/Aki.Reflection.csproj index fb08a82..053968c 100644 --- a/project/Aki.Reflection/Aki.Reflection.csproj +++ b/project/Aki.Reflection/Aki.Reflection.csproj @@ -1,16 +1,17 @@  - net471 + net471 + Release Aki - Copyright @ Aki 2022 + Copyright @ Aki 2024 - + diff --git a/project/Aki.SinglePlayer/Aki.SinglePlayer.csproj b/project/Aki.SinglePlayer/Aki.SinglePlayer.csproj index 76bbd58..a43eb3f 100644 --- a/project/Aki.SinglePlayer/Aki.SinglePlayer.csproj +++ b/project/Aki.SinglePlayer/Aki.SinglePlayer.csproj @@ -1,25 +1,24 @@  - net471 + net471 aki-singleplayer + Release Aki - Copyright @ Aki 2023 + Copyright @ Aki 2024 - - + + - - ..\Shared\Managed\UnityEngine.AudioModule.dll - + diff --git a/project/Modules.code-workspace b/project/Modules.code-workspace index c2b54f9..de30cc3 100644 --- a/project/Modules.code-workspace +++ b/project/Modules.code-workspace @@ -18,7 +18,7 @@ { "label": "build", "type": "shell", - "command": "dotnet cake", + "command": "dotnet build --configuration Release", "group": { "kind": "build", "isDefault": true diff --git a/project/build.bat b/project/build.bat new file mode 100644 index 0000000..03ff394 --- /dev/null +++ b/project/build.bat @@ -0,0 +1,52 @@ +@echo off +:: Set some Vars to use +set buildFolder=..\Build +set bepinexFolder=..\Build\BepInEx +set bepinexPatchFolder=..\Build\BepInEx\Patchers +set bepinexPluginFolder=..\Build\BepInEx\Plugins +set bepinexSptFolder=..\Build\BepInEx\Plugins\spt +set eftDataFolder=..\Build\EscapeFromTarkov_Data +set managedFolder=..\Build\EscapeFromTarkov_Data\Managed +set projReleaseFolder=.\bin\Release\net471 +set licenseFile=..\..\LICENSE.md + +echo --------------- Cleaning Output Build Folder --------------- + +:: Delete build folder and contents to make sure its clean +if exist %buildFolder% rmdir /s /q %buildFolder% + +echo --------------- Done Cleaning Output Build Folder --------------- +echo --------------- Creating Output Build Folders --------------- + +:: Create build folder if it doesn't exist +if not exist %buildFolder% mkdir %buildFolder% +if not exist %bepinexFolder% mkdir %bepinexFolder% +if not exist %bepinexPatchFolder% mkdir %bepinexPatchFolder% +if not exist %bepinexPluginFolder% mkdir %bepinexPluginFolder% +if not exist %bepinexSptFolder% mkdir %bepinexSptFolder% +if not exist %eftDataFolder% mkdir %eftDataFolder% +if not exist %managedFolder% mkdir %managedFolder% + +echo --------------- Done Creating Output Build Folders --------------- + +echo --------------- Moving DLLs to %buildFolder% --------------- + +:: Move DLLs from each project's bin\Release folder to the build folder +xcopy "%projReleaseFolder%\Aki.Common.dll" %managedFolder% +xcopy "%projReleaseFolder%\Aki.Reflection.dll" %managedFolder% + +xcopy "%projReleaseFolder%\aki_PrePatch.dll" %bepinexPatchFolder% + +xcopy "%projReleaseFolder%\aki-core.dll" %bepinexSptFolder% +xcopy "%projReleaseFolder%\aki-custom.dll" %bepinexSptFolder% +xcopy "%projReleaseFolder%\aki-debugging.dll" %bepinexSptFolder% +xcopy "%projReleaseFolder%\aki-singleplayer.dll" %bepinexSptFolder% +:: If any new Dll's need to be copied, add here + +echo --------------- Done Moving DLLs to %buildFolder% --------------- +echo --------------- Writing License File --------------- + +:: write the contents of the license file to a txt +type %licenseFile% > "%buildFolder%\LICENSE-Modules.txt" + +echo --------------- Done Writing License File --------------- \ No newline at end of file diff --git a/project/build.cake b/project/build.cake deleted file mode 100644 index 46a72ed..0000000 --- a/project/build.cake +++ /dev/null @@ -1,107 +0,0 @@ -string target = Argument("target", "ExecuteBuild"); -bool VSBuilt = Argument("vsbuilt", false); - -#addin nuget:?package=Cake.FileHelpers&version=5.0.0 - -// Cake API Reference: https://cakebuild.net/dsl/ -// setup variables -var buildDir = "./Build"; -var delPaths = GetDirectories("./**/*(obj|bin)"); -var licenseFile = "../LICENSE.md"; -var managedFolder = string.Format("{0}/{1}/{2}", buildDir, "EscapeFromTarkov_Data", "Managed"); -var bepInExPluginsFolder = string.Format("{0}/{1}/{2}", buildDir, "BepInEx", "plugins"); -var bepInExPluginsSptFolder = string.Format("{0}/{1}", bepInExPluginsFolder, "spt"); -var bepInExPatchersFolder = string.Format("{0}/{1}/{2}", buildDir, "BepInEx", "patchers"); -var solutionPath = "./Modules.sln"; - -Setup(context => -{ - //building from VS will lock the files and fail to clean the project directories. Post-Build event on Aki.Build sets this switch to true to avoid this. - FileWriteText("./vslock", "lock"); -}); - -Teardown(context => -{ - if(FileExists("./vslock")) - { - DeleteFile("./vslock"); //remove vslock file - } -}); - -// Clean build directory and remove obj / bin folder from projects -Task("Clean") - .WithCriteria(!VSBuilt) - .Does(() => - { - CleanDirectory(buildDir); - }) - .DoesForEach(delPaths, (directoryPath) => - { - DeleteDirectory(directoryPath, new DeleteDirectorySettings - { - Recursive = true, - Force = true - }); - }); - -// Build solution -Task("Build") - .IsDependentOn("Clean") - .WithCriteria(!FileExists("./vslock")) // check for lock file if running from VS - .Does(() => - { - DotNetBuild(solutionPath, new DotNetBuildSettings - { - Configuration = "Release" - }); - }); - -// Copy modules, managed dlls, and license to the build folder -Task("CopyBuildData") - .IsDependentOn("Build") - .Does(() => - { - CleanDirectory(buildDir); - CreateDirectory(managedFolder); - CreateDirectory(bepInExPluginsFolder); - CreateDirectory(bepInExPluginsSptFolder); - CreateDirectory(bepInExPatchersFolder); - CopyFile(licenseFile, string.Format("{0}/LICENSE-Modules.txt", buildDir)); - }) - .DoesForEach(GetFiles("./Aki.*/bin/Release/net471/*.dll"), (dllPath) => //copy modules - { - if(dllPath.GetFilename().ToString().StartsWith("aki_")) - { - //Incase you want to see what is being copied for debuging - //Spectre.Console.AnsiConsole.WriteLine(string.Format("Adding Module: {0}", dllPath.GetFilename())); - - string patcherTransferPath = string.Format("{0}/{1}", bepInExPatchersFolder, dllPath.GetFilename()); - - CopyFile(dllPath, patcherTransferPath); - } - if(dllPath.GetFilename().ToString().StartsWith("aki-")) - { - //Incase you want to see what is being copied for debuging - //Spectre.Console.AnsiConsole.WriteLine(string.Format("Adding Module: {0}", dllPath.GetFilename())); - - string moduleTransferPath = string.Format("{0}/{1}", bepInExPluginsSptFolder, dllPath.GetFilename()); - - CopyFile(dllPath, moduleTransferPath); - } - else if (dllPath.GetFilename().ToString().StartsWith("Aki.")) // Only copy the custom-built dll's to Managed - { - //Incase you want to see what is being copied for debuging - //Spectre.Console.AnsiConsole.WriteLine(string.Format("Adding managed dll: {0}", dllPath.GetFilename())); - - string fileTransferPath = string.Format("{0}/{1}", managedFolder, dllPath.GetFilename()); - - CopyFile(dllPath, fileTransferPath); - } - }); - -// Runs all build tasks based on dependency and configuration -Task("ExecuteBuild") - .IsDependentOn("CopyBuildData"); - -// Runs target task -RunTarget(target); \ No newline at end of file