From bfb036df7a8cffc103204dfcdb94d2280e80963d Mon Sep 17 00:00:00 2001 From: Softonik Date: Sat, 29 Jun 2024 01:24:58 +0300 Subject: [PATCH] =?UTF-8?q?Magefile=20=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Magefile.go | 63 +---------------------------------------------------- 1 file changed, 1 insertion(+), 62 deletions(-) diff --git a/Magefile.go b/Magefile.go index ac0d99a..4567ae0 100644 --- a/Magefile.go +++ b/Magefile.go @@ -23,24 +23,14 @@ var ( func init() { AppName = "ktgo" ImageName = "my/go" - - BuildFn = build } func Test() { mg.Deps(TestLibs) - mg.Deps(TestIntegration) - mg.Deps(TestSharedLibsBuild) } func TestLibs(ctx context.Context) error { paths := []string{ "pkg", - "pkg/printer", - "pkg/scenarios", - "pkg/link", - "pkg/link/wifi", - "pkg/parser", - "internal", } listTests(paths) @@ -53,12 +43,6 @@ func TestLibs(ctx context.Context) error { return runListedTests() } -func TestIntegration(ctx context.Context) error { - return runTests("./test/int") -} -func TestSystem(ctx context.Context) error { - return runTests("./test") -} func listTests(paths []string) error { for _, p := range paths { @@ -89,9 +73,6 @@ func testOne(p string, e os.DirEntry) error { if !e.IsDir() { return nil } - if e.Name() == "driver" { - return nil - } if e.Name() == "lib" { return nil } @@ -140,7 +121,6 @@ func runListedTests() error { } func runTests(paths string) error { - Bash(`cp -f $HOME/.Xauthority /tmp/._test_Xauthority`) return Bash(`sudo docker run -ti --rm \ -h host \ --net=none \ @@ -149,19 +129,11 @@ func runTests(paths string) error { \ -v /gopath:/gopath:rw \ -v ${PWD}:/app \ - -v /usr/bin/docker:/usr/bin/docker:ro \ - -v /var/run/docker.sock:/var/run/docker.sock:ro \ - -v /usr/bin/socat:/usr/bin/socat \ \ -e GOPATH=/gopath \ -e GOCACHE=/gopath/gocache \ -e APPDIR=${PWD} \ \ - --device=/dev/dri/card0 \ - -e DISPLAY=:0 \ - -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ - -v /tmp/._test_Xauthority:/home/user/.Xauthority:ro \ - \ -w /app \ -u 0 \ \ @@ -173,39 +145,6 @@ func runTests(paths string) error { done'`) } -func TestSharedLibsBuild(ctx context.Context) error { - mg.Deps(Build_shared_lib) - return Bash(`rm lib/lib3dscreen.*`) -} - -func build() { - Build_shared_lib(context.Background()) -} - -func Build_shared_lib(ctx context.Context) error { - return Bash(`sudo docker run --rm \ - -h host \ - --net=none \ - -v /etc/localtime:/etc/localtime:ro \ - -v ` + GolangVolume + `:/usr/local/go:ro \ - \ - -v /gopath:/gopath:rw \ - -v ${PWD}:/app \ - \ - -e GOPATH=/gopath \ - -e GOCACHE=/gopath/gocache \ - \ - -w /app/pkg/sharedlib \ - -u 1000 \ - \ - --entrypoint=/bin/bash \ - \ - ` + ImageName + " -c '" + ` \ - go build -o /app/lib/libktgo.so -buildmode=c-shared \ - && strip /app/lib/libktgo.so \ - '`) -} - func Mobile() { Build_Mobile() Upload_Mobile() @@ -239,7 +178,7 @@ func Build_Mobile() { ` + ImageName + " " + `\ bind -o /app/lib/ktgo.aar \ `) - Bash(`cp -afv lib/ktgo.aar ~/wd/mobile/apks/src/Telegram-FOSS/TMessagesProj/libs`) + Bash(`cp -afv lib/ktgo.aar /Telegram-FOSS/TMessagesProj/libs`) } func Upload_Mobile() {