Package flex2.compiler.swc

Examples of flex2.compiler.swc.SwcScript


                {
                    Source dependent = symbolTable.findSourceByQName((QName) name);

                    if ((dependent != null) && dependent.isSwcScriptOwner())
                    {
                        SwcScript swcScript = (SwcScript) dependent.getOwner();
                        Swc swc = swcScript.getLibrary().getSwc();
                       
                        // Make sure each dependency's minimum
                        // supported version is less than or equal to
                        // the compatibility version.
                        if (highestMinimumSupportedVersion < swc.getVersions().getMinimumVersion() &&
                            configuration.getCompilerConfiguration().enableSwcVersionFiltering())
                        {
                            highestMinimumSupportedVersion = swc.getVersions().getMinimumVersion();

                            if (isMinimumSupportedVersionConfigured &&
                                configuration.getMinimumSupportedVersion() < highestMinimumSupportedVersion)
                            {
                                HigherMinimumSupportedVersionRequired message =
                                    new HigherMinimumSupportedVersionRequired(swc.getLocation(),
                                                                              swc.getVersions().getMinimumVersionString());
                                ThreadLocalToolkit.log(message, u.getSource());
                            }
                        }
                    }
                }
            }

            // Warn about linked in dependent SWC's, which have style
            // defaults.  Linking in dependent SWC's pulls in
            // definitions without their associated style defaults and
            // their dependencies.  This can lead to missing skins at
            // runtime for applications, which compile against the
            // output SWC.  Merging the style defaults isn't enough,
            // because styles can bring in additional dependencies, so
            // in order to get a complete dependency set, we would
            // have to compile the style defaults and our current
            // design requires deferring that until application
            // compile time.  Therefore the best option is to
            // recommend that the user put the dependent SWC in the
            // external-library-path of the output SWC compilation and
            // in the library-path of downstream application
            // compilations.
            Source source = u.getSource();

            if (source.isSwcScriptOwner() &&
                !PreLink.isCompilationUnitExternal(u, externs) &&
                !source.isInternal() && !hidePotentialMissingSkinsWarning)
            {
                SwcScript swcScript = (SwcScript) source.getOwner();
                Swc swc = swcScript.getLibrary().getSwc();
                String location = swc.getLocation();

                if (!processedSwcs.contains(location))
                {
                    processedSwcs.add(location);
View Full Code Here


                        // for any scripts that we include from libraries, add the libraries keep-as3-metadata
                        // to the list of metadata we will preserve in postlink.
                        Source source = l.getUnit().getSource();
                        if (source.isSwcScriptOwner() && !source.isInternal())
                        {
                            SwcScript script = (SwcScript)source.getOwner();
                            SwcLibrary library = script.getLibrary();
                
                            // lots of scripts, but not many swcs, so avoid adding the same metadata
                            // over and over.
                            if (!librariesProcessed.contains(library))
                            {
View Full Code Here

    private void addSignatureChecksumToData(CompilationUnit unit)
    {
        Long signatureChecksum = unit.getSignatureChecksum();
        if (signatureChecksum == null)
        {
            SwcScript script = (SwcScript) unit.getSource().getOwner();
            signatureChecksum = new Long(script.getLastModified());
        }

        if (swcDefSignatureChecksums != null)
        {
            for (Iterator<QName> iter = unit.topLevelDefinitions.iterator(); iter.hasNext();)
View Full Code Here

               
                // loop thru the script in a library and build the list of definitions
                for (Iterator<SwcScript> scriptIter = swcLibrary.getScriptIterator();
                     scriptIter.hasNext();)
                {
                    SwcScript swcScript = (SwcScript)scriptIter.next();

                    for (Iterator<String> defIter = swcScript.getDefinitionIterator(); defIter.hasNext();)
                    {
                        String definition = (String)defIter.next();
                        defMap.put(definition, swcScript);
                    }
                }

                // loop thru the script in a library again and look for external definitions
                for (Iterator<SwcScript> scriptIter = swcLibrary.getScriptIterator();
                     scriptIter.hasNext();)
                {
                    SwcScript swcScript = (SwcScript)scriptIter.next();

                    for (Iterator<String> typeIter = swcScript.getDependencySet().getTypeIterator();
                             typeIter.hasNext();)
                    {
                        String type = (String)typeIter.next();
                        
                        // filter the list of dependency types we care about.
                        if (scriptDependencyTypes != null)
                        {
                            if (!scriptDependencyTypes.contains(type))
                                continue;
                        }
                       
                        // loop thru the dependencies of each script
                        for (Iterator<String> scriptDepIter = swcScript.getDependencySet().getDependencyIterator(type);
                             scriptDepIter.hasNext();)
                        {
                            String scriptDep = (String)scriptDepIter.next();
                           
                            // does the script definition live in its own swc?
                            SwcScript dependentScript = defMap.get(scriptDep);
                           
                            if (dependentScript == null)
                            {
                                // keep a list of all externals
                                //System.out.println(swcEntry.getValue().getLocation() + " has external " + scriptDep);
                                externalScripts.addScriptDependencyType(scriptDep, type);
                            }
                        }
                    }
                }
            }
        }
       
        Map<String, Set<String>> dependencyMap = null;
       
        if (minimizeDependencySet)
            dependencyMap = new HashMap<String, Set<String>>(swcGroup.getNumberLoaded());
       
        // for each swc try to resolve its externals in other swcs.
        // Each external can be found in more than one swcs. A dependency could this swc A OR swc B.
        for (Map.Entry<String, SwcExternalScriptInfoImpl> swcExternEntry : swcExternMap.entrySet())
        {
            String swcLocation = swcExternEntry.getKey();
            SwcExternalScriptInfoImpl externalInfo = swcExternEntry.getValue();
            Set<String> dependencyList = null;
            if (minimizeDependencySet)
            {
                dependencyList = dependencyMap.get(swcLocation);
                if (dependencyList == null)
                {
                    dependencyList = new HashSet<String>();
                    dependencyMap.put(swcLocation, dependencyList);
                }
               
            }

            for (String externName : externalInfo.getExternalScripts())
            {
                // for each extern, look in other swcs until we find the entry.
                // look in all the swcs, so we know all the dependencies
                List<SwcScript> resolvingSwcs = new ArrayList<SwcScript>();
                for (Map.Entry<String, Map<String, SwcScript>> swcDefEntry : swcDefMap.entrySet())
                {
                    String swcLocation2 = swcDefEntry.getKey();
                    if (swcLocation2.equals(swcLocation))
                        continue; // skip checking our own definition list

                    Map<String, SwcScript> externMap2 = swcDefEntry.getValue();
                    SwcScript script = externMap2.get(externName);
                    if (script != null)
                    {
                        // If we want a minimum set, then just record the dependency,
                        // later we will prune out subsets and add dependencies
                        // in depInfo. Otherwise just record the dependency now.
                        if (minimizeDependencySet)
                        {
                            resolvingSwcs.add(script);
                        }
                        else
                        {
                            //System.out.println("Add dependency from " + swcLocation + " to " + swcLocation2);
                            depInfo.addDependency(swcLocation, swcLocation2);

                            //System.out.println("External " + externName + " in " + swcLocation + " resolved in " + swcLocation2);
                            externalInfo.addResolvingSwc(externName, swcLocation2);
                        }
                       
                    }
                }

                if (minimizeDependencySet)
                {
                  SwcScript externalScript = null;
                  if (resolvingSwcs.size() > 1)
                  {
                    // chose the swc that will provide us with the original
                    // source of the swc, not the swc that the script was
                    // copied from.
                    externalScript = getOriginalSwc(resolvingSwcs);
                  }
                  else if (resolvingSwcs.size() > 0)
                  {
                    externalScript = resolvingSwcs.get(0);
                  }
                 
                  if (externalScript != null)
                  {
                    String swcLocation2 = externalScript.getSwcLocation();
                    dependencyList.add(swcLocation2);

                    //System.out.println("External " + externName + " in " + swcLocation + " resolved in " + swcLocation2);
                    externalInfo.addResolvingSwc(externName, swcLocation2);
                  }
View Full Code Here

     * @param resolvingSwcs
     * @return
     */
    private static SwcScript getOriginalSwc(List<SwcScript> resolvingSwcs)
    {
      SwcScript originalScript = null;
      SwcScript newestScript = null;
      long oldestSwcCreationTime = Long.MAX_VALUE;
      long newestScriptTime = Long.MAX_VALUE;
      boolean allScriptTimesEqual = true;    // if all the script times are equal, then
                          // there is no monkey patching.
     
View Full Code Here

           
            // loop thru the script in a library and build the list of definitions
            for (Iterator<SwcScript> scriptIter = swcLibrary.getScriptIterator();
                 scriptIter.hasNext();)
            {
                SwcScript swcScript = (SwcScript)scriptIter.next();

                for (Iterator<String> defIter = swcScript.getDefinitionIterator(); defIter.hasNext();)
                {
                    String definition = (String)defIter.next();
                    scripts.add(definition);
                }
            }
View Full Code Here

           
            // loop thru the script in a library and build the list of definitions
            for (Iterator<SwcScript> scriptIter = swcLibrary.getScriptIterator();
                 scriptIter.hasNext();)
            {
                SwcScript swcScript = (SwcScript)scriptIter.next();

                for (String dependencyType : dependencyTypes)
                {
                    for (Iterator<String> depIter = swcScript.getDependencySet().
                            getDependencyIterator(dependencyType);
                     depIter != null && depIter.hasNext();)
                    {
                    String definition = (String)depIter.next();
                    dependencies.add(definition);
View Full Code Here

                    {
                        Source dependent = symbolTable.findSourceByQName((QName) name);

                        if (dependent.isSwcScriptOwner())
                        {
                            SwcScript swcScript = (SwcScript) dependent.getOwner();
                            Swc swc = swcScript.getLibrary().getSwc();
                       
                            // Make sure each dependency's minimum
                            // supported version is less than or equal to
                            // the compatibility version.
                            if (compatibilityVersion < swc.getVersions().getMinimumVersion())
                            {
                                DependencyNotCompatible message =
                                    new DependencyNotCompatible(swcScript.getName().replace('/', '.'),
                                                                swc.getLocation(),
                                                                swc.getVersions().getMinimumVersionString(),
                                                                compilerConfiguration.getCompatibilityVersionString());
                                ThreadLocalToolkit.log(message, u.getSource());
                            }
View Full Code Here

            assert compilationUnit != null : "Must have missed a forcedToStop() check after the most recent batch()";
            Source source = compilationUnit.getSource();

            if (source.isSwcScriptOwner())
            {
                SwcScript swcScript = (SwcScript) source.getOwner();
                Swc swc = swcScript.getLibrary().getSwc();
                VirtualFile defaultsCssFile = null;

                if (versionDefaultsCssFileName != null)
                {
                    defaultsCssFile = swc.getFile(versionDefaultsCssFileName);
View Full Code Here

                // this later to figure out which RSLs to load.
                Source source = u.getSource();
               
                if (!source.isInternal() && source.isSwcScriptOwner())
                {
                    SwcScript script = (SwcScript)source.getOwner();
                    contributingSwcs.add(script.getSwcLocation());
                }
            }
        }

        String flexInitClass = null;
View Full Code Here

TOP

Related Classes of flex2.compiler.swc.SwcScript

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.