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


Java MavenPublicationInternal类代码示例

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


MavenPublicationInternal类属于org.gradle.api.publish.maven.internal.publication包,在下文中一共展示了MavenPublicationInternal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: publish

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
@TaskAction
public void publish() {
    final MavenPublicationInternal publication = getPublicationInternal();
    if (publication == null) {
        throw new InvalidUserDataException("The 'publication' property is required");
    }

    new PublishOperation(publication, "mavenLocal") {
        @Override
        protected void publish() throws Exception {
            MavenPublisher localPublisher = new MavenLocalPublisher(getLoggingManagerFactory(), getMavenRepositoryLocator());
            MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(localPublisher);
            MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
            validatingPublisher.publish(publication.asNormalisedPublication(), null);
        }
    }.run();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:PublishToMavenLocal.java

示例2: realizePublishingTasks

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
@Mutate
@SuppressWarnings("UnusedDeclaration")
public void realizePublishingTasks(ModelMap<Task> tasks, PublishingExtension extension, @Path("buildDir") File buildDir) {
    // Create generatePom tasks for any Maven publication
    PublicationContainer publications = extension.getPublications();
    Task publishLifecycleTask = tasks.get(PublishingPlugin.PUBLISH_LIFECYCLE_TASK_NAME);
    Task publishLocalLifecycleTask = tasks.get(PUBLISH_LOCAL_LIFECYCLE_TASK_NAME);

    for (final MavenPublicationInternal publication : publications.withType(MavenPublicationInternal.class)) {
        String publicationName = publication.getName();

        createGeneratePomTask(tasks, publication, publicationName, buildDir);
        createLocalInstallTask(tasks, publishLocalLifecycleTask, publication, publicationName);
        createPublishTasksForEachMavenRepo(tasks, extension, publishLifecycleTask, publication, publicationName);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:MavenPublishPlugin.java

示例3: createPublishTasksForEachMavenRepo

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
private void createPublishTasksForEachMavenRepo(ModelMap<Task> tasks, PublishingExtension extension, final Task publishLifecycleTask, final MavenPublicationInternal publication,
                                                final String publicationName) {
    for (final MavenArtifactRepository repository : extension.getRepositories().withType(MavenArtifactRepository.class)) {
        final String repositoryName = repository.getName();

        String publishTaskName = "publish" + capitalize(publicationName) + "PublicationTo" + capitalize(repositoryName) + "Repository";

        tasks.create(publishTaskName, PublishToMavenRepository.class, new Action<PublishToMavenRepository>() {
            public void execute(PublishToMavenRepository publishTask) {
                publishTask.setPublication(publication);
                publishTask.setRepository(repository);
                publishTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP);
                publishTask.setDescription("Publishes Maven publication '" + publicationName + "' to Maven repository '" + repositoryName + "'.");

            }
        });
        publishLifecycleTask.dependsOn(publishTaskName);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:20,代码来源:MavenPublishPlugin.java

示例4: createPublishTasksForEachMavenRepo

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
private void createPublishTasksForEachMavenRepo(CollectionBuilder<Task> tasks, PublishingExtension extension, final Task publishLifecycleTask, final MavenPublicationInternal publication,
                                                final String publicationName) {
    for (final MavenArtifactRepository repository : extension.getRepositories().withType(MavenArtifactRepository.class)) {
        final String repositoryName = repository.getName();

        String publishTaskName = String.format("publish%sPublicationTo%sRepository", capitalize(publicationName), capitalize(repositoryName));

        tasks.create(publishTaskName, PublishToMavenRepository.class, new Action<PublishToMavenRepository>() {
            public void execute(PublishToMavenRepository publishTask) {
                publishTask.setPublication(publication);
                publishTask.setRepository(repository);
                publishTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP);
                publishTask.setDescription(String.format("Publishes Maven publication '%s' to Maven repository '%s'.", publicationName, repositoryName));

                //Because dynamic rules are not yet implemented we have to violate input immutability here as an interim step
                publishLifecycleTask.dependsOn(publishTask);
            }
        });
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:21,代码来源:MavenPublishPlugin.java

示例5: createGeneratePomTask

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
private void createGeneratePomTask(CollectionBuilder<Task> tasks, final MavenPublicationInternal publication, String publicationName) {
    String descriptorTaskName = String.format("generatePomFileFor%sPublication", capitalize(publicationName));
    tasks.create(descriptorTaskName, GenerateMavenPom.class, new Action<GenerateMavenPom>() {
        public void execute(final GenerateMavenPom generatePomTask) {
            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(generatePomTask.getProject().getBuildDir(), "publications/" + publication.getName() + "/pom-default.xml");
                }
            });

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

示例6: PublishToMavenRepository

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
@Inject
public PublishToMavenRepository(Factory<LoggingManagerInternal> loggingManagerFactory) {
    this.loggingManagerFactory = loggingManagerFactory;


    // Allow the publication to participate in incremental build
    getInputs().files(new Callable<FileCollection>() {
        public FileCollection call() throws Exception {
            MavenPublicationInternal publicationInternal = getPublicationInternal();
            return publicationInternal == null ? null : publicationInternal.getPublishableFiles();
        }
    });

    // Should repositories be able to participate in incremental?
    // At the least, they may be able to express themselves as output files
    // They *might* have input files and other dependencies as well though
    // Inputs: The credentials they need may be expressed in a file
    // Dependencies: Can't think of a case here
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:20,代码来源:PublishToMavenRepository.java

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

示例8: publish

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
@TaskAction
public void publish() {
    MavenPublicationInternal publicationInternal = getPublicationInternal();
    if (publicationInternal == null) {
        throw new InvalidUserDataException("The 'publication' property is required");
    }

    MavenArtifactRepository repository = getRepository();
    if (repository == null) {
        throw new InvalidUserDataException("The 'repository' property is required");
    }

    doPublish(publicationInternal, repository);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:15,代码来源:PublishToMavenRepository.java

示例9: doPublish

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
private void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
    new PublishOperation(publication, repository.getName()) {
        @Override
        protected void publish() throws Exception {
            MavenPublisher remotePublisher = new MavenRemotePublisher(getLoggingManagerFactory(), getMavenRepositoryLocator(), getTemporaryDirFactory(), getRepositoryTransportFactory());
            MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(remotePublisher);
            MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
            validatingPublisher.publish(publication.asNormalisedPublication(), repository);
        }
    }.run();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:PublishToMavenRepository.java

示例10: AbstractPublishToMaven

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
public AbstractPublishToMaven() {
    // Allow the publication to participate in incremental build
    getInputs().files(new Callable<FileCollection>() {
        public FileCollection call() throws Exception {
            MavenPublicationInternal publicationInternal = getPublicationInternal();
            return publicationInternal == null ? null : publicationInternal.getPublishableFiles();
        }
    }).withPropertyName("publication.publishableFiles");

    // Should repositories be able to participate in incremental?
    // At the least, they may be able to express themselves as output files
    // They *might* have input files and other dependencies as well though
    // Inputs: The credentials they need may be expressed in a file
    // Dependencies: Can't think of a case here
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:16,代码来源:AbstractPublishToMaven.java

示例11: toPublicationInternal

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
private static MavenPublicationInternal toPublicationInternal(MavenPublication publication) {
    if (publication == null) {
        return null;
    } else if (publication instanceof MavenPublicationInternal) {
        return (MavenPublicationInternal) publication;
    } else {
        throw new InvalidUserDataException(
                String.format(
                        "publication objects must implement the '%s' interface, implementation '%s' does not",
                        MavenPublicationInternal.class.getName(),
                        publication.getClass().getName()
                )
        );
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:16,代码来源:AbstractPublishToMaven.java

示例12: createLocalInstallTask

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
private void createLocalInstallTask(ModelMap<Task> tasks, final Task publishLocalLifecycleTask, final MavenPublicationInternal publication, final String publicationName) {
    final String installTaskName = "publish" + capitalize(publicationName) + "PublicationToMavenLocal";

    tasks.create(installTaskName, PublishToMavenLocal.class, new Action<PublishToMavenLocal>() {
        public void execute(PublishToMavenLocal publishLocalTask) {
            publishLocalTask.setPublication(publication);
            publishLocalTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP);
            publishLocalTask.setDescription("Publishes Maven publication '" + publicationName + "' to the local Maven repository.");
        }
    });
    publishLocalLifecycleTask.dependsOn(installTaskName);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:MavenPublishPlugin.java

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

示例14: publish

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
@TaskAction
public void publish() {

    MavenPublicationInternal publicationInternal = getPublicationInternal();
    if (publicationInternal == null) {
        throw new InvalidUserDataException("The 'publication' property is required");
    }

    MavenArtifactRepository repository = getRepository();
    if (repository == null) {
        throw new InvalidUserDataException("The 'repository' property is required");
    }

    doPublish(publicationInternal, repository);
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:16,代码来源:PublishToMavenRepositoryHook.java

示例15: doPublish

import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; //导入依赖的package包/类
@Override
protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
    new PublishOperation(publication, repository) {
        @Override
        protected void publish() throws Exception {
            MavenPublisher antBackedPublisher = new AntTaskBackedMavenLocalPublisher(getLoggingManagerFactory(), getTemporaryDirFactory());
            MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher);
            MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
            validatingPublisher.publish(publication.asNormalisedPublication(), repository);
        }
    }.run();
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:13,代码来源:PublishToMavenLocal.java


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