當前位置: 首頁>>代碼示例>>Java>>正文


Java Project.getBuildFile方法代碼示例

本文整理匯總了Java中org.gradle.api.Project.getBuildFile方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.getBuildFile方法的具體用法?Java Project.getBuildFile怎麽用?Java Project.getBuildFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.gradle.api.Project的用法示例。


在下文中一共展示了Project.getBuildFile方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addSubProjects

import org.gradle.api.Project; //導入方法依賴的package包/類
/**
 * Adds all sub projects of the specified GradleProject.
 *
 * @param parentProject the source parent project. Where we get the sub projects from.
 * @param parentProjectView the destination of the sub projects from parentProject.
 */
private void addSubProjects(Project parentProject, ProjectView parentProjectView) {
    Collection<Project> subProjects = parentProject.getChildProjects().values();
    for (Project subProject : subProjects) {
        ProjectView projectView = new ProjectView(parentProjectView, subProject.getName(), subProject.getBuildFile(), subProject.getDescription());

        addTasks(subProject, projectView);

        projectView.sortSubProjectsAndTasks();

        addSubProjects(subProject, projectView);
    }
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:19,代碼來源:ProjectConverter.java

示例2: configureInit

import org.gradle.api.Project; //導入方法依賴的package包/類
public static void configureInit(final InitBuild init) {
    init.setGroup(GROUP);
    init.setDescription("Initializes a new Gradle build. [incubating]");
    final Transformer<String, Project> setupCanBeSkipped = new Transformer<String, Project>() {

        @Override
        public String transform(Project project) {
            if (project.file("build.gradle").exists()) {
                return "The build file 'build.gradle' already exists. Skipping build initialization.";
            }

            File buildFile = project.getBuildFile();
            if (buildFile != null && buildFile.exists()) {
                return "The build file \'" + buildFile.getName() + "\' already exists. Skipping build initialization.";
            }

            if (project.file("settings.gradle").exists()) {
                return "The settings file 'settings.gradle' already exists. Skipping build initialization.";
            }

            if (project.getSubprojects().size() > 0) {
                return "This Gradle project appears to be part of an existing multi-project Gradle build. Skipping build initialization.";
            }

            return null;
        }
    };
    init.onlyIf(new Spec<Task>() {
        @Override
        public boolean isSatisfiedBy(Task element) {
            Object skippedMsg = setupCanBeSkipped.transform(element.getProject());
            if (skippedMsg != null) {
                element.getProject().getLogger().warn((String) skippedMsg);
                return false;
            }

            return true;
        }
    });

    init.dependsOn(new Callable<String>() {
        @Override
        public String call() throws Exception {
            if (setupCanBeSkipped.transform(init.getProject()) == null) {
                return "wrapper";
            } else {
                return null;
            }
        }
    });
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:52,代碼來源:TaskConfiguration.java

示例3: addRootLevelProject

import org.gradle.api.Project; //導入方法依賴的package包/類
/**
 * This adds the specified project as a root level projects. It then adds all tasks and recursively adds all sub projects.
 *
 * @param rootLevelProject a root level project.
 */
public void addRootLevelProject(Project rootLevelProject) {
    ProjectView rootLevelProjectView = new ProjectView(null, rootLevelProject.getName(), rootLevelProject.getBuildFile(), rootLevelProject.getDescription());

    rootLevelResultingProjects.add(rootLevelProjectView);

    addSubProjects(rootLevelProject, rootLevelProjectView);

    addTasks(rootLevelProject, rootLevelProjectView);

    rootLevelProjectView.sortSubProjectsAndTasks();
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:17,代碼來源:ProjectConverter.java


注:本文中的org.gradle.api.Project.getBuildFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。