Infrastructure: move compiler plugin tests back to their modules

This commit is contained in:
Yan Zhulanow
2017-10-16 20:20:57 +03:00
parent 7248f2568a
commit eccc3447f6
40 changed files with 113 additions and 106 deletions
+4 -2
View File
@@ -408,9 +408,11 @@ tasks {
"plugins-tests" {
dependsOn("dist")
dependsOn(":plugins:plugins-tests:test",
":kotlin-annotation-processing:test",
dependsOn(":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
":kotlin-allopen-compiler-plugin:test",
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test")
}
+15 -1
View File
@@ -21,6 +21,12 @@ dependencies {
compile(commonDep("org.fusesource.jansi", "jansi"))
compile(commonDep("org.jline", "jline"))
compile(files("${System.getProperty("java.home")}/../lib/tools.jar"))
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler:tests-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
}
sourceSets {
@@ -30,5 +36,13 @@ sourceSets {
"../builtins-serializer/src",
"../javac-wrapper/src")
}
"test" {}
"test" {
java.srcDirs("../../plugins/annotation-collector/test")
}
}
testsJar {}
projectTest {
workingDir = rootDir
}
+6 -1
View File
@@ -19,15 +19,20 @@ dependencies {
compile(projectTests(":compiler:tests-common"))
compile(projectTests(":compiler:container"))
compile(projectTests(":compiler:incremental-compilation-impl"))
compile(projectTests(":compiler:cli"))
compile(projectTests(":idea"))
compile(projectTests(":idea:idea-gradle"))
compile(projectTests(":idea:idea-maven"))
compile(projectTests(":j2k"))
compile(projectTests(":idea:idea-android"))
compile(projectTests(":jps-plugin"))
compile(projectTests(":plugins:plugins-tests"))
compile(projectTests(":plugins:android-extensions-compiler"))
compile(projectTests(":plugins:android-extensions-ide"))
compile(projectTests(":plugins:android-extensions-jps"))
compile(projectTests(":kotlin-annotation-processing"))
compile(projectTests(":kotlin-allopen-compiler-plugin"))
compile(projectTests(":kotlin-noarg-compiler-plugin"))
compile(projectTests(":kotlin-sam-with-receiver-compiler-plugin"))
compile(projectTests(":plugins:uast-kotlin"))
compile(projectTests(":js:js.tests"))
compile(projectTests(":generators:test-generator"))
@@ -921,7 +921,7 @@ fun main(args: Array<String>) {
}
}
testGroup("plugins/plugins-tests/tests", "plugins/android-extensions/android-extensions-compiler/testData") {
testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") {
testClass<AbstractAndroidSyntheticPropertyDescriptorTest> {
model("descriptors", recursive = false, extension = null)
}
@@ -940,7 +940,7 @@ fun main(args: Array<String>) {
}
}
testGroup("plugins/plugins-tests/tests", "plugins/annotation-collector/testData") {
testGroup("plugins/annotation-collector/test", "plugins/annotation-collector/testData") {
testClass<AbstractAnnotationProcessorBoxTest> {
model("collectToFile", recursive = false, extension = null)
}
@@ -956,13 +956,13 @@ fun main(args: Array<String>) {
}
}
testGroup("plugins/plugins-tests/tests", "plugins/allopen/allopen-cli/testData") {
testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") {
testClass<AbstractBytecodeListingTestForAllOpen> {
model("bytecodeListing", extension = "kt")
}
}
testGroup("plugins/plugins-tests/tests", "plugins/noarg/noarg-cli/testData") {
testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") {
testClass<AbstractBytecodeListingTestForNoArg> {
model("bytecodeListing", extension = "kt")
}
@@ -972,7 +972,7 @@ fun main(args: Array<String>) {
}
}
testGroup("plugins/plugins-tests/tests", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") {
testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") {
testClass<AbstractSamWithReceiverTest> {
model("diagnostics")
}
@@ -1054,7 +1054,7 @@ fun main(args: Array<String>) {
}
}
testGroup("plugins/plugins-tests/tests", "plugins/android-extensions/android-extensions-jps/testData") {
testGroup("plugins/android-extensions/android-extensions-jps/test", "plugins/android-extensions/android-extensions-jps/testData") {
testClass<AbstractAndroidJpsTestCase> {
model("android", recursive = false, extension = null)
}
-36
View File
@@ -4511,42 +4511,6 @@
"reporting": "org.gradle.api.reporting.ReportingExtension"
}
},
":plugins:plugins-tests": {
"conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention",
"java": "org.gradle.api.plugins.JavaPluginConvention"
},
"configurations": [
"apiElements",
"archives",
"compile",
"compileClasspath",
"compileOnly",
"default",
"implementation",
"kapt",
"kaptTest",
"runtime",
"runtimeClasspath",
"runtimeElements",
"runtimeOnly",
"testCompile",
"testCompileClasspath",
"testCompileOnly",
"testImplementation",
"testRuntime",
"testRuntimeClasspath",
"testRuntimeOnly",
"tests-jar"
],
"extensions": {
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
"kotlin": "org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension",
"kapt": "org.jetbrains.kotlin.gradle.plugin.KaptExtension",
"defaultArtifacts": "org.gradle.api.internal.plugins.DefaultArtifactPublicationSet",
"reporting": "org.gradle.api.reporting.ReportingExtension"
}
},
":plugins:uast-kotlin": {
"conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention",
+14 -1
View File
@@ -9,17 +9,27 @@ dependencies {
compileOnly(project(":compiler:frontend"))
runtime(projectRuntimeJar(":kotlin-compiler"))
runtime(projectDist(":kotlin-stdlib"))
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler:tests-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
testRuntime(ideaSdkDeps("*.jar"))
}
sourceSets {
"main" { projectDefault() }
"test" {}
"test" { projectDefault() }
}
val jar = runtimeJar {
from(fileTree("$projectDir/src")) { include("META-INF/**") }
}
testsJar {}
dist(targetName = the<BasePluginConvention>().archivesBaseName.removePrefix("kotlin-") + ".jar")
ideaPlugin {
@@ -27,3 +37,6 @@ ideaPlugin {
rename("^kotlin-", "")
}
projectTest {
workingDir = rootDir
}
@@ -11,11 +11,21 @@ dependencies {
compile(project(":compiler:frontend.java"))
compile(project(":compiler:backend"))
compileOnly(project(":kotlin-android-extensions-runtime"))
testCompile(project(":compiler:util"))
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler:tests-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(commonDep("junit:junit"))
testRuntime(ideaPluginDeps("idea-junit", "resources_en", plugin = "junit"))
testCompile(project(":kotlin-android-extensions-runtime"))
}
sourceSets {
"main" { projectDefault() }
"test" {}
"test" { projectDefault() }
}
runtimeJar {
@@ -25,3 +35,13 @@ runtimeJar {
dist()
ideaPlugin()
testsJar {}
evaluationDependsOn(":kotlin-android-extensions-runtime")
projectTest {
environment("ANDROID_EXTENSIONS_RUNTIME_CLASSES", getSourceSetsFrom(":kotlin-android-extensions-runtime")["main"].output.classesDirs.asPath)
dependsOnTaskIfExistsRec("dist", project = rootProject)
workingDir = rootDir
}
@@ -6,10 +6,27 @@ dependencies {
compile(project(":jps-plugin"))
compile(project(":plugins:android-extensions-compiler"))
compile(ideaPluginDeps("android-jps-plugin", plugin = "android", subdir = "lib/jps"))
testCompile(projectTests(":jps-plugin"))
testCompile(project(":compiler:tests-common"))
testCompileOnly(ideaSdkDeps("jps-build-test", subdir = "jps/test"))
testRuntime(ideaPluginDeps("*.jar", plugin = "android"))
testCompile(commonDep("junit:junit"))
testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(projectTests(":kotlin-build-common"))
testRuntime(ideaSdkCoreDeps("*.jar"))
testRuntime(ideaSdkDeps("*.jar"))
testRuntime(ideaSdkDeps("*.jar", subdir = "jps/test"))
testRuntime(ideaSdkDeps("*.jar", subdir = "jps"))
}
sourceSets {
"main" { projectDefault() }
"test" {}
"test" { projectDefault() }
}
projectTest {
workingDir = rootDir
}
testsJar {}
@@ -70,9 +70,8 @@ class KotlinAndroidJpsPlugin : KotlinJpsCompilerArgumentsProvider {
val libDirectory = File(PathUtil.getJarPathForClass(this::class.java)).parentFile.parentFile
File(libDirectory, JAR_FILE_NAME).absolutePath
} else {
// We're in tests now (in out/production/android-extensions/android-extensions-jps)
val kotlinProjectDirectory = File(PathUtil.getJarPathForClass(this::class.java)).parentFile.parentFile.parentFile
File(kotlinProjectDirectory, "dist/kotlinc/lib/$JAR_FILE_NAME").absolutePath
// We're in tests now (project root dir)
File("dist/kotlinc/lib/$JAR_FILE_NAME").absolutePath
})
}
else emptyList()
+2
View File
@@ -10,6 +10,8 @@ dependencies {
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:plugin-api"))
testCompile(project(":compiler:tests-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(ideaSdkDeps("idea", "idea_rt", "openapi"))
testCompile(commonDep("junit:junit"))
+12 -1
View File
@@ -11,17 +11,25 @@ dependencies {
compileOnly(project(":compiler:plugin-api"))
runtime(projectRuntimeJar(":kotlin-compiler"))
runtime(projectDist(":kotlin-stdlib"))
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler:tests-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
}
sourceSets {
"main" { projectDefault() }
"test" {}
"test" { projectDefault() }
}
val jar = runtimeJar {
from(fileTree("$projectDir/src")) { include("META-INF/**") }
}
testsJar {}
dist(targetName = the<BasePluginConvention>().archivesBaseName.removePrefix("kotlin-") + ".jar")
ideaPlugin {
@@ -29,3 +37,6 @@ ideaPlugin {
rename("^kotlin-", "")
}
projectTest {
workingDir = rootDir
}
-51
View File
@@ -1,51 +0,0 @@
apply { plugin("kotlin") }
dependencies {
testCompile(project(":compiler:util"))
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli"))
testCompile(project(":plugins:android-extensions-compiler"))
testCompile(project(":plugins:android-extensions-ide"))
testCompile(project(":kotlin-android-extensions-runtime"))
testCompile(project(":allopen-ide-plugin")) { isTransitive = false }
testCompile(project(":kotlin-allopen-compiler-plugin"))
testCompile(project(":noarg-ide-plugin")) { isTransitive = false }
testCompile(project(":kotlin-noarg-compiler-plugin"))
testCompile(project(":plugins:annotation-based-compiler-plugins-ide-support")) { isTransitive = false }
testCompile(project(":sam-with-receiver-ide-plugin")) { isTransitive = false }
testCompile(project(":kotlin-sam-with-receiver-compiler-plugin"))
testCompile(project(":idea:idea-android")) { isTransitive = false }
testCompile(project(":plugins:lint")) { isTransitive = false }
testCompile(project(":plugins:uast-kotlin"))
testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(projectTests(":jps-plugin"))
testCompile(commonDep("junit:junit"))
testCompileOnly(ideaSdkDeps("jps-builders"))
testCompile(ideaSdkDeps("jps-build-test", subdir = "jps/test"))
testCompile(ideaPluginDeps("*.jar", plugin = "android", subdir = "lib/jps"))
testRuntime(projectDist(":kotlin-reflect"))
testRuntime(project(":jps-plugin"))
testRuntime(projectTests(":compiler:tests-common-jvm6"))
testRuntime(ideaSdkDeps("*.jar"))
testRuntime(ideaPluginDeps("idea-junit", "resources_en", plugin = "junit"))
testRuntime(ideaPluginDeps("*.jar", plugin = "gradle"))
testRuntime(ideaPluginDeps("*.jar", plugin = "android"))
testRuntime(preloadedDeps("dx", subdir = "android-5.0/lib"))
}
sourceSets {
"main" {}
"test" { projectDefault() }
}
testsJar {}
evaluationDependsOn(":kotlin-android-extensions-runtime")
projectTest {
environment("ANDROID_EXTENSIONS_RUNTIME_CLASSES", getSourceSetsFrom(":kotlin-android-extensions-runtime")["main"].output.classesDirs.asPath)
dependsOnTaskIfExistsRec("dist", project = rootProject)
workingDir = rootDir
}
@@ -9,11 +9,19 @@ dependencies {
compileOnly(project(":compiler:plugin-api"))
runtime(projectRuntimeJar(":kotlin-compiler"))
runtime(projectDist(":kotlin-stdlib"))
runtime(projectDist(":kotlin-reflect"))
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler:tests-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
testRuntime(ideaSdkDeps("*.jar"))
}
sourceSets {
"main" { projectDefault() }
"test" {}
"test" { projectDefault() }
}
val jar = runtimeJar {
@@ -21,6 +29,7 @@ val jar = runtimeJar {
}
sourcesJar()
javadocJar()
testsJar {}
publish()
@@ -33,3 +42,6 @@ ideaPlugin {
rename("^kotlin-", "")
}
projectTest {
workingDir = rootDir
}
-1
View File
@@ -88,7 +88,6 @@ include ":kotlin-build-common",
":plugins:uast-kotlin",
":plugins:uast-kotlin-idea",
":plugins:annotation-based-compiler-plugins-ide-support",
":plugins:plugins-tests",
":kotlin-script-runtime",
":kotlin-runtime",
":kotlin-test",