当前位置: 首页>>代码示例>>Java>>正文


Java MavenPublicationInternal.setPomFile方法代码示例

本文整理汇总了Java中org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal.setPomFile方法的典型用法代码示例。如果您正苦于以下问题:Java MavenPublicationInternal.setPomFile方法的具体用法?Java MavenPublicationInternal.setPomFile怎么用?Java MavenPublicationInternal.setPomFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal的用法示例。


在下文中一共展示了MavenPublicationInternal.setPomFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createGeneratePomTask

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入方法依赖的package包/类
private void createGeneratePomTask(final MavenPublicationInternal publication, String publicationName) {
    String descriptorTaskName = String.format("generatePomFileFor%sPublication", capitalize(publicationName));
    GenerateMavenPom generatePomTask = project.getTasks().create(descriptorTaskName, GenerateMavenPom.class);
    generatePomTask.setDescription(String.format("Generates the Maven POM file for publication '%s'.", publication.getName()));
    generatePomTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP);
    generatePomTask.setPom(publication.getPom());

    ConventionMapping descriptorTaskConventionMapping = new DslObject(generatePomTask).getConventionMapping();
    descriptorTaskConventionMapping.map("destination", new Callable<Object>() {
        public Object call() throws Exception {
            return new File(project.getBuildDir(), "publications/" + publication.getName() + "/pom-default.xml");
        }
    });

    // Wire the generated pom into the publication.
    publication.setPomFile(generatePomTask.getOutputs().getFiles());
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:18,代码来源:MavenPublishTaskModelRule.java

示例2: createGeneratePomTask

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入方法依赖的package包/类
private void createGeneratePomTask(ModelMap<Task> tasks, final MavenPublicationInternal publication, final String publicationName, final File buildDir) {
    String descriptorTaskName = "generatePomFileFor" + capitalize(publicationName) + "Publication";
    tasks.create(descriptorTaskName, GenerateMavenPom.class, new Action<GenerateMavenPom>() {
        public void execute(final GenerateMavenPom generatePomTask) {
            generatePomTask.setDescription("Generates the Maven POM file for publication '" + publicationName + "'.");
            generatePomTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP);
            generatePomTask.setPom(publication.getPom());
            generatePomTask.setDestination(new File(buildDir, "publications/" + publication.getName() + "/pom-default.xml"));
        }
    });
    // Wire the generated pom into the publication.
    publication.setPomFile(tasks.get(descriptorTaskName).getOutputs().getFiles());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:MavenPublishPlugin.java


注:本文中的org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal.setPomFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。