From 5fb43080b6dc8b62f5a4e92675cfd59ee772b874 Mon Sep 17 00:00:00 2001 From: Zach Klippenstein Date: Fri, 15 Jan 2016 07:54:27 -0800 Subject: [PATCH] Renamed top-level package from `goadb` to just `adb`. --- cmd/adb/main.go | 26 +++++++++++++------------- cmd/raw-adb/raw-adb.go | 4 ++-- device_client.go | 2 +- device_client_test.go | 2 +- device_descriptor.go | 2 +- device_info.go | 2 +- device_info_test.go | 2 +- device_watcher.go | 2 +- device_watcher_test.go | 2 +- devicedescriptortype_string.go | 2 +- devicestate_string.go | 2 +- dialer.go | 2 +- dir_entries.go | 2 +- doc.go | 4 ++-- host_client.go | 2 +- host_client_test.go | 2 +- server.go | 2 +- server_mock_test.go | 2 +- server_test.go | 2 +- sync_client.go | 2 +- sync_client_test.go | 2 +- sync_file_reader.go | 2 +- sync_file_reader_test.go | 2 +- sync_file_writer.go | 2 +- sync_file_writer_test.go | 2 +- util.go | 2 +- util_test.go | 2 +- wire/doc.go | 2 +- 28 files changed, 42 insertions(+), 42 deletions(-) diff --git a/cmd/adb/main.go b/cmd/adb/main.go index 1eb92d8..421a701 100644 --- a/cmd/adb/main.go +++ b/cmd/adb/main.go @@ -36,13 +36,13 @@ var ( pushRemoteArg = pushCommand.Arg("remote", "Path of destination file on device.").Required().String() ) -var server goadb.Server +var server adb.Server func main() { var exitCode int var err error - server, err = goadb.NewServer(goadb.ServerConfig{}) + server, err = adb.NewServer(adb.ServerConfig{}) if err != nil { fmt.Fprintln(os.Stderr, "error:", err) os.Exit(1) @@ -62,16 +62,16 @@ func main() { os.Exit(exitCode) } -func parseDevice() goadb.DeviceDescriptor { +func parseDevice() adb.DeviceDescriptor { if *serial != "" { - return goadb.DeviceWithSerial(*serial) + return adb.DeviceWithSerial(*serial) } - return goadb.AnyDevice() + return adb.AnyDevice() } func listDevices(long bool) int { - client := goadb.NewHostClient(server) + client := adb.NewHostClient(server) devices, err := client.ListDevices() if err != nil { fmt.Fprintln(os.Stderr, "error:", err) @@ -94,7 +94,7 @@ func listDevices(long bool) int { return 0 } -func runShellCommand(commandAndArgs []string, device goadb.DeviceDescriptor) int { +func runShellCommand(commandAndArgs []string, device adb.DeviceDescriptor) int { if len(commandAndArgs) == 0 { fmt.Fprintln(os.Stderr, "error: no command") kingpin.Usage() @@ -108,7 +108,7 @@ func runShellCommand(commandAndArgs []string, device goadb.DeviceDescriptor) int args = commandAndArgs[1:] } - client := goadb.NewDeviceClient(server, device) + client := adb.NewDeviceClient(server, device) output, err := client.RunCommand(command, args...) if err != nil { fmt.Fprintln(os.Stderr, "error:", err) @@ -119,7 +119,7 @@ func runShellCommand(commandAndArgs []string, device goadb.DeviceDescriptor) int return 0 } -func pull(showProgress bool, remotePath, localPath string, device goadb.DeviceDescriptor) int { +func pull(showProgress bool, remotePath, localPath string, device adb.DeviceDescriptor) int { if remotePath == "" { fmt.Fprintln(os.Stderr, "error: must specify remote file") kingpin.Usage() @@ -130,7 +130,7 @@ func pull(showProgress bool, remotePath, localPath string, device goadb.DeviceDe localPath = filepath.Base(remotePath) } - client := goadb.NewDeviceClient(server, device) + client := adb.NewDeviceClient(server, device) info, err := client.Stat(remotePath) if util.HasErrCode(err, util.FileNoExistError) { @@ -167,7 +167,7 @@ func pull(showProgress bool, remotePath, localPath string, device goadb.DeviceDe return 0 } -func push(showProgress bool, localPath, remotePath string, device goadb.DeviceDescriptor) int { +func push(showProgress bool, localPath, remotePath string, device adb.DeviceDescriptor) int { if remotePath == "" { fmt.Fprintln(os.Stderr, "error: must specify remote file") kingpin.Usage() @@ -184,7 +184,7 @@ func push(showProgress bool, localPath, remotePath string, device goadb.DeviceDe localFile = os.Stdin // 0 size will hide the progress bar. perms = os.FileMode(0660) - mtime = goadb.MtimeOfClose + mtime = adb.MtimeOfClose } else { var err error localFile, err = os.Open(localPath) @@ -203,7 +203,7 @@ func push(showProgress bool, localPath, remotePath string, device goadb.DeviceDe } defer localFile.Close() - client := goadb.NewDeviceClient(server, device) + client := adb.NewDeviceClient(server, device) writer, err := client.OpenWrite(remotePath, perms, mtime) if err != nil { fmt.Fprintf(os.Stderr, "error opening remote file %s: %s\n", remotePath, err) diff --git a/cmd/raw-adb/raw-adb.go b/cmd/raw-adb/raw-adb.go index aa70a92..747bf28 100644 --- a/cmd/raw-adb/raw-adb.go +++ b/cmd/raw-adb/raw-adb.go @@ -14,7 +14,7 @@ import ( "github.com/zach-klippenstein/goadb/wire" ) -var port = flag.Int("p", goadb.AdbPort, "port the adb server is listening on") +var port = flag.Int("p", adb.AdbPort, "port the adb server is listening on") func main() { flag.Parse() @@ -49,7 +49,7 @@ func readLine() string { } func doCommand(cmd string) error { - server, err := goadb.NewServer(goadb.ServerConfig{ + server, err := adb.NewServer(adb.ServerConfig{ Port: *port, }) if err != nil { diff --git a/device_client.go b/device_client.go index 3f9a30a..1da8fd6 100644 --- a/device_client.go +++ b/device_client.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "fmt" diff --git a/device_client_test.go b/device_client_test.go index 3a5b6f4..d016e38 100644 --- a/device_client_test.go +++ b/device_client_test.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "testing" diff --git a/device_descriptor.go b/device_descriptor.go index db78b14..a02cf56 100644 --- a/device_descriptor.go +++ b/device_descriptor.go @@ -1,4 +1,4 @@ -package goadb +package adb import "fmt" diff --git a/device_info.go b/device_info.go index d80a656..4944206 100644 --- a/device_info.go +++ b/device_info.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "bufio" diff --git a/device_info_test.go b/device_info_test.go index 3fc3189..d6dc689 100644 --- a/device_info_test.go +++ b/device_info_test.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "testing" diff --git a/device_watcher.go b/device_watcher.go index 095b151..ad7a0e1 100644 --- a/device_watcher.go +++ b/device_watcher.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "log" diff --git a/device_watcher_test.go b/device_watcher_test.go index 27f0733..ad73383 100644 --- a/device_watcher_test.go +++ b/device_watcher_test.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "testing" diff --git a/devicedescriptortype_string.go b/devicedescriptortype_string.go index 231fbb0..6ad6484 100644 --- a/devicedescriptortype_string.go +++ b/devicedescriptortype_string.go @@ -1,6 +1,6 @@ // generated by stringer -type=deviceDescriptorType; DO NOT EDIT -package goadb +package adb import "fmt" diff --git a/devicestate_string.go b/devicestate_string.go index 8164dce..91347fe 100644 --- a/devicestate_string.go +++ b/devicestate_string.go @@ -1,6 +1,6 @@ // generated by stringer -type=DeviceState; DO NOT EDIT -package goadb +package adb import "fmt" diff --git a/dialer.go b/dialer.go index aa82082..065fa2e 100644 --- a/dialer.go +++ b/dialer.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "io" diff --git a/dir_entries.go b/dir_entries.go index 202609e..1a4b432 100644 --- a/dir_entries.go +++ b/dir_entries.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "fmt" diff --git a/doc.go b/doc.go index b989ba7..90723f9 100644 --- a/doc.go +++ b/doc.go @@ -1,5 +1,5 @@ /* -Package goadb is a Go interface to the Android Debug Bridge (adb). +package adb is a Go interface to the Android Debug Bridge (adb). See cmd/demo/demo.go for an example of how to use this library. @@ -7,6 +7,6 @@ The client/server spec is defined at https://android.googlesource.com/platform/s WARNING This library is under heavy development, and its API is likely to change without notice. */ -package goadb +package adb // TODO(z): Write method-specific examples. diff --git a/host_client.go b/host_client.go index 38a6ae5..33850a0 100644 --- a/host_client.go +++ b/host_client.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "strconv" diff --git a/host_client_test.go b/host_client_test.go index 7056cae..16ae26f 100644 --- a/host_client_test.go +++ b/host_client_test.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "testing" diff --git a/server.go b/server.go index ae6aab0..82ecd17 100644 --- a/server.go +++ b/server.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "errors" diff --git a/server_mock_test.go b/server_mock_test.go index 2f7dc35..af7012e 100644 --- a/server_mock_test.go +++ b/server_mock_test.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "io" diff --git a/server_test.go b/server_test.go index 4bf7a2c..c52ff53 100644 --- a/server_test.go +++ b/server_test.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "fmt" diff --git a/sync_client.go b/sync_client.go index 75dfdd4..2993ca7 100644 --- a/sync_client.go +++ b/sync_client.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "io" diff --git a/sync_client_test.go b/sync_client_test.go index 050bd8f..b5df0f3 100644 --- a/sync_client_test.go +++ b/sync_client_test.go @@ -1,5 +1,5 @@ // TODO(z): Implement tests for sync_client functions. -package goadb +package adb import ( "bytes" diff --git a/sync_file_reader.go b/sync_file_reader.go index 1aa1b89..efbff70 100644 --- a/sync_file_reader.go +++ b/sync_file_reader.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "io" diff --git a/sync_file_reader_test.go b/sync_file_reader_test.go index 83da0e8..77f6b2c 100644 --- a/sync_file_reader_test.go +++ b/sync_file_reader_test.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "io" diff --git a/sync_file_writer.go b/sync_file_writer.go index 80c24a6..0ee8a02 100644 --- a/sync_file_writer.go +++ b/sync_file_writer.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "fmt" diff --git a/sync_file_writer_test.go b/sync_file_writer_test.go index 3b10155..993b9da 100644 --- a/sync_file_writer_test.go +++ b/sync_file_writer_test.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "bytes" diff --git a/util.go b/util.go index 92d83ef..8a14f00 100644 --- a/util.go +++ b/util.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "fmt" diff --git a/util_test.go b/util_test.go index 66aab99..e999e41 100644 --- a/util_test.go +++ b/util_test.go @@ -1,4 +1,4 @@ -package goadb +package adb import ( "testing" diff --git a/wire/doc.go b/wire/doc.go index a4293a1..887013f 100644 --- a/wire/doc.go +++ b/wire/doc.go @@ -2,7 +2,7 @@ Package wire implements the low-level part of the client/server wire protocol. It also implements the "sync" wire format for file transfers. -This package is not intended to be used directly. goadb.HostClient and goadb.DeviceClient +This package is not intended to be used directly. adb.HostClient and adb.DeviceClient use it to abstract away the bit-twiddling details of the protocol. You should only ever need to work with the goadb package. Also, this package's API may change more frequently than goadb's.