Skip to content

Commit

Permalink
create makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
FlowingSPDG committed Mar 7, 2020
1 parent 659c42d commit aa324be
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@

# Dependency directories (remove the comment below to include it)
# vendor/
build/*
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# vmix-URL-Generator
vMix RESTful API URL Generator

## Author
Shugo Kawamura
Github : [**FlowingSPDG**](http://github.com/FlowingSPDG)
Twitter : [**@FlowingSPDG**](http://twitter.com/FlowingSPDG) / [**@FlowingSPDG_EN**](http://twitter.com/FlowingSPDG_EN)

## Usage
``./vmix_gen -addr :8080 -vmix "http://localhost:8088" ``
Open http://localhost:8080/
59 changes: 59 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Go
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=vmix_gen
DIST_DIR=build
SERVER_DIR=server
WEB_DIR=web

# Replacing "RM" command for Windows PowerShell.
RM = rm -rf
ifeq ($(OS),Windows_NT)
RM = Remove-Item -Recurse -Force
endif

# Replacing "MKDIR" command for Windows PowerShell.
MKDIR = mkdir -p
ifeq ($(OS),Windows_NT)
MKDIR = New-Item -ItemType Directory
endif

# Replacing "CP" command for Windows PowerShell.
CP = cp -R
ifeq ($(OS),Windows_NT)
CP = powershell -Command Copy-Item -Recurse -Force
endif

# Replacing "GOPATH" command for Windows PowerShell.
GOPATHDIR = $GOPATH
ifeq ($(OS),Windows_NT)
GOPATHDIR = $$env:GOPATH
endif

.DEFAULT_GOAL := build-windows

test:
$(GOTEST) -v ./...
clean:
@$(GOCLEAN)
-@$(RM) $(DIST_DIR)/*
deps: deps-web deps-go
deps-web:
@yarn global add @vue/cli
@cd ./web && yarn
deps-go:
@$(GOGET) -v -u
build-prepare:
@cd ./server && $(GOGET) github.com/mitchellh/gox \
github.com/konsorten/go-windows-terminal-sequences
-@$(RM) ./$(DIST_DIR)/*/static
build-windows: build-prepare build-web build-windows-server-only
@$(MKDIR) ./$(DIST_DIR)/static
@$(CP) ./web/dist/* ./$(DIST_DIR)/static
build-windows-server-only: build-prepare
@cd ./server && GOOS=windows GOARCH=386 go build -o ../$(DIST_DIR)/${BINARY_NAME}.exe main.go
build-web:
@cd ./web && yarn run build
4 changes: 3 additions & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ module github.com/FlowingSPDG/vmix-URL-Generator/server
go 1.13

require (
github.com/FlowingSPDG/vmix-go v0.0.0-20200307175303-94452e49ca7b
github.com/FlowingSPDG/vmix-go v0.0.0-20200307181351-719bbcc80ecb
github.com/gin-contrib/static v0.0.0-20191128031702-f81c604d8ac2
github.com/gin-gonic/gin v1.5.0
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/mitchellh/gox v1.0.1 // indirect
)
12 changes: 10 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/FlowingSPDG/vmix-go v0.0.0-20200307174020-886097e77589 h1:xR0O1vtP2t6H+xA0jKGGd2NUNSipVjty5SkaQK4Bcqw=
github.com/FlowingSPDG/vmix-go v0.0.0-20200307174020-886097e77589/go.mod h1:YRACRMr0DBe6BeMw7n46zuHN5P3vcPsGgH+3SVLXtT0=
github.com/FlowingSPDG/vmix-go v0.0.0-20200307175303-94452e49ca7b h1:gSR62mTV78Jy86i/pqgp7ZrEMZnBSIodsGfHyt4ZHhw=
github.com/FlowingSPDG/vmix-go v0.0.0-20200307175303-94452e49ca7b/go.mod h1:YRACRMr0DBe6BeMw7n46zuHN5P3vcPsGgH+3SVLXtT0=
github.com/FlowingSPDG/vmix-go v0.0.0-20200307181351-719bbcc80ecb h1:vNhIX7gWBOlB50EWPb2+SWsLpbnn2WjtIr8Ujaig/oM=
github.com/FlowingSPDG/vmix-go v0.0.0-20200307181351-719bbcc80ecb/go.mod h1:YRACRMr0DBe6BeMw7n46zuHN5P3vcPsGgH+3SVLXtT0=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -19,12 +19,20 @@ github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEK
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/hashicorp/go-version v1.0.0 h1:21MVWPKDphxa7ineQQTrCU5brh7OuVVAzGOCnnCPtE8=
github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/leodido/go-urn v1.1.0 h1:Sm1gr51B1kKyfD2BlRcLSiEkffoG96g6TPv6eRoEiB8=
github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw=
github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI=
github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4=
github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
Expand Down
3 changes: 3 additions & 0 deletions web/src/type.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'element-ui';
declare module 'element-ui/lib/locale';
declare module 'element-ui/lib/locale/lang/en';
4 changes: 2 additions & 2 deletions web/src/utils/api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export default {
const res = await this.axios.get("/api/vmix");
return res.data.url;
} catch (err) {
console.error(err);
throw new Error(err);
}
},
async GetInputs() {
try {
const res = await this.axios.get("/api/inputs");
return res.data.inputs;
} catch (err) {
console.error(err);
throw new Error(err);
}
},
async RefreshInput() {
Expand Down

0 comments on commit aa324be

Please sign in to comment.