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

Java AbstractCompile类代码示例

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

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



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

示例1: configureForSourceSet

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
public void configureForSourceSet(final SourceSet sourceSet, AbstractCompile compile) {
    ConventionMapping conventionMapping;
    compile.setDescription("Compiles the " + sourceSet.getJava() + ".");
    conventionMapping = compile.getConventionMapping();
    compile.setSource(sourceSet.getJava());
    conventionMapping.map("classpath", new Callable<Object>() {
        public Object call() throws Exception {
            return sourceSet.getCompileClasspath();
        }
    });
    conventionMapping.map("destinationDir", new Callable<Object>() {
        public Object call() throws Exception {
            return sourceSet.getOutput().getClassesDir();
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:JavaBasePlugin.java


示例2: setJavaCompilerTask

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
/**
 * Makes the given task the one used by top-level "compile" task.
 */
public static void setJavaCompilerTask(
        @NonNull AndroidTask<? extends AbstractCompile> javaCompilerTask,
        @NonNull TaskFactory tasks,
        @NonNull VariantScope scope) {
    scope.getCompileTask().dependsOn(tasks, javaCompilerTask);
    scope.setJavaCompilerTask(javaCompilerTask);

    // TODO: Get rid of it once we stop keeping tasks in variant data.
    //noinspection VariableNotUsedInsideIf
    if (scope.getVariantData().javacTask != null) {
        // This is not the experimental plugin, let's update variant data, so Variants API
        // keeps working.
        scope.getVariantData().javaCompilerTask =  (AbstractCompile) tasks.named(javaCompilerTask.getName());
    }

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TaskManager.java


示例3: configureCompileTask

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
/**
 * Preconfigures the specified compile task based on the specified source set and class directory binary.
 *
 * @param compile the compile task to be preconfigured
 * @param sourceSet the source set for the compile task
 * @param binary the binary for the compile task
 */
public void configureCompileTask(AbstractCompile compile, final JavaSourceSet sourceSet, final ClassDirectoryBinarySpec binary) {
    compile.setDescription(String.format("Compiles %s.", sourceSet));
    compile.setSource(sourceSet.getSource());
    compile.dependsOn(sourceSet);
    ConventionMapping conventionMapping = compile.getConventionMapping();
    conventionMapping.map("classpath", new Callable<Object>() {
        public Object call() throws Exception {
            return sourceSet.getCompileClasspath().getFiles();
        }
    });
    conventionMapping.map("destinationDir", new Callable<Object>() {
        public Object call() throws Exception {
            return binary.getClassesDir();
        }
    });
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:24,代码来源:LegacyJavaComponentPlugin.java


示例4: configureForSourceSet

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
public void configureForSourceSet(final SourceSet sourceSet, AbstractCompile compile) {
    ConventionMapping conventionMapping;
    compile.setDescription(String.format("Compiles the %s.", sourceSet.getJava()));
    conventionMapping = compile.getConventionMapping();
    compile.setSource(sourceSet.getJava());
    conventionMapping.map("classpath", new Callable<Object>() {
        public Object call() throws Exception {
            return sourceSet.getCompileClasspath();
        }
    });
    conventionMapping.map("destinationDir", new Callable<Object>() {
        public Object call() throws Exception {
            return sourceSet.getOutput().getClassesDir();
        }
    });
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:17,代码来源:JavaBasePlugin.java


示例5: configureCompileTask

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
/**
 * Preconfigures the specified compile task based on the specified source set and class directory binary.
 *
 * @param compile the compile task to be preconfigured
 * @param sourceSet the source set for the compile task
 * @param binary the binary for the compile task
 */
public void configureCompileTask(AbstractCompile compile, final JavaSourceSet sourceSet, final ClassDirectoryBinary binary) {
    compile.setDescription(String.format("Compiles %s.", sourceSet));
    compile.setSource(sourceSet.getSource());
    compile.dependsOn(sourceSet);
    ConventionMapping conventionMapping = compile.getConventionMapping();
    conventionMapping.map("classpath", new Callable<Object>() {
        public Object call() throws Exception {
            return sourceSet.getCompileClasspath().getFiles();
        }
    });
    conventionMapping.map("destinationDir", new Callable<Object>() {
        public Object call() throws Exception {
            return binary.getClassesDir();
        }
    });
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:24,代码来源:JavaLanguagePlugin.java


示例6: execute

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
@Override
public void execute(AbstractCompile task) {
    if (byteBuddyExtension.implies(task)) {
        task.doLast(new TransformationAction(project, byteBuddyExtension, task));
    } else {
        project.getLogger().info("Skipping non-specified task {}", task.getName());
    }
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:9,代码来源:PostCompilationAction.java


示例7: configureLanguageLevel

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
/**
 * Determines the java language level to use and sets it on the given task and
 * {@link CompileOptions}. The latter is to propagate the information to Studio.
 */
public static void configureLanguageLevel(
        AbstractCompile compileTask,
        final CompileOptions compileOptions,
        String compileSdkVersion) {
    final AndroidVersion hash = AndroidTargetHash.getVersionFromHash(compileSdkVersion);
    Integer compileSdkLevel = (hash == null ? null : hash.getApiLevel());

    JavaVersion javaVersionToUse;
    if (compileSdkLevel == null || (0 <= compileSdkLevel && compileSdkLevel <= 20)) {
        javaVersionToUse = JavaVersion.VERSION_1_6;
    } else {
        javaVersionToUse = JavaVersion.VERSION_1_7;
    }

    JavaVersion jdkVersion =
            JavaVersion.toVersion(System.getProperty("java.specification.version"));
    if (jdkVersion.compareTo(javaVersionToUse) < 0) {
        compileTask.getLogger().warn(
                "Default language level for compileSdkVersion '{}' is " +
                        "{}, but the JDK used is {}, so the JDK language level will be used.",
                compileSdkVersion,
                javaVersionToUse,
                jdkVersion);
        javaVersionToUse = jdkVersion;
    }

    compileOptions.setDefaultJavaVersion(javaVersionToUse);

    ConventionMappingHelper.map(compileTask, "sourceCompatibility", new Callable<String>() {
        @Override
        public String call() throws Exception {
            return compileOptions.getSourceCompatibility().toString();
        }
    });

    ConventionMappingHelper.map(compileTask, "targetCompatibility", new Callable<String>() {
        @Override
        public String call() throws Exception {
            return compileOptions.getTargetCompatibility().toString();
        }
    });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:AbstractCompilesUtil.java


示例8: createUnitTestTask

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
private void createUnitTestTask(@NonNull TaskFactory tasks,
        @NonNull final TestVariantData variantData) {
    final BaseVariantData testedVariantData =
            (BaseVariantData) variantData.getTestedVariantData();

    final Test runTestsTask = project.getTasks().create(
            variantData.getScope().getTaskName(UNIT_TEST.getPrefix()),
            Test.class);
    runTestsTask.setGroup(JavaBasePlugin.VERIFICATION_GROUP);
    runTestsTask.setDescription(
            "Run unit tests for the " +
                    testedVariantData.getVariantConfiguration().getFullName() + " build.");

    fixTestTaskSources(runTestsTask);

    runTestsTask.dependsOn(variantData.assembleVariantTask);

    final AbstractCompile testCompileTask = variantData.javacTask;
    runTestsTask.setTestClassesDir(testCompileTask.getDestinationDir());

    ConventionMappingHelper.map(runTestsTask, "classpath",
            new Callable<ConfigurableFileCollection>() {
                @Override
                public ConfigurableFileCollection call() throws Exception {
                    Iterable<File> filteredBootClasspath = Iterables.filter(
                            androidBuilder.getBootClasspath(),
                            new Predicate<File>() {
                                @Override
                                public boolean apply(@Nullable File file) {
                                    return file != null &&
                                            !SdkConstants.FN_FRAMEWORK_LIBRARY
                                                    .equals(file.getName());
                                }
                            });

                    return project.files(
                            testCompileTask.getClasspath(),
                            testCompileTask.getOutputs().getFiles(),
                            variantData.processJavaResourcesTask.getOutputs(),
                            testedVariantData.processJavaResourcesTask.getOutputs(),
                            filteredBootClasspath,
                            // Mockable JAR is last, to make sure you can shadow the classes
                            // withdependencies.
                            createMockableJar.getOutputFile());
                }
            });

    // Put the variant name in the report path, so that different testing tasks don't
    // overwrite each other's reports.
    TestTaskReports testTaskReports = runTestsTask.getReports();

    for (ConfigurableReport report : new ConfigurableReport[] {
            testTaskReports.getJunitXml(), testTaskReports.getHtml()}) {
        report.setDestination(new File(report.getDestination(), testedVariantData.getName()));
    }

    tasks.named(JavaPlugin.TEST_TASK_NAME, new Action<Task>() {
        @Override
        public void execute(Task test) {
            test.dependsOn(runTestsTask);
        }

    });

    extension.getTestOptions().getUnitTests().applyConfiguration(runTestsTask);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:67,代码来源:TaskManager.java


示例9: getJavaCompilerTask

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
@Nullable
public AndroidTask<? extends AbstractCompile> getJavaCompilerTask() {
    return javaCompilerTask;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:VariantScope.java


示例10: setJavaCompilerTask

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
public void setJavaCompilerTask(
        @NonNull AndroidTask<? extends AbstractCompile> javaCompileTask) {
    this.javaCompilerTask = javaCompileTask;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:VariantScope.java


示例11: apply

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
@Override
public void apply(Project project) {
    project.getTasks().withType(AbstractCompile.class, PostCompilationAction.of(project));
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:5,代码来源:ByteBuddyPlugin.java


示例12: of

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
/**
 * Creates a post compilation action.
 *
 * @param project The project to apply the action upon.
 * @return An appropriate action.
 */
public static Action<AbstractCompile> of(Project project) {
    return new PostCompilationAction(project, project.getExtensions().create("byteBuddy", ByteBuddyExtension.class, project));
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:10,代码来源:PostCompilationAction.java


示例13: TransformationAction

import org.gradle.api.tasks.compile.AbstractCompile; //导入依赖的package包/类
/**
 * Creates a new transformation action.
 *
 * @param project   The current project.
 * @param extension The current project's Byte Buddy extension.
 * @param task      The task to which this transformation was appended.
 */
public TransformationAction(Project project, ByteBuddyExtension extension, AbstractCompile task) {
    this.project = project;
    this.byteBuddyExtension = extension;
    this.task = task;
}
 
开发者ID:raphw,项目名称:byte-buddy,代码行数:13,代码来源:TransformationAction.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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