-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmain.go
More file actions
42 lines (34 loc) · 941 Bytes
/
main.go
File metadata and controls
42 lines (34 loc) · 941 Bytes
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
package main
import (
"os"
"github.com/bitrise-io/go-steputils/stepconf"
"github.com/bitrise-io/go-utils/command"
"github.com/bitrise-io/go-utils/env"
"github.com/bitrise-io/go-utils/log"
"github.com/bitrise-steplib/bitrise-step-android-build/step"
)
func main() {
os.Exit(run())
}
func run() int {
envRepository := env.NewRepository()
inputParser := stepconf.NewInputParser(envRepository)
logger := log.NewLogger()
cmdFactory := command.NewFactory(envRepository)
androidBuild := step.NewAndroidBuild(inputParser, logger, cmdFactory)
config, err := androidBuild.ProcessConfig()
if err != nil {
logger.Errorf("Process config: %s", err.Error())
return 1
}
result, err := androidBuild.Run(config)
if err != nil {
logger.Errorf("Run: %s", err.Error())
return 1
}
if err := androidBuild.Export(result, config.DeployDir); err != nil {
logger.Errorf("Export outputs: %s", err.Error())
return 1
}
return 0
}