From 132de6ed223f871e58dc9fbc2ef45e33c8301e8e Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Tue, 8 Jan 2013 20:35:27 +0000 Subject: [PATCH] Add Python script and update VSIX generator rules to pre-generate the Atmel Studio cache files required to make the extension visible. --- .../ProjectGenerator/placeholder.txt | 1 + .../VSIX/[Content_Types].xml | 1 + LUFA/StudioIntegration/generate_caches.py | 20 +++++++++++++++++++ LUFA/StudioIntegration/makefile | 11 +++++++--- 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 LUFA/StudioIntegration/ProjectGenerator/placeholder.txt create mode 100644 LUFA/StudioIntegration/generate_caches.py diff --git a/LUFA/StudioIntegration/ProjectGenerator/placeholder.txt b/LUFA/StudioIntegration/ProjectGenerator/placeholder.txt new file mode 100644 index 0000000000..381e193811 --- /dev/null +++ b/LUFA/StudioIntegration/ProjectGenerator/placeholder.txt @@ -0,0 +1 @@ +This module requires the ASF Project Generator to be extracted into this directory (i.e. with the Python scripts in the current folder). The project generator can be extracted from the release versions of Atmel Studio's ASF extension. \ No newline at end of file diff --git a/LUFA/StudioIntegration/VSIX/[Content_Types].xml b/LUFA/StudioIntegration/VSIX/[Content_Types].xml index 8a20e77f34..87b2f8e49c 100644 --- a/LUFA/StudioIntegration/VSIX/[Content_Types].xml +++ b/LUFA/StudioIntegration/VSIX/[Content_Types].xml @@ -1,5 +1,6 @@ + diff --git a/LUFA/StudioIntegration/generate_caches.py b/LUFA/StudioIntegration/generate_caches.py new file mode 100644 index 0000000000..033ae28dda --- /dev/null +++ b/LUFA/StudioIntegration/generate_caches.py @@ -0,0 +1,20 @@ +""" + LUFA Library + Copyright (C) Dean Camera, 2013. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +""" + +import sys +import os +sys.path.append("ProjectGenerator") + +try: + from asf_avrstudio5_interface import PythonFacade +except ImportError: + print "The ASF project generator is missing." + +p = PythonFacade(os.path.abspath(__file__)) +p.check_extension_database_sanity(sys.argv[1]) +p.generate_extension_cache_files(sys.argv[1]) diff --git a/LUFA/StudioIntegration/makefile b/LUFA/StudioIntegration/makefile index 2e7ae564ce..f66592288c 100644 --- a/LUFA/StudioIntegration/makefile +++ b/LUFA/StudioIntegration/makefile @@ -48,7 +48,12 @@ generate_xml: $(TEMP_MANIFEST_XML) @rm $(TEMP_MANIFEST_XML) -generate_vsix: $(EXTENSION_OUTPUT_XML) $(MODULE_OUTPUT_XML) +generate_caches: $(EXTENSION_OUTPUT_XML) + @echo "Generating ASF cache files..." + @python generate_caches.py $(LUFA_ROOT)/../ + @echo "ASF cache files generated." + +generate_vsix: $(EXTENSION_OUTPUT_XML) $(MODULE_OUTPUT_XML) generate_caches @echo "Archiving Content..." @cd $(LUFA_ROOT)/../ && zip contents.zip -q -9 -r --exclude=*$(notdir $(DOXYGEN_TAG_FILE_XML)) --exclude=*StudioIntegration* LUFA Bootloaders Demos Projects extension.xml README.txt @@ -61,7 +66,7 @@ generate_vsix: $(EXTENSION_OUTPUT_XML) $(MODULE_OUTPUT_XML) @xsltproc --stringparam lufa-version "$(LUFA_VERSION_NUM)" XSLT/lufa_asfmanifest_transform.xslt VSIX/asf-manifest.xml > $(LUFA_ROOT)/../asf-manifest.xml @echo "Generating Atmel Studio VSIX Extension file..." - @cd $(LUFA_ROOT)/../ && zip LUFA.vsix -q contents.zip License.txt Preview.png PreviewThumb.png "[Content_Types].xml" extension.vsixmanifest asf-manifest.xml extension.xml + @cd $(LUFA_ROOT)/../ && zip LUFA.vsix -q contents.zip exampleProjects.xml content.xml.cache License.txt Preview.png PreviewThumb.png "[Content_Types].xml" extension.vsixmanifest asf-manifest.xml extension.xml @echo "Atmel Studio VSIX Extension file generated." check_filenames: $(TEMP_MANIFEST_XML) @@ -71,4 +76,4 @@ check_filenames: $(TEMP_MANIFEST_XML) fi; \ done; -.PHONY: all clean generate_xml generate_vsix check_filenames \ No newline at end of file +.PHONY: all clean generate_xml check_filenames generate_caches generate_vsix \ No newline at end of file