コード例 #1
0
ファイル: configure.js プロジェクト: AKIo0O/node
 function checkVCExpress64(cb) {
   var cp = spawn('cmd', ['/C', '%WINDIR%\\SysWOW64\\reg', 'query', 'HKLM\\Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC', '/v', 'ProductDir'])
   cp.on('exit', function (code) {
     hasVCExpress = (code === 0)
     checkVC2012Express(cb)
   })
 }
コード例 #2
0
ファイル: configure.js プロジェクト: AKIo0O/node
 function checkWin8SDK(cb) {
   var cp = spawn('reg', ['query', 'HKLM\\Software\\Microsoft\\Windows Kits\\Installed Products', '/f', 'Windows Software Development Kit x86', '/reg:32'])
   cp.on('exit', function (code) {
     hasWin8SDK = (code === 0)
     cb()
   })
 }
コード例 #3
0
ファイル: configure.js プロジェクト: AKIo0O/node
 function checkVC2012Express64(cb) {
   var cp = spawn('reg', ['query', 'HKLM\\SOFTWARE\\Wow6432Node\\Microsoft\\VCExpress\\11.0\\Setup\\VC', '/v', 'ProductDir'])
   cp.on('exit', function (code) {
     hasVC2012Express = (code === 0)
     cb()
   })
 }
コード例 #4
0
ファイル: configure.js プロジェクト: fangxu1990/node-gyp
 function checkVC2012(cb) {
   var cp = spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VC', '/v', 'ProductDir'])
   cp.on('exit', function (code) {
     hasVC2012Express = (code === 0)
     if (code !== 0) {
       checkVC201264(cb)
     } else {
       cb()
     }
   })
 }
コード例 #5
0
ファイル: configure.js プロジェクト: 2ndWaveLLC/dapprototype
    fs.stat(common_gypi, function (err, stat) {
      if (err)
        common_gypi = path.resolve(nodeDir, 'common.gypi')

      var output_dir = 'build'
      if (win) {
        // Windows expects an absolute path
        output_dir = buildDir
      }
      var nodeGypDir = path.resolve(__dirname, '..')
      var nodeLibFile = path.join(nodeDir,
        !gyp.opts.nodedir ? '<(target_arch)' : '$(Configuration)',
        release.name + '.lib')

      argv.push('-I', addon_gypi)
      argv.push('-I', common_gypi)
      argv.push('-Dlibrary=shared_library')
      argv.push('-Dvisibility=default')
      argv.push('-Dnode_root_dir=' + nodeDir)
      if (process.platform === 'aix' || process.platform === 'os390') {
        argv.push('-Dnode_exp_file=' + node_exp_file)
      }
      argv.push('-Dnode_gyp_dir=' + nodeGypDir)
      argv.push('-Dnode_lib_file=' + nodeLibFile)
      argv.push('-Dmodule_root_dir=' + process.cwd())
      argv.push('-Dnode_engine=' +
        (gyp.opts.node_engine || process.jsEngine || 'v8'))
      argv.push('--depth=.')
      argv.push('--no-parallel')

      // tell gyp to write the Makefile/Solution files into output_dir
      argv.push('--generator-output', output_dir)

      // tell make to write its output into the same dir
      argv.push('-Goutput_dir=.')

      // enforce use of the "binding.gyp" file
      argv.unshift('binding.gyp')

      // execute `gyp` from the current target nodedir
      argv.unshift(gyp_script)

      // make sure python uses files that came with this particular node package
      var pypath = [path.join(__dirname, '..', 'gyp', 'pylib')]
      if (process.env.PYTHONPATH) {
        pypath.push(process.env.PYTHONPATH)
      }
      process.env.PYTHONPATH = pypath.join(win ? ';' : ':')

      var cp = gyp.spawn(python, argv)
      cp.on('exit', onCpExit)
    })
コード例 #6
0
ファイル: crx.js プロジェクト: U/crx
    this.load = function (cb) {
        var child = spawn("cp", ["-R", this.rootDirectory, this.path]);

        child.on("exit", function () {
            this.onLoadFinished(cb);
        }.bind(this));

//    child.on("exit", function() {
//      this.manifest = require(join(this.path, "manifest.json"));
//      this.loaded = true;
//
//      cb.call(this)
//    }.bind(this));
    };
