add ability to run makefile.dryice.js from another directory
This commit is contained in:
parent
61aa47bc85
commit
2ebf57e3d1
1 changed files with 24 additions and 24 deletions
|
|
@ -43,7 +43,7 @@ if (!fs.existsSync)
|
||||||
var copy = require('dryice').copy;
|
var copy = require('dryice').copy;
|
||||||
|
|
||||||
var ACE_HOME = __dirname;
|
var ACE_HOME = __dirname;
|
||||||
var BUILD_DIR = "build";
|
var BUILD_DIR = ACE_HOME + "/build";
|
||||||
|
|
||||||
function main(args) {
|
function main(args) {
|
||||||
var type = "minimal";
|
var type = "minimal";
|
||||||
|
|
@ -146,20 +146,20 @@ function ace() {
|
||||||
console.log('# ace License | Readme | Changelog ---------');
|
console.log('# ace License | Readme | Changelog ---------');
|
||||||
|
|
||||||
copy({
|
copy({
|
||||||
source: "build_support/editor.html",
|
source: ACE_HOME + "/build_support/editor.html",
|
||||||
dest: "build/editor.html"
|
dest: BUILD_DIR + "/editor.html"
|
||||||
});
|
});
|
||||||
copy({
|
copy({
|
||||||
source: ACE_HOME + "/LICENSE",
|
source: ACE_HOME + "/LICENSE",
|
||||||
dest: "build/LICENSE"
|
dest: BUILD_DIR + "/LICENSE"
|
||||||
});
|
});
|
||||||
copy({
|
copy({
|
||||||
source: ACE_HOME + "/Readme.md",
|
source: ACE_HOME + "/Readme.md",
|
||||||
dest: "build/Readme.md"
|
dest: BUILD_DIR + "/Readme.md"
|
||||||
});
|
});
|
||||||
copy({
|
copy({
|
||||||
source: ACE_HOME + "/ChangeLog.txt",
|
source: ACE_HOME + "/ChangeLog.txt",
|
||||||
dest: "build/ChangeLog.txt"
|
dest: BUILD_DIR + "/ChangeLog.txt"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,8 +168,8 @@ function demo() {
|
||||||
|
|
||||||
var version, ref;
|
var version, ref;
|
||||||
try {
|
try {
|
||||||
version = JSON.parse(fs.readFileSync(__dirname + "/package.json")).version;
|
version = JSON.parse(fs.readFileSync(ACE_HOME + "/package.json")).version;
|
||||||
ref = fs.readFileSync(__dirname + "/.git-ref").toString();
|
ref = fs.readFileSync(ACE_HOME + "/.git-ref").toString();
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
ref = "";
|
ref = "";
|
||||||
version = "";
|
version = "";
|
||||||
|
|
@ -186,7 +186,7 @@ function demo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
copy({
|
copy({
|
||||||
source: "kitchen-sink.html",
|
source: ACE_HOME + "/kitchen-sink.html",
|
||||||
dest: BUILD_DIR + "/kitchen-sink.html",
|
dest: BUILD_DIR + "/kitchen-sink.html",
|
||||||
filter: [changeComments, function(data) {
|
filter: [changeComments, function(data) {
|
||||||
return data.replace(/"(demo|build)\//g, "\"");
|
return data.replace(/"(demo|build)\//g, "\"");
|
||||||
|
|
@ -194,21 +194,21 @@ function demo() {
|
||||||
});
|
});
|
||||||
|
|
||||||
copy({
|
copy({
|
||||||
source: "demo/kitchen-sink/styles.css",
|
source: ACE_HOME + "/demo/kitchen-sink/styles.css",
|
||||||
dest: BUILD_DIR + "/kitchen-sink/styles.css",
|
dest: BUILD_DIR + "/kitchen-sink/styles.css",
|
||||||
filter: [ changeComments ]
|
filter: [ changeComments ]
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.readdirSync("demo/kitchen-sink/docs/").forEach(function(x) {
|
fs.readdirSync(ACE_HOME +"/demo/kitchen-sink/docs/").forEach(function(x) {
|
||||||
copy({
|
copy({
|
||||||
source: "demo/kitchen-sink/docs/" + x,
|
source: ACE_HOME +"/demo/kitchen-sink/docs/" + x,
|
||||||
dest: BUILD_DIR + "/kitchen-sink/docs/" + x
|
dest: BUILD_DIR + "/kitchen-sink/docs/" + x
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var demo = copy.createDataObject();
|
var demo = copy.createDataObject();
|
||||||
copy({
|
copy({
|
||||||
source: "demo/kitchen-sink/demo.js",
|
source: ACE_HOME + "/demo/kitchen-sink/demo.js",
|
||||||
dest: demo,
|
dest: demo,
|
||||||
filter: [changeComments, function(data) {
|
filter: [changeComments, function(data) {
|
||||||
return data.replace(/"(demo|build)\//g, "\"");
|
return data.replace(/"(demo|build)\//g, "\"");
|
||||||
|
|
@ -217,7 +217,7 @@ function demo() {
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
copy({
|
copy({
|
||||||
source: "lib/ace/split.js",
|
source: ACE_HOME + "/lib/ace/split.js",
|
||||||
dest: demo,
|
dest: demo,
|
||||||
filter: [changeComments, function(data) {
|
filter: [changeComments, function(data) {
|
||||||
return data.replace("define(", "define('ace/split',");
|
return data.replace("define(", "define('ace/split',");
|
||||||
|
|
@ -228,7 +228,7 @@ function demo() {
|
||||||
dest: BUILD_DIR + "/kitchen-sink/demo.js",
|
dest: BUILD_DIR + "/kitchen-sink/demo.js",
|
||||||
});
|
});
|
||||||
|
|
||||||
copyFileSync("demo/kitchen-sink/logo.png", BUILD_DIR + "/kitchen-sink/logo.png");
|
copyFileSync(ACE_HOME + "/demo/kitchen-sink/logo.png", BUILD_DIR + "/kitchen-sink/logo.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildAce(options) {
|
function buildAce(options) {
|
||||||
|
|
@ -246,13 +246,13 @@ function buildAce(options) {
|
||||||
noconflict: false,
|
noconflict: false,
|
||||||
suffix: null,
|
suffix: null,
|
||||||
name: "ace",
|
name: "ace",
|
||||||
modes: fs.readdirSync("lib/ace/mode").map(function(x) {
|
modes: fs.readdirSync(ACE_HOME + "/lib/ace/mode").map(function(x) {
|
||||||
if (x.slice(-3) == ".js" && !/_highlight_rules|_test|_worker|xml_util|_outdent|behaviour/.test(x))
|
if (x.slice(-3) == ".js" && !/_highlight_rules|_test|_worker|xml_util|_outdent|behaviour/.test(x))
|
||||||
return x.slice(0, -3);
|
return x.slice(0, -3);
|
||||||
}).filter(function(x){return !!x}),
|
}).filter(function(x) { return !!x; }),
|
||||||
themes: fs.readdirSync("lib/ace/theme").map(function(x){
|
themes: fs.readdirSync(ACE_HOME + "/lib/ace/theme").map(function(x){
|
||||||
return x.slice(-3) == ".js" && x.slice(0, -3)
|
return x.slice(-3) == ".js" && x.slice(0, -3);
|
||||||
}).filter(function(x){return !!x}),
|
}).filter(function(x){ return !!x; }),
|
||||||
workers: ["javascript", "coffee", "css", "json", "xquery"],
|
workers: ["javascript", "coffee", "css", "json", "xquery"],
|
||||||
keybindings: ["vim", "emacs"]
|
keybindings: ["vim", "emacs"]
|
||||||
};
|
};
|
||||||
|
|
@ -297,7 +297,7 @@ function buildAce(options) {
|
||||||
var project = copy.createCommonJsProject(aceProject);
|
var project = copy.createCommonJsProject(aceProject);
|
||||||
var ace = copy.createDataObject();
|
var ace = copy.createDataObject();
|
||||||
copy({
|
copy({
|
||||||
source: ["build_support/mini_require.js"],
|
source: [ACE_HOME + "/build_support/mini_require.js"],
|
||||||
dest: ace
|
dest: ace
|
||||||
});
|
});
|
||||||
copy({
|
copy({
|
||||||
|
|
@ -344,7 +344,7 @@ function buildAce(options) {
|
||||||
dest: targetDir + "/theme-" + theme + ".js"
|
dest: targetDir + "/theme-" + theme + ".js"
|
||||||
});*/
|
});*/
|
||||||
// use this instead, to not create separate modules for js and css
|
// use this instead, to not create separate modules for js and css
|
||||||
var themePath = "lib/ace/theme/" + theme
|
var themePath = ACE_HOME + "/lib/ace/theme/" + theme
|
||||||
var js = fs.readFileSync(themePath + ".js", "utf8");
|
var js = fs.readFileSync(themePath + ".js", "utf8");
|
||||||
js = js.replace("define(", "define('ace/theme/" + theme + "', ['require', 'exports', 'module', 'ace/lib/dom'], ");
|
js = js.replace("define(", "define('ace/theme/" + theme + "', ['require', 'exports', 'module', 'ace/lib/dom'], ");
|
||||||
|
|
||||||
|
|
@ -364,8 +364,8 @@ function buildAce(options) {
|
||||||
options.keybindings.forEach(function(keybinding) {
|
options.keybindings.forEach(function(keybinding) {
|
||||||
copy({
|
copy({
|
||||||
source: [{
|
source: [{
|
||||||
project: cloneProject(project),
|
project: cloneProject(project),
|
||||||
require: [ 'ace/keyboard/' + keybinding ]
|
require: [ 'ace/keyboard/' + keybinding ]
|
||||||
}],
|
}],
|
||||||
filter: filters,
|
filter: filters,
|
||||||
dest: targetDir + "/keybinding-" + keybinding + ".js"
|
dest: targetDir + "/keybinding-" + keybinding + ".js"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue