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