-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathBuildMe.bat
81 lines (67 loc) · 2.57 KB
/
BuildMe.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
::
:: Google Sync Plugin for KeePass Password Safe
:: Copyright © 2012-2016 DesignsInnovate
:: Copyright © 2014-2016 Paul Voegler
::
:: KPSync for Google Drive
:: Copyright © 2020-2021 Walter Goodwin
::
:: This program is free software: you can redistribute it and/or modify
:: it under the terms of the GNU General Public License as published by
:: the Free Software Foundation, either version 3 of the License, or
:: (at your option) any later version.
::
:: This program is distributed in the hope that it will be useful,
:: but WITHOUT ANY WARRANTY; without even the implied warranty of
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
:: GNU General Public License for more details.
::
:: You should have received a copy of the GNU General Public License
:: along with this program. If not, see <http://www.gnu.org/licenses/>.
::
@echo off
set archname=KPSyncForDrive
set kp_version_manifest_name=kpsync_final
set versionPrefix=4.1.0
set versionSuffix=unstable
set netsdkver=net45
set sevenzip="%ProgramFiles%\7-Zip\7z.exe"
:: set dotnetPgm="%ProgramFiles%\dotnet\dotnet.exe"
set msbuildcmd="%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\VsMSBuildCmd.bat"
set pandoc="%LOCALAPPDATA%\Pandoc\pandoc.exe"
if not exist %msbuildcmd% goto errmsbuild
if not exist %sevenzip% goto errsevenzip
call %msbuildcmd%
if not exist build mkdir build
del /s /f /q build\*
for /d %%o in (build\*) do rmdir "%%o" /s /q
mkdir build\bin
mkdir build\dist
mkdir build\log
:: TODO modify project(s) to use `dotnet msbuild`. May require net461
:: runtime support. See https://github.com/dotnet/msbuild/issues/4704
msbuild -t:clean,restore,build -m -p:TargetFramework=%netsdkver% -p:Configuration=Release;Platform="Any CPU" -flp:logfile=build\log\build.log GoogleDriveSync.sln
if %errorlevel% NEQ 0 goto error
xcopy src\bin\Release\%netsdkver%\*.* build\bin /e /h
copy build\bin\*.plgx build\dist\
set zipFileName=%archname%-%versionPrefix%-%versionSuffix%.zip
if [%versionSuffix%]==[] (
set zipFileName=%archname%-%versionPrefix%.zip
)
%sevenzip% a -tzip -r build\dist\%zipFileName% .\build\bin\*.dll .\build\bin\*.pdb .\build\bin\es\*
.\lib\src\GenVerInfo\bin\Release\%netsdkver%\GenVerInfo.exe .\build\bin\%archname%.dll .\%kp_version_manifest_name%.txt
if not exist %pandoc% goto end
%pandoc% -f gfm -t plain --wrap=auto doc\README.md -o build\dist\readme.txt
goto end
:errmsbuild
echo MsBuild command-line setup not found!
goto error
:errsevenzip
echo Zip command-line tool not found!
goto error
:error
echo *************
echo Build Failed.
echo *************
pause
:end