Package com.adaptrex.tools.command

Examples of com.adaptrex.tools.command.ICommandService


    /*
     * Get guiced and get the environment service
     */
    Injector injector = Guice.createInjector(new ToolsModule());
    ICommandService commandService = injector.getInstance(ICommandService.class);
   
    /*
     * Get our options.  We've got a problem with scripts breaking apart arguments
     * that include spaces... so we manually rebuild it here
     */
    String[] realArgs = args.length > 1 ? Arrays.copyOfRange(args, 2, args.length) : null;
    String repackagedArgs = " ";
    for (String arg : realArgs) repackagedArgs += arg + " ";
    List<String> optionArgs = new ArrayList<String>();
    for (String splitArg : repackagedArgs.split(" -")) {
      splitArg = splitArg.trim();
      if (!splitArg.isEmpty()) optionArgs.add("-" + splitArg.trim());
    }
   
    /*
     * Initialize our command service
     */
    boolean goodEnv = commandService.initialize(verb, target,
        optionArgs.toArray(new String[optionArgs.size()]));
   
    if (!goodEnv) {
      System.out.println(CR + "This is the first time you are running Adaptrex Tools." + CR + CR +
          "Before you can run the tools, you need to run \"adaptrex config environment\"" + CR +
View Full Code Here


    /*
     * Get guiced and get the environment service
     */
    Injector injector = Guice.createInjector(new ToolsModule());
    ICommandService commandService = injector.getInstance(ICommandService.class);
   
    /*
     * Get our options.  We've got a problem with scripts breaking apart arguments
     * that include spaces... so we manually rebuild it here
     */
    String[] realArgs = args.length > 1 ? Arrays.copyOfRange(args, 2, args.length) : null;
    String repackagedArgs = " ";
    for (String arg : realArgs) repackagedArgs += arg + " ";
    List<String> optionArgs = new ArrayList<String>();
    for (String splitArg : repackagedArgs.split(" -")) {
      splitArg = splitArg.trim();
      if (!splitArg.isEmpty()) optionArgs.add("-" + splitArg.trim());
    }
   
    /*
     * Initialize our command service
     */
    boolean goodEnv = commandService.initialize(verb, target,
        optionArgs.toArray(new String[optionArgs.size()]));
   
    if (!goodEnv) {
      System.out.println(CR + "This is the first time you are running Adaptrex Tools." + CR + CR +
          "Before you can run the tools, you need to run \"adaptrex config environment\"" + CR +
View Full Code Here

TOP

Related Classes of com.adaptrex.tools.command.ICommandService

Copyright © 2018 www.massapicom. 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.