forked from Autodesk/AutodeskMachineControlFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_clean_win64.bat
105 lines (86 loc) · 4.54 KB
/
build_clean_win64.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
104
105
REM echo off
set GO111MODULE=off
set basepath=%~dp0
echo %basepath%
set builddir=%basepath%\build
set outputdir=%builddir%\Output
if not exist "%builddir%" (mkdir "%builddir%")
if not exist "%outputdir%" (mkdir "%outputdir%")
if not exist "%builddir%\DevPackage" (mkdir "%builddir%\DevPackage")
if not exist "%builddir%\DevPackage\Framework" (mkdir "%builddir%\DevPackage\Framework")
if not exist "%builddir%\DevPackage\Framework\HeadersDev" (mkdir "%builddir%\DevPackage\Framework\HeadersDev")
if not exist "%builddir%\DevPackage\Framework\HeadersDev\CppDynamic" (mkdir "%builddir%\DevPackage\Framework\HeadersDev\CppDynamic")
if not exist "%builddir%\DevPackage\Framework\HeadersDriver" (mkdir "%builddir%\DevPackage\Framework\HeadersDriver")
if not exist "%builddir%\DevPackage\Framework\HeadersDriver\CppDynamic" (mkdir "%builddir%\DevPackage\Framework\HeadersDriver\CppDynamic")
if not exist "%builddir%\DevPackage\Framework\InterfacesDev" (mkdir "%builddir%\DevPackage\Framework\InterfacesDev")
if not exist "%builddir%\DevPackage\Framework\PluginCpp" (mkdir "%builddir%\DevPackage\Framework\PluginCpp")
if not exist "%builddir%\DevPackage\Framework\PluginPython" (mkdir "%builddir%\DevPackage\Framework\PluginPython")
if not exist "%builddir%\DevPackage\Framework\Dist" (mkdir "%builddir%\DevPackage\Framework\Dist")
if not exist "%builddir%\Framework" (mkdir "%builddir%\Framework")
if not exist "%builddir%\Framework\HeadersDev" (mkdir "%builddir%\Framework\HeadersDev")
if not exist "%builddir%\Framework\HeadersDev\CppDynamic" (mkdir "%builddir%\Framework\HeadersDev\CppDynamic")
if not exist "%builddir%\Framework\HeadersDriver" (mkdir "%builddir%\Framework\HeadersDriver")
if not exist "%builddir%\Framework\HeadersDriver\CppDynamic" (mkdir "%builddir%\Framework\HeadersDriver\CppDynamic")
if not exist "%builddir%\Framework\InterfacesDev" (mkdir "%builddir%\Framework\InterfacesDev")
if not exist "%builddir%\Framework\PluginCpp" (mkdir "%builddir%\Framework\PluginCpp")
copy "%basepath%\Framework\PluginCpp\*.*" "%builddir%\Framework\PluginCpp"
copy "%basepath%\Framework\InterfacesDev\*.*" "%builddir%\Framework\InterfacesDev"
git rev-parse --verify --short HEAD >"%builddir%\githash.txt"
SET /p GITHASH=<"%builddir%\githash.txt"
echo git hash: %GITHASH%
git rev-parse --verify HEAD >"%builddir%\longgithash.txt"
SET /p LONGGITHASH=<"%builddir%\longgithash.txt"
echo long git hash: %LONGGITHASH%
cd /d "%basepath%"
echo "Building Resource builder (Win64)..."
set GOARCH=amd64
set GOOS=windows
go build -o "%builddir%/DevPackage/Framework/buildresources.exe" -ldflags="-s -w" "%basepath%/Server/buildresources.go"
echo "Building Resource builder (Linux64)..."
set GOARCH=amd64
set GOOS=linux
go build -o "%builddir%/DevPackage/Framework/buildresources.linux" -ldflags="-s -w" "%basepath%/Server/buildresources.go"
echo "Building Resource builder (LinuxARM)..."
set GOARCH=arm
set GOOS=linux
set GOARM=5
go build -o "%builddir%/DevPackage/Framework/buildresources.arm" -ldflags="-s -w" "%basepath%/Server/buildresources.go"
echo "Building Server..."
set GOARCH=amd64
set GOOS=windows
go get github.com/gorilla/handlers
go build -o "%builddir%/Output/amc_server.exe" -ldflags="-s -w" "%basepath%/Server/mcserver.go"
echo "Building Client"
cd "%basepath%\Client"
call build_client_clean.bat
cd "%builddir%\Client"
go run ../../Server/createDist.go ../Output %GITHASH%
cd "%builddir%"
echo "Building Core Modules"
call cmake ..
REM call cmake -G "MinGW Makefiles" ..
call cmake --build . --config Release
echo "Building Developer Package"
cd "%builddir%\DevPackage"
copy ..\githash.txt Framework\Dist\disthash.txt
copy ..\Output\amc_server.exe Framework\Dist\
copy ..\Output\amc_server.xml Framework\Dist\
copy ..\Output\%GITHASH%_core_libmc.dll Framework\Dist\
copy ..\Output\%GITHASH%_core_lib3mf.dll Framework\Dist\
copy ..\Output\%GITHASH%_core_libmcdata.dll Framework\Dist\
copy ..\Output\%GITHASH%_*.data Framework\Dist\
copy ..\Output\%GITHASH%_*.client Framework\Dist\
copy ..\Output\%GITHASH%_package.xml Framework\Dist\
copy ..\Output\%GITHASH%_driver_*.dll Framework\Dist\
copy ..\Output\lib3mf.dll Framework\Dist\%GITHASH%_core_lib3mf.dll
copy ..\..\Framework\HeadersDev\CppDynamic\*.* Framework\HeadersDev\CppDynamic
copy ..\..\Framework\InterfacesDev\*.* Framework\InterfacesDev
copy ..\..\Framework\PluginCpp\*.* Framework\PluginCpp
copy ..\..\Framework\PluginPython\*.* Framework\PluginPython
del Framework\Dist\%GITHASH%_core.data
go run ../../Server/createDevPackage.go %builddir%\DevPackage\Framework %builddir%\DevPackage\ %LONGGITHASH%
echo "Build done!"
if "%1" neq "NOPAUSE" (
pause
)
exit 0