Package flex2.tools.oem

Examples of flex2.tools.oem.ProgressMeter


        }

        if (percent > symbolTable.currentPercentage)
        {
            symbolTable.currentPercentage = percent;
            ProgressMeter meter = ThreadLocalToolkit.getProgressMeter();

            if (meter != null)
            {
                meter.percentDone(percent);
            }
        }
    }
View Full Code Here


  public int tick = 0;
  public int currentPercentage = 0;
 
  public void adjustProgress()
  {
    ProgressMeter meter = ThreadLocalToolkit.getProgressMeter();
   
    for (int i = currentPercentage + 1; meter != null && i <= 100; i++)
    {
      meter.percentDone(i);
    }
  }
View Full Code Here

                ThreadLocalToolkit.getBenchmark() != null)
        {
            ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("Start")), true);
        }

        ProgressMeter meter = ThreadLocalToolkit.getProgressMeter();

        if (meter != null)
        {
            meter.start();
        }

        List<CompilationUnit> units = new ArrayList<CompilationUnit>();
        DependencyGraph<CompilationUnit> igraph = new DependencyGraph<CompilationUnit>();
        DependencyGraph<Source> dgraph = null; // new DependencyGraph();

        boolean useFileSpec = false;

        // based on the starting source file, retrieve a list of dependent files.
        if (fileSpec != null)
        {
            sources.addAll(fileSpec.retrieveSources());
            useFileSpec = sources.size() > 0;
        }

        if (sourceList != null)
        {
            sources.addAll(sourceList.retrieveSources());
        }

        // C: This is here for SWC compilation.
        if (classes != null)
        {
            for (Source source : classes)
            {
                // source might have already been added if it's in the SourceList.
                if (!sources.contains(source))
                {
                    sources.add(source);
                }
            }

            useFileSpec = useFileSpec || classes.size() > 0;
        }

        // add the sources to the dependency graphs as vertices.
        addVerticesToGraphs(sources, igraph, dgraph);

        if (configuration.getBenchmarkCompilerDetails() > 0 &&
                ThreadLocalToolkit.getBenchmark() != null)
        {
            ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("addVerticesToGraphs")), true);
        }

        try
        {
            getCommonBuiltinClasses(sources, igraph, dgraph, symbolTable, sourceList, sourcePath, resources, swcContext);

            if (configuration.getBenchmarkCompilerDetails() > 0 &&
                    ThreadLocalToolkit.getBenchmark() != null)
            {
                ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("GetCommonBuiltInClassesTime")), true);
            }

            //    build unit list
            batch(sources, units, igraph, dgraph, symbolTable, compilers, sourceList, sourcePath, resources, swcContext, configuration, useFileSpec);

            if (configuration.getBenchmarkCompilerDetails() > 0 &&
                    ThreadLocalToolkit.getBenchmark() != null)
            {
                ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("batch")));

            }

            // enterprise messaging classes referenced by the messaging config file
            getMessagingClasses(sources, igraph, dgraph, symbolTable, sourceList, sourcePath, resources, swcContext, configuration);

            if (configuration.getBenchmarkCompilerDetails() > 0 &&
                    ThreadLocalToolkit.getBenchmark() != null)
            {
                ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("getMessagingClasses")), true);
            }

            // unconditionally includes classes specified by --includes.
            getIncludeClasses(sources, igraph, dgraph, symbolTable, sourceList, sourcePath, resources, swcContext, configuration);

            if (configuration.getBenchmarkCompilerDetails() > 0 &&
                    ThreadLocalToolkit.getBenchmark() != null)
            {
                ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("GetIncludeClassesTime")), true);
            }

            // backward compatibility
            getIncludeResources(sources, igraph, dgraph, bundlePath, symbolTable, swcContext, configuration);

            if (configuration.getBenchmarkCompilerDetails() > 0 &&
                    ThreadLocalToolkit.getBenchmark() != null)
            {
                ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("GetIncludeResourcesTime")), true);
            }

            // getMessagingClasses, and getIncludeClasses may produce errors. check them...
            if (ThreadLocalToolkit.errorCount() > 0)
            {
                throw new CompilerException();
            }

            if (forcedToStop()) return units;

            // compile additional sources before running prelink so that all metadata-fed lists
            // contributing to codegen (i.e. mixins) are complete
            batch(sources, units, igraph, dgraph, symbolTable, compilers, sourceList, sourcePath, resources, swcContext, configuration, useFileSpec);

            if (configuration.getBenchmarkCompilerDetails() > 0 &&
                    ThreadLocalToolkit.getBenchmark() != null)
            {
                ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("batch")), true);

            }

            if (forcedToStop()) return units;

            // PreLink

            int count = 0; // just in case something impossibly odd happens,
            if (preLink != null// don't wedge the compiler forever.
            {
                // run the prelink step (repeatedly until we've found all nested style dependencies...)
                boolean runPrelink = true;
                while (runPrelink && count++ < 1000)
                {
                    runPrelink = preLink.run(sources, units, fileSpec, sourceList, sourcePath, bundlePath, resources, symbolTable, swcContext, nameMappings, configuration);
                    if (!runPrelink)
                    {
                        // Add synthetic link-in units now that we've found all of our sources
                        preLink.postRun(sources, units, resources, symbolTable, swcContext, nameMappings, configuration);
                    }

                    if (configuration.getBenchmarkCompilerDetails() > 0 &&
                            ThreadLocalToolkit.getBenchmark() != null)
                    {
                        ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("PreLinkTime")), true);
                    }

                    // prelink also may produce errors
                    if (ThreadLocalToolkit.errorCount() > 0)
                    {
                        throw new CompilerException();
                    }

                    // prelink introduces more sources, so we compile again
                    batch(sources, units, igraph, dgraph, symbolTable, compilers, sourceList, sourcePath, resources, swcContext, configuration, useFileSpec);

                    if (configuration.getBenchmarkCompilerDetails() > 0 &&
                            ThreadLocalToolkit.getBenchmark() != null)
                    {
                        ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("batch")), true);
                    }

                    if (forcedToStop()) return units;
                }
            }

            // loader classes, licensing classes, extra classes

            count = 0; // just in case something impossibly odd happens,
            while (++count < 1000) // don't wedge the compiler forever.
            {
                int numSources = sources.size();
                getExtraSources(sources, igraph, dgraph, sourceList, sourcePath, resources, bundlePath, symbolTable, swcContext,
                                configuration, licenseMap);

                if (configuration.getBenchmarkCompilerDetails() > 0 &&
                        ThreadLocalToolkit.getBenchmark() != null)
                {
                    ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("GetExtraSourcesTime")), true);
                }

                // getExtraSources may produce errors. check them...
                if (ThreadLocalToolkit.errorCount() > 0)
                {
                    throw new CompilerException();
                }

                // getExtraSources pulls in more classes, compile again
                batch(sources, units, igraph, dgraph, symbolTable, compilers, sourceList, sourcePath, resources, swcContext, configuration, useFileSpec);

                if (configuration.getBenchmarkCompilerDetails() > 0 &&
                        ThreadLocalToolkit.getBenchmark() != null)
                {
                    ThreadLocalToolkit.getBenchmark().benchmark2(l10n.getLocalizedTextString(new CompileTime("batch")), true);

                }

                if (sources.size() == numSources)
                {
                    break;
                }

                if (forcedToStop()) return units;
            }

            checkResourceBundles(sources, symbolTable);
            assert count < 1000;
        }
        finally
        {
            if (ThreadLocalToolkit.getBenchmark() != null)
            {
                ThreadLocalToolkit.getBenchmark().benchmark(l10n.getLocalizedTextString(new OutputTime(sources.size())));
            }

            // must close swc file handles...
            swcContext.close();
            symbolTable.cleanClassTable();
            symbolTable.adjustProgress();

            if (meter != null)
            {
                meter.end();
            }
        }

        return units;
    }
