var os= require('os'); var path= require('path'); /** * @param logPath * @param mainModule * @param commander * @param clientRoot */ function createDojoConfig(logPath,mainModule,commander,clientRoot,debug){ var libRoot = clientRoot + '/lib/'; var dojoConfig = { libRoot:libRoot, cwd:process.cwd(), logRoot:logPath, commander:commander, clientRoot:clientRoot, has:{ 'xlog':true, 'xblox':true, "debug":debug===true ? true : false, "tests":true, "serialport":os.arch().indexOf('arm') ===-1 }, hasCache: { "host-node": 1, "host-browser":0, "dom":0, "dojo-amd-factory-scan":0, "dojo-has-api":1, "dojo-inject-api":0, "dojo-timeout-api":0, "dojo-trace-api":0, "dojo-log-api":0, "dojo-dom-ready-api":0, "dojo-publish-privates":1, "dojo-config-api":0, "dojo-sniff":1, "dojo-sync-loader":0, "dojo-test-sniff":0, "config-deferredInstrumentation":1, "config-useDeferredInstrumentation":"report-unhandled-rejections", "config-tlmSiblingOfDojo":1, 'xlog':true, 'xblox':true, 'dojo-undef-api': true, "tests":true, "serialport":os.arch().indexOf('arm') ===-1 }, trace: 1, async: 0, baseUrl: ".", packages: [ { name: "dojo", location:"dojo" }, { name: "nxappmain", location: "nxappmain" }, { name: "node", location: "node" }, { name: "nxapp", location: "nxapp" }, { name: "xcf", location: libRoot +'xcf' }, { name: "dstore", location: libRoot + 'dstore' }, { name: "xide", location: libRoot + 'xide' }, { name: "xwire", location: libRoot + 'xwire' }, { name: "dcl", location: libRoot +'dcl' }, { name: "xblox", location: libRoot + 'xblox' }, { name: "xlog", location: libRoot + 'xlog' }, { name: "xblox", location: libRoot + 'xblox' }, { name: "dstore", location: libRoot + 'dstore' }, { name: "dijit", location: libRoot + 'dijit' }, { name: "xlang", location: libRoot + 'xlang' }, { name: "xgrid", location: libRoot + 'xgrid' }, { name: "xaction", location: libRoot + 'xaction/src' }, { name: "xdojo", location: __dirname + '/compat/xdojo' }, { name: 'intern', location: path.resolve('./node_modules/intern') } ], deps: mainModule ? [mainModule] : null, map: { intern: { dojo: 'intern/browser_modules/dojo', chai: 'intern/browser_modules/chai/chai', diff: 'intern/browser_modules/diff/diff' }, '*': { 'intern/dojo': 'intern/browser_modules/dojo' } } }; return dojoConfig; } module.exports.createDojoConfig = createDojoConfig;