From 0fc5ae2253e568788ed62eb11189d77ce64c1a02 Mon Sep 17 00:00:00 2001 From: Jakub Kubrynski Date: Wed, 28 Jan 2015 23:23:14 +0100 Subject: [PATCH] Restored multi-module --- .../accurest/plugin/AccurestGradlePlugin.groovy | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/accurest-gradle-plugin/src/main/groovy/io/codearte/accurest/plugin/AccurestGradlePlugin.groovy b/accurest-gradle-plugin/src/main/groovy/io/codearte/accurest/plugin/AccurestGradlePlugin.groovy index 0c198de1a5..63a5983e3a 100644 --- a/accurest-gradle-plugin/src/main/groovy/io/codearte/accurest/plugin/AccurestGradlePlugin.groovy +++ b/accurest-gradle-plugin/src/main/groovy/io/codearte/accurest/plugin/AccurestGradlePlugin.groovy @@ -24,6 +24,7 @@ class AccurestGradlePlugin implements Plugin { project.logger.info("Accurest Plugin: Invoking test sources generation") extension.stubsBaseDirectory = project.projectDir.path + File.separator + extension.stubsBaseDirectory + extension.generatedTestSourcesDir = buildGeneratedSourcesDir(project, extension) project.sourceSets.test.groovy { srcDir extension.generatedTestSourcesDir @@ -42,7 +43,7 @@ class AccurestGradlePlugin implements Plugin { if (hasIdea) { project.idea { module { - testSourceDirs += new File(extension.generatedTestSourcesDir) + testSourceDirs += new File(buildGeneratedSourcesDir(project, extension)) } } } @@ -50,5 +51,14 @@ class AccurestGradlePlugin implements Plugin { } + private String buildGeneratedSourcesDir(Project project, def extension) { + String moduleDir + if (project.getParent()) { + moduleDir = project.name + File.separator + extension.generatedTestSourcesDir + } else { + moduleDir = extension.generatedTestSourcesDir + } + moduleDir + } }