Example usage for com.google.gwt.core.ext.linker ArtifactSet addAll

List of usage examples for com.google.gwt.core.ext.linker ArtifactSet addAll

Introduction

In this page you can find the example usage for com.google.gwt.core.ext.linker ArtifactSet addAll.

Prototype

public boolean addAll(Collection<? extends Artifact<?>> c) 

Source Link

Usage

From source file:cc.alcina.framework.gwt.appcache.linker.PermutationInfoLinker.java

License:Apache License

@Override
public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean onePermutation)
        throws UnableToCompleteException {
    if (onePermutation) {
        ArtifactSet toReturn = new ArtifactSet(artifacts);
        ArtifactSet writableArtifacts = new ArtifactSet(artifacts);
        for (CompilationResult compilation : artifacts.find(CompilationResult.class)) {
            // pass a writable set so that other stages can use this set for
            // temporary storage
            toReturn.addAll(doEmitCompilation(logger, context, compilation, writableArtifacts));
        }/*from www  . jav  a  2  s.  c o  m*/
        return toReturn;
    } else {
        permutationsUtil.setupPermutationsMap(artifacts);
        ArtifactSet toReturn = new ArtifactSet(artifacts);
        maybeOutputPropertyMap(logger, context, toReturn);
        return toReturn;
    }
}

From source file:com.bedatadriven.rebar.appcache.linker.AppCacheIFrameLinker.java

License:Apache License

@Override
public ArtifactSet link(TreeLogger logger, LinkerContext linkerContext, ArtifactSet artifacts)
        throws UnableToCompleteException {

    Collection<CompilationResult> compilationResults = artifacts.find(CompilationResult.class);

    hostedMode = compilationResults.size() == 0;

    if (hostedMode) {
        // if we are being run in hosted mode, revert entirely to the IFrameLinker

        return super.link(logger, linkerContext, artifacts);

    } else {//from ww w . j a v  a2 s  . com

        ArtifactSet writableArtifacts = new ArtifactSet(artifacts);
        ArtifactSet toReturn = new ArtifactSet(artifacts);

        for (CompilationResult compilation : compilationResults) {
            PermutationContext context = new PermutationContext(linkerContext, writableArtifacts, compilation);

            Collection<Artifact<?>> compilationArtifacts = doEmitCompilation(logger, linkerContext, compilation,
                    writableArtifacts);

            context.addToCache(writableArtifacts.find(EmittedArtifact.class));
            context.addToCache(emittedArtifacts(compilationArtifacts));

            toReturn.addAll(compilationArtifacts);
            toReturn.add(doEmitBootstrapScript(logger, context, writableArtifacts));
            toReturn.add(doEmitManifest(logger, context, new Html5ManifestWriter()));
        }

        toReturn.add(emitPermutationMap(logger, linkerContext, writableArtifacts));

        return toReturn;
    }
}