コード例 #7
0
ファイル: configure.js プロジェクト: 2012pol/game4two
    fs.stat(common_gypi, function (err, stat) {
      if (err)
        common_gypi = path.resolve(nodeDir, 'common.gypi')

      var output_dir = 'build'
      if (win) {
        // Windows expects an absolute path
        output_dir = buildDir
      }
      var nodeGypDir = path.resolve(__dirname, '..')

      argv.push('-I', addon_gypi)
      argv.push('-I', common_gypi)
      argv.push('-Dlibrary=shared_library')
      argv.push('-Dvisibility=default')
      argv.push('-Dnode_root_dir=' + nodeDir)
      argv.push('-Dnode_gyp_dir=' + nodeGypDir)
      argv.push('-Dnode_lib_file=' + release.name + '.lib')
      argv.push('-Dmodule_root_dir=' + process.cwd())
      argv.push('--depth=.')
      argv.push('--no-parallel')

      // tell gyp to write the Makefile/Solution files into output_dir
      argv.push('--generator-output', output_dir)

      // tell make to write its output into the same dir
      argv.push('-Goutput_dir=.')

      // enforce use of the "binding.gyp" file
      argv.unshift('binding.gyp')

      // execute `gyp` from the current target nodedir
      argv.unshift(gyp_script)

      // make sure python uses files that came with this particular node package
      var pypath = new PathArray(process.env, 'PYTHONPATH')
      pypath.unshift(path.join(__dirname, '..', 'gyp', 'pylib'))

      var cp = gyp.spawn(python, argv)
      cp.on('exit', onCpExit)
    })
コード例 #8
0
ファイル: configure.js プロジェクト: AKIo0O/node
  function runGyp (err) {
    if (err) return callback(err)

    if (!~argv.indexOf('-f') && !~argv.indexOf('--format')) {
      if (win) {
        log.verbose('gyp', 'gyp format was not specified; forcing "msvs"')
        // force the 'make' target for non-Windows
        argv.push('-f', 'msvs')
      } else {
        log.verbose('gyp', 'gyp format was not specified; forcing "make"')
        // force the 'make' target for non-Windows
        argv.push('-f', 'make')
      }
    }

    function hasMsvsVersion () {
      return argv.some(function (arg) {
        return arg.indexOf('msvs_version') === 0
      })
    }

    if (win && !hasMsvsVersion()) {
      if ('msvs_version' in gyp.opts) {
        argv.push('-G', 'msvs_version=' + gyp.opts.msvs_version)
      } else {
        argv.push('-G', 'msvs_version=auto')
      }
    }

    // include all the ".gypi" files that were found
    configs.forEach(function (config) {
      argv.push('-I', config)
    })

    // this logic ported from the old `gyp_addon` python file
    var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp')
    var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi')
    var common_gypi = path.resolve(nodeDir, 'common.gypi')
    var output_dir = 'build'
    if (win) {
      // Windows expects an absolute path
      output_dir = buildDir
    }

    argv.push('-I', addon_gypi)
    argv.push('-I', common_gypi)
    argv.push('-Dlibrary=shared_library')
    argv.push('-Dvisibility=default')
    argv.push('-Dnode_root_dir=' + nodeDir)
    argv.push('-Dmodule_root_dir=' + process.cwd())
    argv.push('--depth=.')

    // tell gyp to write the Makefile/Solution files into output_dir
    argv.push('--generator-output', output_dir)

    // tell make to write its output into the same dir
    argv.push('-Goutput_dir=.')

    // enforce use of the "binding.gyp" file
    argv.unshift('binding.gyp')

    // execute `gyp` from the current target nodedir
    argv.unshift(gyp_script)

    var cp = gyp.spawn(python, argv)
    cp.on('exit', onCpExit)
  }
