{"id":13665269,"url":"https://github.com/spray/sbt-revolver","last_synced_at":"2025-04-12T19:46:11.251Z","repository":{"id":2049109,"uuid":"2986711","full_name":"spray/sbt-revolver","owner":"spray","description":"An SBT plugin for dangerously fast development turnaround in Scala","archived":false,"fork":false,"pushed_at":"2023-04-08T09:28:56.000Z","size":441,"stargazers_count":845,"open_issues_count":24,"forks_count":57,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-08-02T06:01:53.076Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spray.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2011-12-15T10:04:49.000Z","updated_at":"2024-07-27T14:41:39.000Z","dependencies_parsed_at":"2023-07-05T20:16:37.560Z","dependency_job_id":null,"html_url":"https://github.com/spray/sbt-revolver","commit_stats":{"total_commits":146,"total_committers":18,"mean_commits":8.11111111111111,"dds":0.5821917808219178,"last_synced_commit":"4ed02fa6b6a71603888fb69ea4dd9d7fb23e3f48"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spray%2Fsbt-revolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spray%2Fsbt-revolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spray%2Fsbt-revolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spray%2Fsbt-revolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spray","download_url":"https://codeload.github.com/spray/sbt-revolver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625491,"owners_count":21135513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T06:00:31.389Z","updated_at":"2025-04-12T19:46:11.229Z","avatar_url":"https://github.com/spray.png","language":"Scala","funding_links":[],"categories":["Scala","Sbt plugins","BUILD \u0026 RELEASE"],"sub_categories":[],"readme":"_sbt-revolver_ is a plugin for [SBT] enabling a super-fast development turnaround for your Scala applications.\n\nIt sports the following features:\n\n* Starting and stopping your application in the background of your interactive SBT shell (in a forked JVM)\n* Triggered restart: automatically restart your application as soon as some of its sources have been changed\n\nEven though _sbt-revolver_ works great with [spray] on [spray-can] there is nothing _spray_-specific to it. It can\nbe used with any Scala application as long as there is some object with a `main` method.\n\n\n## Installation\n\n_sbt-revolver_ requires [SBT] 1.x or greater. Add the following dependency to your `project/plugins.sbt`:\n\n```scala\naddSbtPlugin(\"io.spray\" % \"sbt-revolver\" % \"0.10.0\")\n```\n\nsbt-revolver is an auto plugin, so you don't need any additional configuration in your build.sbt nor in Build.scala\nto make it work. In multi-module builds it will be enabled for each module. To disable sbt-revolver for some submodules use `Project(...).disablePlugins(RevolverPlugin)` in your build file.\n\nFor older versions of sbt see version [0.9.1](https://github.com/spray/sbt-revolver/tree/v0.9.1).\n\n## Usage\n\n_sbt-revolver_ defines three new commands (SBT tasks) in its own `re` configuration:\n\n* `reStart \u003cargs\u003e --- \u003cjvmArgs\u003e` starts your application in a forked JVM.\n  The optionally specified (JVM) arguments are appended to the ones configured via the `reStartArgs`/\n  `reStart::javaOptions` setting (see the \"Configuration\" section below). If the application is already running it\n  is first stopped before being restarted.\n\n* `reStop` stops application.\n  This is done by simply force-killing the forked JVM. Note, that this means that [shutdown hooks] are not run (see\n  [#20](https://github.com/spray/sbt-revolver/issues/20)).\n\n* `reStatus` shows an informational message about the current running state of the application.\n\n#### Triggered Restart\n\nYou can use `~reStart` to go into \"triggered restart\" mode. Your application starts up and SBT watches for changes in\nyour source (or resource) files. If a change is detected SBT recompiles the required classes and _sbt-revolver_\nautomatically restarts your application.\nWhen you press \u0026lt;ENTER\u0026gt; SBT leaves \"triggered restart\" and returns to the normal prompt keeping your application running.\n\nTo customize which files should be watched for triggered restart see the sbt documentation about [Triggered Execution](http://www.scala-sbt.org/0.13/docs/Triggered-Execution.html).\n\n## Configuration\n\nThe following SBT settings defined by _sbt-revolver_ are of potential interest:\n\n* `reStartArgs`, a `SettingKey[Seq[String]]`, which lets you define arguments that _sbt-revolver_ should pass to your\n  application on every start. Any arguments given to the `reStart` task directly will be appended to this setting.\n* `reStart / mainClass`, which lets you optionally define a main class to run in `reStart` independently of the\n  one set for running the project normally. This value defaults to the value of `compile:run::mainClass`. If you\n  don't specify a value here explicitly the same logic as for the normal run main class applies: If only one main class\n  is found it one is chosen. Otherwise, the main-class chooser is shown to the user.\n* `reStart / javaOptions`, a `SettingKey[Seq[String]]`, which lets you define the options to pass to the forked JVM\n  when starting your application\n* `reStart / baseDirectory`, a `SettingKey[File]`, which lets you customize the base directory independently from\n  what `run` assumes.\n* `reStart / fullClasspath`, which lets you customize the full classpath path for running with `reStart`.\n* `reStart / envVars`, which lets you customize the environment variables for running the application.\n* `reJrebelJar`, a `SettingKey[String]`, which lets you override the value of the `JREBEL_PATH` env variable.\n* `reColors`, a `SettingKey[Seq[String]]`, which lets you change colors used to tag output from running processes.\n  There are some pre-defined color schemes, see the example section below.\n* `reLogTag`, a `SettingKey[String]`, which lets you change the log tag shown in front of log messages. Default is the\n  project name.\n* `debugSettings`, a `SettingKey[Option[DebugSettings]]` to specify remote debugger settings. There's a convenience\n  helper `Revolver.enableDebugging` to simplify to enable debugging (see examples).\n\nExamples:\n\nTo configure a 2 GB memory limit for your app when started with `reStart`:\n\n    reStart / javaOptions += \"-Xmx2g\"\n\nTo set a special main class for your app when started with `reStart`:\n\n    reStart / mainClass := Some(\"com.example.Main\")\n\nTo set fixed start arguments (than you can still append to with the `reStart` task):\n\n    reStartArgs := Seq(\"-x\")\n\nTo enable debugging with the specified options:\n\n    Revolver.enableDebugging(port = 5050, suspend = true)\n\nTo change set of colors used to tag output from multiple processes:\n\n    reColors := Seq(\"blue\", \"green\", \"magenta\")\n\nThere are predefined color schemes to use with `reColors`: `Revolver.noColors`, `Revolver.basicColors`,\n`Revolver.basicColorsAndUnderlined`.\n\nTo add environment variables when running the application:\n\n    reStart / envVars := Map(\"USER_TOKEN\" -\u003e \"2359298356239\")\n\n#### Hot Reloading\n\n*Note: JRebel support in sbt-revolver is not actively supported any more.*\n\nIf you have JRebel installed you can let _sbt-revolver_ know where to find the `jrebel.jar`. You can do this\neither via the `Revolver.jRebelJar` setting directly in your SBT config or via a shell environment variable with the\nname `JREBEL_PATH` (which is the recommended way, since it doesn't pollute your SBT config with system-specific settings).\nFor example, on OSX you would add the following line to your shell startup script:\n\n    export JREBEL_PATH=/Applications/ZeroTurnaround/JRebel/jrebel.jar\n\nWith JRebel _sbt-revolver_ supports hot reloading:\n\n* Start your application with `reStart`.\n* Enter \"triggered compilation\" with `~products`. SBT watches for changes in your source (and resource) files.\n  If a change is detected SBT recompiles the required classes and JRebel loads these classes right into your running\n  application. Since your application is not restarted the time required to bring changes online is minimal (see\n  the \"Understanding JRebel\" section below for more details). When you press \u0026lt;ENTER\u0026gt; SBT leaves triggered compilation\n  and returns to the normal prompt keeping your application running.\n* If you changed your application in a way that requires a full restart (see below) press \u0026lt;ENTER\u0026gt; to leave\n  triggered compilation and `reStart`.\n* Of course you always stop the application with `reStop`.\n\n## License\n\n_sbt-revolver_ is licensed under [APL 2.0].\n\n\n## Patch Policy\n\nFeedback and contributions to the project, no matter what kind, are always very welcome.\nHowever, patches can only be accepted from their original author.\nAlong with any patches, please state that the patch is your original work and that you license the work to the\n_sbt-revolver_ project under the project’s open source license.\n\n\n  [SBT]: https://github.com/harrah/xsbt/wiki\n  [JRebel]: http://zeroturnaround.com/software/jrebel/\n  [xsbt-web-plugin]: https://github.com/aolshevskiy/xsbt-web-plugin\n  [spray]: http://spray.io\n  [spray-can]: https://github.com/spray/spray-can\n  [shutdown hooks]: http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)\n  [JRebel FAQ]: http://zeroturnaround.com/software/jrebel/learn/faq/\n  [APL 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspray%2Fsbt-revolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspray%2Fsbt-revolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspray%2Fsbt-revolver/lists"}