@@ -173,7 +173,7 @@ func (s *ContainerFindIncludes) findIncludes(ctx *types.Context) error {
173
173
}
174
174
}
175
175
176
- if err := runCommand (ctx , & FailIfImportedLibraryIsWrong {} ); err != nil {
176
+ if err := failIfImportedLibraryIsWrong (ctx ); err != nil {
177
177
return errors .WithStack (err )
178
178
}
179
179
@@ -196,15 +196,6 @@ func appendIncludeFolder(ctx *types.Context, cache *includeCache, sourceFilePath
196
196
cache .ExpectEntry (sourceFilePath , include , folder )
197
197
}
198
198
199
- func runCommand (ctx * types.Context , command types.Command ) error {
200
- PrintRingNameIfDebug (ctx , command )
201
- err := command .Run (ctx )
202
- if err != nil {
203
- return errors .WithStack (err )
204
- }
205
- return nil
206
- }
207
-
208
199
type includeCacheEntry struct {
209
200
Sourcefile * paths.Path
210
201
Include string
@@ -490,3 +481,29 @@ func ResolveLibrary(ctx *types.Context, header string) *libraries.Library {
490
481
491
482
return selected
492
483
}
484
+
485
+ func failIfImportedLibraryIsWrong (ctx * types.Context ) error {
486
+ if len (ctx .ImportedLibraries ) == 0 {
487
+ return nil
488
+ }
489
+
490
+ for _ , library := range ctx .ImportedLibraries {
491
+ if ! library .IsLegacy {
492
+ if library .InstallDir .Join ("arch" ).IsDir () {
493
+ return errors .New (tr ("%[1]s folder is no longer supported! See %[2]s for more information" , "'arch'" , "http://goo.gl/gfFJzU" ))
494
+ }
495
+ for _ , propName := range libraries .MandatoryProperties {
496
+ if ! library .Properties .ContainsKey (propName ) {
497
+ return errors .New (tr ("Missing '%[1]s' from library in %[2]s" , propName , library .InstallDir ))
498
+ }
499
+ }
500
+ if library .Layout == libraries .RecursiveLayout {
501
+ if library .UtilityDir != nil {
502
+ return errors .New (tr ("Library can't use both '%[1]s' and '%[2]s' folders. Double check in '%[3]s'." , "src" , "utility" , library .InstallDir ))
503
+ }
504
+ }
505
+ }
506
+ }
507
+
508
+ return nil
509
+ }
0 commit comments