@@ -40,9 +40,9 @@ import (
40
40
41
41
type SourceFile struct {
42
42
// Sketch or Library pointer that this source file lives in
43
- Origin interface {}
43
+ Origin interface {}
44
44
// Path to the source file within the sketch/library root folder
45
- RelativePath string
45
+ RelativePath string
46
46
}
47
47
48
48
// Create a SourceFile containing the given source file path within the
@@ -63,40 +63,40 @@ func MakeSourceFile(ctx *Context, origin interface{}, path string) (SourceFile,
63
63
// be placed. Any directories inside SourceFile.RelativePath will be
64
64
// appended here.
65
65
func 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
+ }
74
74
}
75
75
76
76
// Return the source root for the given origin, where its source files
77
77
// can be found. Prepending this to SourceFile.RelativePath will give
78
78
// the full path to that source file.
79
79
func 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
+ }
88
88
}
89
89
90
90
func (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 )
92
92
}
93
93
94
94
func (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" )
96
96
}
97
97
98
98
func (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" )
100
100
}
101
101
102
102
type SketchFile struct {
@@ -163,23 +163,23 @@ const (
163
163
)
164
164
165
165
type Library struct {
166
- Folder string
167
- SrcFolder string
166
+ Folder string
167
+ SrcFolder string
168
168
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
183
183
}
184
184
185
185
func (library * Library ) String () string {
0 commit comments