Skip to content

Commit 771fec1

Browse files
committed
build: added simple Windows-based build script
This orchestrates building HTMLUI and main binary, only uses built-in shell script and avoids having any dependencies on Unix tools. Latest go and npm are required.
1 parent c8360ce commit 771fec1

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

htmlui/build.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
if not exist node_modules\nul call npm install
2+
call npm run build

install.cmd

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@echo Installing tools...
2+
3+
pushd tools
4+
call install.cmd
5+
popd
6+
7+
@echo Building HTML UI...
8+
9+
pushd htmlui
10+
call build.cmd
11+
popd
12+
13+
@echo Building embedded data...
14+
15+
pushd htmlui\build
16+
echo on
17+
..\..\tools\.tools\go-bindata.exe -fs -tags embedhtml -o ..\..\internal\server\htmlui_bindata.go -pkg server -ignore .map . static/css static/js static/media
18+
popd
19+
20+
@echo Building binary...
21+
go build -o kopia.exe -tags embedhtml github.com/kopia/kopia

site/content/docs/Installation/_index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,12 @@ $ deb -i kopia*.deb
8080

8181
### Compilation From Source
8282

83-
If you have [Go 1.12](https://golang.org/) or newer, you may download and build Kopia yourself. No special setup is necessary, other than the Go compiler. You can simply run:
83+
If you have [Go 1.13](https://golang.org/) or newer, you may download and build Kopia yourself. No special setup is necessary, other than the Go compiler. You can simply run:
8484

8585
```shell
8686
$ go get github.com/kopia/kopia
8787
```
8888

89-
The resulting binary will be available in `$HOME/go/bin`.
90-
91-
89+
The resulting binary will be available in `$HOME/go/bin`. Note that this will produce basic binary that has all the features except support for HTML-based UI. To build full binary, download the source from GitHub and run:
9290

91+
`make install` (on macOS/Linux) or `install.cmd` on Windows. Note that building on Windows also requires [NPM](https://nodejs.org/) to be installed.

tools/install.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
if not exist .tools\go-bindata.exe go build -o .tools\go-bindata.exe github.com/go-bindata/go-bindata/go-bindata

0 commit comments

Comments
 (0)