VulpesOS/gaia/build/raptor-test-transformer.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

32 lines
977 B
JavaScript
Executable file

'use strict';
/**
* Overview:
*
* 1. Find all '.js' files in the app directory
* 2. Replace the path with the '.esp.js' one
* 3. Check if such file exists
* 4. Run this transformer + espect to apply the esp file on to target file
*/
var utils = require('./utils');
exports.execute = function(options) {
var webapp = options.webapp;
var debuguypath = options.RAPTOR_TRANSFORMER_PATH;
if (!debuguypath) {
debuguypath = utils.joinPath(options.GAIA_DIR, 'node_modules', 'debuguy');
}
var file = utils.getFile(debuguypath);
if (!file.exists()) {
throw new Error('Cannot find debuguy: set the path of tool as DEBUGUY');
}
var debuguyclipath = utils.joinPath(debuguypath, 'cli.js');
var node = new utils.Commander('node');
node.initPath(utils.getEnvPath());
node.run([debuguyclipath, 'autolog', '--x-espect=' +
utils.joinPath(options.GAIA_DIR, 'build', 'raptor-test-transformer.esp.js'),
'--r',
webapp.buildDirectoryFilePath]);
};