Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
task('test', function () {
// TODO: use a testing suite for testing: nodeunit, mocha, tap, ...
var filelist = new jake.FileList();
filelist.include([
'./test/**/*.js'
]);
var files = filelist.toArray();
files.forEach(function (file) {
require('./' + file);
});
console.log('Executed ' + files.length + ' test files successfully');
});
separator: '\n'
});
console.log('Created ' + JSONEDITOR_CSS);
// minify the css file
write(JSONEDITOR_CSS_MIN, new CleanCSS().minify(String(read(JSONEDITOR_CSS))));
// create a folder img and copy the icons
jake.mkdirP('./img');
jake.cpR(jsoneditorSrc + 'css/img/jsoneditor-icons.png', './img/');
console.log('Copied jsoneditor-icons.png to ./img/');
// copy assets
// concatenate and copy ace files
var aceSrc = './node_modules/ace/build/src-min/';
jake.mkdirP(BUILD_ACE);
concat({
src: [
aceSrc + 'ace.js',
aceSrc + 'ext-searchbox.js',
aceSrc + 'mode-json.js',
aceSrc + 'theme-textmate.js',
jsoneditorSrc + 'js/ace/theme-jsoneditor.js'
],
dest: BUILD_ACE + 'ace.js',
separator: '\n'
});
jake.cpR(aceSrc + 'worker-json.js', BUILD_ACE);
// copy and minify json lint file
jake.mkdirP(BUILD_JSONLINT);
minify({
src: [
jsoneditorSrc + 'css/jsoneditor.css',
jsoneditorSrc + 'css/contextmenu.css',
jsoneditorSrc + 'css/menu.css',
jsoneditorSrc + 'css/searchbox.css'
],
dest: JSONEDITOR_CSS,
separator: '\n'
});
console.log('Created ' + JSONEDITOR_CSS);
// minify the css file
write(JSONEDITOR_CSS_MIN, new CleanCSS().minify(String(read(JSONEDITOR_CSS))));
// create a folder img and copy the icons
jake.mkdirP('./img');
jake.cpR(jsoneditorSrc + 'css/img/jsoneditor-icons.png', './img/');
console.log('Copied jsoneditor-icons.png to ./img/');
// copy assets
// concatenate and copy ace files
var aceSrc = './node_modules/ace/build/src-min/';
jake.mkdirP(BUILD_ACE);
concat({
src: [
aceSrc + 'ace.js',
aceSrc + 'ext-searchbox.js',
aceSrc + 'mode-json.js',
aceSrc + 'theme-textmate.js',
jsoneditorSrc + 'js/ace/theme-jsoneditor.js'
],
dest: BUILD_ACE + 'ace.js',
'cp -r dist/lib/* ' + mapbb,
'cat ' + mapbb + 'override.css dist/lib/leaflet.css > ' + mapbb + 'leaflet.css',
'rm ' + mapbb + 'override.css',
'cp -r dist/lang ' + mapbb,
'cp -r src/layers ' + mapbb + 'proprietary',
'mv ' + mapbb + 'proprietary/LayerList.js ' + mapbb,
'cp src/handlers/Handler.Length.js ' + mapbb,
'cp dist/mapbbcode.js ' + mapbb,
'cp dist/mapbbcode-config.js ' + mapbb,
'cp dist/mapbbcode-window.html ' + mapbb,
'rm -f dist/' + archive,
'cd ' + target + '; zip -r ../' + archive + ' *',
'rm -r ' + target
];
console.log('Creating ' + archive + '...');
jake.exec(commands);
};
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
var jake = require('jake');
var args = process.argv.slice(2);
jake.addListener('complete', function () {
console.log('Complete.');
});
jake.addListener('start', function () {
console.log('start.');
});
jake.addListener('error', function (msg, code) {
console.error('Fatal error: ', msg, code);
});
jake.run.apply(jake, args);
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
var jake = require('jake');
var args = process.argv.slice(2);
jake.addListener('complete', function () {
console.log('Complete.');
});
jake.addListener('start', function () {
console.log('start.');
});
jake.addListener('error', function (msg, code) {
console.error('Fatal error: ', msg, code);
});
jake.run.apply(jake, args);
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
var jake = require('jake');
var args = process.argv.slice(2);
jake.addListener('complete', function () {
console.log('Complete.');
});
jake.addListener('start', function () {
console.log('start.');
});
jake.addListener('error', function (msg, code) {
console.error('Fatal error: ', msg, code);
});
jake.run.apply(jake, args);
jsoneditorSrc + 'css/jsoneditor.css',
jsoneditorSrc + 'css/contextmenu.css',
jsoneditorSrc + 'css/menu.css',
jsoneditorSrc + 'css/searchbox.css'
],
dest: JSONEDITOR_CSS,
separator: '\n'
});
console.log('Created ' + JSONEDITOR_CSS);
// minify the css file
write(JSONEDITOR_CSS_MIN, new CleanCSS().minify(String(read(JSONEDITOR_CSS))));
// create a folder img and copy the icons
jake.mkdirP('./img');
jake.cpR(jsoneditorSrc + 'css/img/jsoneditor-icons.png', './img/');
console.log('Copied jsoneditor-icons.png to ./img/');
// copy assets
// concatenate and copy ace files
var aceSrc = './node_modules/ace/build/src-min/';
jake.mkdirP(BUILD_ACE);
concat({
src: [
aceSrc + 'ace.js',
aceSrc + 'ext-searchbox.js',
aceSrc + 'mode-json.js',
aceSrc + 'theme-textmate.js',
jsoneditorSrc + 'js/ace/theme-jsoneditor.js'
],
dest: BUILD_ACE + 'ace.js',
separator: '\n'
if (!(params.options instanceof Object)) {
throw new Error('Parameter "options" must be an object.');
}
}
var code = '';
var separator = params.separator ? String(params.separator) : '';
var options = params.options || {};
// header
if (params.header) {
code += String(params.header) + separator;
}
// src
var filelist = new jake.FileList();
filelist.include(params.src);
var filenames = filelist.toArray();
var minified = uglify.minify(filenames, options);
code += minified.code;
// footer
if (params.footer) {
code += separator + String(params.footer);
}
// write output
if (params.dest) {
write(params.dest, code);
}
return {
}
finally
{
p.stdin.close();
p.stdout.close();
p.stderr.close();
}
return fileContents;
}
// Preprocess contents into fragments.
// FIXME: should calculate relative path, etc.
try
{
var sources = new JAKE.FileList("**/*.j"),
translateFilenameToPath = {},
otherwayTranslateFilenameToPath = {};
// Create a filename to filename path dictionary. (For example: CPArray.j -> CPArray/CPArray.j)
sources.forEach(function(/*String*/ aFilename)
{
translateFilenameToPath[FILE.basename(aFilename)] = aFilename;
otherwayTranslateFilenameToPath[aFilename] = FILE.basename(aFilename);
}, this);
var translatedFilename = translateFilenameToPath[aFilePath] ? translateFilenameToPath[aFilePath] : aFilePath,
otherwayTranslatedFilename = otherwayTranslateFilenameToPath[aFilePath] ? otherwayTranslateFilenameToPath[aFilePath] : aFilePath,
theTranslatedFilename = otherwayTranslatedFilename ? otherwayTranslatedFilename : translatedFilename,
absolutePath = FILE.absolute(theTranslatedFilename),
basePath = absolutePath.substring(0, absolutePath.length - theTranslatedFilename.length);