-
-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'arduino:master' into master
- Loading branch information
Showing
60 changed files
with
1,702 additions
and
1,426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package builder | ||
|
||
import "github.com/arduino/go-paths-helper" | ||
|
||
// CoreBuildCachePath fixdoc | ||
func (b *Builder) CoreBuildCachePath() *paths.Path { | ||
return b.coreBuildCachePath | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package progress | ||
|
||
// Struct fixdoc | ||
type Struct struct { | ||
Progress float32 | ||
StepAmount float32 | ||
Parent *Struct | ||
} | ||
|
||
// AddSubSteps fixdoc | ||
func (p *Struct) AddSubSteps(steps int) { | ||
p.Parent = &Struct{ | ||
Progress: p.Progress, | ||
StepAmount: p.StepAmount, | ||
Parent: p.Parent, | ||
} | ||
if p.StepAmount == 0.0 { | ||
p.StepAmount = 100.0 | ||
} | ||
p.StepAmount /= float32(steps) | ||
} | ||
|
||
// RemoveSubSteps fixdoc | ||
func (p *Struct) RemoveSubSteps() { | ||
p.Progress = p.Parent.Progress | ||
p.StepAmount = p.Parent.StepAmount | ||
p.Parent = p.Parent.Parent | ||
} | ||
|
||
// CompleteStep fixdoc | ||
func (p *Struct) CompleteStep() { | ||
p.Progress += p.StepAmount | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
// Arduino software without disclosing the source code of your own applications. | ||
// To purchase a commercial license, send an email to [email protected]. | ||
|
||
package types | ||
package progress | ||
|
||
import ( | ||
"fmt" | ||
|
@@ -23,7 +23,7 @@ import ( | |
) | ||
|
||
func TestProgress(t *testing.T) { | ||
p := &ProgressStruct{} | ||
p := &Struct{} | ||
p.AddSubSteps(3) | ||
require.Equal(t, float32(0.0), p.Progress) | ||
require.InEpsilon(t, 33.33333, p.StepAmount, 0.00001) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package builder | ||
|
||
import rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" | ||
|
||
// ExecutableSectionSize represents a section of the executable output file | ||
type ExecutableSectionSize struct { | ||
Name string `json:"name"` | ||
Size int `json:"size"` | ||
MaxSize int `json:"max_size"` | ||
} | ||
|
||
// ExecutablesFileSections is an array of ExecutablesFileSection | ||
type ExecutablesFileSections []ExecutableSectionSize | ||
|
||
// ToRPCExecutableSectionSizeArray transforms this array into a []*rpc.ExecutableSectionSize | ||
func (s ExecutablesFileSections) ToRPCExecutableSectionSizeArray() []*rpc.ExecutableSectionSize { | ||
res := []*rpc.ExecutableSectionSize{} | ||
for _, section := range s { | ||
res = append(res, &rpc.ExecutableSectionSize{ | ||
Name: section.Name, | ||
Size: int64(section.Size), | ||
MaxSize: int64(section.MaxSize), | ||
}) | ||
} | ||
return res | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.