TBR chat: moving all Go code under v.io prefix and making the v23 tool
aware of all of our Go workspaces
The purpose of this CL is to be able to build / test all of our Go
code by running:
$ v23 go [build|test] v.io/...
MultiPart: 3/8
Change-Id: Ief97d1fbb15fa3c7c754546ab6f3d36d33e95dd9
diff --git a/Makefile b/Makefile
index 72d9902..623be30 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
SHELL := /bin/bash -euo pipefail
-export PATH := node_modules/.bin:clients/shell/bin:$(PATH)
-export GOPATH := $(shell pwd)/clients/shell:$(GOPATH)
+export PATH := node_modules/.bin:clients/shell/go/bin:$(PATH)
+export GOPATH := $(shell pwd)/clients/shell/go:$(GOPATH)
export VDLPATH := $(GOPATH)
# Don't use V23_ROOT if NO_V23_ROOT is set.
@@ -24,7 +24,7 @@
# Use standard go compiler.
GO := go
# The vdl tool needs either V23_ROOT or VDLROOT, so set VDLROOT.
- export VDLROOT := $(shell pwd)/clients/shell/src/v.io/v23/vdlroot
+ export VDLROOT := $(shell pwd)/clients/shell/go/src/v.io/v23/vdlroot
endif
@@ -123,39 +123,39 @@
# TODO(sadovsky): Make it so we only run "go install" when binaries are out of
# date.
-vanadium-binaries: clients/shell/src/v.io
+vanadium-binaries: clients/shell/go/src/v.io
$(GO) install \
v.io/x/ref/services/mounttable/mounttabled \
v.io/x/ref/services/proxy/proxyd \
v.io/x/ref/cmd/{principal,servicerunner,vdl}
gen-vdl: vanadium-binaries
- vdl generate --lang=go chat/vdl
- vdl generate --lang=javascript --js-out-dir=clients/web/js chat/vdl
+ vdl generate --lang=go v.io/x/chat/vdl
+ vdl generate --lang=javascript --js-out-dir=clients/web/js v.io/x/chat/vdl
-clients/shell/src/github.com/fatih/color:
+clients/shell/go/src/github.com/fatih/color:
$(GO) get github.com/fatih/color
-clients/shell/src/github.com/kr/text:
+clients/shell/go/src/github.com/kr/text:
$(GO) get github.com/kr/text
-clients/shell/src/github.com/nlacasse/gocui:
+clients/shell/go/src/github.com/nlacasse/gocui:
$(GO) get github.com/nlacasse/gocui
-clients/shell/src/v.io:
+clients/shell/go/src/v.io:
# Only go get v.io go repo if V23_ROOT is not defined.
ifndef V23_ROOT
$(GO) get v.io/x/ref/...
endif
-clients/shell/bin/chat: vanadium-binaries gen-vdl
-clients/shell/bin/chat: clients/shell/src/github.com/fatih/color
-clients/shell/bin/chat: clients/shell/src/github.com/kr/text
-clients/shell/bin/chat: clients/shell/src/github.com/nlacasse/gocui
-clients/shell/bin/chat: $(shell find clients/shell/src -name "*.go")
- $(GO) install chat
+clients/shell/go/bin/chat: vanadium-binaries gen-vdl
+clients/shell/go/bin/chat: clients/shell/go/src/github.com/fatih/color
+clients/shell/go/bin/chat: clients/shell/go/src/github.com/kr/text
+clients/shell/go/bin/chat: clients/shell/go/src/github.com/nlacasse/gocui
+clients/shell/go/bin/chat: $(shell find clients/shell/go/src -name "*.go")
+ $(GO) install v.io/x/chat
-build-shell: vanadium-binaries clients/shell/bin/chat
+build-shell: vanadium-binaries clients/shell/go/bin/chat
mkdir-build:
@mkdir -p build
@@ -201,7 +201,7 @@
# will listen on the external IP address of the gce instance, and our
# firewall rules prevent connections on unknown ports unless coming from
# localhost.
- $(GO) test chat/... --v23.tcp.address=localhost:0
+ $(GO) test v.io/x/chat/... --v23.tcp.address=localhost:0
# We use the same test runner as vanadium.js. It handles starting and stopping
# all required services (proxy, wspr, mounntabled), and runs tests in chrome
@@ -239,7 +239,7 @@
clean:
rm -rf node_modules
- rm -rf clients/shell/{bin,pkg,src/code.google.com,src/github.com,src/golang.org,src/v.io}
+ rm -rf clients/shell/go/{bin,pkg,src/code.google.com,src/github.com,src/golang.org,src/v.io}
rm -rf build
rm -rf vanadium.js
diff --git a/clients/shell/src/chat/channel.go b/clients/shell/go/src/v.io/x/chat/channel.go
similarity index 99%
rename from clients/shell/src/chat/channel.go
rename to clients/shell/go/src/v.io/x/chat/channel.go
index 17e5be0..caa3abe 100644
--- a/clients/shell/src/chat/channel.go
+++ b/clients/shell/go/src/v.io/x/chat/channel.go
@@ -41,10 +41,8 @@
"v.io/v23/security"
"v.io/v23/security/access"
mt "v.io/v23/services/mounttable"
-
+ "v.io/x/chat/vdl"
_ "v.io/x/ref/profiles/roaming"
-
- "chat/vdl"
)
// message is a message that will be displayed in the UI.
diff --git a/clients/shell/src/chat/channel_test.go b/clients/shell/go/src/v.io/x/chat/channel_test.go
similarity index 99%
rename from clients/shell/src/chat/channel_test.go
rename to clients/shell/go/src/v.io/x/chat/channel_test.go
index 3eb7e1d..68181b7 100644
--- a/clients/shell/src/chat/channel_test.go
+++ b/clients/shell/go/src/v.io/x/chat/channel_test.go
@@ -14,7 +14,6 @@
"v.io/v23"
"v.io/v23/context"
"v.io/v23/options"
-
"v.io/x/ref/services/mounttable/mounttablelib"
"v.io/x/ref/test"
"v.io/x/ref/test/modules"
diff --git a/clients/shell/src/chat/history_writer.go b/clients/shell/go/src/v.io/x/chat/history_writer.go
similarity index 100%
rename from clients/shell/src/chat/history_writer.go
rename to clients/shell/go/src/v.io/x/chat/history_writer.go
diff --git a/clients/shell/src/chat/main.go b/clients/shell/go/src/v.io/x/chat/main.go
similarity index 100%
rename from clients/shell/src/chat/main.go
rename to clients/shell/go/src/v.io/x/chat/main.go
diff --git a/clients/shell/src/chat/util.go b/clients/shell/go/src/v.io/x/chat/util.go
similarity index 100%
rename from clients/shell/src/chat/util.go
rename to clients/shell/go/src/v.io/x/chat/util.go
diff --git a/clients/shell/src/chat/v23_internal_test.go b/clients/shell/go/src/v.io/x/chat/v23_internal_test.go
similarity index 100%
rename from clients/shell/src/chat/v23_internal_test.go
rename to clients/shell/go/src/v.io/x/chat/v23_internal_test.go
diff --git a/clients/shell/src/chat/vdl/chat.vdl b/clients/shell/go/src/v.io/x/chat/vdl/chat.vdl
similarity index 100%
rename from clients/shell/src/chat/vdl/chat.vdl
rename to clients/shell/go/src/v.io/x/chat/vdl/chat.vdl
diff --git a/clients/shell/src/chat/vdl/chat.vdl.go b/clients/shell/go/src/v.io/x/chat/vdl/chat.vdl.go
similarity index 98%
rename from clients/shell/src/chat/vdl/chat.vdl.go
rename to clients/shell/go/src/v.io/x/chat/vdl/chat.vdl.go
index dce44ba..b40d90c 100644
--- a/clients/shell/src/chat/vdl/chat.vdl.go
+++ b/clients/shell/go/src/v.io/x/chat/vdl/chat.vdl.go
@@ -101,7 +101,7 @@
// descChat hides the desc to keep godoc clean.
var descChat = rpc.InterfaceDesc{
Name: "Chat",
- PkgPath: "chat/vdl",
+ PkgPath: "v.io/x/chat/vdl",
Methods: []rpc.MethodDesc{
{
Name: "SendMessage",