10000 Compile extract all artifacts by cmaglie · Pull Request #687 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

Compile extract all artifacts #687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 15, 2020
Prev Previous commit
Next Next commit
Updated compile/upload cli commands
  • Loading branch information
cmaglie committed May 15, 2020
commit 7a3ee5bf62d9fdd2b7a125d51da0b97964cbd977
8 changes: 4 additions & 4 deletions cli/compile/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var (
uploadAfterCompile bool // Upload the binary after the compilation.
port string // Upload port, e.g.: COM10 or /dev/ttyACM0.
verify bool // Upload, verify uploaded binary after the upload.
exportFile string // The compiled binary is written to this file
exportDir string // The compiled binary is written to this file
dryRun bool // Use this flag to now write the output file
libraries []string // List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths.
optimizeForDebug bool // Optimize compile output for debug, not for release
Expand All @@ -67,7 +67,7 @@ func NewCommand() *cobra.Command {
command.Flags().BoolVar(&showProperties, "show-properties", false, "Show all build properties used instead of compiling.")
command.Flags().BoolVar(&preprocess, "preprocess", false, "Print preprocessed code to stdout instead of compiling.")
command.Flags().StringVar(&buildCachePath, "build-cache-path", "", "Builds of 'core.a' are saved into this path to be cached and reused.")
command.Flags().StringVarP(&exportFile, "output", "o", "", "Filename of the compile output.")
command.Flags().StringVarP(&exportDir, "output-dir", "", "", "Save build artifacts in this directory.")
command.Flags().BoolVarP(&dryRun, "dry-run", "n", false, "Perform the build but do not copy the compile output file.")
command.Flags().StringVar(&buildPath, "build-path", "",
"Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS.")
Expand Down Expand Up @@ -115,7 +115,7 @@ func run(cmd *cobra.Command, args []string) {
Verbose: verbose,
Quiet: quiet,
VidPid: vidPid,
ExportFile: exportFile,
ExportDir: exportDir,
DryRun: dryRun,
Libraries: libraries,
OptimizeForDebug: optimizeForDebug,
Expand All @@ -134,7 +134,7 @@ func run(cmd *cobra.Command, args []string) {
Port: port,
Verbose: verbose,
Verify: verify,
ImportFile: exportFile,
ImportDir: exportDir,
}, os.Stdout, os.Stderr)

if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions cli/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (
)

var (
fqbn string
port string
verbose bool
verify bool
importFile string
fqbn string
port string
verbose bool
verify bool
importDir string
)

// NewCommand created a new `upload` command
Expand All @@ -50,7 +50,7 @@ func NewCommand() *cobra.Command {

uploadCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno")
uploadCommand.Flags().StringVarP(&port, "port", "p", "", "Upload port, e.g.: COM10 or /dev/ttyACM0")
uploadCommand.Flags().StringVarP(&importFile, "input", "i", "", "Input file to be uploaded.")
uploadCommand.Flags().StringVarP(&importDir, "input-dir", "", "", "Direcory containing binaries to upload.")
uploadCommand.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.")
uploadCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, "Optional, turns on verbose mode.")

Expand All @@ -77,7 +77,7 @@ func run(command *cobra.Command, args []string) {
Port: port,
Verbose: verbose,
Verify: verify,
ImportFile: importFile,
ImportDir: importDir,
}, os.Stdout, os.Stderr); err != nil {
feedback.Errorf("Error during Upload: %v", err)
os.Exit(errorcodes.ErrGeneric)
Expand Down
0