Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typesafe activator available command line options/features

Is there a way to find out all the possible activator command line options?

The activator -help only provides a bare minimum available option/feature list but all the nice things are hidden and not available even on the typesafe website online documentation.

So far I know of the following commands/features:

activator run
activator -jvm-debug 9999 run
activator compile
activator clean
activator clean compile dist
activator doc //creates a nice documentation of your whole project

Any idea where this is information is available?

('m using activator to run Play framework projects)

like image 664
Alex Avatar asked Oct 08 '15 09:10

Alex


People also ask

What can you do with typesafe config?

Let's dive a little deeper and show examples with some of the more useful features built into Typesafe Config. Some features include reading config values as lists, configuration resolution, fallback configs, memory helpers, duration helpers and boolean helpers.

What are the types of errors in SBT/typesafe activator?

Operation Not Permitted in SBT / Typesafe Activator inside Vagrant Synced Folder 1 typesafe activator dependency error 3 Typesafe Activator running error (Could not retrieve jansi 1.11)

Can activator be used as a wrapper script?

It can be used as a wrapper script that launches into traditional command line sbt, but it also includes a template and tutorial system, and an optional GUI for getting started. You can think of Activator as traditional sbt (activator shell or activator ), plus an optional UI mode (activator ui), plus a template system (activator new).

What's new in activator's UI?

The built-in buttons remain for common tasks (compile, run, test), but the search box at the top of Activator’s UI now autocompletes tasks in addition to source files: We’re now grouping templates based on the Typesafe Reactive Platform in their own category.


1 Answers

Activator is not some tool that have some wide options. It looks like, but it is just a wrapper to run sbt project. From the activator source page in git:

Activator aims to be a friendly one-stop-shop to bootstrap your Scala, Akka, and Play development. It can be used as a wrapper script that launches into traditional command line sbt, but it also includes a template and tutorial system, and an optional GUI for getting started.

You can think of Activator as traditional sbt (activator shell or activator ), plus an optional UI mode (activator ui), plus a template system (activator new).

That's all. Actually only four commands:

  • ui - to run ui mode
  • new - to create new project from the template
  • list-templates - to show all available templates
  • shell - to run sbt shell

Let's look in to this in a details.

The source code

https://github.com/typesafehub/activator/blob/master/launcher/src/main/scala/activator/ActivatorLauncher.scala

try configuration.arguments match {
  case Array("ui") => RebootToUI(configuration, version = checkForUpdatedVersion.getOrElse(APP_VERSION))
  case Array("new", _*) => Exit(ActivatorCli(configuration))
  case Array("list-templates") => Exit(TemplateHandler())
  case Array("shell") => RebootToSbt(configuration, useArguments = false)
  case _ if Sbt.looksLikeAProject(new File(".")) => RebootToSbt(configuration, useArguments = true)
  case _ => displayHelp(configuration)
} catch {
  case e: Exception => generateErrorReport(e)
}

You can see that there is only 4 commands ui, new, list-template, shell and one meta command:

case _ if Sbt.looksLikeAProject(new File(".")) => RebootToSbt(configuration, useArguments = true)

It means that if you run activator command in the project directory (and it's not ui, new, list-template, shell) than activator will run sbt with the command and argument that you pass to the activator. So run, compile, stage is not activator commands but sbt commands.

If you will run activator not in the project directory (and it's not ui, new, list-template, shell commands), then it will show you some "help page"

Activator also allow to pass java arguments that would be used for run activator.jar - you can see it by inspecting "activator.bat" file or activator shell script.

SBT

Reference of sbt commands you can found here: http://www.scala-sbt.org/0.13/docs/Command-Line-Reference.html

like image 66
Andriy Kuba Avatar answered Sep 21 '22 12:09

Andriy Kuba