@@ -48,7 +48,7 @@ def add_file(bundle, src_file, zip_name):
48
48
return file_sector_size
49
49
50
50
51
- def build_bundle (libs , bundle_version , output_filename ,
51
+ def build_bundle (libs , bundle_version , output_filename , package_folder_prefix ,
52
52
build_tools_version = "devel" , mpy_cross = None , example_bundle = False ):
53
53
build_dir = "build-" + os .path .basename (output_filename )
54
54
top_folder = os .path .basename (output_filename ).replace (".zip" , "" )
@@ -69,8 +69,8 @@ def build_bundle(libs, bundle_version, output_filename,
69
69
success = True
70
70
for library_path in libs :
71
71
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 )
74
74
except ValueError as e :
75
75
print ("build.library failure:" , library_path )
76
76
print (e )
@@ -135,7 +135,8 @@ def _find_libraries(current_path, depth):
135
135
@click .option ('--output_directory' , default = "bundles" , help = "Output location for the zip files." )
136
136
@click .option ('--library_location' , required = True , help = "Location of libraries to bundle." )
137
137
@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 ):
139
140
os .makedirs (output_directory , exist_ok = True )
140
141
141
142
bundle_version = build .version_string ()
@@ -157,7 +158,7 @@ def build_bundles(filename_prefix, output_directory, library_location, library_d
157
158
zip_filename = os .path .join (output_directory ,
158
159
filename_prefix + '-py-{VERSION}.zip' .format (
159
160
VERSION = bundle_version ))
160
- build_bundle (libs , bundle_version , zip_filename ,
161
+ build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
161
162
build_tools_version = build_tools_version )
162
163
163
164
# Build .mpy bundle(s)
@@ -174,12 +175,12 @@ def build_bundles(filename_prefix, output_directory, library_location, library_d
174
175
filename_prefix + '-{TAG}-mpy-{VERSION}.zip' .format (
175
176
TAG = version ["name" ],
176
177
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 )
179
180
180
181
# Build example bundle
181
182
zip_filename = os .path .join (output_directory ,
182
183
filename_prefix + '-examples-{VERSION}.zip' .format (
183
184
VERSION = bundle_version ))
184
- build_bundle (libs , bundle_version , zip_filename ,
185
+ build_bundle (libs , bundle_version , zip_filename , package_folder_prefix ,
185
186
build_tools_version = build_tools_version , example_bundle = True )
0 commit comments