ValV
11/06/2018, 4:38 PMimport org.jetbrains.kotlin.gradle.tasks.KotlinCompile
, but it says Unresolved reference: jetbrains
. So I need kotlin-gradle-plugin
to installed somehow, right? I have mavenLocal()
and mavenCentral()
, how do I get the plugin into local repository and plug outta there?kartikpatodi
11/06/2018, 6:49 PMjcenter()
in the repositoriesValV
11/06/2018, 7:28 PMcompileKotlin
task, but when I try to do it in Kotlin .kts
it does not workkartikpatodi
11/06/2018, 7:31 PMValV
11/06/2018, 7:38 PMkartikpatodi
11/06/2018, 7:40 PMValV
11/06/2018, 7:45 PMbuildscript { repositories { ... } ... dependencies { ... } }
was in original Groovy build file. Since I'm very new to Gradle and know Groovy a bit better than none, I've ended up with this 😁kartikpatodi
11/06/2018, 7:45 PMValV
11/06/2018, 7:46 PMkartikpatodi
11/06/2018, 7:47 PMimport java.util.regex.Pattern
import kotlin.reflect.jvm.internal.impl.descriptors.annotations.KotlinTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
application
kotlin("jvm") version "1.3.0"
}
val kotlin_version = "1.3.0"
val tornadofx_version = "1.7.16"
val junit_version = "5.1.0"
tasks.withType<KotlinCompile> {//compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
repositories {
jcenter()
}
dependencies {
implementation(kotlin("stdlib"))
implementation("no.tornado:tornadofx:$tornadofx_version")
// testCompile( "org.junit.jupiter:junit-jupiter-api:$junit_version")
// testRuntime( "org.junit.jupiter:junit-jupiter-engine:$junit_version")
}
val mainClassName = "com.github.valv.demo.tfx"
val jar by tasks.getting(Jar::class) {
archiveName = "new.jar"
//mainClassName = "com.github.valv.demo.tfx"
manifest {
attributes( mapOf(
"Class-Path" to configurations.joinToString(" ") { it.name },
"Main-Class" to mainClassName
))
}
// TODO: convert to Kotlin
// from(configurations.compile.collect { entry -> zipTree(entry) }) {
// exclude( "META-INF/MANIFEST.MF")
// exclude( "META-INF/*.SF")
// exclude( "META-INF/*.DSA")
// exclude( "META-INF/*.RSA")
// }
}
ValV
11/06/2018, 7:47 PMkartikpatodi
11/06/2018, 7:49 PMValV
11/06/2018, 7:54 PMbuildscript
block and placing plugins
ontop solved the problemkartikpatodi
11/06/2018, 7:54 PMValV
11/06/2018, 7:55 PMgradle --version
is still 1.2.61. I hope it's not terriblekartikpatodi
11/06/2018, 7:55 PMimplementation
instead of compile
as it is more stableValV
11/06/2018, 7:58 PMimplementation
, but it was not resolved because of the problem above. Now it is. So for tests I should point testImplementation
and testRuntime
, right?kartikpatodi
11/06/2018, 7:59 PMtestImplementation
and testRuntime
ValV
11/06/2018, 8:01 PMkartikpatodi
11/06/2018, 8:02 PM