Skip to content

Commit

Permalink
should work
Browse files Browse the repository at this point in the history
  • Loading branch information
mio-19 committed Oct 25, 2024
1 parent 295dd1d commit 99a2abd
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,9 @@ lazy val buildTool = crossProject(JVMPlatform)
)
)

// Define directories for generated sources and classes
val generatedSourcesDir = file("target") / "generated" / "truffle"

lazy val interpreter = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Full)
Expand Down Expand Up @@ -1236,25 +1239,30 @@ lazy val interpreter = crossProject(JSPlatform, JVMPlatform, NativePlatform)
"org.graalvm.truffle" % "truffle-api" % graalvmVersion,
"org.graalvm.truffle" % "truffle-dsl-processor" % graalvmVersion,
"org.graalvm.truffle" % "truffle-tck" % graalvmVersion,
"org.graalvm.sdk" % "graal-sdk" % graalvmVersion
"org.graalvm.sdk" % "graal-sdk" % graalvmVersion
),
Compile / javacOptions ++= {
val cp = (Compile / dependencyClasspath).value.map(_.data)
val processorJars = cp.filter(_.getName.contains("truffle-dsl-processor"))
val processorPath = processorJars.map(_.getAbsolutePath).mkString(java.io.File.pathSeparator)
val generatedSourcesDir = (Compile / sourceManaged).value / "generated" / "truffle"
println(s"processorJars: $processorJars")
println(s"processorPath: $processorPath")
println(s"generatedSourcesDir: $generatedSourcesDir")

// Ensure the directories exist
IO.createDirectory(generatedSourcesDir)

Seq(
"-processor", "com.oracle.truffle.dsl.processor.TruffleProcessor",
"-processorpath", processorPath,
"-s", generatedSourcesDir.getAbsolutePath,
"-source", "17",
"-target", "17"
"-processorpath",
processorPath,
"-s",
generatedSourcesDir.getAbsolutePath,
"-source",
"17",
"-target",
"17"
)
},
Compile / unmanagedSourceDirectories += (Compile / sourceManaged).value / "generated" / "truffle"

// Add the generated sources to the unmanaged source directories
Compile / unmanagedSourceDirectories += generatedSourcesDir
)

lazy val root = crossProject(JSPlatform, JVMPlatform, NativePlatform)
Expand Down

0 comments on commit 99a2abd

Please sign in to comment.