Pill: Add "Generate All Tests" run configuration
This commit is contained in:
@@ -99,7 +99,8 @@ private val CONFIGURATION_MAPPING = mapOf(
|
||||
private val TEST_CONFIGURATION_MAPPING = mapOf(
|
||||
listOf("runtime", "testRuntime") to Scope.RUNTIME,
|
||||
listOf("compile", "testCompile") to Scope.COMPILE,
|
||||
listOf("compileOnly", "testCompileOnly") to Scope.PROVIDED
|
||||
listOf("compileOnly", "testCompileOnly") to Scope.PROVIDED,
|
||||
listOf("jpsTest") to Scope.TEST
|
||||
)
|
||||
|
||||
private val SOURCE_SET_MAPPING = mapOf(
|
||||
@@ -273,9 +274,9 @@ private fun ParserContext.parseDependencies(project: Project, forTests: Boolean)
|
||||
}
|
||||
}
|
||||
|
||||
if (dependency.configuration == "runtimeElements") {
|
||||
if (dependency.configuration == "runtimeElements" && scope != Scope.TEST) {
|
||||
mainRoots += POrderRoot(PDependency.Module(dependency.moduleName + ".src"), scope)
|
||||
} else if (dependency.configuration == "tests-jar") {
|
||||
} else if (dependency.configuration == "tests-jar" || dependency.configuration == "jpsTest") {
|
||||
mainRoots += POrderRoot(
|
||||
PDependency.Module(dependency.moduleName + ".test"),
|
||||
scope,
|
||||
|
||||
@@ -14,7 +14,10 @@ import java.io.FileOutputStream
|
||||
import javax.xml.transform.stream.StreamResult
|
||||
|
||||
class JpsCompatiblePlugin : Plugin<Project> {
|
||||
override fun apply(project: Project) {}
|
||||
override fun apply(project: Project) {
|
||||
// 'jpsTest' does not require the 'tests-jar' artifact
|
||||
project.configurations.create("jpsTest")
|
||||
}
|
||||
}
|
||||
|
||||
class JpsCompatibleRootPlugin : Plugin<Project> {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="[JPS] Generate All Tests" type="Application" factoryName="Application">
|
||||
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.pill.generateAllTests.Main" />
|
||||
<module name="generate-all-tests.test" />
|
||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
||||
Reference in New Issue
Block a user