@@ -159,8 +159,7 @@ func (s *ContainerFindIncludes) findIncludes(ctx *types.Context) error {
159
159
return errors .WithStack (err )
160
160
}
161
161
162
- err = runCommand (ctx , & FailIfImportedLibraryIsWrong {})
163
- if err != nil {
162
+ if err := failIfImportedLibraryIsWrong (ctx ); err != nil {
164
163
return errors .WithStack (err )
165
164
}
166
165
@@ -177,15 +176,6 @@ func appendIncludeFolder(ctx *types.Context, cache *includeCache, sourceFilePath
177
176
cache .ExpectEntry (sourceFilePath , include , folder )
178
177
}
179
178
180
- func runCommand (ctx * types.Context , command types.Command ) error {
181
- PrintRingNameIfDebug (ctx , command )
182
- err := command .Run (ctx )
183
- if err != nil {
184
- return errors .WithStack (err )
185
- }
186
- return nil
187
- }
188
-
189
179
type includeCacheEntry struct {
190
180
Sourcefile * paths.Path
191
181
Include string
@@ -471,3 +461,29 @@ func ResolveLibrary(ctx *types.Context, header string) *libraries.Library {
471
461
472
462
return selected
473
463
}
464
+
465
+ func failIfImportedLibraryIsWrong (ctx * types.Context ) error {
466
+ if len (ctx .ImportedLibraries ) == 0 {
467
+ return nil
468
+ }
469
+
470
+ for _ , library := range ctx .ImportedLibraries {
471
+ if ! library .IsLegacy {
472
+ if library .InstallDir .Join ("arch" ).IsDir () {
473
+ return errors .New (tr ("%[1]s folder is no longer supported! See %[2]s for more information" , "'arch'" , "http://goo.gl/gfFJzU" ))
474
+ }
475
+ for _ , propName := range libraries .MandatoryProperties {
476
+ if ! library .Properties .ContainsKey (propName ) {
477
+ return errors .New (tr ("Missing '%[1]s' from library in %[2]s" , propName , library .InstallDir ))
478
+ }
479
+ }
480
+ if library .Layout == libraries .RecursiveLayout {
481
+ if library .UtilityDir != nil {
482
+ return errors .New (tr ("Library can't use both '%[1]s' and '%[2]s' folders. Double check in '%[3]s'." , "src" , "utility" , library .InstallDir ))
483
+ }
484
+ }
485
+ }
486
+ }
487
+
488
+ return nil
489
+ }
0 commit comments