@@ -40,9 +40,9 @@ import (
4040
4141type SourceFile struct {
4242 // Sketch or Library pointer that this source file lives in
43- Origin interface {}
43+ Origin interface {}
4444 // Path to the source file within the sketch/library root folder
45- RelativePath string
45+ RelativePath string
4646}
4747
4848// Create a SourceFile containing the given source file path within the
@@ -63,40 +63,40 @@ func MakeSourceFile(ctx *Context, origin interface{}, path string) (SourceFile,
6363// be placed. Any directories inside SourceFile.RelativePath will be
6464// appended here.
6565func buildRoot (ctx * Context , origin interface {}) string {
66- switch o := origin .(type ) {
67- case * Sketch :
68- return ctx .SketchBuildPath
69- case * Library :
70- return filepath .Join (ctx .LibrariesBuildPath , o .Name )
71- default :
72- panic ("Unexpected origin for SourceFile: " + fmt .Sprint (origin ))
73- }
66+ switch o := origin .(type ) {
67+ case * Sketch :
68+ return ctx .SketchBuildPath
69+ case * Library :
70+ return filepath .Join (ctx .LibrariesBuildPath , o .Name )
71+ default :
72+ panic ("Unexpected origin for SourceFile: " + fmt .Sprint (origin ))
73+ }
7474}
7575
7676// Return the source root for the given origin, where its source files
7777// can be found. Prepending this to SourceFile.RelativePath will give
7878// the full path to that source file.
7979func sourceRoot (ctx * Context , origin interface {}) string {
80- switch o := origin .(type ) {
81- case * Sketch :
82- return ctx .SketchBuildPath
83- case * Library :
84- return o .SrcFolder
85- default :
86- panic ("Unexpected origin for SourceFile: " + fmt .Sprint (origin ))
87- }
80+ switch o := origin .(type ) {
81+ case * Sketch :
82+ return ctx .SketchBuildPath
83+ case * Library :
84+ return o .SrcFolder
85+ default :
86+ panic ("Unexpected origin for SourceFile: " + fmt .Sprint (origin ))
87+ }
8888}
8989
9090func (f * SourceFile ) SourcePath (ctx * Context ) string {
91- return filepath .Join (sourceRoot (ctx , f .Origin ), f .RelativePath )
91+ return filepath .Join (sourceRoot (ctx , f .Origin ), f .RelativePath )
9292}
9393
9494func (f * SourceFile ) ObjectPath (ctx * Context ) string {
95- return filepath .Join (buildRoot (ctx , f .Origin ), f .RelativePath + ".o" )
95+ return filepath .Join (buildRoot (ctx , f .Origin ), f .RelativePath + ".o" )
9696}
9797
9898func (f * SourceFile ) DepfilePath (ctx * Context ) string {
99- return filepath .Join (buildRoot (ctx , f .Origin ), f .RelativePath + ".d" )
99+ return filepath .Join (buildRoot (ctx , f .Origin ), f .RelativePath + ".d" )
100100}
101101
102102type SketchFile struct {
@@ -163,23 +163,23 @@ const (
163163)
164164
165165type Library struct {
166- Folder string
167- SrcFolder string
166+ Folder string
167+ SrcFolder string
168168 UtilityFolder string
169- Layout LibraryLayout
170- Name string
171- Archs []string
172- DotALinkage bool
173- IsLegacy bool
174- Version string
175- Author string
176- Maintainer string
177- Sentence string
178- Paragraph string
179- URL string
180- Category string
181- License string
182- Properties map [string ]string
169+ Layout LibraryLayout
170+ Name string
171+ Archs []string
172+ DotALinkage bool
173+ IsLegacy bool
174+ Version string
175+ Author string
176+ Maintainer string
177+ Sentence string
178+ Paragraph string
179+ URL string
180+ Category string
181+ License string
182+ Properties map [string ]string
183183}
184184
185185func (library * Library ) String () string {
0 commit comments