Add a way to customize compiler file in build.gradle
This commit is contained in:
+17
@@ -308,6 +308,23 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testCustomCompilerFile() {
|
||||
val project = Project("customCompilerFile", GRADLE_VERSION)
|
||||
project.setupWorkingDir()
|
||||
|
||||
// copy compiler embeddable to project dir using custom name
|
||||
val classpath = System.getProperty("java.class.path").split(File.pathSeparator)
|
||||
val kotlinEmbeddableJar = File(classpath.find { it.contains("kotlin-compiler-embeddable") })
|
||||
val compilerJar = File(project.projectDir, "compiler.jar")
|
||||
kotlinEmbeddableJar.copyTo(compilerJar)
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains("Using kotlin compiler jar: $compilerJar")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
fun testMultiplatformCompile() {
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: "kotlin"
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testCompile 'junit:junit:4.12'
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
}
|
||||
|
||||
compileKotlin.compilerJarFile = project.file("compiler.jar")
|
||||
Reference in New Issue
Block a user