diff --git a/app/go.mod b/app/go.mod index 676143a..04d3ba0 100644 --- a/app/go.mod +++ b/app/go.mod @@ -15,7 +15,7 @@ require ( ) require ( - github.com/apernet/quic-go v0.37.4-0.20230809015843-1a8307c5d4f6 // indirect + github.com/apernet/quic-go v0.37.5-0.20230809210726-5508a358d07e // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect diff --git a/app/go.sum b/app/go.sum index e30fa97..db6c7ed 100644 --- a/app/go.sum +++ b/app/go.sum @@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/apernet/quic-go v0.37.4-0.20230809015843-1a8307c5d4f6 h1:c0Om+1DKS4kIQtDx31Tx1Vkz5h0f1ETZMHfwu3rsNyE= -github.com/apernet/quic-go v0.37.4-0.20230809015843-1a8307c5d4f6/go.mod h1:Gqxx9qMiutRcTLNlbdPwuI9dF8+GV2GQG+5mVW0E34I= +github.com/apernet/quic-go v0.37.5-0.20230809210726-5508a358d07e h1:hWrd6A3QZQX2pXT1JJA2x1vgqNf5jZH8po0oa2GsbeI= +github.com/apernet/quic-go v0.37.5-0.20230809210726-5508a358d07e/go.mod h1:Gqxx9qMiutRcTLNlbdPwuI9dF8+GV2GQG+5mVW0E34I= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/caddyserver/certmagic v0.17.2 h1:o30seC1T/dBqBCNNGNHWwj2i5/I/FMjBbTAhjADP3nE= diff --git a/core/go.mod b/core/go.mod index 0f22729..b9596d5 100644 --- a/core/go.mod +++ b/core/go.mod @@ -3,7 +3,7 @@ module github.com/apernet/hysteria/core go 1.20 require ( - github.com/apernet/quic-go v0.37.4-0.20230809015843-1a8307c5d4f6 + github.com/apernet/quic-go v0.37.5-0.20230809210726-5508a358d07e github.com/stretchr/testify v1.8.4 github.com/zhangyunhao116/fastrand v0.3.0 go.uber.org/goleak v1.2.1 diff --git a/core/go.sum b/core/go.sum index 20d6091..a70e396 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,5 +1,5 @@ -github.com/apernet/quic-go v0.37.4-0.20230809015843-1a8307c5d4f6 h1:c0Om+1DKS4kIQtDx31Tx1Vkz5h0f1ETZMHfwu3rsNyE= -github.com/apernet/quic-go v0.37.4-0.20230809015843-1a8307c5d4f6/go.mod h1:Gqxx9qMiutRcTLNlbdPwuI9dF8+GV2GQG+5mVW0E34I= +github.com/apernet/quic-go v0.37.5-0.20230809210726-5508a358d07e h1:hWrd6A3QZQX2pXT1JJA2x1vgqNf5jZH8po0oa2GsbeI= +github.com/apernet/quic-go v0.37.5-0.20230809210726-5508a358d07e/go.mod h1:Gqxx9qMiutRcTLNlbdPwuI9dF8+GV2GQG+5mVW0E34I= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= diff --git a/extras/go.mod b/extras/go.mod index 2c03586..2da36e6 100644 --- a/extras/go.mod +++ b/extras/go.mod @@ -10,7 +10,7 @@ require ( ) require ( - github.com/apernet/quic-go v0.37.4-0.20230809015843-1a8307c5d4f6 // indirect + github.com/apernet/quic-go v0.37.5-0.20230809210726-5508a358d07e // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/golang/mock v1.6.0 // indirect diff --git a/extras/go.sum b/extras/go.sum index 0c2a834..bf355b5 100644 --- a/extras/go.sum +++ b/extras/go.sum @@ -1,5 +1,5 @@ -github.com/apernet/quic-go v0.37.4-0.20230809015843-1a8307c5d4f6 h1:c0Om+1DKS4kIQtDx31Tx1Vkz5h0f1ETZMHfwu3rsNyE= -github.com/apernet/quic-go v0.37.4-0.20230809015843-1a8307c5d4f6/go.mod h1:Gqxx9qMiutRcTLNlbdPwuI9dF8+GV2GQG+5mVW0E34I= +github.com/apernet/quic-go v0.37.5-0.20230809210726-5508a358d07e h1:hWrd6A3QZQX2pXT1JJA2x1vgqNf5jZH8po0oa2GsbeI= +github.com/apernet/quic-go v0.37.5-0.20230809210726-5508a358d07e/go.mod h1:Gqxx9qMiutRcTLNlbdPwuI9dF8+GV2GQG+5mVW0E34I= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= diff --git a/hyperbole.py b/hyperbole.py index 5920a87..b729e98 100755 --- a/hyperbole.py +++ b/hyperbole.py @@ -25,9 +25,13 @@ DESC = "Hyperbole is the official build script for Hysteria." BUILD_DIR = "build" +CORE_SRC_DIR = "./core" +EXTRAS_SRC_DIR = "./extras" APP_SRC_DIR = "./app" APP_SRC_CMD_PKG = "github.com/apernet/hysteria/app/cmd" +MODULE_SRC_DIRS = [CORE_SRC_DIR, EXTRAS_SRC_DIR, APP_SRC_DIR] + def check_command(args): try: @@ -224,6 +228,24 @@ def cmd_mockgen(): print("Failed to generate mocks for %s" % dirpath) +def cmd_tidy(): + if not check_build_env(): + return + + for dir in MODULE_SRC_DIRS: + print("Tidying %s..." % dir) + try: + subprocess.check_call(["go", "mod", "tidy"], cwd=dir) + except Exception: + print("Failed to tidy %s" % dir) + + print("Syncing go work...") + try: + subprocess.check_call(["go", "work", "sync"]) + except Exception: + print("Failed to sync go work") + + def cmd_clean(): shutil.rmtree(BUILD_DIR, ignore_errors=True) @@ -261,6 +283,9 @@ def main(): # Mockgen p_cmd.add_parser("mockgen", help="Generate mock interfaces") + # Tidy + p_cmd.add_parser("tidy", help="Tidy the go modules") + # Clean p_cmd.add_parser("clean", help="Clean the build directory") @@ -277,6 +302,8 @@ def main(): cmd_format() elif args.command == "mockgen": cmd_mockgen() + elif args.command == "tidy": + cmd_tidy() elif args.command == "clean": cmd_clean() elif args.command == "about":