all: improve the method of import for internal packages

1. Change directory structure and Makefile to let GOPATH=`pwd`, so wherever the project directory is, just use make to build.
This commit is contained in:
fatedier 2016-02-25 17:38:34 +08:00
parent f32cc7a840
commit 09127a3b55
17 changed files with 28 additions and 27 deletions

View File

@ -1,4 +1,5 @@
export PATH := $(GOPATH)/bin:$(PATH)
export NEW_GOPATH := $(shell pwd)
all: build
@ -9,13 +10,13 @@ godep:
godep restore
fmt:
@godep go fmt ./...
@GOPATH=$(NEW_GOPATH) godep go fmt ./...
frps:
godep go build -o bin/frps ./cmd/frps
GOPATH=$(NEW_GOPATH) godep go build -o bin/frps ./src/frp/cmd/frps
frpc:
godep go build -o bin/frpc ./cmd/frpc
GOPATH=$(NEW_GOPATH) godep go build -o bin/frpc ./src/frp/cmd/frpc
test:
@godep go test ./...
@GOPATH=$(NEW_GOPATH) godep go test ./...

View File

@ -7,11 +7,11 @@ import (
"sync"
"time"
"github.com/fatedier/frp/models/client"
"github.com/fatedier/frp/models/consts"
"github.com/fatedier/frp/models/msg"
"github.com/fatedier/frp/utils/conn"
"github.com/fatedier/frp/utils/log"
"frp/models/client"
"frp/models/consts"
"frp/models/msg"
"frp/utils/conn"
"frp/utils/log"
)
func ControlProcess(cli *client.ProxyClient, wait *sync.WaitGroup) {

View File

@ -4,8 +4,8 @@ import (
"os"
"sync"
"github.com/fatedier/frp/models/client"
"github.com/fatedier/frp/utils/log"
"frp/models/client"
"frp/utils/log"
)
func main() {

View File

@ -6,11 +6,11 @@ import (
"io"
"time"
"github.com/fatedier/frp/models/consts"
"github.com/fatedier/frp/models/msg"
"github.com/fatedier/frp/models/server"
"github.com/fatedier/frp/utils/conn"
"github.com/fatedier/frp/utils/log"
"frp/models/consts"
"frp/models/msg"
"frp/models/server"
"frp/utils/conn"
"frp/utils/log"
)
func ProcessControlConn(l *conn.Listener) {

View File

@ -3,9 +3,9 @@ package main
import (
"os"
"github.com/fatedier/frp/models/server"
"github.com/fatedier/frp/utils/conn"
"github.com/fatedier/frp/utils/log"
"frp/models/server"
"frp/utils/conn"
"frp/utils/log"
)
func main() {

View File

@ -3,10 +3,10 @@ package client
import (
"encoding/json"
"github.com/fatedier/frp/models/consts"
"github.com/fatedier/frp/models/msg"
"github.com/fatedier/frp/utils/conn"
"github.com/fatedier/frp/utils/log"
"frp/models/consts"
"frp/models/msg"
"frp/utils/conn"
"frp/utils/log"
)
type ProxyClient struct {

View File

@ -5,9 +5,9 @@ import (
"sync"
"time"
"github.com/fatedier/frp/models/consts"
"github.com/fatedier/frp/utils/conn"
"github.com/fatedier/frp/utils/log"
"frp/models/consts"
"frp/utils/conn"
"frp/utils/log"
)
type ProxyServer struct {

View File

@ -7,7 +7,7 @@ import (
"net"
"sync"
"github.com/fatedier/frp/utils/log"
"frp/utils/log"
)
type Listener struct {