示例#1
0
  private IToolChain getDefaultToolChain() {
    IResourceInfo rcInfo = getResourceInfo();
    IToolChain defaultTc = null;
    if (rcInfo.getPath().segmentCount() == 0) {
      //			1.Per-project : change to the "default" tool-chain defined in the extension
      //			super-class of the project configuration. NOTE: the makefile project case might
      //			need a special handling in this case.

      IConfiguration cfg = rcInfo.getParent();
      IConfiguration extCfg = cfg.getParent();
      defaultTc = extCfg.getToolChain();
      if (defaultTc == null) {
        if (cfg.getToolChain() != null) {
          defaultTc = cfg.getToolChain().getSuperClass();
        }
      }
    } else {
      //			2.per-folder : change to the same tool-chain as the one used by the parent
      //			folder.
      IFolderInfo parentFo = ((ResourceInfo) rcInfo).getParentFolderInfo();
      IToolChain tc = parentFo.getToolChain();
      defaultTc = ManagedBuildManager.getExtensionToolChain(tc);
    }

    if (defaultTc != null && defaultTc.getId().equals(ConfigurationDataProvider.PREF_TC_ID))
      defaultTc = null;

    return defaultTc;
  }