Java 类org.gradle.api.tasks.Delete 实例源码

项目:Reer    文件:CleanRule.java   
@Override
public void apply(String taskName) {
    if (!taskName.startsWith(CLEAN) || taskName.equals(CLEAN)) {
        return;
    }
    String targetTaskName = taskName.substring(CLEAN.length());
    if (Character.isLowerCase(targetTaskName.charAt(0))) {
        return;
    }

    Task task = tasks.findByName(StringUtils.uncapitalize(targetTaskName));
    if (task == null) {
        return;
    }

    Delete clean = tasks.create(taskName, Delete.class);
    clean.delete(task.getOutputs().getFiles());
}
项目:Pushjet-Android    文件:CleanRule.java   
public void apply(String taskName) {
    if (!taskName.startsWith(PREFIX)) {
        return;
    }

    String targetTaskName = taskName.substring(PREFIX.length());
    if (Character.isLowerCase(targetTaskName.charAt(0))) {
        return;
    }

    Task task = tasks.findByName(StringUtils.uncapitalize(targetTaskName));
    if (task == null) {
        return;
    }

    Delete clean = tasks.create(taskName, Delete.class);
    clean.delete(task.getOutputs().getFiles());
}
项目:Pushjet-Android    文件:CleanRule.java   
public void apply(String taskName) {
    if (!taskName.startsWith(PREFIX)) {
        return;
    }

    String targetTaskName = taskName.substring(PREFIX.length());
    if (Character.isLowerCase(targetTaskName.charAt(0))) {
        return;
    }

    Task task = tasks.findByName(StringUtils.uncapitalize(targetTaskName));
    if (task == null) {
        return;
    }

    Delete clean = tasks.create(taskName, Delete.class);
    clean.delete(task.getOutputs().getFiles());
}
项目:Reer    文件:LifecycleBasePlugin.java   
private void addClean(final ProjectInternal project) {
    addPlaceholderAction(project, CLEAN_TASK_NAME, Delete.class, new Action<Delete>() {
        @Override
        public void execute(Delete clean) {
            clean.setDescription("Deletes the build directory.");
            clean.setGroup(BUILD_GROUP);
            clean.delete(new Callable<File>() {
                public File call() throws Exception {
                    return project.getBuildDir();
                }
            });
        }
    });
}
项目:Reer    文件:IdePlugin.java   
public void addWorker(Task worker, boolean includeInClean) {
    lifecycleTask.dependsOn(worker);
    Delete cleanWorker = project.getTasks().create(cleanName(worker.getName()), Delete.class);
    cleanWorker.delete(worker.getOutputs().getFiles());
    if (includeInClean) {
        cleanTask.dependsOn(cleanWorker);
    }
}
项目:gradle-project-config    文件:EclipseConfigPlugin.java   
/**
 * Create the Eclipse UI tasks
 *
 * @param tasks Task container
 * @param eclipseConfig Eclipse configuration
 * @param project Current Gradle project
 */
@Mutate
public void createEclipseUiTasks(ModelMap<Task> tasks, EclipseConfig eclipseConfig, Project project) {
    tasks.create("eclipseUi", GenerateEclipseUi.class, t -> {
        t.setDescription("Generates the Eclipse JDT UI settings file (org.eclipse.jdt.ui.prefs).");
        t.setOutputFile(project.file(".settings/org.eclipse.jdt.ui.prefs"));
        t.setInputFile(project.file(".settings/org.eclipse.jdt.ui.prefs"));
        t.setUi(eclipseConfig.getUi());
    });

    tasks.create("cleanEclipseUi", Delete.class, t -> {
        t.delete(project.file(".settings/org.eclipse.jdt.ui.prefs"));
        t.setDescription("Removes the Eclipse JDT UI settings file (org.eclipse.jdt.ui.prefs).");
    });
}
项目:Pushjet-Android    文件:LifecycleBasePlugin.java   
private void addClean(final Project project) {
    Delete clean = project.getTasks().create(CLEAN_TASK_NAME, Delete.class);
    clean.setDescription("Deletes the build directory.");
    clean.setGroup(BUILD_GROUP);
    clean.delete(new Callable<File>() {
        public File call() throws Exception {
            return project.getBuildDir();
        }
    });
}
项目:Pushjet-Android    文件:BasePlugin.java   
private void addClean(final Project project) {
    Delete clean = project.getTasks().create(CLEAN_TASK_NAME, Delete.class);
    clean.setDescription("Deletes the build directory.");
    clean.setGroup(BUILD_GROUP);
    clean.delete(new Callable<File>() {
        public File call() throws Exception {
            return project.getBuildDir();
        }
    });
}