Add transform to update the VSIX extension version automatically when built.

pull/1469/head
Dean Camera 12 years ago
parent 78e6e4f4c2
commit fbab860902

@ -8,8 +8,8 @@
<MoreInfoUrl>http://www.lufa-lib.org</MoreInfoUrl> <MoreInfoUrl>http://www.lufa-lib.org</MoreInfoUrl>
<Description xml:space="preserve">LUFA USB Framework</Description> <Description xml:space="preserve">LUFA USB Framework</Description>
<Icon>LUFA\DoxygenPages\Images\LUFA_thumb.png</Icon> <Icon>LUFA\DoxygenPages\Images\LUFA_thumb.png</Icon>
<PreviewImage>LUFA\DoxygenPages\Images\LUFA.png</PreviewImage> <PreviewImage>LUFA\DoxygenPages\Images\LUFA.png</PreviewImage>
<SupportedProducts> <SupportedProducts>
<IsolatedShell Version="6.1">AtmelStudio</IsolatedShell> <IsolatedShell Version="6.1">AtmelStudio</IsolatedShell>

@ -0,0 +1,32 @@
<!--
LUFA Library
Copyright (C) Dean Camera, 2013.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
-->
<!-- Atmel Studio framework VSIX XML transform file -->
<!-- -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vs="http://schemas.microsoft.com/developer/vsx-schema/2010" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<!-- Need to input the extension version for later use -->
<xsl:param name="extension-version"/>
<!-- Recursively match and copy/process all nodes/attributes -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- Update the extension version to the version of LUFA being used -->
<xsl:template match="vs:Version">
<xsl:copy>
<xsl:value-of select="$extension-version"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

@ -16,6 +16,7 @@ EXTENSION_OUTPUT_XML := $(LUFA_ROOT)/../extension.xml
MODULE_OUTPUT_XML := $(LUFA_ROOT)/asf.xml MODULE_OUTPUT_XML := $(LUFA_ROOT)/asf.xml
XML_FILES := $(filter-out $(TEMP_MANIFEST_FILE), $(shell ls *.xml)) XML_FILES := $(filter-out $(TEMP_MANIFEST_FILE), $(shell ls *.xml))
LUFA_VERSION_NUM := $(shell grep LUFA_VERSION_STRING $(LUFA_ROOT)/Version.h | cut -d'"' -f2) LUFA_VERSION_NUM := $(shell grep LUFA_VERSION_STRING $(LUFA_ROOT)/Version.h | cut -d'"' -f2)
EXT_VERSION_NUM := $(shell date +"%y.%m.%d").$(LUFA_VERSION_NUM)
all: check_filenames generate_xml generate_vsix all: check_filenames generate_xml generate_vsix
@ -45,10 +46,9 @@ generate_xml: $(TEMP_MANIFEST_XML)
@xsltproc XSLT/lufa_extension_transform.xslt $< | xsltproc XSLT/lufa_indent_transform.xslt - > $(EXTENSION_OUTPUT_XML) @xsltproc XSLT/lufa_extension_transform.xslt $< | xsltproc XSLT/lufa_indent_transform.xslt - > $(EXTENSION_OUTPUT_XML)
@echo "Atmel Studio extension.xml file generated." @echo "Atmel Studio extension.xml file generated."
@rm $(TEMP_MANIFEST_XML)
generate_vsix: $(EXTENSION_OUTPUT_XML) $(MODULE_OUTPUT_XML) generate_vsix: $(EXTENSION_OUTPUT_XML) $(MODULE_OUTPUT_XML)
cp VSIX/* $(LUFA_ROOT)/../ cp "VSIX/[Content_Types].xml" $(LUFA_ROOT)/../
xsltproc --stringparam extension-version $(EXT_VERSION_NUM) XSLT/lufa_vsmanifest_transform.xslt VSIX/extension.vsixmanifest > $(LUFA_ROOT)/../extension.vsixmanifest
cd $(LUFA_ROOT)/../; zip LUFA_AS_Extension.vsix -r --exclude=*StudioIntegration* * cd $(LUFA_ROOT)/../; zip LUFA_AS_Extension.vsix -r --exclude=*StudioIntegration* *
check_filenames: $(TEMP_MANIFEST_XML) check_filenames: $(TEMP_MANIFEST_XML)

Loading…
Cancel
Save