Add Python script and update VSIX generator rules to pre-generate the Atmel Studio...
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 8 Jan 2013 20:35:27 +0000 (20:35 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 8 Jan 2013 20:35:27 +0000 (20:35 +0000)
LUFA/StudioIntegration/ProjectGenerator/placeholder.txt [new file with mode: 0644]
LUFA/StudioIntegration/VSIX/[Content_Types].xml
LUFA/StudioIntegration/generate_caches.py [new file with mode: 0644]
LUFA/StudioIntegration/makefile

diff --git a/LUFA/StudioIntegration/ProjectGenerator/placeholder.txt b/LUFA/StudioIntegration/ProjectGenerator/placeholder.txt
new file mode 100644 (file)
index 0000000..381e193
--- /dev/null
@@ -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
index 8a20e77..87b2f8e 100644 (file)
@@ -1,5 +1,6 @@
 <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">\r
   <Default Extension="vsixmanifest" ContentType="text/xml"/>\r
+  <Default Extension="cache" ContentType="text/xml"/>\r
   <Default Extension="png" ContentType="application/octet-stream"/>\r
   <Default Extension="txt" ContentType="text/plain"/>\r
   <Default Extension="xml" ContentType="text/xml"/>\r
diff --git a/LUFA/StudioIntegration/generate_caches.py b/LUFA/StudioIntegration/generate_caches.py
new file mode 100644 (file)
index 0000000..033ae28
--- /dev/null
@@ -0,0 +1,20 @@
+"""\r
+             LUFA Library\r
+     Copyright (C) Dean Camera, 2013.\r
+\r
+  dean [at] fourwalledcubicle [dot] com\r
+           www.lufa-lib.org\r
+"""\r
+\r
+import sys\r
+import os\r
+sys.path.append("ProjectGenerator")\r
+\r
+try:\r
+       from asf_avrstudio5_interface import PythonFacade\r
+except ImportError:\r
+       print "The ASF project generator is missing."\r
+\r
+p = PythonFacade(os.path.abspath(__file__))\r
+p.check_extension_database_sanity(sys.argv[1])\r
+p.generate_extension_cache_files(sys.argv[1])\r
index 2e7ae56..f665922 100644 (file)
@@ -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