Scala 是否可以从sbt重新启动和测试xsbti.AppMain派生的应用程序?
我在按习惯发展。 问题是,每次我想测试它时,我都必须删除以前发布的Scala 是否可以从sbt重新启动和测试xsbti.AppMain派生的应用程序?,scala,sbt,Scala,Sbt,我在按习惯发展。 问题是,每次我想测试它时,我都必须删除以前发布的boot目录,然后重新编译并在本地发布工件,最后运行应用程序并手动测试。其中一部分是通过运行外部shell脚本来完成的 我怎样才能让sbt为我做这项工作?我已经为它创建了骨架命令: lazy val root = Project( id = "app", base = file("."), settings = buildSettings ++ Seq( resolvers := r
boot
目录,然后重新编译并在本地发布工件,最后运行应用程序并手动测试。其中一部分是通过运行外部shell脚本来完成的
我怎样才能让sbt
为我做这项工作?我已经为它创建了骨架命令:
lazy val root = Project(
id = "app",
base = file("."),
settings = buildSettings ++ Seq( resolvers := rtResolvers,
libraryDependencies ++= libs,
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked"),
commands ++= Seq(launchApp))
)
val launchApp = Command.command("launch") { state =>
state.log.info("Re-launching app")
state
}
fqb.build.properties
#!/usr/bin/env bash
java -jar /path/to/sbt-launch.jar "$@"
lazy val launcherTask = TaskKey[Unit]("launch", "Starts the application from the locally published JAR")
lazy val launchApp: Seq[Setting[_]] = Seq(
commands += Command.command("publish-launch") { state =>
state.log.info("Re-launching app")
val modulesProj = modules.id
s"$modulesProj/publishLocal" ::
"publishLocal" ::
launcherTask.key.label ::
state
},
launcherTask := {
"launch @fqb.build.properties" !<
}
)
~/.
目录,以便更改生效
lazy val root = Project(
id = "app",
base = file("."),
settings = buildSettings ++ Seq( resolvers := rtResolvers,
libraryDependencies ++= libs,
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked"),
launchApp)
)