/**
   * This constructor is called to create a projectType defined by an extension point in a plugin
   * manifest file.
   */
  public ProjectType(IManagedConfigElement element, String managedBuildRevision) {
    // setup for resolving
    resolved = false;

    setManagedBuildRevision(managedBuildRevision);

    loadFromManifest(element);

    // Hook me up to the Managed Build Manager
    ManagedBuildManager.addExtensionProjectType(this);

    // Load the configuration children
    IManagedConfigElement[] configs =
        element.getChildren(IConfiguration.CONFIGURATION_ELEMENT_NAME);

    String[] usedConfigNames = new String[configs.length];
    IConfigurationNameProvider configurationNameProvder = getConfigurationNameProvider();

    if (configurationNameProvder != null) {
      // Tool Integrator provided 'ConfigurationNameProvider' class
      // to get configuration names dynamically based architecture, os, toolchain version etc.
      for (int n = 0; n < configs.length; ++n) {
        Configuration config = new Configuration(this, configs[n], managedBuildRevision);
        String newConfigName =
            configurationNameProvder.getNewConfigurationName(config, usedConfigNames);
        config.setName(newConfigName);
        usedConfigNames[n] = newConfigName;
      }
    } else {
      for (int n = 0; n < configs.length; ++n) {
        Configuration config = new Configuration(this, configs[n], managedBuildRevision);
      }
    }
  }
 private void load(IManagedConfigElement element) {
   String names[] = MbsMacroSupplier.getInstance().getMacroNames(IBuildMacroProvider.CONTEXT_FILE);
   fValues.clear();
   for (int i = 0; i < names.length; i++) {
     String value = element.getAttribute(PREFIX + names[i] + SUFFIX);
     if (value != null) fValues.put(names[i], value);
   }
 }
Exemple #3
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);
    }
  }
Exemple #4
0
  /**
   * This constructor is called to create a resource configuration defined by an extension point in
   * a plugin manifest file, or returned by a dynamic element provider
   *
   * @param parent The IConfiguration parent of this resource configuration
   * @param element The resource configuration definition from the manifest file or a dynamic
   *     element provider
   */
  public ResourceConfiguration(
      IConfiguration parent, IManagedConfigElement element, String managedBuildRevision) {
    super(parent, element, true);
    isExtensionResourceConfig = true;

    // setup for resolving
    resolved = false;

    setManagedBuildRevision(managedBuildRevision);
    loadFromManifest(element);

    // Hook me up to the Managed Build Manager
    ManagedBuildManager.addExtensionResourceConfiguration(this);

    // Load the tool children
    IManagedConfigElement[] tools = element.getChildren(ITool.TOOL_ELEMENT_NAME);
    for (int n = 0; n < tools.length; ++n) {
      Tool toolChild = new Tool(this, tools[n], getManagedBuildRevision());
      getToolList().add(toolChild);
      getToolMap().put(toolChild.getId(), toolChild);
    }

    setDirty(false);
  }
  /**
   * 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));
  }
 public BooleanExpressionApplicabilityCalculator(IManagedConfigElement optionElement) {
   this(optionElement.getChildren(OptionEnablementExpression.NAME));
 }