Java 类org.gradle.api.tasks.application.CreateStartScripts 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:RunPluginFeatures.java   
private void mainClassNameFinder(Project project) {
    FindMainClassTask findMainClassTask = project.getTasks()
            .create(FIND_MAIN_CLASS_TASK_NAME, FindMainClassTask.class);
    SourceSet mainSourceSet = SourceSets.findMainSourceSet(project);
    if (mainSourceSet != null) {
        findMainClassTask.setMainClassSourceSetOutput(mainSourceSet.getOutput());
    }
    project.getTasks().all(new Action<Task>() {
        @Override
        public void execute(Task task) {
            if (task instanceof BootRunTask || task instanceof CreateStartScripts) {
                task.dependsOn(FIND_MAIN_CLASS_TASK_NAME);
            }
        }
    });
}
项目:spring-boot-concourse    文件:RunPluginFeatures.java   
private void mainClassNameFinder(Project project) {
    FindMainClassTask findMainClassTask = project.getTasks()
            .create(FIND_MAIN_CLASS_TASK_NAME, FindMainClassTask.class);
    SourceSet mainSourceSet = SourceSets.findMainSourceSet(project);
    if (mainSourceSet != null) {
        findMainClassTask.setMainClassSourceSetOutput(mainSourceSet.getOutput());
    }
    project.getTasks().all(new Action<Task>() {
        @Override
        public void execute(Task task) {
            if (task instanceof BootRunTask || task instanceof CreateStartScripts) {
                task.dependsOn(FIND_MAIN_CLASS_TASK_NAME);
            }
        }
    });
}
项目:contestparser    文件:RunPluginFeatures.java   
private void mainClassNameFinder(Project project) {
    FindMainClassTask findMainClassTask = project.getTasks()
            .create(FIND_MAIN_CLASS_TASK_NAME, FindMainClassTask.class);
    SourceSet mainSourceSet = SourceSets.findMainSourceSet(project);
    if (mainSourceSet != null) {
        findMainClassTask.setMainClassSourceSetOutput(mainSourceSet.getOutput());
    }
    project.getTasks().all(new Action<Task>() {
        @Override
        public void execute(Task task) {
            if (task instanceof JavaExec || task instanceof CreateStartScripts) {
                task.dependsOn(FIND_MAIN_CLASS_TASK_NAME);
            }
        }
    });
}
项目:Reer    文件:ApplicationPlugin.java   
private void addCreateScriptsTask() {
    CreateStartScripts startScripts = project.getTasks().create(TASK_START_SCRIPTS_NAME, CreateStartScripts.class);
    startScripts.setDescription("Creates OS specific scripts to run the project as a JVM application.");
    startScripts.setClasspath(project.getTasks().getAt(JavaPlugin.JAR_TASK_NAME).getOutputs().getFiles().plus(project.getConfigurations().getByName("runtime")));

    startScripts.getConventionMapping().map("mainClassName", new Callable<Object>() {
        @Override
        public Object call() throws Exception {
            return pluginConvention.getMainClassName();
        }
    });

    startScripts.getConventionMapping().map("applicationName", new Callable<Object>() {
        @Override
        public Object call() throws Exception {
            return pluginConvention.getApplicationName();
        }
    });

    startScripts.getConventionMapping().map("outputDir", new Callable<Object>() {
        @Override
        public Object call() throws Exception {
            return new File(project.getBuildDir(), "scripts");
        }
    });

    startScripts.getConventionMapping().map("defaultJvmOpts", new Callable<Object>() {
        @Override
        public Object call() throws Exception {
            return pluginConvention.getApplicationDefaultJvmArgs();
        }
    });
}