Пример #1
0
  @Override
  public void performDefaults() {
    // Missing builder info
    if (fBuildInfo == null) {
      return;
    }
    IMakeBuilderInfo info;
    if (getContainer().getProject() != null) {
      info = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, false);
    } else {
      info = MakeCorePlugin.createBuildInfo(fPrefs, fBuilderID, true);
    }
    if (info.isStopOnError()) stopOnErrorButton.setSelection(true);
    else stopOnErrorButton.setSelection(false);
    if (info.getBuildCommand() != null) {
      StringBuffer cmd = new StringBuffer(info.getBuildCommand().toOSString());
      if (!info.isDefaultBuildCmd()) {
        String args = info.getBuildArguments();
        if (args != null && !args.equals("")) { // $NON-NLS-1$
          cmd.append(" "); // $NON-NLS-1$
          cmd.append(args);
        }
      }
      buildCommand.setText(cmd.toString());
    }
    if (info.isDefaultBuildCmd()) {
      buildCommand.setEnabled(false);
      argumentVariablesButton.setEnabled(false);
      stopOnErrorButton.setEnabled(true);
    } else {
      buildCommand.setEnabled(true);
      argumentVariablesButton.setEnabled(true);
      stopOnErrorButton.setEnabled(false);
    }

    defButton.setSelection(info.isDefaultBuildCmd());

    autoButton.setSelection(info.isAutoBuildEnable());
    autoVariableButton.setEnabled(info.isAutoBuildEnable());
    targetAuto.setEnabled(info.isAutoBuildEnable());
    targetAuto.setText(info.getAutoBuildTarget());
    incrButton.setSelection(info.isIncrementalBuildEnabled());
    incrVariableButton.setEnabled(info.isIncrementalBuildEnabled());
    targetIncr.setText(info.getIncrementalBuildTarget());
    targetIncr.setEnabled(info.isIncrementalBuildEnabled());
    cleanButton.setSelection(info.isCleanBuildEnabled());
    cleanVariableButton.setEnabled(info.isCleanBuildEnabled());
    targetClean.setText(info.getCleanBuildTarget());
    targetClean.setEnabled(info.isCleanBuildEnabled());
  }
Пример #2
0
  /**
   * @param project - project where to get build command from
   * @return build command from project settings.
   */
  public static String getProjectBuildCommand(IProject project) {
    IMakeTargetManager targetManager = MakeCorePlugin.getDefault().getTargetManager();
    String[] targetBuilders = targetManager.getTargetBuilders(project);
    if (targetBuilders == null || targetBuilders.length == 0) {
      return DEFAULT_BUILD_COMMAND;
    }

    String builderId = targetManager.getBuilderID(targetBuilders[0]);
    String buildCommand = DEFAULT_BUILD_COMMAND;
    try {
      IMakeBuilderInfo buildInfo = MakeCorePlugin.createBuildInfo(project, builderId);
      buildCommand = buildInfo.getBuildCommand().toString().trim();
    } catch (CoreException e) {
      // keep default value
    }
    return buildCommand;
  }