Commit cff37ca5 authored by Loïck Bonniot's avatar Loïck Bonniot
Browse files

[gui] Add build instructions and basic example

parent 71599f9e
Pipeline #386 passed with stage
build/embed/VERSION
release/
bin/
*.qrc.go
......@@ -22,7 +22,7 @@ Unit tests:
script:
- "ln -s $(pwd) $GOPATH/src/dfss"
- "./build/deps.sh"
- "cd $GOPATH/src/dfss && go install ./..."
- "cd $GOPATH/src/dfss && rm -rf gui && go install ./..."
- "go test -coverprofile auth.part -v dfss/auth"
- "go test -coverprofile mgdb.part -v dfss/mgdb"
- "go test -coverprofile mails.part -v dfss/mails"
......@@ -53,7 +53,7 @@ Integration tests:
script:
- "ln -s -f $(pwd) $GOPATH/src/dfss"
- "./build/deps.sh"
- "cd $GOPATH/src/dfss && go install ./..."
- "cd $GOPATH/src/dfss && rm -rf gui && go install ./..."
- "go test -v dfss/tests"
Code lint:
......@@ -68,7 +68,7 @@ Code lint:
- "ln -s $(pwd) $GOPATH/src/dfss"
- "go get github.com/alecthomas/gometalinter"
- "./build/deps.sh"
- "cd $GOPATH/src/dfss && go install ./..."
- "cd $GOPATH/src/dfss && rm -rf gui && go install ./..."
- "gometalinter --install"
- "gometalinter -t --deadline=600s -j1 --skip=api --skip=fixtures --disable=aligncheck ./..."
......
......@@ -6,11 +6,37 @@ endif
.PHONY:
install: nocache
go install .
go install ./dfssc
go install ./dfssd
go install ./dfssp
go install ./dfsst
release: clean build_all package
clean:
rm -rf release
# GUI Build (Docker required)
# prepare_gui builds a new container from the goqt image, adding DFSS dependencies for faster builds.
# call it once or after dependency addition.
prepare_gui: nocache
docker run --name dfss-builder -v ${PWD}:/go/src/dfss -w /go/src/dfss lesterpig/goqt \
cp -r ../github.com/visualfc/goqt/bin . && \
./build/deps.sh
docker commit dfss-builder dfss:builder
docker rm dfss-builder
# gui builds the gui component of the dfss project into a docker container, outputing the result in bin/ directory.
gui: nocache
docker run --rm -v ${PWD}:/go/src/dfss -w /go/src/dfss/gui lesterpig/goqt \
../bin/goqt_rcc -go main -o application.qrc.go application.qrc && \
go build -ldflags "-r ." -o ../bin/gui
# Release internals
build_all:
go get github.com/mitchellh/gox
gox -os "linux darwin windows" -parallel 1 -output "release/dfss_${VERSION}_{{.OS}}_{{.Arch}}/{{.Dir}}" dfss/dfssc dfss/dfssd dfss/dfssp dfss/dfsst
......@@ -30,3 +56,5 @@ protobuf:
protoc --go_out=plugins=grpc:. dfss/dfssd/api/demonstrator.proto && \
protoc --go_out=plugins=grpc:. dfss/dfssp/api/platform.proto && \
protoc --go_out=plugins=grpc:. dfss/dfsst/api/resolution.proto
nocache:
<RCC>
<qresource prefix="/">
</qresource>
</RCC>
package main
import "github.com/visualfc/goqt/ui"
func main() {
ui.Run(func() {
widget := ui.NewWidget()
label := ui.NewLabel()
label.SetText("Welcome on dat fresh DFSS Client!")
text := ui.NewTextEdit()
text.SetText("Edit me!")
button := ui.NewPushButton()
button.SetText("Click me!")
button.OnClicked(func() {
button.SetText("Clicked!")
})
vbox := ui.NewVBoxLayout()
vbox.SetAlignment(ui.Qt_AlignCenter)
vbox.AddWidget(label)
vbox.AddWidget(text)
vbox.AddWidget(button)
widget.SetWindowTitle("DFSS Client")
widget.SetLayout(vbox)
widget.SetMinimumWidth(400)
widget.SetMinimumHeight(400)
widget.Show()
})
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment