-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmakeplgx.bat
103 lines (84 loc) · 3.15 KB
/
makeplgx.bat
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
94
95
96
97
98
99
100
101
102
103
@echo off
setlocal enableextensions enabledelayedexpansion
set arg1=%1
echo %1
cd %~dp0
set PlgXPath=%~dp0PlgX
set ReleasesPath=%~dp0Releases
set DebugPath=%~dp0Debug
set PlgXExculdeDirectoriesPath=%~dp0PlgXExcludeDirectories.txt
set PlgXExculdeFilesPath=%~dp0PlgXExcludeFiles.txt
set PackagesPath=%~dp0packages
set PlgXExculdeDirectories=
for /f "usebackq tokens=*" %%D in (%PlgXExculdeDirectoriesPath%) do (
If NOT "!PlgXExculdeDirectories!"=="" (
Set PlgXExculdeDirectories=!PlgXExculdeDirectories! "%%D"
) Else (
Set PlgXExculdeDirectories="%%D"
)
)
set PlgXExculdeFiles=
for /f "usebackq tokens=*" %%F in (%PlgXExculdeFilesPath%) do (
If NOT "!PlgXExculdeFiles!"=="" (
Set PlgXExculdeFiles=!PlgXExculdeFiles! "%%F"
) Else (
Set PlgXExculdeFiles="%%F"
)
)
echo %PlgXPath%
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a
set datestamp=%dt:~0,8%
set timestamp=%dt:~8,6%
set YYYY=%dt:~0,4%
set MM=%dt:~4,2%
set DD=%dt:~6,2%
set HH=%dt:~8,2%
set Min=%dt:~10,2%
set Sec=%dt:~12,2%
set stamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%
echo Start compiling process - %stamp%
echo Deleting existing PlgX folder
rmdir /s /q "%PlgXPath%"
echo Creating PlgX folder
mkdir "%PlgXPath%"
echo Copying files
robocopy "%~dp0." "%PlgXPath%" "PasswordChangeReminder.sln" /NDL /NJH /NJS /NP /NS /NC
robocopy "%~dp0PasswordChangeReminder" "%PlgXPath%\PasswordChangeReminder" /MIR /E /NDL /NJH /NJS /NP /NS /NC /XF !PlgXExculdeFiles! /XD !PlgXExculdeDirectories!
robocopy "%~dp0Dependencies" "%PlgXPath%\Dependencies" /MIR /E /NDL /NJH /NJS /NP /NS /NC /XF !PlgXExculdeFiles! /XD !PlgXExculdeDirectories!
for /f "usebackq delims=|" %%f in (`dir /b "%PackagesPath%"`) do (
echo Copying Dependencie: %%f
robocopy "%PackagesPath%\%%f\lib" "%PlgXPath%\packages\%%f\lib" *.dll /MIR /E /NDL /NJH /NJS /NP /NS /NC /XF !PlgXExculdeFiles!
)
if exist "%ReleasesPath%" (
echo Releases folder already exist
) ELSE (
echo Create Releases folder
mkdir "%ReleasesPath%"
)
if exist "%ReleasesPath%\Others" (
echo Relases\Others folder already exist
) ELSE (
echo Create Releases\Others folder
mkdir "%ReleasesPath%\Others"
)
echo Compiling PlgX
"%PROGRAMFILES(X86)%\KeePass Password Safe 2\KeePass.exe" --plgx-create "%PlgXPath%" --plgx-prereq-net:4.0
echo Releasing PlgX
move /y PlgX.plgx "%ReleasesPath%\PasswordChangeReminder.plgx"
If "%arg1%" == "--visualstudiomode" (
if exist "%ReleasesPath%\Others\TESTBUILDS" (
echo Releases\Others\TESTBUILDS folder already exist
) ELSE (
echo Create Releases\Others\TESTBUILDS folder
mkdir "%ReleasesPath%\Others\TESTBUILDS"
)
echo Copying PlgX
copy "%ReleasesPath%\PasswordChangeReminder.plgx" "%ReleasesPath%\Others\TESTBUILDS\PasswordChangeReminder-%stamp%.plgx"
robocopy "%ReleasesPath%" "%DebugPath%/Plugins" "PasswordChangeReminder.plgx" /NDL /NJH /NJS /NP /NS /NC
) ELSE (
echo Copying PlgX
copy "%ReleasesPath%\PasswordChangeReminder.plgx" "%ReleasesPath%\Others\PasswordChangeReminder-%stamp%.plgx"
)
echo Cleaning up
rmdir /s /q "%PlgXPath%"
If "%arg1%" == "--visualstudiomode" start "" "%DebugPath%\KeePass.exe" --debug