Initial commit

This commit is contained in:
Mira 2025-01-27 18:37:17 +01:00
commit ea04fd2785
Signed by untrusted user who does not match committer: Xorog
GPG key ID: 983798ED9C3E7C36
25 changed files with 2156 additions and 0 deletions

61
.build.cmd Normal file
View file

@ -0,0 +1,61 @@
@echo off
REM User-definable variables
set PluginDir=C:\path\to\plugin\directory
set PluginName=ProjectMakoto.Plugins.Translations
REM Build procedure, leave alone
for %%I in (.) do set CurrDirName=%%~nxI
echo Deleting conflicting files..
del /S build.zip >NUL
del /S %CurrDirName%.pmpl >NUL
rmdir /S /Q bin >NUL
rmdir /S /Q build >NUL
echo Building project..
dotnet clean
dotnet restore
dotnet publish %PluginName%.sln --property:PublishDir="build" --framework net9.0
if %errorlevel% neq 0 goto error
echo Zipping project to build.zip..
dotnet run --project "Tools\CreateZipFolder\CreateZipFolder.csproj" -- "build" "build.zip"
if %errorlevel% neq 0 goto error
rename build.zip %CurrDirName%.pmpl
echo Creating manifest..
set current_dir=%cd%
cd ..\deps
dotnet ProjectMakoto.dll --build-manifests %current_dir%
cd %current_dir%
echo.
echo.
echo Created pmpl-File at %cd%\%CurrDirName%.pmpl!
echo Cleaning up..
rmdir /S /Q bin >NUL
rmdir /S /Q build >NUL
if "%PluginDir%"=="C:\path\to\plugin\directory" (
echo.
echo Tip: You can define an output directory in this file by replacing PluginDir with the appropriate path.
goto skipcopy
)
echo Copying to %PluginDir%..
del /S %PluginDir%\%CurrDirName%.pmpl >NUL
timeout /t 1 >NUL
move %CurrDirName%.pmpl %PluginDir%\%CurrDirName%.pmpl
if %errorlevel% neq 0 goto error
:skipcopy
exit /b 0
:error
echo Something went wrong!
pause >NUL
exit /b %errorlevel%