Merge pull request #915 from BlackstoneEngineering/exporterUpdate2

Update to Offline Exporters
pull/917/head
Martin Kojtal 2015-02-15 11:06:07 +00:00
commit 8dce46b543
2 changed files with 24 additions and 2 deletions

View File

@ -0,0 +1,20 @@
syntax: regexp
\.hgignore$
\.git$
\.svn$
\.orig$
\.msub$
\.meta$
\.ctags
\.uvproj$
\.uvopt$
\.project$
\.cproject$
\.launch$
\.project$
\.cproject$
\.launch$
Makefile$
\.ewp$
\.eww$
\.htm$

View File

@ -16,7 +16,7 @@ limitations under the License.
"""
import os, tempfile
from os.path import join, exists, basename
from shutil import copytree, rmtree
from shutil import copytree, rmtree, copy
from workspace_tools.utils import mkdir
from workspace_tools.export import uvision4, codesourcery, codered, gccarm, ds5_5, iar, emblocks, coide, kds, zip
@ -89,7 +89,9 @@ def export(project_path, project_name, ide, target, destination='/tmp/',
zip_path = None
if report['success']:
# add readme file to every offline export.
open(os.path.join(tempdir, 'README.html'),'w').write('<meta http-equiv="refresh" content="0; url=http://developer.mbed.org/handbook/ExportToOfflineToolchain#%s#%s"/>'% (target,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(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir)
zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean)
return zip_path, report