How to use the xdl.Project.stopAsync function in xdl

To help you get started, we’ve selected a few xdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NervJS / taro / packages / taro-rn-runner / src / util / packager.js View on Github external
async function cleanUpPackager (projectDir) {
  const result = await Promise.race([
    Project.stopAsync(projectDir),
    new Promise((resolve, reject) => setTimeout(resolve, 1000, 'stopFailed'))
  ])

  if (result === 'stopFailed') {
    // find RN packager pid, attempt to kill manually
    try {
      const { packagerPid } = await ProjectSettings.readPackagerInfoAsync(projectDir)
      process.kill(packagerPid)
    } catch (e) {
      process.exit(1)
    }
  }
}
github react-community / create-react-native-app / react-native-scripts / src / util / packager.js View on Github external
async function cleanUpPackager(projectDir) {
  const result = await Promise.race([
    Project.stopAsync(projectDir),
    new Promise((resolve, reject) => setTimeout(resolve, 1000, 'stopFailed')),
  ]);

  if (result === 'stopFailed') {
    // find RN packager pid, attempt to kill manually
    try {
      const { packagerPid } = await ProjectSettings.readPackagerInfoAsync(projectDir);
      process.kill(packagerPid);
    } catch (e) {
      process.exit(1);
    }
  }
}
github expo / xde / src / ui / MainScreen.js View on Github external
_stopProjectAsync = async projectRoot => {
    if (!this.state.projectRoot) {
      return false;
    }

    this._currentOpenProjectXDEId++;

    // Send projectRoot to main process.
    ipcRenderer.send('project-closed', projectRoot);

    try {
      await Project.stopAsync(projectRoot);
      this._logInfo('Project closed.');
      this.setState({
        projectSettings: null,
        projectRoot: null,
        projectJson: null,
        computedUrl: null,
        isProjectRunning: false,
        expJson: null,
        logs: [],
        connectedDevices: {},
        focusedConnectedDeviceId: null,
      });
      this._resetLocalProperties();

      return true;
    } catch (err) {
github expo / xde / src / ui / App.js View on Github external
_stopProjectAsync = async (projectRoot) => {
    if (!this.state.projectRoot) {
      return false;
    }

    this._currentOpenProjectXDEId++;

    // Send projectRoot to main process.
    ipcRenderer.send('project-closed', projectRoot);

    try {
      await Project.stopAsync(projectRoot);
      this._logInfo('Project closed.');
      this.setState({
        projectSettings: null,
        projectRoot: null,
        projectJson: null,
        computedUrl: null,
        isProjectRunning: false,
        expJson: null,
        logs: [],
        connectedDevices: {},
        focusedConnectedDeviceId: null,
      });
      this._resetLocalProperties();

      return true;
    } catch (err) {
github expo / xde / src / main.js View on Github external
      await Promise.all(projectRoots.map(root => Project.stopAsync(root)));
    } catch (e) {