mirror of https://github.com/ARMmbed/mbed-os.git
Remove yaml exporter
parent
3b2b06197a
commit
4f7804b221
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
import os, tempfile
|
import os, tempfile
|
||||||
from os.path import join, exists, basename
|
from os.path import join, exists, basename
|
||||||
from shutil import copytree, rmtree, copy
|
from shutil import copytree, rmtree, copy
|
||||||
import yaml
|
|
||||||
|
|
||||||
from tools.utils import mkdir
|
from tools.utils import mkdir
|
||||||
from tools.export import uvision4, codered, gccarm, ds5_5, iar, emblocks, coide, kds, zip, simplicityv3, atmelstudio, sw4stm32
|
from tools.export import uvision4, codered, gccarm, ds5_5, iar, emblocks, coide, kds, zip, simplicityv3, atmelstudio, sw4stm32
|
||||||
|
@ -55,7 +54,7 @@ def online_build_url_resolver(url):
|
||||||
|
|
||||||
|
|
||||||
def export(project_path, project_name, ide, target, destination='/tmp/',
|
def export(project_path, project_name, ide, target, destination='/tmp/',
|
||||||
tempdir=None, clean=True, extra_symbols=None, build_url_resolver=online_build_url_resolver):
|
tempdir=None, clean=True, extra_symbols=None, zip=True, build_url_resolver=online_build_url_resolver):
|
||||||
# Convention: we are using capitals for toolchain and target names
|
# Convention: we are using capitals for toolchain and target names
|
||||||
if target is not None:
|
if target is not None:
|
||||||
target = target.upper()
|
target = target.upper()
|
||||||
|
@ -109,30 +108,16 @@ def export(project_path, project_name, ide, target, destination='/tmp/',
|
||||||
|
|
||||||
zip_path = None
|
zip_path = None
|
||||||
if report['success']:
|
if report['success']:
|
||||||
# readme.txt to contain more exported data
|
|
||||||
exporter_yaml = {
|
|
||||||
'project_generator': {
|
|
||||||
'active' : False,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if use_progen:
|
|
||||||
try:
|
|
||||||
import pkg_resources
|
|
||||||
version = pkg_resources.get_distribution('project_generator').version
|
|
||||||
exporter_yaml['project_generator']['version'] = version
|
|
||||||
exporter_yaml['project_generator']['active'] = True;
|
|
||||||
exporter_yaml['project_generator_definitions'] = {}
|
|
||||||
version = pkg_resources.get_distribution('project_generator_definitions').version
|
|
||||||
exporter_yaml['project_generator_definitions']['version'] = version
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
with open(os.path.join(tempdir, 'exporter.yaml'), 'w') as outfile:
|
|
||||||
yaml.dump(exporter_yaml, outfile, default_flow_style=False)
|
|
||||||
# add readme file to every offline export.
|
# add readme file to every offline export.
|
||||||
open(os.path.join(tempdir, 'GettingStarted.htm'),'w').write('<meta http-equiv="refresh" content="0; url=http://mbed.org/handbook/Getting-Started-mbed-Exporters#%s"/>'% (ide))
|
open(os.path.join(tempdir, 'GettingStarted.htm'),'w').write('<meta http-equiv="refresh" content="0; url=http://mbed.org/handbook/Getting-Started-mbed-Exporters#%s"/>'% (ide))
|
||||||
# copy .hgignore file to exported direcotry as well.
|
# copy .hgignore file to exported direcotry as well.
|
||||||
|
if exists(os.path.join(exporter.TEMPLATE_DIR,'.hgignore')):
|
||||||
copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir)
|
copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir)
|
||||||
|
|
||||||
|
if zip:
|
||||||
zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean)
|
zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean)
|
||||||
|
else:
|
||||||
|
zip_path = destination
|
||||||
|
|
||||||
return zip_path, report
|
return zip_path, report
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue