
pl.allegro.tech.build.axion.release.infrastructure.NoOpRepository.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of axion-release-plugin Show documentation
Show all versions of axion-release-plugin Show documentation
Gradle release and version management plugin
The newest version!
package pl.allegro.tech.build.axion.release.infrastructure
import org.gradle.api.logging.Logger
import org.gradle.api.logging.Logging
import pl.allegro.tech.build.axion.release.domain.scm.*
import java.util.regex.Pattern
class NoOpRepository implements ScmRepository {
private static final Logger logger = Logging.getLogger(NoOpRepository.class);
private final ScmRepository delegateRepository
NoOpRepository(ScmRepository delegateRepository) {
this.delegateRepository = delegateRepository
}
@Override
void fetchTags(ScmIdentity identity, String remoteName) {
log("fetching tags from remote")
delegateRepository.fetchTags(identity, remoteName)
}
@Override
void tag(String tagName) {
log("creating tag with name: $tagName")
}
@Override
void dropTag(String tagName) {
log("dropping tag with name: $tagName")
}
@Override
ScmPushResult push(ScmIdentity identity, ScmPushOptions pushOptions) {
log("pushing to remote: ${pushOptions.remote}")
return new ScmPushResult(ScmPushResultOutcome.SUCCESS, Optional.empty(), Optional.empty())
}
@Override
void commit(List patterns, String message) {
log("commiting files matching $patterns with message: $message")
}
@Override
void attachRemote(String remoteName, String url) {
log("attaching remote: $remoteName")
}
@Override
ScmPosition currentPosition() {
return delegateRepository.currentPosition()
}
@Override
ScmPosition positionOfLastChangeIn(String path, List excludeSubFolders, Set dependenciesFolders) {
return delegateRepository.positionOfLastChangeIn(path)
}
@Override
Boolean isIdenticalForPath(String path, String latestChangeRevision, String tagCommitRevision) {
return delegateRepository.isIdenticalForPath(path, latestChangeRevision, tagCommitRevision)
}
@Override
TagsOnCommit latestTags(List patterns) {
TagsOnCommit tags = delegateRepository.latestTags(patterns)
log("Latest tags: ${tags.tags}")
return tags
}
@Override
TagsOnCommit latestTags(List patterns, String sinceCommit) {
TagsOnCommit tags = delegateRepository.latestTags(patterns, sinceCommit)
log("Latest tags: ${tags.tags}")
return tags
}
@Override
List taggedCommits(List patterns) {
return delegateRepository.taggedCommits(patterns)
}
@Override
boolean remoteAttached(String remoteName) {
return true
}
@Override
boolean checkUncommittedChanges() {
boolean uncommittedChanges = delegateRepository.checkUncommittedChanges()
log("uncommitted changes: $uncommittedChanges")
return uncommittedChanges
}
@Override
boolean checkAheadOfRemote() {
boolean aheadOfRemote = delegateRepository.checkAheadOfRemote()
log("ahead of remote: $aheadOfRemote")
return aheadOfRemote
}
@Override
boolean isLegacyDefTagnameRepo() {
boolean isLegacyDefTagnameRepo = delegateRepository.isLegacyDefTagnameRepo()
log('is legacy named repository')
return isLegacyDefTagnameRepo
}
@Override
List lastLogMessages(int messageCount) {
return delegateRepository.lastLogMessages(messageCount)
}
private void log(String msg) {
logger.quiet("DRY-RUN: $msg")
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy