Fix projects for gradle integration tests
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user