Package flex2.compiler.config

Examples of flex2.compiler.config.ConfigurationBuffer


    }
  }

  public static final ConfigurationBuffer getCommandLineConfigurationBuffer(Logger logger, PathResolver resolver, String[] args)
  {
    ConfigurationBuffer cfgbuf = null;
   
        try
        {
      OEMUtil.init(logger, null, null, resolver, null);
     
          cfgbuf = new ConfigurationBuffer(CommandLineConfiguration.class, CommandLineConfiguration.getAliases());
          SystemPropertyConfigurator.load( cfgbuf, "flex" );
          CommandLineConfigurator.parse( cfgbuf, null, args);
        }
        catch (ConfigurationException ex)
        {
View Full Code Here


        return cfgbuf;
  }
 
  public static final ConfigurationBuffer getCompcConfigurationBuffer(Logger logger, PathResolver resolver, String[] args)
  {
    ConfigurationBuffer cfgbuf = null;
   
        try
        {
      OEMUtil.init(logger, null, null, resolver, null);
     
          cfgbuf = new ConfigurationBuffer(CompcConfiguration.class, CompcConfiguration.getAliases());
          SystemPropertyConfigurator.load( cfgbuf, "flex" );
          CommandLineConfigurator.parse( cfgbuf, null, args);
        }
        catch (ConfigurationException ex)
        {
View Full Code Here

        {
            // setup the path resolver
            CompilerAPI.usePathResolver();

            // process configuration
            ConfigurationBuffer cfgbuf = new ConfigurationBuffer(CompcConfiguration.class, CompcConfiguration.getAliases());
            cfgbuf.setDefaultVar("include-classes");
            DefaultsConfigurator.loadCompcDefaults( cfgbuf );
            CompcConfiguration configuration = (CompcConfiguration) Mxmlc.processConfiguration(
                ThreadLocalToolkit.getLocalizationManager(), "compc", s.args, cfgbuf, CompcConfiguration.class, "include-classes");

            CompilerAPI.setupHeadless(configuration);

            if (configuration.benchmark())
            {
                benchmark = CompilerAPI.runBenchmark();
                benchmark.startTime(Benchmark.PRECOMPILE);
            }
            else
            {
                CompilerAPI.disableBenchmark();
            }

            s.sourcePath.clearCache();
            s.bundlePath.clearCache();
            s.resources.refresh();

            // C: We don't really need to parse the manifest files again.
            CompilerConfiguration compilerConfig = configuration.getCompilerConfiguration();
            // note: if Configuration is ever shared with other parts of the system, then this part will need
            // to change, since we're setting a compc-specific setting below
            compilerConfig.setMetadataExport(true);

            NameMappings mappings = CompilerAPI.getNameMappings(configuration);

            Transcoder[] transcoders = WebTierAPI.getTranscoders( configuration );
            SubCompiler[] compilers = WebTierAPI.getCompilers(compilerConfig, mappings, transcoders);

            if (benchmark != null)
            {
                benchmark.benchmark(l10n.getLocalizedTextString(new InitialSetup()));
            }

            // load SWCs
            CompilerSwcContext swcContext = new CompilerSwcContext(true);
            // for compc the theme and include-libraries values have been purposely not passed in below.
            // This is done because the theme attribute doesn't make sense and the include-libraries value
            // actually causes issues when the default value is used with external libraries.
            // FIXME: why don't we just get rid of these values from the configurator for compc?  That's a problem
            // for include-libraries at least, since this value appears in flex-config.xml
            swcContext.load( compilerConfig.getLibraryPath(),
                             compilerConfig.getExternalLibraryPath(),
                             null,
                             null,
                             mappings,
                             I18nUtils.getTranslationFormat(compilerConfig),
                             s.swcCache );
            configuration.addExterns( swcContext.getExterns() );

            // recompile or incrementally compile...
            boolean recompile = false;
            int newChecksum = cfgbuf.checksum_ts() + swcContext.checksum();

            if (newChecksum != s.checksum)
            {
                ThreadLocalToolkit.logInfo(l10n.getLocalizedTextString(new DetectConfigurationChange()));
                s.checksum = newChecksum;
View Full Code Here

        {
            // setup the path resolver
            CompilerAPI.usePathResolver();

            // process configuration
            ConfigurationBuffer cfgbuf = new ConfigurationBuffer(CommandLineConfiguration.class, Configuration.getAliases());
            cfgbuf.setDefaultVar(Mxmlc.FILE_SPECS);
            DefaultsConfigurator.loadDefaults( cfgbuf );
            CommandLineConfiguration configuration = (CommandLineConfiguration) Mxmlc.processConfiguration(
                ThreadLocalToolkit.getLocalizationManager(), "mxmlc", s.args, cfgbuf, CommandLineConfiguration.class, Mxmlc.FILE_SPECS);

            CompilerAPI.setupHeadless(configuration);

            if (configuration.benchmark())
            {
                benchmark = CompilerAPI.runBenchmark();
                benchmark.startTime(Benchmark.PRECOMPILE);
            }
            else
            {
                CompilerAPI.disableBenchmark();
            }

            s.sourcePath.clearCache();
            s.bundlePath.clearCache();
            s.resources.refresh();

            // C: We don't really need to parse the manifest files again.
            CompilerConfiguration compilerConfig = configuration.getCompilerConfiguration();
            NameMappings mappings = CompilerAPI.getNameMappings(configuration);

            Transcoder[] transcoders = WebTierAPI.getTranscoders( configuration );
            SubCompiler[] compilers = WebTierAPI.getCompilers(compilerConfig, mappings, transcoders);

            if (benchmark != null)
            {
                benchmark.benchmark(l10n.getLocalizedTextString(new InitialSetup()));
            }

            CompilerSwcContext swcContext = new CompilerSwcContext(true);
            swcContext.load( compilerConfig.getLibraryPath(),
                             Configuration.getAllExcludedLibraries(compilerConfig, configuration),
                             compilerConfig.getThemeFiles(),
                             compilerConfig.getIncludeLibraries(),
                             mappings,
                             I18nUtils.getTranslationFormat(compilerConfig),
                             s.swcCache );
            configuration.addExterns( swcContext.getExterns() );
            configuration.addIncludes( swcContext.getIncludes() );
            configuration.getCompilerConfiguration().addThemeCssFiles( swcContext.getThemeStyleSheets() );

            // recompile or incrementally compile...
            boolean recompile = false;
            int newChecksum = cfgbuf.checksum_ts() + swcContext.checksum();

            if (newChecksum != s.checksum)
            {
                ThreadLocalToolkit.logInfo(l10n.getLocalizedTextString(new DetectConfigurationChange()));
                s.checksum = newChecksum;
View Full Code Here

        {
            // setup the path resolver
            CompilerAPI.usePathResolver();

            // process configuration
            ConfigurationBuffer cfgbuf = new ConfigurationBuffer(CommandLineConfiguration.class, Configuration.getAliases());
            cfgbuf.setDefaultVar(Mxmlc.FILE_SPECS);
            DefaultsConfigurator.loadDefaults( cfgbuf );
            CommandLineConfiguration configuration = (CommandLineConfiguration) Mxmlc.processConfiguration(
                ThreadLocalToolkit.getLocalizationManager(), "mxmlc", args, cfgbuf, CommandLineConfiguration.class, Mxmlc.FILE_SPECS);
            s.configuration = configuration;

            CompilerAPI.setupHeadless(configuration);

            if (configuration.benchmark())
            {
                benchmark = CompilerAPI.runBenchmark();
                benchmark.startTime(Benchmark.PRECOMPILE);
            }
            else
            {
                CompilerAPI.disableBenchmark();
            }

            String target = configuration.getTargetFile();
            targets.put("" + id, s);
            s.args = args;

            // make sure targetFile abstract pathname is an absolute path...
            VirtualFile targetFile = CompilerAPI.getVirtualFile(target);
            WebTierAPI.checkSupportedTargetMimeType(targetFile);
            List<VirtualFile> virtualFileList = CompilerAPI.getVirtualFileList(configuration.getFileList());

            CompilerConfiguration compilerConfig = configuration.getCompilerConfiguration();
            NameMappings mappings = CompilerAPI.getNameMappings(configuration);

            Transcoder[] transcoders = WebTierAPI.getTranscoders( configuration );
            SubCompiler[] compilers = WebTierAPI.getCompilers(compilerConfig, mappings, transcoders);

            // construct the SWF file name...
            VirtualFile projector = configuration.getProjector();

            if (projector != null && projector.getName().endsWith("avmplus.exe"))
            {
                // output .exe
                s.outputName = configuration.getOutput();
                if (s.outputName == null)
                {
                    s.outputName = targetFile.getName();
                    s.outputName = s.outputName.substring(0, s.outputName.lastIndexOf('.')) + ".exe";
                }
            }
            else
            {
                // output SWF
                s.outputName = configuration.getOutput();
                if (s.outputName == null)
                {
                    s.outputName = targetFile.getName();
                    if (projector != null)
                    {
                        s.outputName = s.outputName.substring(0, s.outputName.lastIndexOf('.')) + ".exe";
                    }
                    else
                    {
                        s.outputName = s.outputName.substring(0, s.outputName.lastIndexOf('.')) + ".swf";
                    }
                }
            }

            VirtualFile[] asClasspath = compilerConfig.getSourcePath();

            // create a FileSpec...
            s.fileSpec = new FileSpec(Collections.<VirtualFile>emptyList(), WebTierAPI.getFileSpecMimeTypes());

            // create a SourceList
            s.sourceList = new SourceList(virtualFileList, asClasspath, targetFile, WebTierAPI.getSourcePathMimeTypes());

            // create a SourcePath...
            s.sourcePath = new SourcePath(asClasspath, targetFile, WebTierAPI.getSourcePathMimeTypes(),
                                          compilerConfig.allowSourcePathOverlap());

            // create a ResourceContainer...
            s.resources = new ResourceContainer();

            // create a ResourceBundlePath...
            s.bundlePath = new ResourceBundlePath(configuration.getCompilerConfiguration(), targetFile);

            if (benchmark != null)
            {
                benchmark.benchmark(l10n.getLocalizedTextString(new InitialSetup()));
            }

            // load SWCs
            s.swcCache = new SwcCache();
           
            CompilerSwcContext swcContext = new CompilerSwcContext(true);
            swcContext.load( compilerConfig.getLibraryPath(),
                             Configuration.getAllExcludedLibraries(compilerConfig, configuration),
                             compilerConfig.getThemeFiles(),
                             compilerConfig.getIncludeLibraries(),
                             mappings,
                             I18nUtils.getTranslationFormat(compilerConfig),
                             s.swcCache );
            configuration.addExterns( swcContext.getExterns() );
            configuration.addIncludes( swcContext.getIncludes() );
            configuration.getCompilerConfiguration().addThemeCssFiles( swcContext.getThemeStyleSheets() );

               s.checksum = cfgbuf.checksum_ts() + swcContext.checksum();

            final SymbolTable symbolTable = new SymbolTable(configuration);
            s.perCompileData = symbolTable.perCompileData;

            Map licenseMap = configuration.getLicensesConfiguration().getLicenseMap();
View Full Code Here

        {
            // setup the path resolver
            CompilerAPI.usePathResolver();

            // process configuration
            ConfigurationBuffer cfgbuf = new ConfigurationBuffer(CompcConfiguration.class, CompcConfiguration.getAliases());
            cfgbuf.setDefaultVar("include-classes");
            DefaultsConfigurator.loadCompcDefaults( cfgbuf );
            CompcConfiguration configuration = (CompcConfiguration) Mxmlc.processConfiguration(
                ThreadLocalToolkit.getLocalizationManager(), "compc", args, cfgbuf, CompcConfiguration.class, "include-classes");
            s.configuration = configuration;

            CompilerAPI.setupHeadless(configuration);

            if (configuration.benchmark())
            {
                benchmark = CompilerAPI.runBenchmark();
                benchmark.startTime(Benchmark.PRECOMPILE);
            }
            else
            {
                CompilerAPI.disableBenchmark();
            }

            targets.put("" + id, s);
            s.args = args;

            String[] sourceMimeTypes = WebTierAPI.getSourcePathMimeTypes();

            CompilerConfiguration compilerConfig = configuration.getCompilerConfiguration();

            // create a SourcePath...
            s.sourcePath = new SourcePath(sourceMimeTypes, compilerConfig.allowSourcePathOverlap());
            s.sourcePath.addPathElements( compilerConfig.getSourcePath() );

            List<VirtualFile>[] array
                = CompilerAPI.getVirtualFileList(configuration.getIncludeSources(), configuration.getStylesheets().values(),
                                                        new HashSet<String>(Arrays.asList(sourceMimeTypes)), s.sourcePath.getPaths());

            NameMappings mappings = CompilerAPI.getNameMappings(configuration);

            // note: if Configuration is ever shared with other parts of the system, then this part will need
            // to change, since we're setting a compc-specific setting below
            compilerConfig.setMetadataExport(true);

            //    get standard bundle of compilers, transcoders
            Transcoder[] transcoders = WebTierAPI.getTranscoders( configuration );
            SubCompiler[] compilers = WebTierAPI.getCompilers(compilerConfig, mappings, transcoders);

            // construct the SWC file name...
            s.outputName = FileUtil.getCanonicalPath(FileUtil.openFile(configuration.getOutput()));

            // create a FileSpec...
            s.fileSpec = new FileSpec(array[0], WebTierAPI.getFileSpecMimeTypes(), false);

            // create a SourceList...
            s.sourceList = new SourceList(array[1], compilerConfig.getSourcePath(), null,
                                                   WebTierAPI.getSourceListMimeTypes(), false);

            // create a ResourceContainer...
            s.resources = new ResourceContainer();

            // create a ResourceBundlePath...
            s.bundlePath = new ResourceBundlePath(configuration.getCompilerConfiguration(), null);

            if (benchmark != null)
            {
                benchmark.benchmark(l10n.getLocalizedTextString(new InitialSetup()));
            }

            // load SWCs
            s.swcCache = new SwcCache();
           
            CompilerSwcContext swcContext = new CompilerSwcContext(true);
            // for compc the theme and include-libraries values have been purposely not passed in below.
            // This is done because the theme attribute doesn't make sense and the include-libraries value
            // actually causes issues when the default value is used with external libraries.
            // FIXME: why don't we just get rid of these values from the configurator for compc?  That's a problem
            // for include-libraries at least, since this value appears in flex-config.xml
            swcContext.load( compilerConfig.getLibraryPath(),
                             compilerConfig.getExternalLibraryPath(),
                             null,
                             null,
                             mappings,
                             I18nUtils.getTranslationFormat(compilerConfig),
                             s.swcCache );
            configuration.addExterns( swcContext.getExterns() );

               s.checksum = cfgbuf.checksum_ts() + swcContext.checksum();

            final SymbolTable symbolTable = new SymbolTable(configuration);
            s.perCompileData = symbolTable.perCompileData;

            Map licenseMap = configuration.getLicensesConfiguration().getLicenseMap();
View Full Code Here

            // setup the console logger. the configuration parser needs a logger.
            CompilerAPI.useConsoleLogger();

            // process configuration
            ConfigurationBuffer cfgbuf = new ConfigurationBuffer(DependencyRootConfiguration.class, Configuration.getAliases());
            DefaultsConfigurator.loadDefaults( cfgbuf );

            DependencyRootConfiguration configuration = (DependencyRootConfiguration) Mxmlc.processConfiguration(
                        l10n, "swcdepends", args, cfgbuf, DependencyRootConfiguration.class, "no-default-arg");
View Full Code Here

    // create of list of options that we want. All the other options that
    // we inherit will be filtered out.
    final String[] configVars = new String[]{"help", "version", "load-config", "input", "output",
                         "compiler.keep-as3-metadata", "compiler.debug"};
    Arrays.sort(configVars);
    ConfigurationBuffer cfgbuf = new ConfigurationBuffer(OptimizerConfiguration.class,
        new HashMap<String, String>(),
        new ConfigurationFilter() {

      public boolean select(String name)
      {
        return Arrays.binarySearch(configVars, name) >= 0;
      }

    });
   
        cfgbuf.setDefaultVar("input");
        try
        {
          DefaultsConfigurator.loadMinimumDefaults(cfgbuf);
          OptimizerConfiguration configuration = (OptimizerConfiguration) Mxmlc.processConfiguration(
                  l10n, "optimizer", args, cfgbuf, OptimizerConfiguration.class, "input", true);
View Full Code Here

  }

  private static void digestTool(String[] args)
  {
   
        ConfigurationBuffer cfgbuf = new ConfigurationBuffer(DigestRootConfiguration.class,
                                      DigestConfiguration.getAliases());
        try
        {
            // setup the path resolver
          flex2.compiler.CompilerAPI.usePathResolver();
View Full Code Here

    public static void compc(String[] args)
    {
        CompilerAPI.useAS3();

        Benchmark benchmark = null;
        ConfigurationBuffer cfgbuf = new ConfigurationBuffer(CompcConfiguration.class, CompcConfiguration.getAliases());

        // Do not set this.  The include-classes should be included in the configuration buffer checksum so changes
        // to the class list can be detected during incremental builds.
        //cfgbuf.setDefaultVar("include-classes");
View Full Code Here

TOP

Related Classes of flex2.compiler.config.ConfigurationBuffer

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.