mirror of
https://github.com/fatedier/frp.git
synced 2024-12-04 22:01:43 +01:00
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:
parent
f32cc7a840
commit
09127a3b55
9
Makefile
9
Makefile
@ -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 ./...
|
||||
|
@ -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) {
|
@ -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() {
|
@ -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) {
|
@ -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() {
|
@ -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 {
|
@ -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 {
|
@ -7,7 +7,7 @@ import (
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/fatedier/frp/utils/log"
|
||||
"frp/utils/log"
|
||||
)
|
||||
|
||||
type Listener struct {
|
Loading…
Reference in New Issue
Block a user