• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java WorkResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gradle.api.tasks.WorkResult的典型用法代码示例。如果您正苦于以下问题:Java WorkResult类的具体用法?Java WorkResult怎么用?Java WorkResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WorkResult类属于org.gradle.api.tasks包,在下文中一共展示了WorkResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@Override
public WorkResult execute(JavadocSpec spec) {
    JavadocExecHandleBuilder javadocExecHandleBuilder = new JavadocExecHandleBuilder(execActionFactory);
    javadocExecHandleBuilder.setExecutable(spec.getExecutable());
    javadocExecHandleBuilder.execDirectory(spec.getWorkingDir()).options(spec.getOptions()).optionsFile(spec.getOptionsFile());

    ExecAction execAction = javadocExecHandleBuilder.getExecHandle();
    if (spec.isIgnoreFailures()) {
        execAction.setIgnoreExitValue(true);
    }

    try {
        execAction.execute();
    } catch (ExecException e) {
        LOG.info("Problems generating Javadoc."
                + "\n  Command line issued: " + execAction.getCommandLine()
                + "\n  Generated Javadoc options file has following contents:\n------\n{}------", GFileUtils.readFileQuietly(spec.getOptionsFile()));
        throw new GradleException(String.format("Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '%s'", spec.getOptionsFile()), e);
    }

    return new SimpleWorkResult(true);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:23,代码来源:JavadocGenerator.java


示例2: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visited = new HashSet<RelativePath>();

    WorkResult didWork = delegate.execute(new CopyActionProcessingStream() {
        public void process(final CopyActionProcessingStreamAction action) {
            stream.process(new CopyActionProcessingStreamAction() {
                public void processFile(FileCopyDetailsInternal details) {
                    visited.add(details.getRelativePath());
                    action.processFile(details);
                }
            });
        }
    });

    SyncCopyActionDecoratorFileVisitor fileVisitor = new SyncCopyActionDecoratorFileVisitor(visited, preserveSpec);

    MinimalFileTree walker = new DirectoryFileTree(baseDestDir).postfix();
    walker.visit(fileVisitor);
    visited.clear();

    return new SimpleWorkResult(didWork.getDidWork() || fileVisitor.didWork);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:23,代码来源:SyncCopyActionDecorator.java


示例3: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
public WorkResult execute(final CopyActionProcessingStream stream) {
    final Set<RelativePath> visited = new HashSet<RelativePath>();

    WorkResult didWork = delegate.execute(new CopyActionProcessingStream() {
        public void process(final CopyActionProcessingStreamAction action) {
            stream.process(new CopyActionProcessingStreamAction() {
                public void processFile(FileCopyDetailsInternal details) {
                    visited.add(details.getRelativePath());
                    action.processFile(details);
                }
            });
        }
    });

    SyncCopyActionDecoratorFileVisitor fileVisitor = new SyncCopyActionDecoratorFileVisitor(visited);

    MinimalFileTree walker = new DirectoryFileTree(baseDestDir).postfix();
    walker.visit(fileVisitor);
    visited.clear();

    return new SimpleWorkResult(didWork.getDidWork() || fileVisitor.didWork);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:23,代码来源:SyncCopyActionDecorator.java


示例4: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
public WorkResult execute(T spec) {
    boolean didWork = false;
    boolean windowsPathLimitation = OperatingSystem.current().isWindows();

    String objectFileExtension = OperatingSystem.current().isWindows() ? ".obj" : ".o";
    for (File sourceFile : spec.getSourceFiles()) {
        String objectFileName = FilenameUtils.removeExtension(sourceFile.getName()) + objectFileExtension;
        WorkResult result = commandLineTool.inWorkDirectory(spec.getObjectFileDir())
                .withArguments(new SingleSourceCompileArgTransformer<T>(sourceFile,
                                        objectFileName,
                                        new ShortCircuitArgsTransformer(argsTransfomer),
                                        windowsPathLimitation,
                                        false))
                .execute(spec);
        didWork = didWork || result.getDidWork();
    }
    return new SimpleWorkResult(didWork);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:19,代码来源:NativeCompiler.java


示例5: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
public WorkResult execute(ScalaJavaJointCompileSpec spec) {
    scalaCompiler.execute(spec);

    PatternFilterable patternSet = new PatternSet();
    patternSet.include("**/*.java");
    FileTree javaSource = spec.getSource().getAsFileTree().matching(patternSet);
    if (!javaSource.isEmpty()) {
        spec.setSource(javaSource);
        javaCompiler.execute(spec);
    }

    return new WorkResult() {
        public boolean getDidWork() {
            return true;
        }
    };
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:DefaultScalaJavaJointCompiler.java


示例6: link

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@TaskAction
public void link() {
    SimpleStaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs());
    cleaner.setDestinationDir(getDestinationDir());
    cleaner.execute();

    if (getSource().isEmpty()) {
        setDidWork(false);
        return;

    }


    LinkerSpec spec = createLinkerSpec();
    spec.setTargetPlatform(getTargetPlatform());
    spec.setTempDir(getTemporaryDir());
    spec.setOutputFile(getOutputFile());

    spec.objectFiles(getSource());
    spec.libraries(getLibs());
    spec.args(getLinkerArgs());

    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    spec.setOperationLogger(operationLogger);

    Compiler<LinkerSpec> compiler = Cast.uncheckedCast(toolChain.select(targetPlatform).newCompiler(spec.getClass()));
    compiler = BuildOperationLoggingCompilerDecorator.wrap(compiler);
    WorkResult result = compiler.execute(spec);
    setDidWork(result.getDidWork());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:31,代码来源:AbstractLinkTask.java


示例7: link

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@TaskAction
public void link() {

    StaticLibraryArchiverSpec spec = new DefaultStaticLibraryArchiverSpec();
    spec.setTempDir(getTemporaryDir());
    spec.setOutputFile(getOutputFile());
    spec.objectFiles(getSource());
    spec.args(getStaticLibArgs());

    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    spec.setOperationLogger(operationLogger);

    Compiler<StaticLibraryArchiverSpec> compiler = Cast.uncheckedCast(toolChain.select(targetPlatform).newCompiler(spec.getClass()));
    WorkResult result = BuildOperationLoggingCompilerDecorator.wrap(compiler).execute(spec);
    setDidWork(result.getDidWork());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:CreateStaticLibrary.java


示例8: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@Override
public WorkResult execute(final LinkerSpec spec) {
    List<String> args = argsTransformer.transform(spec);
    invocationContext.getArgAction().execute(args);
    if (useCommandFile) {
        new GccOptionsFileArgsWriter(spec.getTempDir()).execute(args);
    }
    final CommandLineToolInvocation invocation = invocationContext.createInvocation(
            "linking " + spec.getOutputFile().getName(), args, spec.getOperationLogger());

    buildOperationProcessor.run(commandLineToolInvocationWorker, new Action<BuildOperationQueue<CommandLineToolInvocation>>() {
        @Override
        public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
            buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
            buildQueue.add(invocation);
        }
    });

    return new SimpleWorkResult(true);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:21,代码来源:GccLinker.java


示例9: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@Override
public WorkResult execute(final StaticLibraryArchiverSpec spec) {
    deletePreviousOutput(spec);

    List<String> args = argsTransformer.transform(spec);
    invocationContext.getArgAction().execute(args);
    final CommandLineToolInvocation invocation = invocationContext.createInvocation(
            "archiving " + spec.getOutputFile().getName(), args, spec.getOperationLogger());

    buildOperationProcessor.run(commandLineToolInvocationWorker, new Action<BuildOperationQueue<CommandLineToolInvocation>>() {
        @Override
        public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
            buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
            buildQueue.add(invocation);
        }
    });
    return new SimpleWorkResult(true);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:ArStaticLibraryArchiver.java


示例10: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@Override
public WorkResult execute(final StaticLibraryArchiverSpec spec) {
    final StaticLibraryArchiverSpec transformedSpec = specTransformer.transform(spec);
    final List<String> args = argsTransformer.transform(transformedSpec);
    invocationContext.getArgAction().execute(args);
    new VisualCppOptionsFileArgsWriter(spec.getTempDir()).execute(args);
    final CommandLineToolInvocation invocation = invocationContext.createInvocation(
            "archiving " + spec.getOutputFile().getName(), args, spec.getOperationLogger());

    buildOperationProcessor.run(commandLineToolInvocationWorker, new Action<BuildOperationQueue<CommandLineToolInvocation>>() {
        @Override
        public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
            buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
            buildQueue.add(invocation);
        }
    });

    return new SimpleWorkResult(true);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:20,代码来源:LibExeStaticLibraryArchiver.java


示例11: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@Override
public WorkResult execute(final LinkerSpec spec) {
    LinkerSpec transformedSpec = specTransformer.transform(spec);
    List<String> args = argsTransformer.transform(transformedSpec);
    invocationContext.getArgAction().execute(args);
    new VisualCppOptionsFileArgsWriter(spec.getTempDir()).execute(args);
    final CommandLineToolInvocation invocation = invocationContext.createInvocation(
            "linking " + spec.getOutputFile().getName(), args, spec.getOperationLogger());

    buildOperationProcessor.run(commandLineToolInvocationWorker, new Action<BuildOperationQueue<CommandLineToolInvocation>>() {
        @Override
        public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
            buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
            buildQueue.add(invocation);
        }
    });

    return new SimpleWorkResult(true);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:20,代码来源:LinkExeLinker.java


示例12: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@Override
public WorkResult execute(final T spec) {
    final T transformedSpec = specTransformer.transform(spec);
    final List<String> genericArgs = getArguments(transformedSpec);

    final File objectDir = transformedSpec.getObjectFileDir();
    buildOperationProcessor.run(commandLineToolInvocationWorker, new Action<BuildOperationQueue<CommandLineToolInvocation>>() {
        @Override
        public void execute(BuildOperationQueue<CommandLineToolInvocation> buildQueue) {
            buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation());
            for (File sourceFile : transformedSpec.getSourceFiles()) {
                CommandLineToolInvocation perFileInvocation =
                    createPerFileInvocation(genericArgs, sourceFile, objectDir, spec);
                buildQueue.add(perFileInvocation);
            }
        }
    });

    return new SimpleWorkResult(!transformedSpec.getSourceFiles().isEmpty());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:21,代码来源:NativeCompiler.java


示例13: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@Override
public WorkResult execute(JavaCompileSpec spec) {
    Timer clock = Timers.startTimer();
    JarClasspathSnapshot jarClasspathSnapshot = jarClasspathSnapshotProvider.getJarClasspathSnapshot(spec.getClasspath());
    RecompilationSpec recompilationSpec = recompilationSpecProvider.provideRecompilationSpec(inputs, previousCompilation, jarClasspathSnapshot);

    if (recompilationSpec.isFullRebuildNeeded()) {
        LOG.lifecycle("Full recompilation is required because {}. Analysis took {}.", recompilationSpec.getFullRebuildCause(), clock.getElapsed());
        return cleaningCompiler.execute(spec);
    }

    incrementalCompilationInitilizer.initializeCompilation(spec, recompilationSpec.getClassNames());
    if (spec.getSource().isEmpty()) {
        LOG.lifecycle("None of the classes needs to be compiled! Analysis took {}. ", clock.getElapsed());
        return new RecompilationNotNecessary();
    }

    try {
        //use the original compiler to avoid cleaning up all the files
        return cleaningCompiler.getCompiler().execute(spec);
    } finally {
        LOG.lifecycle("Incremental compilation of {} classes completed in {}.", recompilationSpec.getClassNames().size(), clock.getElapsed());
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:25,代码来源:SelectiveCompiler.java


示例14: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@Override
public WorkResult execute(final T spec) {
    PersistentStateCache<CompilationState> compileStateCache = compilationStateCacheFactory.create(task.getPath());
    DefaultSourceIncludesParser sourceIncludesParser = new DefaultSourceIncludesParser(sourceParser, importsAreIncludes);
    IncrementalCompileProcessor processor = createProcessor(compileStateCache, sourceIncludesParser, spec.getIncludeRoots());
    IncrementalCompilation compilation = processor.processSourceFiles(spec.getSourceFiles());

    spec.setSourceFileIncludeDirectives(mapIncludes(spec.getSourceFiles(), compilation.getFinalState()));

    handleDiscoveredInputs(spec, compilation, spec.getDiscoveredInputRecorder());

    WorkResult workResult;
    if (spec.isIncrementalCompile()) {
        workResult = doIncrementalCompile(compilation, spec);
    } else {
        workResult = doCleanIncrementalCompile(spec);
    }

    compileStateCache.set(compilation.getFinalState());

    return workResult;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:23,代码来源:IncrementalNativeCompiler.java


示例15: doCleanIncrementalCompile

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
protected WorkResult doCleanIncrementalCompile(T spec) {
    boolean deleted = cleanPreviousOutputs(spec);
    WorkResult compileResult = delegateCompiler.execute(spec);
    if (deleted && !compileResult.getDidWork()) {
        return new SimpleWorkResult(deleted);
    }
    return compileResult;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:IncrementalNativeCompiler.java


示例16: compile

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@TaskAction
public void compile(IncrementalTaskInputs inputs) {
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());

    NativeCompileSpec spec = new DefaultWindowsResourceCompileSpec();
    spec.setTempDir(getTemporaryDir());
    spec.setObjectFileDir(getOutputDir());
    spec.include(getIncludes());
    spec.source(getSource());
    spec.setMacros(getMacros());
    spec.args(getCompilerArgs());
    spec.setIncrementalCompile(inputs.isIncremental());
    spec.setDiscoveredInputRecorder((DiscoveredInputRecorder) inputs);
    spec.setOperationLogger(operationLogger);

    PlatformToolProvider platformToolProvider = toolChain.select(targetPlatform);
    WorkResult result = doCompile(spec, platformToolProvider);
    setDidWork(result.getDidWork());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:20,代码来源:WindowsResourceCompile.java


示例17: assemble

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@TaskAction
public void assemble() {
    BuildOperationLogger operationLogger = getOperationLoggerFactory().newOperationLogger(getName(), getTemporaryDir());
    SimpleStaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs());
    cleaner.setDestinationDir(getObjectFileDir());
    cleaner.execute();

    DefaultAssembleSpec spec = new DefaultAssembleSpec();
    spec.setTempDir(getTemporaryDir());

    spec.setObjectFileDir(getObjectFileDir());
    spec.source(getSource());
    spec.args(getAssemblerArgs());
    spec.setOperationLogger(operationLogger);

    Compiler<AssembleSpec> compiler = toolChain.select(targetPlatform).newCompiler(AssembleSpec.class);
    WorkResult result = BuildOperationLoggingCompilerDecorator.wrap(compiler).execute(spec);
    setDidWork(result.getDidWork());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:20,代码来源:Assemble.java


示例18: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
@Override
public WorkResult execute(TwirlCompileSpec spec) {
    ArrayList<File> outputFiles = Lists.newArrayList();
    try {
        ClassLoader cl = getClass().getClassLoader();
        ScalaMethod compile = adapter.getCompileMethod(cl);
        Iterable<RelativeFile> sources = spec.getSources();
        for (RelativeFile sourceFile : sources) {
            Object result = compile.invoke(adapter.createCompileParameters(cl, sourceFile.getFile(), sourceFile.getBaseDir(), spec.getDestinationDir(), spec.getDefaultImports()));
            ScalaOptionInvocationWrapper<File> maybeFile = new ScalaOptionInvocationWrapper<File>(result);
            if (maybeFile.isDefined()) {
                outputFiles.add(maybeFile.get());
            }
        }
    } catch (Exception e) {
        throw new RuntimeException("Error invoking Play Twirl template compiler.", e);
    }

    return new SimpleWorkResult(!outputFiles.isEmpty());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:21,代码来源:TwirlCompiler.java


示例19: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
static WorkResult execute(ScalaJavaJointCompileSpec spec) {
    LOGGER.info("Compiling with Zinc Scala compiler.");

    xsbti.Logger logger = new SbtLoggerAdapter();

    com.typesafe.zinc.Compiler compiler = createCompiler(spec.getScalaClasspath(), spec.getZincClasspath(), logger);
    List<String> scalacOptions = new ScalaCompilerArgumentsGenerator().generate(spec);
    List<String> javacOptions = new JavaCompilerArgumentsBuilder(spec).includeClasspath(false).build();
    Inputs inputs = Inputs.create(ImmutableList.copyOf(spec.getClasspath()), ImmutableList.copyOf(spec.getSource()), spec.getDestinationDir(),
            scalacOptions, javacOptions, spec.getScalaCompileOptions().getIncrementalOptions().getAnalysisFile(), spec.getAnalysisMap(), "mixed", getIncOptions(), true);
    if (LOGGER.isDebugEnabled()) {
        Inputs.debug(inputs, logger);
    }

    try {
        compiler.compile(inputs, logger);
    } catch (xsbti.CompileFailed e) {
        throw new CompilationFailedException(e);
    }

    return new SimpleWorkResult(true);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:23,代码来源:ZincScalaCompiler.java


示例20: execute

import org.gradle.api.tasks.WorkResult; //导入依赖的package包/类
public WorkResult execute(StaticLibraryArchiverSpec spec) {
    deletePreviousOutput(spec);

    MutableCommandLineToolInvocation invocation = baseInvocation.copy();
    invocation.setArgs(arguments.transform(spec));
    commandLineTool.execute(invocation);
    return new SimpleWorkResult(true);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:9,代码来源:ArStaticLibraryArchiver.java



注:本文中的org.gradle.api.tasks.WorkResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GeometryEnvelope类代码示例发布时间:2022-05-22
下一篇:
Java Bag类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap