Fixed the test resources for Gradle

wiuthout this change Intellij support wasn't great if one hasn't applied the idea plugin
with this change if someone's using Intellij (we check that by verifying the presence of .idea folder) then we apply the plugin automatically

fixes #286
This commit is contained in:
Marcin Grzejszczak
2017-04-28 15:05:56 +02:00
parent 8ca2ed6b22
commit d0841400ef
3 changed files with 9 additions and 10 deletions

View File

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

View File

@@ -16,5 +16,5 @@
nexusUsername =
nexusPassword =
verifierVersion=1.0.4.BUILD-SNAPSHOT
verifierVersion=1.0.5.BUILD-SNAPSHOT
org.gradle.daemon=false

View File

@@ -75,14 +75,13 @@ class SpringCloudContractVerifierGradlePlugin implements Plugin<Project> {
}
private addIdeaTestSources(Project project, extension) {
project.afterEvaluate {
def hasIdea = project.plugins.findPlugin(IDEA_PLUGIN_CLASS)
if (hasIdea) {
project.idea {
module {
testSourceDirs += extension.generatedTestSourcesDir
testSourceDirs += extension.contractsDslDir
}
def hasIdea = new File(project.projectDir, ".idea").exists()
if (hasIdea) {
project.apply(plugin: 'idea')
project.idea {
module {
testSourceDirs += extension.generatedTestSourcesDir
testSourceDirs += extension.contractsDslDir
}
}
}