提交 1862c78b 编写于 作者: I Ilya Chernikov

Fix projects for gradle integration tests

上级 8ec5cc7d
......@@ -4,13 +4,13 @@ description = "Kotlin Build Common"
apply { plugin("kotlin") }
dependencies {
compile(project(":core:util.runtime"))
compile(project(":compiler:util"))
compile(project(":compiler:cli-common"))
compile(project(":compiler:frontend.java"))
compile(project(":js:js.serializer"))
compile(project(":js:js.frontend"))
compile(ideaSdkDeps("util"))
compileOnly(project(":core:util.runtime"))
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:cli-common"))
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":js:js.serializer"))
compileOnly(project(":js:js.frontend"))
compileOnly(ideaSdkDeps("util"))
testCompile(commonDep("junit:junit"))
testCompile(project(":compiler.tests-common"))
testCompile(protobufFull())
......@@ -28,3 +28,5 @@ runtimeJar()
testsJar()
projectTest()
publish()
\ No newline at end of file
......@@ -18,6 +18,11 @@ import java.io.File
// can be used now only for the non-published projects, due to conflicts in the "archives" config
// TODO: fix the problem above
fun Project.classesDirsArtifact(): FileCollection {
task("uploadArchives") {
// hides rule-based task with the same name, which appears to be broken in this project
}
val classesDirsCfg = configurations.getOrCreate("classes-dirs")
val classesDirs = the<JavaPluginConvention>().sourceSets["main"].output.classesDirs
......@@ -47,6 +52,10 @@ fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
}
}
fun Project.noDefaultJar() {
tasks.findByName("jar")?.enabled = false
}
fun<T> Project.runtimeJarArtifactBy(task: Task, artifactRef: T, body: ConfigurablePublishArtifact.() -> Unit = {}) {
addArtifact("archives", task, artifactRef, body)
addArtifact("runtimeJar", task, artifactRef, body)
......@@ -108,6 +117,11 @@ fun Project.standardPublicJars(): Unit {
fun Project.publish(body: Upload.() -> Unit = {}): Upload {
apply<plugins.PublishedKotlinModule>()
afterEvaluate {
if (configurations.findByName("classes-dirs") != null)
throw GradleException("classesDirsArtifact() is incompatible with publish(), see sources comments for details")
}
return (tasks.getByName("uploadArchives") as Upload).apply {
body()
}
......
......@@ -52,3 +52,11 @@ fun SourceSet.projectDefault() {
//
//fun SourceSet.kotlin(action: SourceDirectorySet.() -> Unit) =
// kotlin.action()
fun Project.getSourceSetsFrom(projectPath: String): SourceSetContainer {
evaluationDependsOn(projectPath)
return project(projectPath).the<JavaPluginConvention>().sourceSets
}
......@@ -21,7 +21,7 @@ dependencies {
compile(project(":js:js.serializer"))
compile(project(":js:js.frontend"))
compile(project(":js:js.translator"))
compile(project(":android-extensions-compiler"))
compileOnly(project(":plugins:android-extensions-compiler"))
compile(project(":kotlin-test:kotlin-test-jvm"))
compile(commonDep("junit:junit"))
compile(ideaSdkCoreDeps("intellij-core"))
......
......@@ -31,7 +31,7 @@ val testDistProjects = listOf(
":kotlin-test:kotlin-test-js",
":kotlin-daemon-client",
":kotlin-preloader",
":android-extensions-compiler",
":plugins:android-extensions-compiler",
":kotlin-ant")
dependencies {
......
......@@ -5,18 +5,14 @@ apply { plugin("kotlin") }
jvmTarget = "1.6"
val packIntoJar by configurations.creating
dependencies {
val compile by configurations
compile(project(":kotlin-build-common"))
compile(project(":compiler:cli-common"))
compile(project(":kotlin-preloader"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:daemon-common"))
compileOnly(project(":compiler:cli-common"))
compileOnly(project(":kotlin-preloader"))
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":compiler:daemon-common"))
compile(project(":kotlin-daemon-client"))
compile(project(":compiler:util"))
packIntoJar(projectClasses(":compiler:daemon-common"))
compileOnly(project(":compiler:util"))
}
sourceSets {
......@@ -24,11 +20,9 @@ sourceSets {
"test" {}
}
evaluationDependsOn(":kotlin-daemon-client")
runtimeJar {
from(packIntoJar)
from(project(":kotlin-daemon-client").the<JavaPluginConvention>().sourceSets["main"].output.classesDirs)
from(getSourceSetsFrom(":kotlin-daemon-client")["main"].output.classesDirs)
from(getSourceSetsFrom(":compiler:daemon-common")["main"].output.classesDirs)
}
sourcesJar()
javadocJar()
......
......@@ -7,14 +7,11 @@ jvmTarget = "1.6"
val nativePlatformUberjar = preloadedDeps("native-platform-uberjar")
val packIntoJar by configurations.creating
dependencies {
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:cli-common"))
compileOnly(project(":compiler:daemon-common"))
compileOnly(nativePlatformUberjar)
packIntoJar(projectClasses(":compiler:daemon-common"))
}
sourceSets {
......@@ -26,7 +23,7 @@ runtimeJar {
nativePlatformUberjar.forEach {
from(zipTree(it))
}
from(packIntoJar)
from(getSourceSetsFrom(":compiler:daemon-common")["main"].output.classesDirs)
}
sourcesJar()
javadocJar()
......
......@@ -16,4 +16,3 @@ sourceSets {
"test" {}
}
classesDirsArtifact()
......@@ -53,7 +53,8 @@
":android-extensions-compiler": {
"conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention",
"java": "org.gradle.api.plugins.JavaPluginConvention"
"java": "org.gradle.api.plugins.JavaPluginConvention",
"maven": "org.gradle.api.plugins.MavenPluginConvention"
},
"configurations": [
"apiElements",
......@@ -63,16 +64,15 @@
"compileClasspath",
"compileOnly",
"default",
"distJar",
"implementation",
"kapt",
"kaptTest",
"packIntoJar",
"runtime",
"runtimeClasspath",
"runtimeElements",
"runtimeJar",
"runtimeOnly",
"signatures",
"testCompile",
"testCompileClasspath",
"testCompileOnly",
......@@ -86,7 +86,8 @@
"kotlin": "org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension",
"kapt": "org.jetbrains.kotlin.gradle.plugin.KaptExtension",
"defaultArtifacts": "org.gradle.api.internal.plugins.DefaultArtifactPublicationSet",
"reporting": "org.gradle.api.reporting.ReportingExtension"
"reporting": "org.gradle.api.reporting.ReportingExtension",
"signing": "org.gradle.plugins.signing.SigningExtension"
}
},
":android-lint": {
......@@ -547,7 +548,6 @@
"apiElements",
"archives",
"buildVersion",
"classes-dirs",
"compile",
"compileClasspath",
"compileOnly",
......@@ -699,7 +699,8 @@
":kotlin-build-common": {
"conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention",
"java": "org.gradle.api.plugins.JavaPluginConvention"
"java": "org.gradle.api.plugins.JavaPluginConvention",
"maven": "org.gradle.api.plugins.MavenPluginConvention"
},
"configurations": [
"apiElements",
......@@ -717,6 +718,7 @@
"runtimeElements",
"runtimeJar",
"runtimeOnly",
"signatures",
"testCompile",
"testCompileClasspath",
"testCompileOnly",
......@@ -731,7 +733,8 @@
"kotlin": "org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension",
"kapt": "org.jetbrains.kotlin.gradle.plugin.KaptExtension",
"defaultArtifacts": "org.gradle.api.internal.plugins.DefaultArtifactPublicationSet",
"reporting": "org.gradle.api.reporting.ReportingExtension"
"reporting": "org.gradle.api.reporting.ReportingExtension",
"signing": "org.gradle.plugins.signing.SigningExtension"
}
},
":kotlin-compiler": {
......@@ -873,7 +876,6 @@
"implementation",
"kapt",
"kaptTest",
"packIntoJar",
"runtime",
"runtimeClasspath",
"runtimeElements",
......@@ -907,7 +909,6 @@
"apiElements",
"archives",
"buildVersion",
"classes-dirs",
"compile",
"compileClasspath",
"compileOnly",
......@@ -916,7 +917,6 @@
"implementation",
"kapt",
"kaptTest",
"packIntoJar",
"runtime",
"runtimeClasspath",
"runtimeElements",
......@@ -2218,7 +2218,6 @@
"configurations": [
"apiElements",
"archives",
"classes-dirs",
"compile",
"compileClasspath",
"compileOnly",
......@@ -3830,6 +3829,44 @@
"signing": "org.gradle.plugins.signing.SigningExtension"
}
},
":plugins:android-extensions-compiler": {
"conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention",
"java": "org.gradle.api.plugins.JavaPluginConvention"
},
"configurations": [
"apiElements",
"archives",
"buildVersion",
"compile",
"compileClasspath",
"compileOnly",
"default",
"distJar",
"implementation",
"kapt",
"kaptTest",
"runtime",
"runtimeClasspath",
"runtimeElements",
"runtimeJar",
"runtimeOnly",
"testCompile",
"testCompileClasspath",
"testCompileOnly",
"testImplementation",
"testRuntime",
"testRuntimeClasspath",
"testRuntimeOnly"
],
"extensions": {
"ext": "org.gradle.api.plugins.ExtraPropertiesExtension",
"kotlin": "org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension",
"kapt": "org.jetbrains.kotlin.gradle.plugin.KaptExtension",
"defaultArtifacts": "org.gradle.api.internal.plugins.DefaultArtifactPublicationSet",
"reporting": "org.gradle.api.reporting.ReportingExtension"
}
},
":plugins:android-extensions-ide": {
"conventions": {
"base": "org.gradle.api.plugins.BasePluginConvention",
......
......@@ -66,7 +66,7 @@ dependencies {
testRuntime(ideaPluginDeps("*.jar", plugin = "android"))
// deps below are test runtime deps, but made test compile to split compilation and running to reduce mem req
testCompile(project(":android-extensions-compiler"))
testCompile(project(":plugins:android-extensions-compiler"))
testCompile(project(":plugins:android-extensions-ide")) { isTransitive = false }
testCompile(project(":allopen-ide-plugin")) { isTransitive = false }
testCompile(project(":kotlin-allopen-compiler-plugin"))
......@@ -108,7 +108,3 @@ testsJar {}
classesDirsArtifact()
task("uploadArchives") {
// hides rule-based task with the same name, which appears to be broken in this project
}
......@@ -11,7 +11,7 @@ dependencies {
compile(project(":j2k"))
compile(project(":idea:ide-common"))
compile(project(":idea:idea-jps-common"))
compile(project(":android-extensions-compiler"))
compile(project(":plugins:android-extensions-compiler"))
compile(ideaSdkCoreDeps("intellij-core", "util"))
compile(ideaSdkDeps("openapi", "idea"))
compile(ideaPluginDeps("gradle-tooling-api", "gradle", plugin = "gradle"))
......
......@@ -13,11 +13,15 @@ dependencies {
testCompile project(':kotlin-gradle-plugin').sourceSets.test.output
testCompile project(':kotlin-gradle-subplugin-example')
testCompile project(':kotlin-allopen')
testCompile project(':kotlin-test:kotlin-test-jvm')
testCompile project(path: ':kotlin-compiler-embeddable', configuration: 'runtimeJar')
testCompile project(path: ':examples:annotation-processor-example')
testCompile project(':kotlin-stdlib-jre8')
testCompile project(':kotlin-reflect')
testCompile project(':android-extensions-compiler')
testCompile project(path: ':kotlin-build-common', configuration: 'tests-jar')
testCompile project(path: ':compiler:incremental-compilation-impl', configuration: 'tests-jar')
testCompile 'org.jetbrains.kotlin:gradle-api:2.2'
}
......
......@@ -28,14 +28,13 @@ configurations {
dependencies {
compile project(':kotlin-gradle-plugin-api')
compile project(path: ':kotlin-compiler-embeddable', configuration: "runtimeJar")
compile project(':kotlin-stdlib')
compile project(':android-extensions-compiler')
// compile project(path: ':compiler', configuration: 'embeddableCompilerJar')
compile project(':kotlin-build-common')
compile project(':kotlin-compiler-runner')
compile project(":compiler:incremental-compilation-impl")
compile project(":compiler:daemon")
// compileOnly project(":compiler:daemon")
compile project(path: ':kotlin-annotation-processing-gradle', configuration: "runtimeJar")
compileOnly 'com.android.tools.build:gradle:2.0.0'
......
......@@ -18,10 +18,8 @@ sourceSets {
"test" {}
}
evaluationDependsOn(":kotlin-android-extensions-runtime")
runtimeJar {
from(project(":kotlin-android-extensions-runtime").the<JavaPluginConvention>().sourceSets["main"].output.classesDirs)
from(getSourceSetsFrom(":kotlin-android-extensions-runtime")["main"].output.classesDirs)
}
dist()
......
......@@ -9,7 +9,7 @@ dependencies {
compile(project(":idea:idea-core"))
compile(project(":idea"))
compile(project(":idea:idea-gradle"))
compile(project(":android-extensions-compiler"))
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"))
......
......@@ -4,7 +4,7 @@ apply { plugin("kotlin") }
dependencies {
compile(project(":compiler:util"))
compile(project(":jps-plugin"))
compile(project(":android-extensions-compiler"))
compile(project(":plugins:android-extensions-compiler"))
compile(ideaPluginDeps("android-jps-plugin", plugin = "android", subdir = "lib/jps"))
}
......
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
description = "Kotlin Android Extensions Runtime"
......@@ -29,6 +13,8 @@ sourceSets {
"test" {}
}
runtimeJar ()
runtimeJar()
sourcesJar()
javadocJar()
publish()
......@@ -6,7 +6,7 @@ dependencies {
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler.tests-common"))
testCompile(project(":android-extensions-compiler"))
testCompile(project(":plugins:android-extensions-compiler"))
testCompile(project(":plugins:android-extensions-ide"))
testCompile(project(":allopen-ide-plugin")) { isTransitive = false }
testCompile(project(":kotlin-allopen-compiler-plugin"))
......
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
description = "Kotlin Android Extensions Compiler"
apply { plugin("kotlin") }
dependencies {
compileOnly(ideaSdkCoreDeps("intellij-core"))
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:plugin-api"))
compileOnly(project(":compiler:frontend"))
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":compiler:backend"))
compileOnly(project(":kotlin-android-extensions-runtime"))
runtime(projectRuntimeJar(":kotlin-compiler-embeddable"))
runtime("com.google.android:android:2.3.1")
}
//val originalSrc = "$projectDir/src"
//val targetSrc = file("$buildDir/embeddable-target-src")
//
//if (System.getProperty("idea.active") == null) {
//
// val prepareEmbeddableSources by task<Copy> {
// from(originalSrc)
// into(targetSrc)
// filter { it.replace(Regex("(?<!\\.)com\\.intellij"), "org.jetbrains.kotlin.com.intellij") }
// }
//
// tasks.withType<KotlinCompile> { dependsOn(prepareEmbeddableSources) }
// tasks.withType<JavaCompile> { dependsOn(prepareEmbeddableSources) }
//}
sourceSets {
"main" {
// if (System.getProperty("idea.active") == null) {
// java.srcDir(targetSrc)
// resources.srcDir("src").apply { include("META-INF/**", "**/*.properties") }
// }
// else {
projectDefault()
// }
}
"test" {}
}
runtimeJar {
from(getSourceSetsFrom(":kotlin-android-extensions-runtime")["main"].output.classesDirs)
}
sourcesJar()
javadocJar()
publish()
......@@ -38,23 +38,8 @@ val compilerBaseName = name
val outputJar = File(buildDir, "libs", "$compilerBaseName.jar")
val compilerModules: Array<String> by rootProject.extra
val packagesToRelocate =
listOf("com.intellij",
"com.google",
"com.sampullara",
"org.apache",
"org.jdom",
"org.picocontainer",
"org.jline",
"gnu",
"javax.inject",
"org.fusesource",
"kotlinx.coroutines")
val ideaCoreSdkJars: Array<String> by rootProject.extra
val coreSdkJarsSimple = ideaCoreSdkJars.filterNot { it == "jdom" || it == "log4j" }.toTypedArray()
......@@ -132,6 +117,8 @@ val proguard by task<ProGuardTask> {
printconfiguration("$buildDir/compiler.pro.dump")
}
noDefaultJar()
dist(targetName = compilerBaseName + ".jar",
fromTask = if (shrink) proguard
else packCompiler)
......
......@@ -77,7 +77,7 @@ val jar = runtimeJar(task<ShadowJar>("shadowJar")) {
from(packedJars)
for (p in projectsToShadow) {
dependsOn("$p:classes")
from(project(p).the<JavaPluginConvention>().sourceSets.getByName("main").output)
from(getSourceSetsFrom(p)["main"].output)
}
}
......
......@@ -68,6 +68,7 @@ include ":kotlin-build-common",
":eval4j",
":j2k",
":plugins:lint",
":plugins:android-extensions-compiler",
":android-extensions-compiler",
":kotlin-android-extensions-runtime",
":plugins:android-extensions-ide",
......@@ -167,7 +168,8 @@ project(':compiler:ir.psi2ir').projectDir = "$rootDir/compiler/ir/ir.psi2ir" as
project(':compiler:ir.ir2cfg').projectDir = "$rootDir/compiler/ir/ir.ir2cfg" as File
project(':kotlin-jps-plugin').projectDir = "$rootDir/prepare/jps-plugin" as File
project(':idea:idea-android-output-parser').projectDir = "$rootDir/idea/idea-android/idea-android-output-parser" as File
project(':android-extensions-compiler').projectDir = "$rootDir/plugins/android-extensions/android-extensions-compiler" as File
project(':plugins:android-extensions-compiler').projectDir = "$rootDir/plugins/android-extensions/android-extensions-compiler" as File
project(':android-extensions-compiler').projectDir = "$rootDir/prepare/android-extensions-compiler-gradle" as File
project(':kotlin-android-extensions-runtime').projectDir = "$rootDir/plugins/android-extensions/android-extensions-runtime" as File
project(':plugins:android-extensions-ide').projectDir = "$rootDir/plugins/android-extensions/android-extensions-idea" as File
project(':plugins:android-extensions-jps').projectDir = "$rootDir/plugins/android-extensions/android-extensions-jps" as File
......
......@@ -29,7 +29,7 @@ dependencies {
compile(project(":compiler:frontend")) { isTransitive = false }
compile(project(":compiler:frontend.java")) { isTransitive = false }
compile(project(":js:js.frontend")) { isTransitive = false }
compile(projectClasses(":idea"))
compile(project(":idea"))
compile(project(":idea:idea-core")) { isTransitive = false }
compile(project(":idea:ide-common")) { isTransitive = false }
compile(project(":idea:idea-gradle")) { isTransitive = false }
......@@ -49,8 +49,8 @@ dependencies {
compile(ideaUltimatePluginDeps("*.jar", plugin = "gradle"))
compile(ideaUltimatePluginDeps("*.jar", plugin = "Groovy"))
compile(ideaUltimatePluginDeps("*.jar", plugin = "junit"))
compile(ideaUltimatePluginDeps("*.jar", plugin = "JavaScriptLanguage"))
compile(ideaUltimatePluginDeps("*.jar", plugin = "uml"))
compile(ideaUltimatePluginDeps("*.jar", plugin = "JavaScriptLanguage"))
testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompile(project(":compiler.tests-common")) { isTransitive = false }
......@@ -66,7 +66,7 @@ dependencies {
testRuntime(projectDist(":kotlin-compiler"))
testRuntime(project(":plugins:android-extensions-ide")) { isTransitive = false }
testRuntime(project(":android-extensions-compiler")) { isTransitive = false }
testRuntime(project(":plugins:android-extensions-compiler")) { isTransitive = false }
testRuntime(project(":plugins:annotation-based-compiler-plugins-ide-support")) { isTransitive = false }
testRuntime(project(":idea:idea-android")) { isTransitive = false }
testRuntime(project(":idea:idea-maven")) { isTransitive = false }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册