本文整理汇总了Java中com.google.gwt.core.ext.linker.CompilationResult类的典型用法代码示例。如果您正苦于以下问题:Java CompilationResult类的具体用法?Java CompilationResult怎么用?Java CompilationResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CompilationResult类属于com.google.gwt.core.ext.linker包,在下文中一共展示了CompilationResult类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doEmitCompilation
import com.google.gwt.core.ext.linker.CompilationResult; //导入依赖的package包/类
@Override
protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,
LinkerContext context, CompilationResult result, ArtifactSet artifacts)
throws UnableToCompleteException {
String[] js = result.getJavaScript();
if (js.length != 1) {
logger.branch(TreeLogger.ERROR, getMultiFragmentWarningMessage(), null);
throw new UnableToCompleteException();
}
Collection<Artifact<?>> toReturn = new ArrayList<Artifact<?>>();
toReturn.add(new Script(result.getStrongName(), js[0]));
toReturn.addAll(emitSelectionInformation(result.getStrongName(), result));
return toReturn;
}
开发者ID:metteo,项目名称:gwt-worker,代码行数:17,代码来源:SingleScriptLinker.java
示例2: link
import com.google.gwt.core.ext.linker.CompilationResult; //导入依赖的package包/类
@Override
public ArtifactSet link(
TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean onePermutation)
throws UnableToCompleteException {
ArtifactSet toReturn = new ArtifactSet(artifacts);
ArtifactSet writableArtifacts = new ArtifactSet(artifacts);
boolean export = getExportProperty(context);
for (CompilationResult result : toReturn.find(CompilationResult.class)) {
String[] js = result.getJavaScript();
checkArgument(js.length == 1, "MinimalLinker doesn't support GWT.runAsync");
String output = formatOutput(js[0], export);
toReturn.add(emitString(logger, output, context.getModuleName() + ".js"));
}
for (SymbolMapsLinker.ScriptFragmentEditsArtifact ea :
writableArtifacts.find(SymbolMapsLinker.ScriptFragmentEditsArtifact.class)) {
toReturn.add(ea);
}
return toReturn;
}
开发者ID:google,项目名称:closure-compiler,代码行数:23,代码来源:MinimalLinker.java
示例3: link
import com.google.gwt.core.ext.linker.CompilationResult; //导入依赖的package包/类
@Override
public ArtifactSet link(TreeLogger logger, LinkerContext context,
ArtifactSet artifacts) throws UnableToCompleteException {
ArtifactSet toLink = new ArtifactSet(artifacts);
// Mask the stub manifest created by the generator
for (EmittedArtifact res : toLink.find(EmittedArtifact.class)) {
if (res.getPartialPath().endsWith(".gadget.xml")) {
manifestArtifact = res;
toLink.remove(res);
break;
}
}
if (manifestArtifact == null) {
if (artifacts.find(CompilationResult.class).isEmpty()) {
// Maybe hosted mode or junit, defer to XSLinker.
return new XSLinker().link(logger, context, toLink);
} else {
// When compiling for web mode, enforce that the manifest is present.
logger.log(TreeLogger.ERROR,
"No gadget manifest found in ArtifactSet.");
throw new UnableToCompleteException();
}
}
return super.link(logger, context, toLink);
}
开发者ID:kebernet,项目名称:shortyz,代码行数:30,代码来源:GadgetLinker.java
示例4: link
import com.google.gwt.core.ext.linker.CompilationResult; //导入依赖的package包/类
@Override
public ArtifactSet link( TreeLogger logger, LinkerContext context,
ArtifactSet artifacts ) throws UnableToCompleteException {
ArtifactSet toReturn = new ArtifactSet( artifacts );
out = new DefaultTextOutput( true );
long compilationTime = System.currentTimeMillis();
out.print( "(function(){" );
out.newline();
// get compilation result
Set<CompilationResult> results = artifacts
.find( CompilationResult.class );
if( results.size() == 0 ) {
logger.log( TreeLogger.WARN, "Requested 0 permutations" );
return toReturn;
}
CompilationResult result = results.iterator().next();
// get the generated javascript
String[] javaScript = result.getJavaScript();
out.print( "var $wnd;var $doc;" );
out.print( "var $moduleName, $moduleBase;" );
out.newline();
out.print( "if(typeof(window)!='undefined'){$wnd=window;$doc=$wnd.document;}" );
out.newline();
out.print( "if(typeof(navigator)=='undefined'){navigator={};navigator.userAgent='timobile';$doc={};$doc.documentMode=''; }" );
out.newline();
out.print( "var $gwt_version = \"" + About.getGwtVersionNum() + "\";" );
out.newlineOpt();
out.print( context.optimizeJavaScript( logger, javaScript[0] ) );
out.newline();
out.print( "var $stats = function(){};" );
out.newline();
out.print( "var $sessionId = function(){};" );
out.newline();
out.print( "$strongName = '" + result.getStrongName() + "';" );
out.newline();
out.print( "$ti4jCompilationDate = " + compilationTime + ";" );
out.newline();
out.print( "gwtOnLoad(null,'" + context.getModuleName() + "',null);" );
out.newline();
out.print( "})();" );
out.newline();
toReturn.add( emitString( logger, out.toString(), generateJavaScriptPath( context ) ) );
// toReturn.add(emitString(logger, Long.toString(compilationTime),
// APP_COMPILATION_FILE_NAME));
return toReturn;
}
开发者ID:ahome-it,项目名称:ahome-core,代码行数:54,代码来源:BaseSingleScriptLinker.java
注:本文中的com.google.gwt.core.ext.linker.CompilationResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论