@@ -48,7 +48,7 @@ def add_file(bundle, src_file, zip_name):
4848 return file_sector_size
4949
5050
51- def build_bundle (libs , bundle_version , output_filename ,
51+ def build_bundle (libs , bundle_version , output_filename , package_folder_prefix ,
5252 build_tools_version = "devel" , mpy_cross = None , example_bundle = False ):
5353 build_dir = "build-" + os .path .basename (output_filename )
5454 top_folder = os .path .basename (output_filename ).replace (".zip" , "" )
@@ -69,8 +69,8 @@ def build_bundle(libs, bundle_version, output_filename,
6969 success = True
7070 for library_path in libs :
7171 try :
72- build .library (library_path , build_lib_dir , mpy_cross = mpy_cross ,
73- example_bundle = example_bundle )
72+ build .library (library_path , build_lib_dir , package_folder_prefix ,
73+ mpy_cross = mpy_cross , example_bundle = example_bundle )
7474 except ValueError as e :
7575 print ("build.library failure:" , library_path )
7676 print (e )
@@ -135,7 +135,8 @@ def _find_libraries(current_path, depth):
135135@click .option ('--output_directory' , default = "bundles" , help = "Output location for the zip files." )
136136@click .option ('--library_location' , required = True , help = "Location of libraries to bundle." )
137137@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." )
138- def build_bundles (filename_prefix , output_directory , library_location , library_depth ):
138+ @click .option ('--package_folder_prefix' , default = "adafruit_" , help = "Prefix string used to determine package folders to bundle." )
139+ def build_bundles (filename_prefix , output_directory , library_location , library_depth , package_folder_prefix ):
139140 os .makedirs (output_directory , exist_ok = True )
140141
141142 bundle_version = build .version_string ()
@@ -157,7 +158,7 @@ def build_bundles(filename_prefix, output_directory, library_location, library_d
157158 zip_filename = os .path .join (output_directory ,
158159 filename_prefix + '-py-{VERSION}.zip' .format (
159160 VERSION = bundle_version ))
160- build_bundle (libs , bundle_version , zip_filename ,
161+ build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
161162 build_tools_version = build_tools_version )
162163
163164 # Build .mpy bundle(s)
@@ -174,12 +175,12 @@ def build_bundles(filename_prefix, output_directory, library_location, library_d
174175 filename_prefix + '-{TAG}-mpy-{VERSION}.zip' .format (
175176 TAG = version ["name" ],
176177 VERSION = bundle_version ))
177- build_bundle (libs , bundle_version , zip_filename , mpy_cross = mpy_cross ,
178- build_tools_version = build_tools_version )
178+ build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
179+ mpy_cross = mpy_cross , build_tools_version = build_tools_version )
179180
180181 # Build example bundle
181182 zip_filename = os .path .join (output_directory ,
182183 filename_prefix + '-examples-{VERSION}.zip' .format (
183184 VERSION = bundle_version ))
184- build_bundle (libs , bundle_version , zip_filename ,
185+ build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
185186 build_tools_version = build_tools_version , example_bundle = True )
0 commit comments