generated from Fortunevale/ProjectMakoto.Plugins.Example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.build.cmd
61 lines (47 loc) · 1.38 KB
/
.build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@echo off
REM User-definable variables
set PluginDir=C:\path\to\plugin\directory
set PluginName=ProjectMakoto.Plugins.Social
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%