当前位置: 首页>>代码示例>>Java>>正文


Java ScalaSourceSet类代码示例

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


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

示例1: configureScalaCompile

import org.gradle.api.tasks.ScalaSourceSet; //导入依赖的package包/类
private static void configureScalaCompile(final Project project, JavaBasePlugin javaPlugin, final SourceSet sourceSet) {
    String taskName = sourceSet.getCompileTaskName("scala");
    final ScalaCompile scalaCompile = project.getTasks().create(taskName, ScalaCompile.class);
    scalaCompile.dependsOn(sourceSet.getCompileJavaTaskName());
    javaPlugin.configureForSourceSet(sourceSet, scalaCompile);
    Convention scalaConvention = (Convention) InvokerHelper.getProperty(sourceSet, "convention");
    ScalaSourceSet scalaSourceSet = scalaConvention.findPlugin(ScalaSourceSet.class);
    scalaCompile.setDescription("Compiles the " + scalaSourceSet.getScala() + ".");
    scalaCompile.setSource(scalaSourceSet.getScala());
    project.getTasks().getByName(sourceSet.getClassesTaskName()).dependsOn(taskName);

    // cannot use convention mapping because the resulting object won't be serializable
    // cannot compute at task execution time because we need association with source set
    project.getGradle().addBuildListener(new BuildAdapter() {
        @Override
        public void projectsEvaluated(Gradle gradle) {
            IncrementalCompileOptions incrementalOptions = scalaCompile.getScalaCompileOptions().getIncrementalOptions();
            if (incrementalOptions.getAnalysisFile() == null) {
                String analysisFilePath = project.getBuildDir().getPath() + "/tmp/scala/compilerAnalysis/" + scalaCompile.getName() + ".analysis";
                incrementalOptions.setAnalysisFile(new File(analysisFilePath));
            }

            if (incrementalOptions.getPublishedCode() == null) {
                Jar jarTask = (Jar) project.getTasks().findByName(sourceSet.getJarTaskName());
                incrementalOptions.setPublishedCode(jarTask == null ? null : jarTask.getArchivePath());
            }
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:30,代码来源:ScalaBasePlugin.java

示例2: scala

import org.gradle.api.tasks.ScalaSourceSet; //导入依赖的package包/类
public ScalaSourceSet scala(Closure configureClosure) {
    return scala(ClosureBackedAction.of(configureClosure));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:DefaultScalaSourceSet.java

示例3: scala

import org.gradle.api.tasks.ScalaSourceSet; //导入依赖的package包/类
public ScalaSourceSet scala(Closure configureClosure) {
    ConfigureUtil.configure(configureClosure, getScala());
    return this;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:5,代码来源:DefaultScalaSourceSet.java


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