diff --git a/Gruntfile.js b/Gruntfile.js index 956971e76..97fa3d1b6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -312,7 +312,7 @@ module.exports = function(grunt) { "c1pxsl": { files: [ { - cwd: "./modules/shared/templates/", + cwd: "modules/shared/templates/", src: ["common.css", "common.xsl", "document.css", "document.xsl", "machine.xsl", "manifest.xsl", "outline.xsl"], dest: "versions/c1pjs/<%= pkg.version %>/", expand: true @@ -330,7 +330,7 @@ module.exports = function(grunt) { "pcxsl": { files: [ { - cwd: "./modules/shared/templates/", + cwd: "modules/shared/templates/", src: ["common.css", "common.xsl", "document.css", "document.xsl", "machine.xsl", "manifest.xsl", "outline.xsl"], dest: "versions/pcjs/<%= pkg.version %>/", expand: true @@ -348,7 +348,7 @@ module.exports = function(grunt) { "c1pjs": { files: [ { - cwd: "./modules/c1pjs/templates/", + cwd: "modules/c1pjs/templates/", src: ["components.*"], dest: "versions/c1pjs/<%= pkg.version %>/", expand: true @@ -365,7 +365,7 @@ module.exports = function(grunt) { "pcjs": { files: [ { - cwd: "./modules/pcjs/templates/", + cwd: "modules/pcjs/templates/", src: ["components.*"], dest: "versions/pcjs/<%= pkg.version %>/", expand: true @@ -393,6 +393,48 @@ module.exports = function(grunt) { return content.replace(/\/versions\/\{\$APPCLASS}\/\{\$APPVERSION}\//g, ""); } } + }, + "manifests": { + files: [ + { + cwd: "disks/pc/", + src: ["library.xml", "samples.xml"], + dest: "disks/pc/compiled/", + expand: true + } + ], + options: { + process: function(content, srcPath) { + var contentOrig = content; + var reManifest = /([ \t]*)/g, matchManifest; + while ((matchManifest = reManifest.exec(contentOrig))) { + var sManifest = grunt.file.read(path.join('.', matchManifest[2])); + if (!sManifest) continue; + var sDefaultName = "", match; + match = sManifest.match(/(.*?)<\/title>/); + if (match) { + sDefaultName = match[1]; + match = sManifest.match(/(.*?)<\/version>/); + if (match) sDefaultName += ' ' + match[1]; + } + var reDisk, matchDisk, sDisks = ""; + reDisk = //g; + while ((matchDisk = reDisk.exec(sManifest))) { + if (sDisks) sDisks += "\n"; + sDisks += matchManifest[1] + "" + sDefaultName + ""; + } + reDisk = /([\S\s]*?)<\/disk>/g; + while ((matchDisk = reDisk.exec(sManifest))) { + if (sDisks) sDisks += "\n"; + var matchName = matchDisk[2].match(/(.*?)<\/name>/); + var sName = matchName && matchName[1] || sDefaultName; + sDisks += matchManifest[1] + "" + sName + ""; + } + content = content.replace(matchManifest[0], sDisks); + } + return content; + } + } } }, run: { diff --git a/devices/pc/machine/5150/cga/384kb/softkbd/machine.xml b/devices/pc/machine/5150/cga/384kb/softkbd/machine.xml index 7e3ad6baf..d5c3c3e4a 100644 --- a/devices/pc/machine/5150/cga/384kb/softkbd/machine.xml +++ b/devices/pc/machine/5150/cga/384kb/softkbd/machine.xml @@ -11,7 +11,7 @@