使用激活器 1.3.10 播放框架构建 dist 文件或任何旧命令(干净编译阶段) windows

Play framework build dist file, or any old commands (clean compile stage) with activator 1.3.10 for windows

我正在尝试将我的游戏框架应用程序的激活器启动器从旧版本更新到最新版本,我使用的版本从 1.3.6 到 1.3.8,运行 命令没有任何问题,例如以下:

ACTIVATOR_BIN_PATH> activator clean compile stage dist

但我尝试使用最新版本 1.3.10 它不起作用,它说的是这样的:

ACTIVATOR_HOME=[PROJECT_PATH]\play-java
The system cannot find the file [PROJECT_PATH]\play-java\bin\..\conf\sbtconfig.txt.
 Did not detect an activator project in this directory.
 - activator
 Load an existing project (has to be executed from the project directory)
 or print this help message if no project is found

 Sub-commands
 - activator ui
 Open the project in the UI if executed from an existing project
 directory, otherwise open a project-creation UI.

 - activator new [project-name] [template-name]
 Create a new project, prompting for project-name if missing and helping you
 find a template if template-name is not provided.

 - activator list-templates
 Fetch the latest template list and print it to the console.

您可以下载激活器 (1.3.8-minimal) and (1.3.10-minimal), for 1.3.10 donwnload (scala-sbt) and then, apply fixes provided here :

然后你就可以开始两个激活器的第一个项目了:

activator new my-first-app play-java

我的plugin.sbt:

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.3")

addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.1")

addSbtPlugin("com.github.mmizutani" % "sbt-play-gulp" % "0.1.1")

现在我找到了某种解决方案,将激活器从 bin 文件夹移回 [PROJECT_PATH] ,并更改了一些行

BIN_DIRECTORYACTIVATOR_HOME 的价值变化来自:

set BIN_DIRECTORY=%~dp0
set BIN_DIRECTORY=%BIN_DIRECTORY:~0,-1%
for %%d in (%BIN_DIRECTORY%) do set ACTIVATOR_HOME=%%~dpd
set ACTIVATOR_HOME=%ACTIVATOR_HOME:~0,-1%

至:

set BIN_DIRECTORY=%~dp0
set BIN_DIRECTORY=%BIN_DIRECTORY:~0,-1%
for %%d in (%BIN_DIRECTORY%) do set ACTIVATOR_HOME=%~dp0
set ACTIVATOR_HOME=%ACTIVATOR_HOME:~0,-1%

SBT_HOME到:

set SBT_HOME=%BIN_DIRECTORY%

FN到:

set FN=%SBT_HOME%\conf\sbtconfig.txt

对于 Linux 版本 (bash),将 sbt_home 更改为:

declare -r sbt_home="$(realpath "$(dirname "$(realpath "[=14=]")")")"

现在似乎可以正常工作了。

不太确定是否有一种方法可以在不将激活器移出 bin 的情况下修复它,因为 Linux 版本在 bin 中似乎仍然运行良好,但 windows 则不然。

但是这个解决方案现在仍然有效。