YAML contracts (#522)

with this change we allow the users to use YAML to define contracts

fixes gh-300 gh-508
helps with #501
This commit is contained in:
Marcin Grzejszczak
2018-01-19 00:27:15 +01:00
committed by GitHub
parent b2428c5f13
commit b745d9a7e3
125 changed files with 5116 additions and 272 deletions

View File

@@ -23,7 +23,7 @@ ext {
]
}
project.version = findProperty('verifierVersion') ?: '1.5.4.RELEASE'
project.version = findProperty('verifierVersion') ?: '1.5.9.RELEASE'
apply plugin: 'groovy'
apply from: "$rootDir/gradle/release.gradle"
apply plugin: 'eclipse'

View File

@@ -20,7 +20,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.4.RELEASE")
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.9.RELEASE")
}
}

View File

@@ -20,7 +20,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.4.RELEASE")
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.9.RELEASE")
}
}

View File

@@ -20,7 +20,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.4.RELEASE")
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.9.RELEASE")
}
}

View File

@@ -40,7 +40,9 @@ import org.codehaus.plexus.archiver.jar.JarArchiver;
public class GenerateStubsMojo extends AbstractMojo {
private static final String STUB_MAPPING_FILE_PATTERN = "**/*.json";
private static final String CONTRACT_FILE_PATTERN = "**/*.groovy";
private static final String GROOVY_CONTRACT_FILE_PATTERN = "**/*.groovy";
private static final String YAML_CONTRACT_FILE_PATTERN = "**/*.yaml";
private static final String YML_CONTRACT_FILE_PATTERN = "**/*.yml";
@Parameter(defaultValue = "${project.build.directory}", readonly = true,
required = true)
@@ -110,7 +112,10 @@ public class GenerateStubsMojo extends AbstractMojo {
try {
if (this.attachContracts) {
this.archiver.addDirectory(stubsOutputDir,
new String[] { STUB_MAPPING_FILE_PATTERN, CONTRACT_FILE_PATTERN },
new String[] { STUB_MAPPING_FILE_PATTERN,
GROOVY_CONTRACT_FILE_PATTERN,
YAML_CONTRACT_FILE_PATTERN,
YML_CONTRACT_FILE_PATTERN },
excludedFilesEmpty() ? new String[0] : this.excludedFiles);
}
else {
@@ -134,7 +139,9 @@ public class GenerateStubsMojo extends AbstractMojo {
private String[] excludes() {
List<String> excludes = new ArrayList<>();
excludes.add(CONTRACT_FILE_PATTERN);
excludes.add(GROOVY_CONTRACT_FILE_PATTERN);
excludes.add(YAML_CONTRACT_FILE_PATTERN);
excludes.add(YML_CONTRACT_FILE_PATTERN);
if (!excludedFilesEmpty()) {
excludes.addAll(Arrays.asList(this.excludedFiles));
}

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<version>1.5.9.RELEASE</version>
</parent>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<version>1.5.9.RELEASE</version>
</parent>
<dependencies>

View File

@@ -28,7 +28,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<version>1.5.9.RELEASE</version>
</parent>
<dependencies>