Skip to content

Commit

Permalink
Strip out glsl doc for JsDoc to process.
Browse files Browse the repository at this point in the history
  • Loading branch information
kristiancalhoun committed Jun 27, 2012
1 parent 6bd9d16 commit e3e4c94
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ for (var i = 0; i < filesets.size(); i++) {
var basedir = fileset.getDir(project);
var filenames = fileset.getDirectoryScanner(project).getIncludedFiles();
var glslDoc = "";
for (var j = 0; j < filenames.length; j++) {
var filename = filenames[j];
Expand All @@ -130,7 +132,12 @@ for (var i = 0; i < filesets.size(); i++) {
reader.close();
contents = contents.replace(/\r\n/gm, '\n');
var docComments = contents.match(/\/\*\*[\s\S]*?\*\//gm) || [];
if (docComments.length > 0) {
glslDoc = glslDoc + docComments.join('\n');
}
var copyrightComments = contents.match(/\/\*\!(?:.|\n)*?\*\//gm) || [];
if (stripComments) {
Expand All @@ -151,6 +158,11 @@ for (var i = 0; i < filesets.size(); i++) {
writer.write(contents);
writer.close();
}
var glslDocFile = new File(destination, 'glslComments.js');
var glslDocWriter = new FileWriter(glslDocFile);
glslDocWriter.write(glslDoc);
glslDocWriter.close();
}
]]>
</scriptdef>
Expand Down

0 comments on commit e3e4c94

Please sign in to comment.