@@ -234,7 +234,10 @@ def _find_libraries(current_path, depth):
234234@click .option ('--library_depth' , default = 0 , help = "Depth of library folders. This is useful when multiple libraries are bundled together but are initially in separate subfolders." )
235235@click .option ('--package_folder_prefix' , default = "adafruit_" , help = "Prefix string used to determine package folders to bundle." )
236236@click .option ('--remote_name' , default = "origin" , help = "Git remote name to use during building" )
237- def build_bundles (filename_prefix , output_directory , library_location , library_depth , package_folder_prefix , remote_name ):
237+ @click .option ('--ignore' , default = "" , help = "Bundles to ignore building" )
238+ def build_bundles (filename_prefix , output_directory , library_location , library_depth , package_folder_prefix , remote_name , ignore ):
239+ skip_bundles = ignore .lower ().split (", " )
240+
238241 os .makedirs (output_directory , exist_ok = True )
239242
240243 package_folder_prefix = package_folder_prefix .split (", " )
@@ -255,38 +258,42 @@ def build_bundles(filename_prefix, output_directory, library_location, library_d
255258 f .write (build_tools_version )
256259
257260 # Build raw source .py bundle
258- zip_filename = os .path .join (output_directory ,
259- filename_prefix + '-py-{VERSION}.zip' .format (
260- VERSION = bundle_version ))
261- build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
262- build_tools_version = build_tools_version , remote_name = remote_name )
263-
264- # Build .mpy bundle(s)
265- os .makedirs ("build_deps" , exist_ok = True )
266- for version in target_versions .VERSIONS :
267- # Use prebuilt mpy-cross on Travis, otherwise build our own.
268- if "TRAVIS" in os .environ :
269- mpy_cross = pkg_resources .resource_filename (
270- target_versions .__name__ , "data/mpy-cross-" + version ["name" ])
271- else :
272- mpy_cross = "build_deps/mpy-cross-" + version ["name" ] + (".exe" * (os .name == "nt" ))
273- build .mpy_cross (mpy_cross , version ["tag" ])
261+ if "py" not in skip_bundles :
274262 zip_filename = os .path .join (output_directory ,
275- filename_prefix + '-{TAG}-mpy-{VERSION}.zip' .format (
276- TAG = version ["name" ],
263+ filename_prefix + '-py-{VERSION}.zip' .format (
277264 VERSION = bundle_version ))
278265 build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
279- mpy_cross = mpy_cross , build_tools_version = build_tools_version , remote_name = remote_name )
266+ build_tools_version = build_tools_version , remote_name = remote_name )
267+
268+ # Build .mpy bundle(s)
269+ if "mpy" not in skip_bundles :
270+ os .makedirs ("build_deps" , exist_ok = True )
271+ for version in target_versions .VERSIONS :
272+ # Use prebuilt mpy-cross on Travis, otherwise build our own.
273+ if "TRAVIS" in os .environ :
274+ mpy_cross = pkg_resources .resource_filename (
275+ target_versions .__name__ , "data/mpy-cross-" + version ["name" ])
276+ else :
277+ mpy_cross = "build_deps/mpy-cross-" + version ["name" ] + (".exe" * (os .name == "nt" ))
278+ build .mpy_cross (mpy_cross , version ["tag" ])
279+ zip_filename = os .path .join (output_directory ,
280+ filename_prefix + '-{TAG}-mpy-{VERSION}.zip' .format (
281+ TAG = version ["name" ],
282+ VERSION = bundle_version ))
283+ build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
284+ mpy_cross = mpy_cross , build_tools_version = build_tools_version , remote_name = remote_name )
280285
281286 # Build example bundle
282- zip_filename = os .path .join (output_directory ,
283- filename_prefix + '-examples-{VERSION}.zip' .format (
284- VERSION = bundle_version ))
285- build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
286- build_tools_version = build_tools_version , example_bundle = True , remote_name = remote_name )
287+ if "example" not in skip_bundles :
288+ zip_filename = os .path .join (output_directory ,
289+ filename_prefix + '-examples-{VERSION}.zip' .format (
290+ VERSION = bundle_version ))
291+ build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
292+ build_tools_version = build_tools_version , example_bundle = True , remote_name = remote_name )
287293
288294 # Build Bundle JSON
289- json_filename = os .path .join (output_directory ,
290- filename_prefix + '-{VERSION}.json' .format (
291- VERSION = bundle_version ))
292- build_bundle_json (libs , bundle_version , json_filename , package_folder_prefix , remote_name = remote_name )
295+ if "json" not in skip_bundles :
296+ json_filename = os .path .join (output_directory ,
297+ filename_prefix + '-{VERSION}.json' .format (
298+ VERSION = bundle_version ))
299+ build_bundle_json (libs , bundle_version , json_filename , package_folder_prefix , remote_name = remote_name )
0 commit comments