Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SBT 1.x #668

Closed
ngocdaothanh opened this issue Sep 2, 2018 · 3 comments
Closed

Support SBT 1.x #668

ngocdaothanh opened this issue Sep 2, 2018 · 3 comments
Assignees
Milestone

Comments

@ngocdaothanh
Copy link
Member

Xitrum doesn't support SBT 1.x yet, because it's calculating program's root directory like this:

  lazy val root = {
    // Support the case when Xitrum is used in a SBT multimodule project, see:
    // https://github.com/xitrum-framework/xitrum/issues/47

    // Don't use application.conf, because Akka .jar file also include it
    val url = Thread.currentThread.getContextClassLoader.getResource("xitrum.conf")
    if (url != null) {
      val fileName = url.getFile
      // Use "/" instead of File.separator because "/" is always used in fileName,
      // even on Windows
      fileName.replace("/config/xitrum.conf", "")
    } else {
      // Fallback to current working directory
      System.getProperty("user.dir")
    }
  }

The code works with SBT 0.13.x, but not with SBT 1.2.1 (latest version as of September 2, 2018):
sbt/sbt#4340

@ngocdaothanh ngocdaothanh added this to the 3.28.12 milestone Sep 2, 2018
@ngocdaothanh ngocdaothanh self-assigned this Sep 2, 2018
@ngocdaothanh
Copy link
Member Author

As commented in the linked SBT issue, sbt fgRun should be used instead of sbt run.

@ngocdaothanh
Copy link
Member Author

Example to use Xitrum in an SBT 1.x project:
xitrum-framework/xitrum-new@317e626

@ngocdaothanh
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant