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


Java Project.getName方法代碼示例

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


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

示例1: resolve

import org.gradle.api.Project; //導入方法依賴的package包/類
public ModuleVersionIdentifier resolve(ProjectDependency dependency) {
    Project dependencyProject = dependency.getDependencyProject();
    ((ProjectInternal) dependencyProject).evaluate();

    PublishingExtension publishing = dependencyProject.getExtensions().findByType(PublishingExtension.class);

    if (publishing == null || publishing.getPublications().withType(PublicationInternal.class).isEmpty()) {
        // Project does not apply publishing (or has no publications): simply use the project name in place of the dependency name
        return new DefaultModuleVersionIdentifier(dependency.getGroup(), dependencyProject.getName(), dependency.getVersion());
    }

    // See if all publications have the same identifier
    Set<? extends PublicationInternal> publications = publishing.getPublications().withType(PublicationInternal.class);
    Iterator<? extends PublicationInternal> iterator = publications.iterator();
    ModuleVersionIdentifier candidate = iterator.next().getCoordinates();
    while (iterator.hasNext()) {
        ModuleVersionIdentifier alternative = iterator.next().getCoordinates();
        if (!candidate.equals(alternative)) {
            throw new UnsupportedOperationException("Publishing is not yet able to resolve a dependency on a project with multiple different publications.");
        }
    }
    return candidate;

}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:25,代碼來源:ProjectDependencyPublicationResolver.java

示例2: 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

示例3: buildProjectOutput

import org.gradle.api.Project; //導入方法依賴的package包/類
private DefaultProjectOutcomes buildProjectOutput(Project project, ProjectOutcomes parent) {
    DefaultProjectOutcomes projectOutput = new DefaultProjectOutcomes(project.getName(), project.getPath(),
            project.getDescription(), project.getProjectDir(), getFileOutcomes(project), parent);
    for (Project child : project.getChildProjects().values()) {
        projectOutput.addChild(buildProjectOutput(child, projectOutput));
    }
    return projectOutput;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:9,代碼來源:ProjectOutcomesModelBuilder.java

示例4: defaultAttributesUsingDetailsFrom

import org.gradle.api.Project; //導入方法依賴的package包/類
/**
 * Resolve default values to be used in manifest.
 * 
 * @param project Context the default values should be resolved from.
 */
private void defaultAttributesUsingDetailsFrom(Project project) {
  Object projectGroup = project.getGroup();
  String projectName = project.getName();
  if (projectGroup != null) {
    capsuleManifest.defaultApplicationIdTo(projectGroup + "." + projectName);
  }
  
  Jar jarTask = (Jar) project.getTasks().getAt("jar");
  capsuleManifest.defaultApplicationClassTo((String) jarTask.getManifest().getAttributes().get("Main-Class"));
}
 
開發者ID:jonas-l,項目名稱:gradle-capsule-plugin,代碼行數:16,代碼來源:Capsule.java

示例5: deriveProjectDescription

import org.gradle.api.Project; //導入方法依賴的package包/類
private ProjectDescriptor deriveProjectDescription(Project project) {
    ProjectDescriptor projectDescriptor = new ProjectDescriptor(project.getName(), project.getGroup().toString(), project.getDescription(), project.getVersion().toString(), new EnvironmentDescriptor(project.getGradle().getGradleVersion()));
    addPluginDescription(project, projectDescriptor);
    addTasksDescription(project, projectDescriptor);
    addJavaDescription(project, projectDescriptor);
    return projectDescriptor;
}
 
開發者ID:gradle-guides,項目名稱:gradle-site-plugin,代碼行數:8,代碼來源:SitePlugin.java

示例6: BasePluginConvention

import org.gradle.api.Project; //導入方法依賴的package包/類
public BasePluginConvention(Project project) {
    this.project = (ProjectInternal) project;
    archivesBaseName = project.getName();
    distsDirName = "distributions";
    libsDirName = "libs";
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:7,代碼來源:BasePluginConvention.java

示例7: createAwbBundle

import org.gradle.api.Project; //導入方法依賴的package包/類
public AwbBundle createAwbBundle(LibVariantContext libVariantContext) throws IOException {

        String variantName = libVariantContext.getVariantName();

        AtlasDependencyTree libDependencyTree = AtlasBuildContext.libDependencyTrees.get(variantName);

        //TODO 2.3
        if (null == libDependencyTree) {

            libDependencyTree = new AtlasDepTreeParser(libVariantContext.getProject(),
                                                       new ExtraModelInfo(libVariantContext.getProject()), null)
                .parseDependencyTree(libVariantContext.getVariantDependency());
            AtlasBuildContext.libDependencyTrees.put(variantName, libDependencyTree);
        }

        Project project = libVariantContext.getProject();

        String groupName = (String)project.getGroup();
        String name = "";
        String version = (String)project.getVersion();
        if (project.hasProperty("archivesBaseName")) {
            name = (String)project.getProperties().get("archivesBaseName");
        } else {
            name = project.getName();
        }

        File explodedDir = project.file(
            project.getBuildDir().getAbsolutePath() + "/" + FD_INTERMEDIATES + "/exploded-awb/" + computeArtifactPath(
                groupName, name, version));
        FileUtils.deleteDirectory(explodedDir);

        MavenCoordinates mavenCoordinates = new MavenCoordinatesImpl(groupName, name, version, "awb", "");

        ResolvedDependencyInfo resolvedDependencyInfo = new ResolvedDependencyInfo(groupName, name, version, "awb");
        resolvedDependencyInfo.setVariantName(libVariantContext.getVariantName());

        AwbBundle awbBundle = new AwbBundle(resolvedDependencyInfo, DependencyConvertUtils
            .toAndroidLibrary(mavenCoordinates, libVariantContext.getBundleTask().getArchivePath(), explodedDir));

        awbBundle.getSoLibraries().addAll(libDependencyTree.getMainBundle().getSoLibraries());
        awbBundle.getAndroidLibraries().addAll(libDependencyTree.getMainBundle().getAndroidLibraries());
        awbBundle.getJavaLibraries().addAll(libDependencyTree.getMainBundle().getJavaLibraries());

        return awbBundle;

    }
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:47,代碼來源:AwbGenerator.java

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