sbt / sbt-projectmatrix

MIT License
124 stars 14 forks source link

Play Application cross-compilation not working #35

Open aberman opened 4 years ago

aberman commented 4 years ago

Hello,

I currently have a simple Play application I want to cross-compile between two different Scala versions. The app is set up with the standard Play directory structure with app, conf, and public. When I run a dist I see the two directories built, jvm-2.11 and jvm-2.12, but the jars that are built are empty, which seems to imply the Play plugin is not being used for building. I'm not sure if I've done something wrong in my build or if this is an unresolved issue in this project.

Here's my build.sbt:

ThisBuild / organization := "com.foo"
ThisBuild / scalaVersion := "2.12.12"
ThisBuild / version := "rev1"

lazy val play = (projectMatrix in file("."))
  .enablePlugins(PlayScala)
  .settings(
    name := "play-2.6",
    libraryDependencies ++= Seq(
      guice
    ),
    scalacOptions ++= Seq(
      "-feature",
      "-encoding", "utf8",
      "-deprecation",
      "-Xfatal-warnings"
    ))
 .jvmPlatform(scalaVersions = Seq("2.12.12", "2.11.12"))

Thanks!

psuszyns commented 2 years ago

I also have problems with sbt-projectmatrix in a Play application with submodules. For me, the jars created do contain the classes but they lack the application.conf and other files from the resources directory, which for Play applications is /conf, not /src/main/resources

I'm using sbt plugins: "com.typesafe.play" % "sbt-plugin" % "2.6.15" "com.eed3si9n" % "sbt-projectmatrix" % "0.8.0"