Ejemplo n.º 1
0
  /* (non-Javadoc)
   * Loads the resource configuration information from the ManagedConfigElement
   * specified in the argument.
   *
   * @param element Contains the resource configuration information
   */
  protected void loadFromManifest(IManagedConfigElement element) {
    ManagedBuildManager.putConfigElement(this, element);

    // toolsToInvoke
    toolsToInvoke =
        SafeStringInterner.safeIntern(element.getAttribute(IResourceConfiguration.TOOLS_TO_INVOKE));

    // rcbsApplicability
    String rcbsApplicabilityStr = element.getAttribute(IResourceConfiguration.RCBS_APPLICABILITY);
    if (rcbsApplicabilityStr == null || rcbsApplicabilityStr.equals(DISABLE_RCBS_TOOL)) {
      rcbsApplicability = new Integer(KIND_DISABLE_RCBS_TOOL);
    } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_BEFORE)) {
      rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_BEFORE);
    } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_AFTER)) {
      rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_AFTER);
    } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_AS_OVERRIDE)) {
      rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_AS_OVERRIDE);
    }
  }
Ejemplo n.º 2
0
  /* (non-Javadoc)
   * Initialize the resource configuration information from the XML element
   * specified in the argument
   *
   * @param element An XML element containing the resource configuration information
   */
  protected void loadFromProject(ICStorageElement element) {
    // toolsToInvoke
    if (element.getAttribute(IResourceConfiguration.TOOLS_TO_INVOKE) != null) {
      toolsToInvoke =
          SafeStringInterner.safeIntern(
              element.getAttribute(IResourceConfiguration.TOOLS_TO_INVOKE));
    }

    // rcbsApplicability
    if (element.getAttribute(IResourceConfiguration.RCBS_APPLICABILITY) != null) {
      String rcbsApplicabilityStr = element.getAttribute(IResourceConfiguration.RCBS_APPLICABILITY);
      if (rcbsApplicabilityStr == null || rcbsApplicabilityStr.equals(DISABLE_RCBS_TOOL)) {
        rcbsApplicability = new Integer(KIND_DISABLE_RCBS_TOOL);
      } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_BEFORE)) {
        rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_BEFORE);
      } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_AFTER)) {
        rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_AFTER);
      } else if (rcbsApplicabilityStr.equals(APPLY_RCBS_TOOL_AS_OVERRIDE)) {
        rcbsApplicability = new Integer(KIND_APPLY_RCBS_TOOL_AS_OVERRIDE);
      }
    }
  }
Ejemplo n.º 3
0
  /**
   * Load the project-type information from the XML element specified in the argument
   *
   * @param element An XML element containing the project type information
   */
  protected void loadFromManifest(IManagedConfigElement element) {
    ManagedBuildManager.putConfigElement(this, element);

    // id
    setId(SafeStringInterner.safeIntern(element.getAttribute(ID)));

    // Get the name
    setName(SafeStringInterner.safeIntern(element.getAttribute(NAME)));

    // version
    setVersion(getVersionFromId());

    // superClass
    superClassId = SafeStringInterner.safeIntern(element.getAttribute(SUPERCLASS));

    String props = SafeStringInterner.safeIntern(element.getAttribute(BUILD_PROPERTIES));
    if (props != null) buildProperties = new BuildObjectProperties(props, this, this);

    String artType = SafeStringInterner.safeIntern(element.getAttribute(BUILD_ARTEFACT_TYPE));
    if (artType != null) {
      if (buildProperties == null) buildProperties = new BuildObjectProperties(this, this);

      try {
        buildProperties.setProperty(
            ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_ID, artType, true);
      } catch (CoreException e) {
        ManagedBuilderCorePlugin.log(e);
      }
    }

    // Get the unused children, if any
    unusedChildren = SafeStringInterner.safeIntern(element.getAttribute(UNUSED_CHILDREN));

    // isAbstract
    String isAbs = element.getAttribute(IS_ABSTRACT);
    if (isAbs != null) {
      isAbstract = Boolean.parseBoolean(isAbs);
    }

    // Is this a test project type
    String isTestStr = element.getAttribute(IS_TEST);
    if (isTestStr != null) {
      isTest = Boolean.parseBoolean(isTestStr);
    }

    // Store the configuration element IFF there is a configuration name provider defined
    if (element.getAttribute(CONFIGURATION_NAME_PROVIDER) != null
        && element instanceof DefaultManagedConfigElement) {
      configurationNameProviderElement =
          ((DefaultManagedConfigElement) element).getConfigurationElement();
    }

    // Get the environmentVariableSupplier configuration element
    String environmentVariableSupplier = element.getAttribute(PROJECT_ENVIRONMENT_SUPPLIER);
    if (environmentVariableSupplier != null && element instanceof DefaultManagedConfigElement) {
      environmentVariableSupplierElement =
          ((DefaultManagedConfigElement) element).getConfigurationElement();
    }

    // Get the buildMacroSupplier configuration element
    String buildMacroSupplier = element.getAttribute(PROJECT_MACRO_SUPPLIER);
    if (buildMacroSupplier != null && element instanceof DefaultManagedConfigElement) {
      buildMacroSupplierElement = ((DefaultManagedConfigElement) element).getConfigurationElement();
    }

    // Get the 'convertToId' attribute if it is available
    convertToId = SafeStringInterner.safeIntern(element.getAttribute(CONVERT_TO_ID));
  }