Commit 8b6b80c0 authored by Saif Abdul Cassim's avatar Saif Abdul Cassim

Converted all build files in dist task graph and added an intermediatory...

Converted all build files in dist task graph and added an intermediatory method for intellijPluginDep
parent 1e46236f
......@@ -66,6 +66,8 @@ fun Project.intellijCoreDep() = intellijDep("intellij-core")
fun customIntellijCoreDep(project:Project) = project.intellijDep("intellij-core")
fun Project.intellijPluginDep(plugin: String) = intellijDep(plugin)
fun customIntellijPluginDep(project:Project,plugin: String):String{return project.intellijPluginDep(plugin)}
fun Project.intellijUltimateDep() = intellijDep("intellij")
fun Project.intellijUltimatePluginDep(plugin: String) = intellijDep(plugin)
......
......@@ -57,6 +57,8 @@ fun Project.getSourceSetsFrom(projectPath: String): SourceSetContainer {
return project(projectPath).sourceSets
}
fun customGetSourceSetsFrom(project:Project,projectPath: String): SourceSetContainer{return project.getSourceSetsFrom(projectPath)}
val Project.sourceSets: SourceSetContainer
get() = javaPluginConvention().sourceSets
......
......@@ -165,3 +165,5 @@ fun Task.useAndroidSdk() {
fun Task.useAndroidJar() {
TaskUtils.useAndroidJar(this)
}
fun customUseAndroidJar(task:Task){task.useAndroidJar()}
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
description = "Kotlin Mock Runtime for Tests"
plugins {
kotlin("jvm")
`maven-publish`
id("org.jetbrains.kotlin.jvm")
}
description = "Kotlin Mock Runtime for Tests"
jvmTarget = "1.6"
javaHome = rootProject.extra["JDK_16"] as String
javaHome = rootProject.ext["JDK_16"] as String
val builtins by configurations.creating
configurations.create("builtins")
dependencies {
compileOnly(project(":kotlin-stdlib"))
......@@ -19,57 +18,58 @@ dependencies {
sourceSets {
"main" {
java.apply {
srcDir(File(buildDir, "src"))
java {
srcDir(new File(buildDir, "src"))
}
}
"test" {}
}
val copySources by task<Sync> {
val stdlibProjectDir = project(":kotlin-stdlib").projectDir
from(stdlibProjectDir.resolve("runtime"))
task("copySources",type:Sync) {
def stdlibProjectDir = project(":kotlin-stdlib").projectDir
println("Look at me woo")
println("$stdlibProjectDir")
from(stdlibProjectDir.toString()+"/runtime")
.include("kotlin/TypeAliases.kt",
"kotlin/text/TypeAliases.kt")
from(stdlibProjectDir.resolve("src"))
from(stdlibProjectDir.toString()+"/src")
.include("kotlin/collections/TypeAliases.kt")
from(stdlibProjectDir.resolve("../src"))
from(stdlibProjectDir.toString()+"/../src")
.include("kotlin/util/Standard.kt",
"kotlin/internal/Annotations.kt",
"kotlin/contracts/ContractBuilder.kt",
"kotlin/contracts/Effect.kt")
into(File(buildDir, "src"))
into(new File(buildDir, "src"))
}
tasks.withType<JavaCompile> {
tasks.withType(JavaCompile) {
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
}
tasks.withType<KotlinCompile> {
tasks.withType(KotlinCompile) {
dependsOn(copySources)
kotlinOptions {
freeCompilerArgs += listOf(
freeCompilerArgs += [
"-module-name",
"kotlin-stdlib",
"-Xmulti-platform",
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
"-Xuse-experimental=kotlin.Experimental"
)
]
}
}
val jar = runtimeJar {
dependsOn(builtins)
from(provider { zipTree(builtins.singleFile) }) { include("kotlin/**") }
Task jar = ArtifactsKt.customRuntimeJar(project){
it.dependsOn(project.configurations.builtins)
it.from(provider { zipTree(project.configurations.builtins.getSingleFile()) }) { include("kotlin/**") }
}
val distDir: String by rootProject.extra
ext.distDir= rootProject.ext.distDir
dist(targetName = "kotlin-stdlib-minimal-for-test.jar", targetDir = File(distDir), fromTask = jar)
ArtifactsKt.customDist(project,new File(distDir),"kotlin-stdlib-minimal-for-test.jar",jar){}
publishing {
/*publishing {
publications {
create<MavenPublication>("internal") {
artifactId = "kotlin-stdlib-minimal-for-test"
......@@ -81,4 +81,4 @@ publishing {
maven("${rootProject.buildDir}/internal/repo")
}
}
*/
description = "Compatibility artifact with Mutable and ReadOnly annotations"
plugins {
java
id("java")
id("jps-compatible")
}
description = "Compatibility artifact with Mutable and ReadOnly annotations"
jvmTarget = "1.6"
tasks.withType<JavaCompile> {
tasks.withType(JavaCompile) {
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
}
sourceSets {
"main" { projectDefault() }
"main" {
java.srcDirs("src")
resources.srcDir("resources")
}
"test" {}
}
dist()
ArtifactsKt.customDist(project,null,null,null){}
description = "Kotlin Android Extensions Compiler"
plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
id("jps-compatible")
}
val robolectricClasspath by configurations.creating
description = "Kotlin Android Extensions Compiler"
configurations.create("robolectricClasspath")
dependencies {
testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") }
testCompileOnly(IntellijDependenciesKt.customIntellijCoreDep(project)) { IntellijDependenciesKt.customIncludeJars(it,["intellij-core"],null) }
compile(project(":compiler:util"))
compile(project(":compiler:plugin-api"))
......@@ -17,50 +17,55 @@ dependencies {
compile(project(":compiler:frontend.java"))
compile(project(":compiler:backend"))
compileOnly(project(":kotlin-android-extensions-runtime"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("asm-all", rootProject = rootProject) }
compileOnly(IntellijDependenciesKt.customIntellijCoreDep(project)) { IntellijDependenciesKt.customIncludeJars(it,["intellij-core"],null) }
compileOnly(IntellijDependenciesKt.getIntellijDep(project,"intellij")) { IntellijDependenciesKt.customIncludeJars(it,["asm-all"], rootProject) }
testCompile(project(":compiler:util"))
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:cli"))
testCompile(project(":kotlin-android-extensions-runtime"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(DependenciesKt.customProjectTests(it,":compiler:tests-common"))
testCompile(project(":kotlin-test:kotlin-test-jvm"))
testCompile(commonDep("junit:junit"))
testCompile(DependenciesKt.customCommonDep(project,"junit:junit"))
testRuntime(intellijPluginDep("junit")) { includeJars("idea-junit", "resources_en") }
testRuntime(IntellijDependenciesKt.customIntellijPluginDep(project,"junit")) { IntellijDependenciesKt.customIncludeJars(it,["idea-junit", "resources_en"],null) }
robolectricClasspath(commonDep("org.robolectric", "robolectric"))
robolectricClasspath(DependenciesKt.customCommonDep(project,"org.robolectric", "robolectric",[]))
robolectricClasspath("org.robolectric:android-all:4.4_r1-robolectric-1")
robolectricClasspath(project(":kotlin-android-extensions-runtime")) { isTransitive = false }
robolectricClasspath(project(":kotlin-android-extensions-runtime")) { setTransitive(false) }
embeddedComponents(project(":kotlin-android-extensions-runtime")) { isTransitive = false }
embeddedComponents(project(":kotlin-android-extensions-runtime")) { setTransitive(false) }
}
sourceSets {
"main" { projectDefault() }
"test" { projectDefault() }
"main" {
java.srcDirs("src")
resources.srcDir("resources")
}
"test" {
java.srcDirs("test", "tests")
}
}
runtimeJar {
fromEmbeddedComponents()
ArtifactsKt.customRuntimeJar(project){
DependenciesKt.customFromEmbeddedComponents(it)
}
dist()
ArtifactsKt.customDist(project,null,null,null){}
ideaPlugin()
ArtifactsKt.customIdeaPlugin(project,"lib") {}
testsJar {}
ArtifactsKt.customTestsJar(project){}
evaluationDependsOn(":kotlin-android-extensions-runtime")
projectTest {
environment("ANDROID_EXTENSIONS_RUNTIME_CLASSES", getSourceSetsFrom(":kotlin-android-extensions-runtime")["main"].output.classesDirs.asPath)
dependsOn(":dist")
workingDir = rootDir
useAndroidJar()
doFirst {
val androidPluginPath = File(intellijRootDir(), "plugins/android").canonicalPath
TasksKt.customProjectTest(project,"test"){
it.environment("ANDROID_EXTENSIONS_RUNTIME_CLASSES", SourceSetsKt.customGetSourceSetsFrom(project,":kotlin-android-extensions-runtime")["main"].output.classesDirs.asPath)
it.dependsOn(":dist")
it.workingDir = rootDir
TasksKt.customUseAndroidJar(it)
it.doFirst {
def androidPluginPath = new File(intellijRootDir(), "plugins/android").canonicalPath
systemProperty("ideaSdk.androidPlugin.path", androidPluginPath)
systemProperty("robolectric.classpath", robolectricClasspath.asPath)
}
......
description = "ABI generation for Kotlin/JVM"
plugins {
kotlin("jvm")
id("org.jetbrains.kotlin.jvm")
id("jps-compatible")
}
description = "ABI generation for Kotlin/JVM"
dependencies {
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:cli"))
......@@ -17,26 +17,31 @@ dependencies {
runtimeOnly(project(":kotlin-compiler"))
testCompile(commonDep("junit:junit"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(projectTests(":compiler:incremental-compilation-impl"))
testRuntime(intellijCoreDep())
testCompile(DependenciesKt.customCommonDep(project,"junit:junit"))
testCompile(DependenciesKt.customProjectTests(it,":compiler:tests-common"))
testCompile(DependenciesKt.customProjectTests(it,":compiler:incremental-compilation-impl"))
testRuntime(IntellijDependenciesKt.customIntellijCoreDep(project))
}
sourceSets {
"main" { projectDefault() }
"test" { projectDefault() }
"main" {
java.srcDirs("src")
resources.srcDir("resources")
}
"test" {
java.srcDirs("test", "tests")
}
}
projectTest {
workingDir = rootDir
dependsOn(":dist")
TasksKt.customProjectTest(project,"test"){
it.workingDir = rootDir
it.dependsOn(":dist")
}
publish()
//publish()
sourcesJar()
javadocJar()
dist()
ArtifactsKt.customSourcesJar(project,"main") {}
//javadocJar()
ArtifactsKt.customDist(project,null,null,null){}
testsJar()
\ No newline at end of file
ArtifactsKt.customTestsJar(project){}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment