Skip to content

Commit

Permalink
Fixes pfn#31 - failed to compile .kts file (pfn#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpritam authored and pfn committed Oct 18, 2019
1 parent ee9e714 commit ddc91c1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target/
.idea
8 changes: 5 additions & 3 deletions src/main/scala/KotlinPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ object KotlinPlugin extends AutoPlugin {
}) :: Nil

override def projectSettings = Seq(
libraryDependencies += {
"org.jetbrains.kotlin" % "kotlin-compiler-embeddable" % kotlinVersion.value % KotlinInternal.name
},
libraryDependencies ++= Seq(
"org.jetbrains.kotlin" % "kotlin-compiler-embeddable" % kotlinVersion.value % KotlinInternal.name,
"org.jetbrains.kotlin" % "kotlin-scripting-compiler-embeddable" % kotlinVersion.value % KotlinInternal.name,
"org.jetbrains.kotlin" % "kotlin-scripting-compiler-embeddable" % kotlinVersion.value,
),
managedClasspath in KotlinInternal := Classpaths.managedJars(KotlinInternal, classpathTypes.value, update.value),
updateCheck in Kotlin := {
val log = streams.value.log
Expand Down
2 changes: 2 additions & 0 deletions src/sbt-test/kotlin/mixed/src/main/kotlin/script.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

println("Hello from Kotlin script")
2 changes: 1 addition & 1 deletion src/sbt-test/kotlin/mixed/tests.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TaskKey[Unit]("check-classes") := {
val classes = (classDirectory in Compile).value
val classList = (classes ** "*.class").get
if (classList.size != 6) {
if (classList.size != 7) {
throw new MessageOnlyException(s"Incorrect number of classes: ${classList.size} =>\n${classList.mkString("\n")}")
}
}

0 comments on commit ddc91c1

Please sign in to comment.