Java Code Examples for org.gradle.api.internal.jvm.ClassDirectoryBinarySpecInternal#getNamingScheme()

The following examples show how to use org.gradle.api.internal.jvm.ClassDirectoryBinarySpecInternal#getNamingScheme() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private void createProcessResourcesTaskForBinary(final ClassDirectoryBinarySpecInternal binary, final Project target) {
    final BinaryNamingScheme namingScheme = binary.getNamingScheme();
    binary.getSource().withType(JvmResourceSet.class).all(new Action<JvmResourceSet>() {
        public void execute(JvmResourceSet resourceSet) {
            Copy resourcesTask = target.getTasks().create(namingScheme.getTaskName("process", "resources"), ProcessResources.class);
            resourcesTask.setDescription(String.format("Processes %s.", resourceSet));
            new DslObject(resourcesTask).getConventionMapping().map("destinationDir", new Callable<File>() {
                public File call() throws Exception {
                    return binary.getResourcesDir();
                }
            });
            binary.getTasks().add(resourcesTask);
            binary.builtBy(resourcesTask);
            resourcesTask.from(resourceSet.getSource());
        }
    });
}
 
Example 2
private void createProcessResourcesTaskForBinary(final ClassDirectoryBinarySpecInternal binary, final Project target) {
    final BinaryNamingScheme namingScheme = binary.getNamingScheme();
    binary.getSource().withType(JvmResourceSet.class).all(new Action<JvmResourceSet>() {
        public void execute(JvmResourceSet resourceSet) {
            Copy resourcesTask = target.getTasks().create(namingScheme.getTaskName("process", "resources"), ProcessResources.class);
            resourcesTask.setDescription(String.format("Processes %s.", resourceSet));
            new DslObject(resourcesTask).getConventionMapping().map("destinationDir", new Callable<File>() {
                public File call() throws Exception {
                    return binary.getResourcesDir();
                }
            });
            binary.getTasks().add(resourcesTask);
            binary.builtBy(resourcesTask);
            resourcesTask.from(resourceSet.getSource());
        }
    });
}
 
Example 3
private void setClassesDirConvention(ClassDirectoryBinarySpecInternal binary, final Project target) {
    final BinaryNamingScheme namingScheme = binary.getNamingScheme();
    ConventionMapping conventionMapping = new DslObject(binary).getConventionMapping();
    conventionMapping.map("classesDir", new Callable<File>() {
        public File call() throws Exception {
            return new File(new File(target.getBuildDir(), "classes"), namingScheme.getOutputDirectoryBase());
        }
    });
}
 
Example 4
private void createCompileJavaTaskForBinary(final ClassDirectoryBinarySpecInternal binary, final Project target) {
    final BinaryNamingScheme namingScheme = binary.getNamingScheme();
    binary.getSource().withType(JavaSourceSet.class).all(new Action<JavaSourceSet>() {
        public void execute(JavaSourceSet javaSourceSet) {
            JavaCompile compileTask = target.getTasks().create(namingScheme.getTaskName("compile", "java"), JavaCompile.class);
            configureCompileTask(compileTask, javaSourceSet, binary);
            binary.getTasks().add(compileTask);
            binary.builtBy(compileTask);
        }
    });
}
 
Example 5
private void setClassesDirConvention(ClassDirectoryBinarySpecInternal binary, final Project target) {
    final BinaryNamingScheme namingScheme = binary.getNamingScheme();
    ConventionMapping conventionMapping = new DslObject(binary).getConventionMapping();
    conventionMapping.map("classesDir", new Callable<File>() {
        public File call() throws Exception {
            return new File(new File(target.getBuildDir(), "classes"), namingScheme.getOutputDirectoryBase());
        }
    });
}
 
Example 6
private void createCompileJavaTaskForBinary(final ClassDirectoryBinarySpecInternal binary, final Project target) {
    final BinaryNamingScheme namingScheme = binary.getNamingScheme();
    binary.getSource().withType(JavaSourceSet.class).all(new Action<JavaSourceSet>() {
        public void execute(JavaSourceSet javaSourceSet) {
            JavaCompile compileTask = target.getTasks().create(namingScheme.getTaskName("compile", "java"), JavaCompile.class);
            configureCompileTask(compileTask, javaSourceSet, binary);
            binary.getTasks().add(compileTask);
            binary.builtBy(compileTask);
        }
    });
}