org.gradle.api.publish.internal.PublishOperation Java Examples

The following examples show how to use org.gradle.api.publish.internal.PublishOperation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PublishToMavenLocal.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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();
}
 
Example #2
Source File: PublishToMavenRepository.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
    new PublishOperation(publication, repository) {
        @Override
        protected void publish() throws Exception {
            MavenPublisher antBackedPublisher = new AntTaskBackedMavenPublisher(getLoggingManagerFactory(), getTemporaryDirFactory());
            MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher);
            MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
            validatingPublisher.publish(publication.asNormalisedPublication(), repository);
        }
    }.run();
}
 
Example #3
Source File: PublishToIvyRepository.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void doPublish(final IvyPublicationInternal publication, final IvyArtifactRepository repository) {
    new PublishOperation(publication, repository) {
        @Override
        protected void publish() throws Exception {
            IvyNormalizedPublication normalizedPublication = publication.asNormalisedPublication();
            IvyPublisher publisher = getIvyPublisher();
            publisher.publish(normalizedPublication, Cast.cast(PublicationAwareRepository.class, repository));
        }
    }.run();
}
 
Example #4
Source File: PublishToMavenLocal.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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();
}
 
Example #5
Source File: PublishToMavenRepository.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
    new PublishOperation(publication, repository) {
        @Override
        protected void publish() throws Exception {
            MavenPublisher antBackedPublisher = new AntTaskBackedMavenPublisher(loggingManagerFactory, getTemporaryDirFactory());
            MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher);
            MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
            validatingPublisher.publish(publication.asNormalisedPublication(), repository);
        }
    }.run();
}
 
Example #6
Source File: PublishToIvyRepository.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void doPublish(final IvyPublicationInternal publication, final IvyArtifactRepository repository) {
    new PublishOperation(publication, repository) {
        @Override
        protected void publish() throws Exception {
            IvyNormalizedPublication normalizedPublication = publication.asNormalisedPublication();
            IvyPublisher publisher = new DependencyResolverIvyPublisher();
            publisher = new ValidatingIvyPublisher(publisher);
            publisher = new ContextualizingIvyPublisher(publisher, getServices().get(IvyContextManager.class));
            publisher.publish(normalizedPublication, Cast.cast(PublicationAwareRepository.class, repository));
        }
    }.run();
}
 
Example #7
Source File: PublishToMavenLocal.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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();
}
 
Example #8
Source File: PublishToMavenRepository.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
    new PublishOperation(publication, repository) {
        @Override
        protected void publish() throws Exception {
            MavenPublisher antBackedPublisher = new AntTaskBackedMavenPublisher(getLoggingManagerFactory(), getTemporaryDirFactory());
            MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher);
            MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
            validatingPublisher.publish(publication.asNormalisedPublication(), repository);
        }
    }.run();
}
 
Example #9
Source File: PublishToIvyRepository.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void doPublish(final IvyPublicationInternal publication, final IvyArtifactRepository repository) {
    new PublishOperation(publication, repository) {
        @Override
        protected void publish() throws Exception {
            IvyNormalizedPublication normalizedPublication = publication.asNormalisedPublication();
            IvyPublisher publisher = getIvyPublisher();
            publisher.publish(normalizedPublication, Cast.cast(PublicationAwareRepository.class, repository));
        }
    }.run();
}
 
Example #10
Source File: PublishToMavenLocal.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@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();
}
 
Example #11
Source File: PublishToMavenRepository.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
    new PublishOperation(publication, repository) {
        @Override
        protected void publish() throws Exception {
            MavenPublisher antBackedPublisher = new AntTaskBackedMavenPublisher(loggingManagerFactory, getTemporaryDirFactory());
            MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher);
            MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
            validatingPublisher.publish(publication.asNormalisedPublication(), repository);
        }
    }.run();
}
 
Example #12
Source File: PublishToIvyRepository.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void doPublish(final IvyPublicationInternal publication, final IvyArtifactRepository repository) {
    new PublishOperation(publication, repository) {
        @Override
        protected void publish() throws Exception {
            IvyNormalizedPublication normalizedPublication = publication.asNormalisedPublication();
            IvyPublisher publisher = new DependencyResolverIvyPublisher();
            publisher = new ValidatingIvyPublisher(publisher);
            publisher = new ContextualizingIvyPublisher(publisher, getServices().get(IvyContextManager.class));
            publisher.publish(normalizedPublication, Cast.cast(PublicationAwareRepository.class, repository));
        }
    }.run();
}
 
Example #13
Source File: PublishToMavenRepositoryHook.java    From atlas with Apache License 2.0 4 votes vote down vote up
private void doPublish(final MavenPublicationInternal publication,
                       final MavenArtifactRepository repository) {
    new PublishOperation(publication, repository.getName()) {
        @Override
        protected void publish() throws Exception {

            try {
                MavenPublisher remotePublisher = new MavenRemotePublisher(
                        getLoggingManagerFactory(),
                        getMavenRepositoryLocator(),
                        getTemporaryDirFactory(),
                        getRepositoryTransportFactory());
                MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(
                        remotePublisher);
                MavenPublisher validatingPublisher = new ValidatingMavenPublisher(
                        staticLockingPublisher);

                validatingPublisher.publish(publication.asNormalisedPublication(), repository);
            } catch (Throwable e) {

                String message = e.getMessage();
                if (message.contains("Could not write to resource") &&
                        !publication.getVersion().endsWith("SNAPSHOT")) {
                    throw new GradleException("Unable to deploy releaseThe release is packaged with the MTL platform",e);
                }

                if (message.contains("status code 400") &&
                        !publication.getVersion().endsWith("SNAPSHOT")) {
                    throw new GradleException("Your release " +
                                                      publication.getVersion() +
                                                      " It already exists in the warehouse",e);
                }

                if (message.contains("status code 413")) {
                    throw new GradleException("You post more than 200M, unable to upload",e);
                }

                throw e;
            }
        }
    }.run();
}