backend: Split backends which use the vfs into a seperate file

This is so that the VFS tests can use the backends but not cause an
import loop.
This commit is contained in:
Nick Craig-Wood 2023-12-01 15:59:34 +00:00
parent 578b9df6ea
commit 65d1e5d47e
4 changed files with 17 additions and 10 deletions

4
backend/usevfs/usevfs.go Normal file
View File

@ -0,0 +1,4 @@
// Package all imports all the backends which use the VFS as part of
// their implementation these can't be imported by the VFS so need to
// be mentioned in here, not backend/all.
package all

View File

@ -4,8 +4,9 @@ package gomobile
import (
"github.com/rclone/rclone/librclone/librclone"
_ "github.com/rclone/rclone/backend/all" // import all backends
_ "github.com/rclone/rclone/lib/plugin" // import plugins
_ "github.com/rclone/rclone/backend/all" // import all backends
_ "github.com/rclone/rclone/backend/usevfs" // import all backends which use the VFS
_ "github.com/rclone/rclone/lib/plugin" // import plugins
_ "golang.org/x/mobile/event/key" // make go.mod add this as a dependency
)

View File

@ -34,13 +34,14 @@ import (
"github.com/rclone/rclone/librclone/librclone"
_ "github.com/rclone/rclone/backend/all" // import all backends
_ "github.com/rclone/rclone/cmd/cmount" // import cmount
_ "github.com/rclone/rclone/cmd/mount" // import mount
_ "github.com/rclone/rclone/cmd/mount2" // import mount2
_ "github.com/rclone/rclone/fs/operations" // import operations/* rc commands
_ "github.com/rclone/rclone/fs/sync" // import sync/*
_ "github.com/rclone/rclone/lib/plugin" // import plugins
_ "github.com/rclone/rclone/backend/all" // import all backends
_ "github.com/rclone/rclone/backend/usevfs" // import all backends which use the VFS
_ "github.com/rclone/rclone/cmd/cmount" // import cmount
_ "github.com/rclone/rclone/cmd/mount" // import mount
_ "github.com/rclone/rclone/cmd/mount2" // import mount2
_ "github.com/rclone/rclone/fs/operations" // import operations/* rc commands
_ "github.com/rclone/rclone/fs/sync" // import sync/*
_ "github.com/rclone/rclone/lib/plugin" // import plugins
)
// RcloneInitialize initializes rclone as a library

View File

@ -4,7 +4,8 @@
package main
import (
_ "github.com/rclone/rclone/backend/all" // import all backends
_ "github.com/rclone/rclone/backend/all" // import all backends
_ "github.com/rclone/rclone/backend/usevfs" // import all backends which use the VFS
"github.com/rclone/rclone/cmd"
_ "github.com/rclone/rclone/cmd/all" // import all commands
_ "github.com/rclone/rclone/lib/plugin" // import plugins