File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -138,3 +138,18 @@ func (library *Library) SourceDirs() []SourceDir {
138
138
}
139
139
return dirs
140
140
}
141
+
142
+ // LocationPriorityFor returns a number representing the location priority for the given library
143
+ // using the given platform and referenced-platform. Higher value means higher priority.
144
+ func (library * Library ) LocationPriorityFor (platformRelease , refPlatformRelease * cores.PlatformRelease ) int {
145
+ if library .Location == IDEBuiltIn {
146
+ return 1
147
+ } else if library .ContainerPlatform == refPlatformRelease {
148
+ return 2
149
+ } else if library .ContainerPlatform == platformRelease {
150
+ return 3
151
+ } else if library .Location == User {
152
+ return 4
153
+ }
154
+ return 0
155
+ }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ type LibraryLocation int
28
28
// The enumeration is listed in ascending order of priority
29
29
const (
30
30
// IDEBuiltIn are libraries bundled in the IDE
31
- IDEBuiltIn = iota
31
+ IDEBuiltIn LibraryLocation = iota
32
32
// PlatformBuiltIn are libraries bundled in a PlatformRelease
33
33
PlatformBuiltIn
34
34
// ReferencedPlatformBuiltIn are libraries bundled in a PlatformRelease referenced for build
You can’t perform that action at this time.
0 commit comments