Implement Gradle Kotlin DSL build

This commit is contained in:
Ilya Chernikov
2017-08-02 12:26:50 +02:00
parent f5d6e41993
commit 61dfb75e0e
93 changed files with 3737 additions and 0 deletions
@@ -0,0 +1,30 @@
import org.gradle.jvm.tasks.Jar
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(ideaSdkCoreDeps("intellij-core"))
compile(project(":compiler:plugin-api"))
compile(project(":compiler:frontend"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
val jar: Jar by tasks
jar.apply {
setupRuntimeJar("Kotlin AllOpen Compiler Plugin")
from(fileTree("$projectDir/src")) { include("META-INF/**") }
archiveName = "allopen-compiler-plugin.jar"
}
dist {
from(jar)
}
ideaPlugin {
from(jar)
}
@@ -0,0 +1,29 @@
import org.gradle.jvm.tasks.Jar
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":plugins:allopen-cli"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:cli-common"))
compile(project(":idea"))
compile(project(":idea:idea-jps-common"))
compile(project(":plugins:annotation-based-compiler-plugins-ide-support"))
compile(ideaSdkDeps("openapi", "idea"))
compile(ideaPluginDeps("maven", plugin = "maven"))
compile(ideaPluginDeps("gradle-tooling-api", "gradle", plugin = "gradle"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
val jar: Jar by tasks
ideaPlugin {
from(jar)
}
@@ -0,0 +1,32 @@
import org.gradle.jvm.tasks.Jar
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(ideaSdkCoreDeps("intellij-core"))
compile(project(":compiler:util"))
compile(project(":compiler:plugin-api"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:backend"))
compile(ideaPluginDeps("layoutlib", plugin = "android"))
}
configureKotlinProjectSources("android-extensions-compiler/src", "android-extensions-runtime/src", sourcesBaseDir = File(rootDir, "plugins", "android-extensions"))
configureKotlinProjectNoTests()
val jar: Jar by tasks
jar.apply {
setupRuntimeJar("Kotlin Android Extensions Compiler")
}
dist {
from(jar)
}
ideaPlugin {
from(jar)
}
@@ -0,0 +1,63 @@
import org.gradle.jvm.tasks.Jar
apply { plugin("kotlin") }
dependencies {
val compile by configurations
val compileOnly by configurations
val testCompile by configurations
val testCompileOnly by configurations
val testRuntime by configurations
compile(project(":compiler:util"))
compile(project(":compiler:light-classes"))
compile(project(":idea:idea-core"))
compile(project(":idea"))
compile(project(":plugins:android-extensions-compiler"))
compile(ideaPluginDeps("android", "sdk-tools", "sdk-common", plugin = "android"))
compile(ideaPluginDeps("Groovy", plugin = "Groovy"))
testCompile(project(":compiler.tests-common"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler:frontend.java"))
testCompile(project(":idea:idea-test-framework")) { isTransitive = false }
testCompile(projectTests(":idea"))
testCompile(projectTests(":idea:idea-android"))
testCompile(project(":kotlin-test:kotlin-test-jvm"))
testRuntime(project(":plugins:android-extensions-jps"))
testRuntime(project(":plugins:sam-with-receiver-ide"))
testRuntime(project(":plugins:noarg-ide"))
testRuntime(project(":plugins:allopen-ide"))
testRuntime(ideaSdkDeps("*.jar"))
testRuntime(ideaPluginDeps("idea-junit", "resources_en", plugin = "junit"))
testRuntime(ideaPluginDeps("IntelliLang", plugin = "IntelliLang"))
testRuntime(ideaPluginDeps("jcommander", "testng", "testng-plugin", "resources_en", plugin = "testng"))
testRuntime(ideaPluginDeps("copyright", plugin = "copyright"))
testRuntime(ideaPluginDeps("properties", "resources_en", plugin = "properties"))
testRuntime(ideaPluginDeps("java-i18n", plugin = "java-i18n"))
testRuntime(ideaPluginDeps("*.jar", plugin = "gradle"))
testRuntime(ideaPluginDeps("*.jar", plugin = "Groovy"))
testRuntime(ideaPluginDeps("coverage", "jacocoant", plugin = "coverage"))
testRuntime(ideaPluginDeps("java-decompiler", plugin = "java-decompiler"))
testRuntime(ideaPluginDeps("*.jar", plugin = "maven"))
testRuntime(ideaPluginDeps("*.jar", plugin = "android"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectTestsDefault()
testsJar {}
tasks.withType<Test> {
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
}
val jar: Jar by tasks
ideaPlugin {
from(jar)
}
@@ -0,0 +1,14 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:util"))
compile(project(":jps-plugin"))
compile(project(":plugins:android-extensions-compiler"))
compile(ideaPluginDeps("android-jps-plugin", plugin = "android", subdir = "lib/jps"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
@@ -0,0 +1,22 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
val compileOnly by configurations
val testCompile by configurations
val testCompileOnly by configurations
val testRuntime by configurations
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:cli-common"))
compile(project(":idea"))
compile(project(":idea:idea-jps-common"))
compileOnly(ideaPluginDeps("maven", "maven-server-api", plugin = "maven"))
compileOnly(ideaPluginDeps("gradle-tooling-api", "gradle", plugin = "gradle"))
compileOnly(ideaSdkDeps("openapi", "idea"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
+31
View File
@@ -0,0 +1,31 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
val compileOnly by configurations
val testCompile by configurations
val testCompileOnly by configurations
val testRuntime by configurations
compile(project(":compiler:util"))
compile(project(":compiler:cli"))
compile(project(":compiler:backend"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:plugin-api"))
testCompile(project(":compiler.tests-common"))
testCompile(commonDep("junit:junit"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectTestsDefault()
testsJar {}
tasks.withType<Test> {
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
}
+25
View File
@@ -0,0 +1,25 @@
apply {
plugin("kotlin")
plugin("java")
}
dependencies {
val compile by configurations
compile(project(":compiler:frontend"))
compile(project(":idea"))
compile(project(":idea:idea-core"))
compile(project(":idea:idea-android"))
compile(project(":plugins:uast-kotlin"))
compile(preloadedDeps("uast-common", "uast-java"))
compile(ideaPluginDeps("android", "android-common", "common", "sdk-common", "sdklib", "sdk-tools", "repository", "lombok-ast", "kxml2", plugin = "android"))
compile(ideaSdkCoreDeps("intellij-core", "util"))
compile(ideaSdkDeps("guava"))
}
configureKotlinProjectSources("android-annotations/src",
"lint-api/src",
"lint-checks/src",
"lint-idea/src")
configureKotlinProjectNoTests()
+32
View File
@@ -0,0 +1,32 @@
import org.gradle.jvm.tasks.Jar
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:backend"))
compile(project(":compiler:util"))
compile(project(":compiler:plugin-api"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
val jar: Jar by tasks
jar.apply {
setupRuntimeJar("Kotlin NoArg Compiler Plugin")
from(fileTree("$projectDir/src")) { include("META-INF/**") }
archiveName = "noarg-compiler-plugin.jar"
}
dist {
from(jar)
}
ideaPlugin {
from(jar)
}
+32
View File
@@ -0,0 +1,32 @@
import org.gradle.jvm.tasks.Jar
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":plugins:noarg-cli"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:backend"))
compile(project(":compiler:cli-common"))
compile(project(":idea"))
compile(project(":idea:idea-jps-common"))
compile(project(":plugins:annotation-based-compiler-plugins-ide-support"))
compile(ideaSdkDeps("openapi", "idea"))
compile(ideaPluginDeps("maven", plugin = "maven"))
compile(ideaPluginDeps("gradle-tooling-api", "gradle", plugin = "gradle"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
val jar: Jar by tasks
ideaPlugin {
from(jar)
}
+51
View File
@@ -0,0 +1,51 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
val compileOnly by configurations
val testCompile by configurations
val testCompileOnly by configurations
val testRuntime by configurations
testCompile(project(":compiler:util"))
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler.tests-common"))
testCompile(project(":plugins:android-extensions-compiler"))
testCompile(project(":plugins:android-extensions-idea"))
testCompile(project(":plugins:allopen-ide")) { isTransitive = false }
testCompile(project(":plugins:allopen-cli"))
testCompile(project(":plugins:noarg-ide")) { isTransitive = false }
testCompile(project(":plugins:noarg-cli"))
testCompile(project(":plugins:annotation-based-compiler-plugins-ide-support")) { isTransitive = false }
testCompile(project(":plugins:sam-with-receiver-ide")) { isTransitive = false }
testCompile(project(":plugins:sam-with-receiver-cli"))
testCompile(project(":idea:idea-android")) { isTransitive = false }
testCompile(project(":plugins:lint")) { isTransitive = false }
testCompile(project(":plugins:uast-kotlin"))
testCompile(project(":kotlin-test:kotlin-test-jvm"))
testCompile(projectTests(":jps-plugin"))
testCompileOnly(ideaSdkDeps("jps-builders"))
testCompile(ideaSdkDeps("jps-build-test", subdir = "jps/test"))
testCompile(ideaPluginDeps("*.jar", plugin = "android", subdir = "lib/jps"))
testRuntime(project(":jps-plugin"))
testRuntime(ideaSdkDeps("*.jar"))
testRuntime(ideaPluginDeps("idea-junit", "resources_en", plugin = "junit"))
testRuntime(ideaPluginDeps("*.jar", plugin = "gradle"))
testRuntime(ideaPluginDeps("*.jar", plugin = "android"))
}
configureKotlinProjectSources()
configureKotlinProjectTestsDefault()
testsJar {}
val test: Test by tasks
test.apply {
dependsOnTaskIfExistsRec("dist", project = rootProject)
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
}
@@ -0,0 +1,30 @@
import org.gradle.jvm.tasks.Jar
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:plugin-api"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
val jar: Jar by tasks
jar.apply {
setupRuntimeJar("Kotlin SamWithReceiver Compiler Plugin")
from(fileTree("$projectDir/src")) { include("META-INF/**") }
archiveName = "sam-with-receiver-compiler-plugin.jar"
}
dist {
from(jar)
}
ideaPlugin {
from(jar)
}
@@ -0,0 +1,26 @@
import org.gradle.jvm.tasks.Jar
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":plugins:sam-with-receiver-cli"))
compile(project(":plugins:annotation-based-compiler-plugins-ide-support"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":idea:idea-core"))
compile(project(":idea:idea-android"))
compile(project(":idea"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
val jar: Jar by tasks
ideaPlugin {
from(jar)
}
@@ -0,0 +1,48 @@
import org.gradle.jvm.tasks.Jar
apply { plugin("kotlin") }
dependencies {
val compile by configurations
val compileOnly by configurations
val testCompile by configurations
val testCompileOnly by configurations
val testRuntime by configurations
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.script"))
compile(project(":compiler:plugin-api"))
testCompile(project(":compiler.tests-common"))
testCompile(commonDep("junit:junit"))
testCompile(project(":compiler:util"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler:cli-common"))
testCompile(project(":compiler:frontend.java"))
testCompile(project(":compiler:daemon-common"))
testCompile(project(":compiler:daemon-client"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectResources("src") {
include("META-INF/**")
}
configureKotlinProjectTestsDefault()
val jar: Jar by tasks
jar.apply {
setupRuntimeJar("Kotlin SourceSections Compiler Plugin")
archiveName = "kotlin-source-sections-compiler-plugin.jar"
}
dist {
from(jar)
}
tasks.withType<Test> {
dependsOnTaskIfExistsRec("dist", project = rootProject)
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
}
+18
View File
@@ -0,0 +1,18 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
compile(project(":kotlin-stdlib"))
compile(project(":core:util.runtime"))
compile(project(":compiler:backend"))
compile(project(":compiler:frontend.java"))
compile(project(":idea:ide-common"))
compile(project(":plugins:uast-kotlin"))
compile(preloadedDeps("uast-common", "uast-java"))
buildVersion()
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectNoTests()
+39
View File
@@ -0,0 +1,39 @@
apply { plugin("kotlin") }
dependencies {
val compile by configurations
val compileOnly by configurations
val testCompile by configurations
val testCompileOnly by configurations
val testRuntime by configurations
compile(project(":kotlin-stdlib"))
compile(project(":core:util.runtime"))
compile(project(":compiler:backend"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:light-classes"))
compile(preloadedDeps("uast-common", "uast-java"))
buildVersion()
testCompile(project(":kotlin-test:kotlin-test-jvm"))
testCompile(project(":compiler.tests-common"))
testCompile(commonDep("junit:junit"))
testCompile(project(":compiler:util"))
testCompile(project(":compiler:cli"))
testCompile(project(":idea:idea-android"))
testCompile(preloadedDeps("uast-tests"))
testRuntime(ideaSdkDeps("*.jar"))
}
configureKotlinProjectSourcesDefault()
configureKotlinProjectTestsDefault()
testsJar {}
tasks.withType<Test> {
workingDir = rootDir
systemProperty("idea.is.unit.test", "true")
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
ignoreFailures = true
}