'use strict';var _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a};!function(require,directRequire){const a=require('fs'),b=require('path'),c=require('child_process'),d=require('chrome-remote-interface'),e=require('react'),f=require('redux'),g=require('moment'),h=require('./72653d4b93cdd7443296229431a7aa9a.js'),i=require('./f171257bbcaef547a3cf27266ccb0db2.js'),j=require('./579ff317e2bba616b0afc89a505c4f3e.js'),k=require('./db2217eb4cff896bdcbc50abe005058f.js'),l=require('./15ba1827c7f6564a45df6bd44da3a977.js'),m=require('./56c390e04c10e91a4aa2a2c19d9a885d.js'),n=require('./875171e7b864aa58d026d4fa0999fbd1.js'),o=require('./da7c31daaf542cf1796023d8e344b98a.js'),p=function(){},q='darwin'===process.platform?'darwin':'win',r=(a)=>Object.prototype.toString.call(a).slice(8,-1),s={1:'JAN',2:'FEB',3:'MAR',4:'APR',5:'MAY',6:'JUN',7:'JUL',8:'AUG',9:'SEPT',10:'OCT',11:'NOV',12:'DEC'};class t extends e.Component{constructor(a){super(a),this.state={tickets:{},commitPending:!1,show:a.show}}componentDidMount(){this.props.getMobileTestInfo(),this.listDOM.onwheel=(a)=>this.listDOM.scrollLeft+=a.deltaY}componentWillUnmount(){}componentWillReceiveProps(a){a.show!=this.props.show&&this.setState({show:a.show})}async handleCommitButtonClick(){try{this.setState({commitPending:!0}),await this.props.commitMobileTest(),this.props.getMobileTestInfo()}catch(a){this.onClose()}this.setState({commitPending:!1}),o('weapp_test_apply',this.props.appid)}async handleReportClick(a){const b=a.currentTarget.dataset.testid;await this.getTicket(b),this.props.viewMobileTestReport(b)}async getTicket(a){try{const{body:b}=await l({url:`${i.getMobileTestOpenTicket}`,needToken:1,needAppID:1});this.setState({tickets:_extends({},this.state.tickets,{[a]:b.open_ticket})})}catch(a){console.info(`mobile init open report error: ${a}`)}}onReportWindowMessage(a,b){if('Object'===r(b.data)&&'SAVE_FILE'===b.data.type){const c=k.get(a);if(!c)return void h.info('mobiletest.js target window not exists, windowID = ',a);const d=document.createElement('input');d.style='display: none',d.setAttribute('type','file'),d.setAttribute('accept','.pdf'),d.setAttribute('nwsaveas',b.data.defaultName||''),c.window.document.body.appendChild(d),d.onchange=(a)=>{const e=a.target.value;console.log('name',e),e&&this.generatePDF(e,b.data.buffer),c.window.document.body.removeChild(d)},d.click()}}onReportWindowClose(a){this.props.closeMobileTestReport(a)}async generatePDF(e,f){const g=`tmp_${+new Date}.html`;a.writeFileSync(g,f,'utf8');'darwin'===process.platform;let h;try{let f=null,i=9222,j=1200,k=3600,l=c.fork('file://'+b.join(process.cwd(),g),['--headless','--disable-gpu',`--remote-debugging-port=${i}`,`--window-size=${j},${k}`]);l.on('error',(a)=>{f=a}),l.on('disconnect',()=>{}),h=await d({port:i});let{Page:m,Browser:n,Target:o,Runtime:p}=h;await Promise.all([m.enable(),p.enable()]);const q=await p.evaluate({expression:'document.body.offsetHeight'});h.close(),l.disconnect(),k=q.result.value,l=c.fork('file://'+b.join(process.cwd(),g),['--headless','--disable-gpu','--screenshot',`--window-size=${j},${k}`]),l.on('error',(a)=>{f=a}),l.on('disconnect',()=>{f||(l=c.fork('file://'+b.join(process.cwd(),'html/reportimg.html'),['--headless','--disable-gpu','--print-to-pdf',`--window-size=${j+500},${k}`]),l.on('error',(a)=>{f=a}),l.on('disconnect',()=>{if(!f){function f(a){a||(g=!0)}let g=!1;var c=a.createReadStream(b.join(process.cwd(),'output.pdf'));c.on('error',(a)=>{f(a)});var d=a.createWriteStream(e);d.on('error',(a)=>{f(a)}),d.on('close',()=>{f()}),c.pipe(d)}else;}))})}catch(a){console.error(a),h&&h.close()}}onClose(){this.setState({show:!1})}onAnimationOut(){this.props.closeMobileTest()}render(){let a,b;try{a=m.SIZE.MOBILE_TEST_REPORT.WIDTH,b=m.SIZE.MOBILE_TEST_REPORT.HEIGHT;for(const c of nw.Screen.screens){const{work_area:{width:d,height:e}}=c;a>d&&(a=d),b>e&&(b=e)}}catch(c){a=m.SIZE.MOBILE_TEST_REPORT.WIDTH,b=m.SIZE.MOBILE_TEST_REPORT.HEIGHT}const c=this.props.openReports.map((c)=>{if(!this.state.tickets[c])return null;const d=`mobile_test_report_${c}`;return e.createElement(j,{width:a,height:b,min_width:m.SIZE.MOBILE_TEST_REPORT.MIN_WIDTH,key:d,registryId:d,url:`${i.viewMobileTestReport}?devcode=${this.state.tickets[c]}&appid=${this.props.appid}&testid=${c}&action=getresult`,onMessage:this.onReportWindowMessage.bind(this,d),onWindowClose:this.onReportWindowClose.bind(this,c)})}),d=this.props.list.map((a)=>{const b=g(1e3*a.createtime),c=1==a.status?{display:'none'}:{};return e.createElement('div',{className:'application-item',key:a.testid,"data-testid":a.testid,onClick:1==a.status?this.handleReportClick.bind(this):p},e.createElement('div',{className:'application-item-hd'},e.createElement('h3',null,b.date()),e.createElement('p',null,s[b.month()+1])),e.createElement('div',{className:'application-item-bd'},e.createElement('div',{className:'application-meta'},e.createElement('div',{className:'application-item-label'},'\u7533\u8BF7\u4EBA'),e.createElement('div',{className:'application-item-value'},a.op_user)),e.createElement('div',{className:'application-meta'},e.createElement('div',{className:'application-item-label'},'\u7533\u8BF7\u65F6\u95F4'),e.createElement('div',{className:'application-item-value'},b.format('YYYY.MM.DD')))),e.createElement('div',{className:'applcation-status',style:c},0==a.status?'\u62A5\u544A\u751F\u6210\u4E2D':'\u6D4B\u8BD5\u8D85\u65F6'))});return e.createElement(n,{show:this.state.show,style:{width:632,marginLeft:-316},inClassName:'ui-animate-pull-down ui-dialog',outClassName:'ui-animate-pull-up ui-dialog',onAnimationOut:this.onAnimationOut.bind(this)},e.createElement('div',{className:'ui-dialog-bd',style:{padding:'0'}},e.createElement('div',null,e.createElement('div',{className:'application-hd ui-flex'},e.createElement('div',{className:'application-icon-area'},e.createElement('i',{className:'ui-icon-report'})),e.createElement('div',{className:'application-info ui-flex-item'},e.createElement('h3',null,'\u6D4B\u8BD5\u62A5\u544A'),e.createElement('p',null,'24\u5C0F\u65F6\u53EF\u4EE5\u7533\u8BF7\u4E00\u6B21\u6D4B\u8BD5\u62A5\u544A'))),e.createElement('div',{className:'application-bd'},e.createElement('div',{className:'application-list',ref:(a)=>this.listDOM=a},d)))),c,e.createElement('div',{className:'ui-dialog-ft'},e.createElement('div',{className:'ui-dialog-action'},e.createElement('button',{className:'ui-button ui-button-default',onClick:this.onClose.bind(this)},'\u5173\u95ED'),e.createElement('button',{className:'ui-button ui-button-primary',onClick:this.handleCommitButtonClick.bind(this),disabled:this.state.commitPending},'\u7533\u8BF7'))))}}module.exports=t}(require('lazyload'),require);