View Full Code Here

        }

        if (percent > symbolTable.currentPercentage)
        {
            symbolTable.currentPercentage = percent;
            ProgressMeter meter = ThreadLocalToolkit.getProgressMeter();

            if (meter != null)
            {
                meter.percentDone(percent);
            }
        }
    }
View Full Code Here

  }
 
  protected int compile(boolean incremental)
  {
    //File dumpConfigFile = null;
    OEMConfiguration config = null;
   
        // step over special-cased configuration options:
        //     FlexBuilder exposes some compiler options as UI (such as a checkbox for accessibility)
        //     and other compiler options like -help have no meaning when used in FB (since you press F1...)
        //     FB serialzes these and gives it to us as a commandline in OEMConfiguration.extra
        //     So we need to parse those...
    if (c != null)
    {
      String[] args = c.extra;
      if (args != null && args.length > 0)
      {
        config = (OEMConfiguration) c.configuration;
        if (config != null)
        {
          ConfigurationBuffer cfgbuf = OEMUtil.getCompcConfigurationBuffer(OEMUtil.getLogger(getLogger(), null), resolver, args);
          if (cfgbuf == null)
          {
            return -1;
          }
         
          List positions = cfgbuf.getPositions();
          for (int i = 0, length = positions.size(); i < length; i++)
          {
            Object[] a = (Object[]) positions.get(i);
            String var = (String) a[0];   
           
            if ("link-report".equals(var))
            {
              config.keepLinkReport(true);
            }
            else if ("compiler.debug".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                String debugPassword = cfgbuf.peekSimpleConfigurationVar("debug-password");
                if ("true".equals(value))
                {
                  config.enableDebugging(true, debugPassword);
                }
                else if ("false".equals(value))
                {
                  config.enableDebugging(false, debugPassword);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("compiler.verbose-stacktraces".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.enableVerboseStacktraces(true);
                }
                else if ("false".equals(value))
                {
                  config.enableVerboseStacktraces(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }             
            }
            else if ("compiler.accessible".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.enableAccessibility(true);
                }
                else if ("false".equals(value))
                {
                  config.enableAccessibility(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("compiler.strict".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.enableStrictChecking(true);
                }
                else if ("false".equals(value))
                {
                  config.enableStrictChecking(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("help".equals(var))
            {
              // do nothing
            }
            else if ("output".equals(var))
            {
              try
              {
                String isDirectory = cfgbuf.peekSimpleConfigurationVar("directory");
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(isDirectory))
                {
                  setDirectory(new File(value));
                }
                else
                {
                  setOutput(new File(value));
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("size-report".equals(var))
            {
              config.keepSizeReport(true);
            }
            else if ("directory".equals(var))
            {
              // do nothing
            }
            else if ("version".equals(var))
            {
              // do nothing
            }
            else if ("include-classes".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    this.addComponent((String) valArgs.get(k));
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-file".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  this.addArchiveFile((String) valArgs.get(0), new File((String) valArgs.get(1)));
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-namespaces".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    try
                    {
                      this.addComponent(new URI((String) valArgs.get(k)));
                    }
                    catch (URISyntaxException ex)
                    {
                      ex.printStackTrace();
                    }
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-resource-bundles".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    this.addResourceBundle((String) valArgs.get(k));
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("include-sources".equals(var))
            {
              try
              {
                List l = cfgbuf.peekConfigurationVar(var);
                for (int j = 0, len = l == null ? 0 : l.size(); j < len; j++)
                {
                  ConfigurationValue val = (ConfigurationValue) l.get(j);
                  List valArgs = val.getArgs();
                  for (int k = 0, size = valArgs == null ? 0 : valArgs.size(); k < size; k++)
                  {
                    this.addComponent(new File((String) valArgs.get(k)));
                  }
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
          }

          config.setConfiguration(OEMUtil.trim(args, cfgbuf, excludes));
          // c.extra = null;
        }
      }
    }
   
View Full Code Here

  }
 
  protected int compile(boolean incremental)
  {
    //File dumpConfigFile = null;
    OEMConfiguration config = null;
   
        // step over special-cased configuration options:
        //     FlexBuilder exposes some compiler options as UI (such as a checkbox for accessibility)
        //     and other compiler options like -help have no meaning when used in FB (since you press F1...)
        //     FB serialzes these and gives it to us as a commandline in OEMConfiguration.extra
        //     So we need to parse those...
    if (c != null)
    {
      String[] args = c.extra;
      if (args != null && args.length > 0)
      {
        config = (OEMConfiguration) c.configuration;
        if (config != null)
        {
          ConfigurationBuffer cfgbuf = OEMUtil.getCommandLineConfigurationBuffer(OEMUtil.getLogger(getLogger(), null), resolver, args);
          if (cfgbuf == null)
          {
            return -1;
          }
         
          List positions = cfgbuf.getPositions();
          for (int i = 0, length = positions.size(); i < length; i++)
          {
            Object[] a = (Object[]) positions.get(i);
            String var = (String) a[0];
           
            if ("link-report".equals(var))
            {
              config.keepLinkReport(true);
            }
            else if ("compiler.debug".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                String debugPassword = cfgbuf.peekSimpleConfigurationVar("debug-password");
                if ("true".equals(value))
                {
                  config.enableDebugging(true, debugPassword);
                }
                else if ("false".equals(value))
                {
                  config.enableDebugging(false, debugPassword);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("compiler.verbose-stacktraces".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.enableVerboseStacktraces(true);
                }
                else if ("false".equals(value))
                {
                  config.enableVerboseStacktraces(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }             
            }
            else if ("compiler.accessible".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.enableAccessibility(true);
                }
                else if ("false".equals(value))
                {
                  config.enableAccessibility(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("compiler.strict".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.enableStrictChecking(true);
                }
                else if ("false".equals(value))
                {
                  config.enableStrictChecking(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("help".equals(var))
            {
              // do nothing
            }
            else if ("output".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                setOutput(new File(value));
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("size-report".equals(var))
            {
              config.keepSizeReport(true);
            }
            else if ("version".equals(var))
            {
              // do nothing
            }
            else if ("warnings".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.showActionScriptWarnings(true);
                  config.showBindingWarnings(true);
                  config.showDeprecationWarnings(true);
                  config.showUnusedTypeSelectorWarnings(true);
                }
                else if ("false".equals(value))
                {
                  config.showActionScriptWarnings(false);
                  config.showBindingWarnings(false);
                  config.showDeprecationWarnings(false);
                  config.showUnusedTypeSelectorWarnings(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("compiler.show-actionscript-warnings".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.showActionScriptWarnings(true);
                }
                else if ("false".equals(value))
                {
                  config.showActionScriptWarnings(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("compiler.show-deprecation-warnings".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.showDeprecationWarnings(true);
                }
                else if ("false".equals(value))
                {
                  config.showDeprecationWarnings(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
                        else if ("compiler.show-shadowed-device-font-warnings".equals(var))
                        {
                            try
                            {
                                String value = cfgbuf.peekSimpleConfigurationVar(var);
                                if ("true".equals(value))
                                {
                                    config.showShadowedDeviceFontWarnings(true);
                                }
                                else if ("false".equals(value))
                                {
                                    config.showShadowedDeviceFontWarnings(false);
                                }
                            }
                            catch (ConfigurationException ex)
                            {
                            }
                        }
                        else if ("compiler.show-binding-warnings".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.showBindingWarnings(true);
                }
                else if ("false".equals(value))
                {
                  config.showBindingWarnings(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
            else if ("compiler.show-unused-type-selector-warnings".equals(var))
            {
              try
              {
                String value = cfgbuf.peekSimpleConfigurationVar(var);
                if ("true".equals(value))
                {
                  config.showUnusedTypeSelectorWarnings(true);
                }
                else if ("false".equals(value))
                {
                  config.showUnusedTypeSelectorWarnings(false);
                }
              }
              catch (ConfigurationException ex)
              {
              }
            }
          }

          config.setConfiguration(OEMUtil.trim(args, cfgbuf, excludes));
          // c.extra = null;
        }
      }
    }
   
View Full Code Here

        try
        {
        messages.clear();

        // if there is no configuration, use the default... but don't populate this.configuration.
        OEMConfiguration tempOEMConfiguration;

        if (oemConfiguration == null)
        {
            tempOEMConfiguration = (OEMConfiguration) getDefaultConfiguration(true);
        }
View Full Code Here

        try
        {
            messages.clear();
   
            // if there is no configuration, use the default... but don't populate this.configuration.
            OEMConfiguration tempOEMConfiguration;
            if (oemConfiguration == null)
            {
                tempOEMConfiguration = (OEMConfiguration) getDefaultConfiguration(true);
            }
            else
View Full Code Here

     * @inheritDoc
     */
    public Report getReport()
    {
        //OEMUtil.setupLocalizationManager();
        return new OEMReport(null,
                             null,
                             null,
                             null,
                             configurationReport,
                             messages, files);
View Full Code Here

     * @inheritDoc
     */
    public Report getReport()
    {
        //OEMUtil.setupLocalizationManager();
        return new OEMReport( sources,
                              movie,
                              null,
                              sourceList,
                             configurationReport,
                             messages);
View Full Code Here

TOP

Related Classes of flex2.tools.oem.ProgressMeter

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.