File tree Expand file tree Collapse file tree
builder/frameworks/arduino Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444
4545
4646def get_variants_dir ():
47+ # variants_dir is not specified in board.json file
48+ # Use <framework>/variants as a default path
4749 if "build.variants_dir" not in board :
4850 return os .path .join (FRAMEWORK_DIR , "variants" )
4951
52+ # Check if specified variants_dir exist as a package subdirectory to support custom packages installations
53+ package_variants = os .path .join (platform .get_dir (), board .get ("build.variants_dir" ))
54+ if os .path .isabs (package_variants ):
55+ return package_variants
56+
57+ # Check if the specified variants_dir exist as an absolute path on it's own
5058 if os .path .isabs (env .subst (board .get ("build.variants_dir" ))):
5159 return board .get ("build.variants_dir" , "" )
5260
61+ # Last resort, use specified variants_dir as subdirectory in current project path
5362 return os .path .join ("$PROJECT_DIR" , board .get ("build.variants_dir" ))
5463
5564
You can’t perform that action at this time.
0 commit comments