Removed deprecated contractRepositoryUrl prop; fixes gh-795

This commit is contained in:
Marcin Grzejszczak
2018-11-13 11:44:29 +01:00
parent 1b41c2b1a8
commit 930eb02191
5 changed files with 4 additions and 51 deletions

View File

@@ -18,5 +18,5 @@ nexusUsername =
nexusPassword =
verifierVersion=2.1.0.BUILD-SNAPSHOT
org.gradle.daemon=false
aetherVersion=1.0.2.v20150114
aetherVersion=1.1.0
springCloudBuildVersion=2.1.0.BUILD-SNAPSHOT

View File

@@ -127,24 +127,6 @@ class ContractVerifierExtension {
*/
Boolean assertJsonSize = false
/**
* The URL from which a JAR containing the contracts should get downloaded. If not provided
* but artifactid / coordinates notation was provided then the current Maven's build repositories will be
* taken into consideration
*
* @deprecated - use {@link ContractVerifierExtension#contractRepository(groovy.lang.Closure)}
*/
@Deprecated
String contractsRepositoryUrl
/*
* @deprecated - use {@link ContractVerifierExtension#contractRepository(groovy.lang.Closure)}
*/
@Deprecated
void setContractsRepositoryUrl(String contractsRepositoryUrl) {
this.contractRepository.repositoryUrl(contractsRepositoryUrl)
}
ContractRepository contractRepository = new ContractRepository()
/**

View File

@@ -62,8 +62,8 @@ class GradleContractsDownloader {
}
private boolean shouldDownloadContracts(ContractVerifierExtension extension) {
return extension.contractDependency != null &&
StringUtils.hasText(extension.contractDependency.getArtifactId()) ||
return StringUtils.hasText(extension.contractDependency.getArtifactId()) ||
StringUtils.hasText(extension.contractDependency.getStringNotation()) ||
StringUtils.hasText(extension.contractRepository.repositoryUrl)
}

View File

@@ -123,8 +123,7 @@ class SpringCloudContractVerifierGradlePlugin implements Plugin<Project> {
stubsOutputDir = { extension.stubsOutputDir }
}
task.onlyIf {
String contractRepoUrl = extension.contractsRepositoryUrl ?:
extension.contractRepository.repositoryUrl ?: ""
String contractRepoUrl = extension.contractRepository.repositoryUrl ?: ""
if (!contractRepoUrl || !ScmStubDownloaderBuilder.isProtocolAccepted(contractRepoUrl)) {
project.logger.info("Skipping pushing stubs to scm since your [contractsRepositoryUrl] property doesn't match any of the accepted protocols")
return false

View File

@@ -77,34 +77,6 @@ class GradleContractsDownloaderSpec extends Specification {
stubConfig.classifier == "stubs"
}
def "should pick dependency from cache for a non snapshot contract dependency with old property"() {
given:
ContractVerifierExtension ext = new ContractVerifierExtension()
ext.with {
contractsMode = StubRunnerProperties.StubsMode.REMOTE
contractDependency {
groupId("com.example")
artifactId("foo")
version("1.0.0")
classifier("stubs")
}
contractsRepositoryUrl = "foo"
}
and:
final AetherStubDownloader downloader = Mock(AetherStubDownloader)
final ContractDownloader contractDownloader = Mock(ContractDownloader)
and:
def gradleDownloader = stubbedContractDownloader(downloader, contractDownloader)
and:
StubConfiguration expectedStubConfig = new StubConfiguration("com.example:foo:1.0.0:stubs")
File expectedFileFromCache = new File("foo/bar")
GradleContractsDownloader.downloadedContract.put(expectedStubConfig, expectedFileFromCache)
when:
File file = gradleDownloader.downloadAndUnpackContractsIfRequired(ext, new ContractVerifierConfigProperties())
then:
file == expectedFileFromCache
}
def "should pick dependency from cache for a non snapshot contract dependency with new property"() {
given:
ContractVerifierExtension ext = new ContractVerifierExtension()