mirror of https://github.com/flysand7/ciabatta.git
Add export section to library.json
This commit is contained in:
parent
e41df0dd4d
commit
e041fdd474
5
build.py
5
build.py
|
@ -163,9 +163,11 @@ try:
|
||||||
ciabatta_header.write('\n')
|
ciabatta_header.write('\n')
|
||||||
# Write module sources
|
# Write module sources
|
||||||
mod_exports = []
|
mod_exports = []
|
||||||
|
requirements_satisfied = True
|
||||||
for api in library_config['apis']:
|
for api in library_config['apis']:
|
||||||
api_name = api['name']
|
api_name = api['name']
|
||||||
api_path = api['path']
|
api_path = api['path']
|
||||||
|
if api_name in library_config['export']:
|
||||||
reqs_satisfied = True
|
reqs_satisfied = True
|
||||||
# Check API dependencies
|
# Check API dependencies
|
||||||
for req in api['reqs']:
|
for req in api['reqs']:
|
||||||
|
@ -177,12 +179,15 @@ try:
|
||||||
break
|
break
|
||||||
if not reqs_satisfied:
|
if not reqs_satisfied:
|
||||||
print(colors.red, f" * Not exporting API '{api_name}'", colors.reset, sep='')
|
print(colors.red, f" * Not exporting API '{api_name}'", colors.reset, sep='')
|
||||||
|
requirements_satisfied = False
|
||||||
else:
|
else:
|
||||||
print(colors.green, f" * Exporting API '{api_name}'", colors.reset, sep='')
|
print(colors.green, f" * Exporting API '{api_name}'", colors.reset, sep='')
|
||||||
ciabatta_header.write(f'// Module {api_name}\n')
|
ciabatta_header.write(f'// Module {api_name}\n')
|
||||||
mod_exports.append(api_name)
|
mod_exports.append(api_name)
|
||||||
for include in api['includes']:
|
for include in api['includes']:
|
||||||
ciabatta_header.write(f'#include "{api_path}/{include}"\n')
|
ciabatta_header.write(f'#include "{api_path}/{include}"\n')
|
||||||
|
if not requirements_satisfied:
|
||||||
|
sys.exit(1)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
print(colors.red, f" ERROR writing file '{ciabatta_header_path}':", sep='')
|
print(colors.red, f" ERROR writing file '{ciabatta_header_path}':", sep='')
|
||||||
print(f" {error}", colors.reset)
|
print(f" {error}", colors.reset)
|
||||||
|
|
|
@ -88,4 +88,14 @@ apis: [
|
||||||
"cia_memory",
|
"cia_memory",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
// Edit this part for a particular build you want
|
||||||
|
// this contains list of "name" properties for modules
|
||||||
|
// in the "apis" section
|
||||||
|
|
||||||
|
export: [
|
||||||
|
"cia_memory",
|
||||||
|
"stdlib_program",
|
||||||
|
"stdlib_file",
|
||||||
]
|
]
|
Loading…
Reference in New Issue