summaryrefslogtreecommitdiff
path: root/lib/lufa/LUFA/StudioIntegration/XDK/lufa_filelist_transform.xslt
diff options
context:
space:
mode:
authorJack Humbert2017-07-07 15:33:29 -0400
committerGitHub2017-07-07 15:33:29 -0400
commit9de443cbf10ac41bc15762c9c83f138f51dd3b9a (patch)
treed8ddcb428e0b7d9773a1e52c42b60bdca2658beb /lib/lufa/LUFA/StudioIntegration/XDK/lufa_filelist_transform.xslt
parent88b3d051b21cb1ddacc6353c5d59b19f03f3a242 (diff)
parent1c26468ad5a0701e244c99cbcbc547c93b75d515 (diff)
Merge pull request #1471 from qmk/lufa_lib
Update LUFA and move it to /lib/lufa
Diffstat (limited to 'lib/lufa/LUFA/StudioIntegration/XDK/lufa_filelist_transform.xslt')
-rw-r--r--lib/lufa/LUFA/StudioIntegration/XDK/lufa_filelist_transform.xslt35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/lufa/LUFA/StudioIntegration/XDK/lufa_filelist_transform.xslt b/lib/lufa/LUFA/StudioIntegration/XDK/lufa_filelist_transform.xslt
new file mode 100644
index 000000000..2998b879f
--- /dev/null
+++ b/lib/lufa/LUFA/StudioIntegration/XDK/lufa_filelist_transform.xslt
@@ -0,0 +1,35 @@
+<!--
+ LUFA Library
+ Copyright (C) Dean Camera, 2017.
+
+ dean [at] fourwalledcubicle [dot] com
+ www.lufa-lib.org
+-->
+
+<!-- Atmel Studio framework Module XML transform file -->
+
+<!-- Outputs a flat file list of all source files referenced in all modules of
+ the input manifest XML file, so that they can be checked for existence. -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="xml" omit-xml-declaration="yes"/>
+
+ <!-- Read manifest list, add a comment to indicate the source filename
+ and then process all ASF nodes in the referenced document -->
+ <xsl:template match="lufa-manifest">
+ <xsl:for-each select="xml-source">
+ <xsl:comment>Sourced from <xsl:value-of select="@filename"/></xsl:comment>
+ <xsl:apply-templates select="document(@filename)/lufa/asf/*"/>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Recursively match and process all nodes/attributes -->
+ <xsl:template match="@*|node()">
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:template>
+
+ <!-- Match source file nodes, output filename -->
+ <xsl:template match="build[@type='c-source']|build[@type='header-file']|build[@type='distribute']">
+ <xsl:value-of select="@value"/>
+ <xsl:text>&#xA;</xsl:text>
+ </xsl:template>
+</xsl:stylesheet>