使用激活器1.3.10 for windows

时间:2016-06-09 03:04:00

标签: java windows batch-file playframework typesafe-activator

我正在尝试将我的游戏框架应用程序的激活器启动器从旧版本更新到最新版本,我使用的是从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.10 donwnload(1.3.8-minimal)下载激活器(1.3.10-minimal)和(scala-sbt),然后应用此处提供的修补程序:Warning message running Play 2.5.x

然后你可以为两个激活器启动第一个项目:

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")

1 个答案:

答案 0 :(得分: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 "$0")")")"

现在似乎正在发挥作用。

不确定是否有办法修复它而不将激活器从bin中移出,因为Linux版似乎仍然在bin中运行良好,但是Windows没有。

但是这个解决方案现在仍适用。