-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPluginPostBuild.cmd
More file actions
95 lines (70 loc) · 3.24 KB
/
PluginPostBuild.cmd
File metadata and controls
95 lines (70 loc) · 3.24 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
rem @echo off
rem TODO: merge it into DelftTools.target
rem %1 %2 %3 %4 %5 %6
rem call "$(SolutionDir)\build\tools\PluginPostBuild.cmd" "$(SolutionDir)" "$(TargetDir)" $(ProjectName) $(PluginName) $(InstallDir) $(ProjectDir)
echo Runnning PostBuild event script for plugin project: %3
set SOLUTION_DIR=%1
set TARGET_DIR=%2
set PROJECT_NAME=%3
set INSTALL_DIR=%5
set PROJECT_DIR=%6
set PLUGIN_NAME=%4
set PLUGIN_HOME=%INSTALL_DIR%\plugins\%PLUGIN_NAME%
if not exist %INSTALL_DIR%\skip-plugins.txt (
echo "# add plugin names below to skip copying them during compilation" > %INSTALL_DIR%\skip-plugins.txt
)
%SOLUTION_DIR%\build\tools\grep.exe %PLUGIN_NAME% %INSTALL_DIR%\skip-plugins.txt
if %ERRORLEVEL% == 0 (
echo Skipping plugin: %PLUGIN_NAME% ...
exit 0
)
echo Install dir: %INSTALL_DIR%
echo Plugin home: %PLUGIN_HOME%
if not exist %PLUGIN_HOME% md %PLUGIN_HOME%
if exist %TARGET_DIR%\%PROJECT_NAME%.dll (
%windir%\System32\xcopy.exe /D /Y /Q %TARGET_DIR%%PROJECT_NAME%.dll %PLUGIN_HOME% > nul
)
if exist %TARGET_DIR%\%PROJECT_NAME%.exe (
%windir%\System32\xcopy.exe /D /Y /Q %TARGET_DIR%%PROJECT_NAME%.exe %PLUGIN_HOME% > nul
)
if exist %TARGET_DIR%\%PROJECT_NAME%.dll.config (
%windir%\System32\xcopy.exe /D /Y /Q %TARGET_DIR%%PROJECT_NAME%.dll.config %PLUGIN_HOME% > nul
echo Copied plugin config file %TARGET_DIR%%PROJECT_NAME%.dll.config to %PLUGIN_HOME%
) else (
echo "Plugin config file (%TARGET_DIR%%PROJECT_NAME%.dll.config) does not exist, skipping copy."
)
rem copying plugin language-specific resource files
rem ============================================================
rem hardcoded for now, make it generic when necessary (ADD MORE LANGUAGES HERE)
if exist %TARGET_DIR%\%PROJECT_NAME%.dll (
%windir%\System32\xcopy.exe /D /Y /Q %TARGET_DIR%%PROJECT_NAME%.dll %PLUGIN_HOME% > nul
)
if exist %TARGET_DIR%\nl-NL (
if exist %TARGET_DIR%\nl-NL\%PROJECT_NAME%.resources.dll (
if not exist %PLUGIN_HOME%\nl-NL md %PLUGIN_HOME%\nl-NL
%windir%\System32\xcopy.exe /D /Y /Q %TARGET_DIR%\nl-NL\%PROJECT_NAME%.resources.dll %PLUGIN_HOME%\nl-NL > nul
)
)
if exist %TARGET_DIR%\ru-RU (
if exist %TARGET_DIR%\ru-RU\%PROJECT_NAME%.resources.dll (
if not exist %PLUGIN_HOME%\ru-RU md %PLUGIN_HOME%\ru-RU
%windir%\System32\xcopy.exe /D /Y /Q %TARGET_DIR%\ru-RU\%PROJECT_NAME%.resources.dll %PLUGIN_HOME%\ru-RU > nul
)
)
if exist %TARGET_DIR%\Data (
if not exist %PLUGIN_HOME%\Data md %PLUGIN_HOME%\Data
%windir%\System32\xcopy.exe /D /Y /S /Q %TARGET_DIR%\Data %PLUGIN_HOME%\Data > nul
)
rem ===============================================================
rem copying native libraries to loader dir
rem detect relative path to the project
for %%a in (%PROJECT_DIR%\..) do set PLUGIN_TYPE_DIR=%%~nxa
if "%PLUGIN_TYPE_DIR%" == "DeltaShell" (
set NATIVE_RESOURCES_DIR=%SOLUTION_DIR%\lib\DeltaShell\%PROJECT_NAME%
) else (
set NATIVE_RESOURCES_DIR=%SOLUTION_DIR%\lib\Plugins\%PLUGIN_TYPE_DIR%\%PROJECT_NAME%
)
echo Copying plugin native resources from: %NATIVE_RESOURCES_DIR% to %PLUGIN_HOME% ...
if exist %NATIVE_RESOURCES_DIR% (
%windir%\System32\xcopy.exe /E /D /Y /Q %NATIVE_RESOURCES_DIR%\* %PLUGIN_HOME% > nul
)