Merge branch '1.0.x'

fixes #167
This commit is contained in:
Marcin Grzejszczak
2016-12-28 12:52:15 +01:00
17 changed files with 228 additions and 14 deletions

View File

@@ -134,6 +134,13 @@ class ContractVerifierExtension {
*/
Map<String, String> baseClassMappings = [:]
/**
* If set to true then the {@code target} or {@code build} folders are getting
* excluded from any operations. This is used out of the box when working with
* common repo with contracts.
*/
boolean excludeBuildFolders
void contractDependency(@DelegatesTo(Dependency) Closure closure) {
closure.delegate = contractDependency
closure.call()

View File

@@ -32,6 +32,9 @@ class ContractsCopyTask extends ConventionTask {
project.copy {
from(file)
include(antPattern)
if (props.isExcludeBuildFolders()) {
exclude "**/target/**", "**/build/**"
}
into(outputContractsFolder)
}
}

View File

@@ -27,7 +27,8 @@ class ExtensionToProperties {
stubsSuffix: extension.stubsSuffix,
assertJsonSize: extension.assertJsonSize,
packageWithBaseClasses: extension.packageWithBaseClasses,
baseClassMappings: extension.baseClassMappings
baseClassMappings: extension.baseClassMappings,
excludeBuildFolders: extension.excludeBuildFolders
)
}
}

View File

@@ -90,6 +90,7 @@ class SpringCloudContractVerifierGradlePlugin implements Plugin<Project> {
}
}
//TODO: Deprecate this since starting with 1.1.x
private void addProjectDependencies(Project project) {
//TODO: Consider removing this at some point
project.dependencies.add("testCompile", "com.github.tomakehurst:wiremock:2.1.7")