-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
make.cmd
64 lines (55 loc) · 2.4 KB
/
make.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
62
63
64
@ECHO OFF
SETLOCAL EnableDelayedExpansion
CD /D "%~dp0"
SET "tgt=RethinkRAW"
IF NOT EXIST %tgt%\utils MKDIR %tgt%\utils
COPY build\exiftool_config.pl %tgt%\utils >NUL
IF NOT EXIST %tgt%\utils\exiftool\exiftool.exe (
ECHO Download ExifTool...
SET "url=https://github.com/ncruces/go-exiftool/releases/download/dist/exiftool_windows.zip"
go run github.com/ncruces/go-fetch -unpack !url! %tgt%\utils
)
IF NOT EXIST %tgt%\utils\dcraw.wasm (
ECHO Download dcraw...
SET "url=https://github.com/ncruces/dcraw/releases/download/v9.28.8-wasm/dcraw.wasm.gz"
go run github.com/ncruces/go-fetch -unpack !url! %tgt%\utils
COPY /Y %tgt%\utils\dcraw.wasm pkg\dcraw\embed\dcraw.wasm
)
IF NOT EXIST assets\normalize.css (
ECHO Download normalize.css...
go run github.com/ncruces/go-fetch "https://unpkg.com/@csstools/normalize.css" assets\normalize.css
)
IF NOT EXIST assets\dialog-polyfill.js (
ECHO Download dialog-polyfill...
go run github.com/ncruces/go-fetch "https://unpkg.com/dialog-polyfill@0.5/dist/dialog-polyfill.js" assets\dialog-polyfill.js
go run github.com/ncruces/go-fetch "https://unpkg.com/dialog-polyfill@0.5/dist/dialog-polyfill.css" assets\dialog-polyfill.css
)
IF NOT EXIST assets\fontawesome.css (
ECHO Download Font Awesome...
go run github.com/ncruces/go-fetch "https://unpkg.com/@fortawesome/fontawesome-free@5.x/css/fontawesome.css" assets\fontawesome.css
go run github.com/ncruces/go-fetch "https://unpkg.com/@fortawesome/fontawesome-free@5.x/webfonts/fa-solid-900.woff2" assets\fa-solid-900.woff2
)
IF [%1]==[test] (
ECHO Run tests...
go test .\...
) ELSE IF [%1]==[run] (
ECHO Run app...
go build -race -o %tgt%\RethinkRAW.exe && %tgt%\RethinkRAW.exe
) ELSE IF [%1]==[run] (
ECHO Run server...
go build -race -o %tgt%\RethinkRAW.com && %tgt%\RethinkRAW.com -pass= .
) ELSE IF [%1]==[install] (
ECHO Build installer...
IF EXIST %tgt%\data RMDIR /S /Q %tgt%\data
IF EXIST %tgt%\debug.log DEL /Q %tgt%\debug.log
7z a -mx9 -myx9 -sfx7z.sfx RethinkRAW.exe %tgt%
) ELSE (
ECHO Release build...
go run github.com/josephspurrier/goversioninfo/cmd/goversioninfo -64 build/versioninfo.json
SET CGO_ENABLED=0
SET GOOS=windows
go clean
go generate ^
&& go build -tags memfs -ldflags "-s -w" -trimpath -o %tgt%\RethinkRAW.com ^
&& go build -tags memfs -ldflags "-s -w -H windowsgui" -trimpath -o %tgt%\RethinkRAW.exe
)