This repository was archived by the owner on Jan 16, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 140
/
Copy pathsymbols.go
67 lines (62 loc) · 1.77 KB
/
symbols.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package parsecmd
import (
"fmt"
"github.com/ParsePlatform/parse-cli/parsecli"
"github.com/facebookgo/stackerr"
"github.com/spf13/cobra"
)
type symbolsCmd struct {
path string
apk string
manifest string
aapt string
skipOsCheck bool
}
func (s *symbolsCmd) run(e *parsecli.Env, c *parsecli.Context) error {
android := &androidSymbolUploader{
Path: s.path,
Apk: s.apk,
Manifest: s.manifest,
AAPT: s.aapt}
ios := &iosSymbolUploader{
Path: s.path,
SkipOsCheck: s.skipOsCheck}
switch {
case android.acceptsPath():
if err := android.validate(); err != nil {
return err
}
fmt.Fprintln(e.Out, "Uploading Android symbol files...")
return android.uploadSymbols(e)
case ios.acceptsPath():
if err := ios.validate(); err != nil {
return err
}
fmt.Fprintln(e.Out, "Uploading iOS symbol files...")
return ios.uploadSymbols(e)
default:
if s.path == "" {
return stackerr.New("Please specify path to symbol files")
}
return stackerr.Newf("Do not understand symbol files at : %s", s.path)
}
}
func NewSymbolsCmd(e *parsecli.Env) *cobra.Command {
var s symbolsCmd
cmd := &cobra.Command{
Use: "symbols [app]",
Short: "Uploads symbol files",
Long: `Uploads the symbol files for the application to symbolicate crash reports with.
Path specifies the path to xcarchive/dSYM/DWARF for iOS or mapping.txt for Android.`,
Run: parsecli.RunWithClient(e, s.run),
}
cmd.Flags().StringVarP(&s.path, "path", "p", s.path,
"Path to symbols files")
cmd.Flags().StringVarP(&s.apk, "apk", "a", s.apk,
"Path to apk file")
cmd.Flags().StringVarP(&s.manifest, "manifest", "m", s.manifest,
"Path to AndroidManifest.xml file")
cmd.Flags().StringVarP(&s.aapt, "aapt", "t", s.aapt,
"Path to aapt for android")
return cmd
}