From b09a602eff435acbf8cb9c8f7c4b1b03dd2f4f72 Mon Sep 17 00:00:00 2001 From: "Simeon H.K. Fitch" Date: Fri, 7 Aug 2015 09:54:02 -0400 Subject: [PATCH] Fix for #644 (`src/deploy` in Ant classpath). --- .../sbt/packager/jdkpackager/JDKPackagerAntHelper.scala | 3 ++- .../typesafe/sbt/packager/jdkpackager/JDKPackagerKeys.scala | 3 +++ .../typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala index 2ef9475e3..895fb0d17 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala @@ -156,6 +156,7 @@ object JDKPackagerAntHelper { */ private[jdkpackager] def makeAntBuild( antTaskLib: Option[File], + antExtraClasspath: Seq[File], name: String, sourceDir: File, mappings: Seq[(File, String)], @@ -170,7 +171,7 @@ object JDKPackagerAntHelper { """(antPackagerTasks in JDKPackager) := Some("C:\\Program Files\\Java\\jdk1.8.0_45\\lib\\ant-javafx.jar")""") } - val taskClassPath = Seq(sourceDir.getAbsolutePath, antTaskLib.get, ".") + val taskClassPath = antTaskLib.get +: antExtraClasspath val (jarFiles, supportFiles) = mappings.partition(_._2.endsWith(".jar")) diff --git a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerKeys.scala b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerKeys.scala index d0ffe8ef0..a8b813326 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerKeys.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerKeys.scala @@ -97,4 +97,7 @@ trait JDKPackagerKeys { val writeAntBuild = taskKey[File]( "Write the Ant `build.xml` file to the jdkpackager target directory") + + val antExtraClasspath = settingKey[Seq[File]]( + "Additional classpath entries for the JavaFX Ant task beyond `antPackagerTasks`") } diff --git a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala index d72aa8307..3eada494a 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala @@ -42,7 +42,7 @@ object JDKPackagerPlugin extends AutoPlugin { jdkPackagerAssociations := Seq.empty ) ++ inConfig(JDKPackager)( Seq( - sourceDirectory := sourceDirectory.value / dirname, + sourceDirectory := sourceDirectory.value / "deploy", target := target.value / dirname, mainClass := (mainClass in Runtime).value, name := name.value, @@ -52,8 +52,10 @@ object JDKPackagerPlugin extends AutoPlugin { packageDescription := packageDescription.value, mappings := (mappings in Universal).value, antPackagerTasks := locateAntTasks(javaHome.value, sLog.value), + antExtraClasspath := Seq(sourceDirectory.value, target.value), antBuildDefn := makeAntBuild( antPackagerTasks.value, + antExtraClasspath.value, name.value, (stage in Universal).value, mappings.value,