Examples of IOption


Examples of megamek.common.options.IOption

            addGroup(group, gridbag, c);

            for (Enumeration<IOption> j = group.getOptions(); j
                    .hasMoreElements();) {
                IOption option = j.nextElement();

                addOption(option, gridbag, c);
            }
        }
View Full Code Here

Examples of megamek.common.options.IOption

        while (groups.hasMoreElements()) {
            final IOptionGroup group = groups.nextElement();

            Enumeration<IOption> iter = group.getOptions();
            while (iter.hasMoreElements()) {
                final IOption option = iter.nextElement();

                // Encode this option.
                output.write("<gameoption><optionname>");
                output.write(option.getName());
                output.write("</optionname><optionvalue>");
                output.write(option.getValue().toString());
                output.write("</optionvalue></gameoption>");
            }

        } // Handle the next option group.
View Full Code Here

Examples of org.eclipse.cdt.managedbuilder.core.IOption

    //get LLVM front-end
    ITool llvmFrontEnd = getLlvmFrontEnd(cf);
    //If the LLVM front-end is found from the given build configuration
    if (llvmFrontEnd != null) {
      //get LLVM front-end Include paths option.
      IOption llvmFrontEndIncPathOption = getLlvmFrontEndIncludePathOption(cf);
      //add a new include path to front-end's Include paths option.
      boolean val = addIncludePathToToolOption(cf, llvmFrontEnd, llvmFrontEndIncPathOption, newIncludePath);
      return val;
    }
    return false;
View Full Code Here

Examples of org.eclipse.cdt.managedbuilder.core.IOption

    //get LLVM front-end
    ITool llvmFrontEnd = getLlvmFrontEnd(cf);
    //If the LLVM front-end is found from the given build configuration
    if (llvmFrontEnd != null) {
      //get LLVM front-end Include paths option.
      IOption llvmFrontEndIncPathOption = getLlvmFrontEndIncludePathOption(cf);
      //remove an include path from front-end's Include paths option.
      removeIncludePathFromToolOption(cf, llvmFrontEnd, llvmFrontEndIncPathOption, removeIncludePath);
      return true;
    }
    return false;
View Full Code Here

Examples of org.eclipse.cdt.managedbuilder.core.IOption

    //get LLVM linker
    ITool llvmLinker = getLlvmLinker(cf);
    //If the LLVM linker is found from the given build configuration
    if (llvmLinker != null) {
      //get LLVM Linker Libraries option
      IOption librariesOption = getLlvmLinkerLibrariesOption(cf);
      //add library to LLVM linker's Libraries Option type
      boolean val = addLibraryToToolOption(cf, llvmLinker, librariesOption, lib);
      return val;
    }
    //adding the library failed
View Full Code Here

Examples of org.eclipse.cdt.managedbuilder.core.IOption

    //get LLVM linker
    ITool llvmLinker = getLlvmLinker(cf);
    //If the LLVM linker is found from the given build configuration
    if (llvmLinker != null) {
      //get LLVM Linker Libraries option
      IOption librariesOption = getLlvmLinkerLibrariesOption(cf);
      //remove a library from LLVM linker's Libraries Option type
      removeLibraryFromToolOption(cf, llvmLinker, librariesOption, removeLib);
      return true;
    }
    //removing the library failed
View Full Code Here

Examples of org.eclipse.cdt.managedbuilder.core.IOption

    //get LLVM linker
    ITool llvmLinker = getLlvmLinker(cf);
    //If the LLVM linker is found from the given build configuration
    if (llvmLinker != null) {
      //get LLVM Linker Library search path option
      IOption libDirOption = getLlvmLinkerLibrarySearchPathOption(cf);
      //add library search path to LLVM linker's Library Search Path Option type
      boolean val = addLibrarySearchPathToToolOption(cf, llvmLinker, libDirOption, libDir);
      return val;
    }
    //adding library failed
View Full Code Here

Examples of org.eclipse.cdt.managedbuilder.core.IOption

    //get LLVM linker
    ITool llvmLinker = getLlvmLinker(cf);
    //If the LLVM linker is found from the given build configuration
    if (llvmLinker != null) {
      //get LLVM Linker Library search path option
      IOption libDirOption = getLlvmLinkerLibrarySearchPathOption(cf);
      //remove a library search path from LLVM linker's Library Search Path Option type
      removeLibrarySearchPathFromToolOption(cf, llvmLinker, libDirOption, removeLibDir);
      return true;
    }
    //removing the library search path failed
View Full Code Here

Examples of org.eclipse.cdt.managedbuilder.core.IOption

        for(ITool tool : tools){
          if (!tool.isEnabled() || !acceptTool(project, tool)){
            continue;
          }

          IOption ioption = getOptionByType(tool, IOption.INCLUDE_PATH);
          IOption soption = getOptionByType(tool, IOption.PREPROCESSOR_SYMBOLS);
          if (ioption == null && soption == null){
            continue;
          }

          HashMap<String,Object> tl = new HashMap<String,Object>();
          tls.add(tl);
          tl.put("name", tool.getName());

          // includes
          if(ioption != null){
            String[] includes = ioption.getIncludePaths();
            if(includes.length > 0){
              ArrayList<String> ins = new ArrayList<String>();
              tl.put("includes", ins);
              for(String include : includes){
                ins.add(include);
              }
            }
          }

          // symbols
          if(soption != null){
            String[] symbols = soption.getDefinedSymbols();
            if(symbols.length > 0){
              ArrayList<String> syms = new ArrayList<String>();
              tl.put("symbols", syms);
              for(String symbol : symbols){
                syms.add(symbol);
View Full Code Here

Examples of org.eclipse.cdt.managedbuilder.core.IOption

                    // this
                    // input-type
    String variable = type.getBuildVariable();
    boolean primaryInput = type.getPrimaryInput();
    boolean useFileExts = false;
    IOption option = tool.getOptionBySuperClassId(type.getOptionId());
    IOption assignToOption = tool.getOptionBySuperClassId(type.getAssignToOptionId());

    // Option?
    if (option != null) {
        try {
      List<String> inputs = new ArrayList<String>();
      int optType = option.getValueType();
      if (optType == IOption.STRING) {
          inputs.add(option.getStringValue());
      } else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES || optType == IOption.OBJECTS
        || optType == IOption.INCLUDE_FILES || optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
        || optType == IOption.MACRO_FILES) {
          @SuppressWarnings("unchecked")
          List<String> valueList = (List<String>) option.getValue();
          inputs = valueList;
          tool.filterValues(optType, inputs);
          tool.filterValues(optType, inputs);
      }
      for (int j = 0; j < inputs.size(); j++) {
          String inputName = inputs.get(j);

          try {
        // try to resolve the build macros in the output
        // names

        String resolved = null;

        // does the input name contain spaces?
        // TODO: support other special characters
        if (inputName.indexOf(" ") != -1) //$NON-NLS-1$
        {
            // resolve to string
            resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(inputName, "", //$NON-NLS-1$
              " ", //$NON-NLS-1$
              IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(option, tool));
        } else {

            // resolve to makefile variable format
            resolved = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(inputName, "", //$NON-NLS-1$
              " ", //$NON-NLS-1$
              IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(option, tool));
        }

        if ((resolved = resolved.trim()).length() > 0)
            inputName = resolved;
          } catch (BuildMacroException e) {// JABA is not
                   // going to add
                   // code
          }

          if (primaryInput) {
        itCommandDependencies.add(j, inputName);
          } else {
        itCommandDependencies.add(inputName);
          }
          // NO - itCommandInputs.add(inputName);
          // NO - itEnumeratedInputs.add(inputName);
      }
        } catch (BuildException ex) {// JABA is not going to add
             // code
        }

    } else {

        // Build Variable?
        if (variable.length() > 0) {
      String cmdVariable = variable = "$(" + variable + ")"; //$NON-NLS-1$  //$NON-NLS-2$
      itCommandInputs.add(cmdVariable);
      if (primaryInput) {
          itCommandDependencies.add(0, cmdVariable);
      } else {
          itCommandDependencies.add(cmdVariable);
      }
      // If there is an output variable with the same name,
      // get
      // the files associated with it.
      List<String> outMacroList = makeGen.getBuildVariableList(h, variable, ArduinoGnuMakefileGenerator.PROJECT_RELATIVE, null,
        true);
      if (outMacroList != null) {
          itEnumeratedInputs.addAll(outMacroList);
      } else {
          // If "last chance", then calculate using file
          // extensions below
          if (lastChance) {
        useFileExts = true;
          } else {
        done = false;
        break;
          }
      }
        }

        // Use file extensions
        if (variable.length() == 0 || useFileExts) {
      // if (type.getMultipleOfType()) {
      // Calculate EnumeratedInputs using the file extensions
      // and the resources in the project
      // Note: This is only correct for tools with
      // multipleOfType == true, but for other tools
      // it gives us an input resource for generating default
      // names
      // Determine the set of source input macros to use
      HashSet<String> handledInputExtensions = new HashSet<String>();
      String[] exts = type.getSourceExtensions(tool);
      if (projResources != null) {
          for (IResource rc : projResources) {
        if (rc.getType() == IResource.FILE) {
            String fileExt = rc.getFileExtension();

            // fix for NPE, bugzilla 99483
            if (fileExt == null) {
          fileExt = ""; //$NON-NLS-1$
            }

            for (int k = 0; k < exts.length; k++) {
          if (fileExt.equals(exts[k])) {
              if (!useFileExts) {
            if (!handledInputExtensions.contains(fileExt)) {
                handledInputExtensions.add(fileExt);
                String buildMacro = "$(" + makeGen.getSourceMacroName(fileExt).toString() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
                itCommandInputs.add(buildMacro);
                if (primaryInput) {
              itCommandDependencies.add(0, buildMacro);
                } else {
              itCommandDependencies.add(buildMacro);
                }
            }
              }
              if (type.getMultipleOfType() || itEnumeratedInputs.size() == 0) {
            // Add a path that is relative
            // to the project directory
            itEnumeratedInputs.add(rc.getProjectRelativePath().toString());
              }
              break;
          }
            }
        }
          }
      }
      // }
        }
    }

    // Get any additional inputs specified in the manifest file or
    // the project file
    IAdditionalInput[] addlInputs = type.getAdditionalInputs();
    if (addlInputs != null) {
        for (int j = 0; j < addlInputs.length; j++) {
      IAdditionalInput addlInput = addlInputs[j];
      int kind = addlInput.getKind();
      if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT || kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
          String[] paths = addlInput.getPaths();
          if (paths != null) {
        for (int k = 0; k < paths.length; k++) {
            String path = paths[k];
            itEnumeratedInputs.add(path);
            // Translate the path from project relative
            // to build directory relative
            if (!(path.startsWith("$("))) { //$NON-NLS-1$
          IResource addlResource = project.getFile(path);
          if (addlResource != null) {
              IPath addlPath = addlResource.getLocation();
              if (addlPath != null) {
            path = ManagedBuildManager.calculateRelativePath(makeGen.getTopBuildDir(), addlPath).toString();
              }
          }
            }
            itCommandInputs.add(path);
        }
          }
      }
        }
    }

    // If the assignToOption attribute is specified, set the
    // input(s) as the value of that option
    if (assignToOption != null && option == null) {
        try {
      int optType = assignToOption.getValueType();
      if (optType == IOption.STRING) {
          String optVal = ""; //$NON-NLS-1$
          for (int j = 0; j < itCommandInputs.size(); j++) {
        if (j != 0) {
            optVal += " "; //$NON-NLS-1$
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.