{"action":"created","issue":{"url":"https://api.github.com/repos/lihaoyi/Ammonite/issues/184","labels_url":"https://api.github.com/repos/lihaoyi/Ammonite/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/lihaoyi/Ammonite/issues/184/comments","events_url":"https://api.github.com/repos/lihaoyi/Ammonite/issues/184/events","html_url":"https://github.com/lihaoyi/Ammonite/pull/184","id":102115029,"number":184,"title":"Add SBT plugin","user":{"login":"alexarchambault","id":7063723,"avatar_url":"https://avatars.githubusercontent.com/u/7063723?v=3","gravatar_id":"","url":"https://api.github.com/users/alexarchambault","html_url":"https://github.com/alexarchambault","followers_url":"https://api.github.com/users/alexarchambault/followers","following_url":"https://api.github.com/users/alexarchambault/following{/other_user}","gists_url":"https://api.github.com/users/alexarchambault/gists{/gist_id}","starred_url":"https://api.github.com/users/alexarchambault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexarchambault/subscriptions","organizations_url":"https://api.github.com/users/alexarchambault/orgs","repos_url":"https://api.github.com/users/alexarchambault/repos","events_url":"https://api.github.com/users/alexarchambault/events{/privacy}","received_events_url":"https://api.github.com/users/alexarchambault/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-20T11:01:47Z","updated_at":"2015-08-22T17:11:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lihaoyi/Ammonite/pulls/184","html_url":"https://github.com/lihaoyi/Ammonite/pull/184","diff_url":"https://github.com/lihaoyi/Ammonite/pull/184.diff","patch_url":"https://github.com/lihaoyi/Ammonite/pull/184.patch"},"body":"No unit tests yet, maybe scripted could help for that."},"comment":{"url":"https://api.github.com/repos/lihaoyi/Ammonite/issues/comments/133727782","html_url":"https://github.com/lihaoyi/Ammonite/pull/184#issuecomment-133727782","issue_url":"https://api.github.com/repos/lihaoyi/Ammonite/issues/184","id":133727782,"user":{"login":"alexarchambault","id":7063723,"avatar_url":"https://avatars.githubusercontent.com/u/7063723?v=3","gravatar_id":"","url":"https://api.github.com/users/alexarchambault","html_url":"https://github.com/alexarchambault","followers_url":"https://api.github.com/users/alexarchambault/followers","following_url":"https://api.github.com/users/alexarchambault/following{/other_user}","gists_url":"https://api.github.com/users/alexarchambault/gists{/gist_id}","starred_url":"https://api.github.com/users/alexarchambault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexarchambault/subscriptions","organizations_url":"https://api.github.com/users/alexarchambault/orgs","repos_url":"https://api.github.com/users/alexarchambault/repos","events_url":"https://api.github.com/users/alexarchambault/events{/privacy}","received_events_url":"https://api.github.com/users/alexarchambault/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T17:11:37Z","updated_at":"2015-08-22T17:11:37Z","body":"About unit tests for this: scripted (examples [here](https://github.com/xerial/sbt-pack/tree/master/src/sbt-test/sbt-pack) or [there](https://github.com/sbt/sbt-doge/tree/master/src/sbt-test/sbt-doge)) can test the return code of commands it runs. How I'd like to test this is by having various projects, with things in their main and test sources, and code that would rely on that in `initialCommands` (provided as predef by the plugin). This code would exit with success or failure codes, depending on what was available to it, testing what was put in its classpath this way (main or test code, dependencies, ...).\r\n\r\nFor that, I would need to be able to exit the Ammonite REPL programatically from the predef, specifying the exit code of the process at the same time. This, in turn, would/could require:\r\n- using the value of the `Exit` ([here](https://github.com/lihaoyi/Ammonite/blob/e8454a7b5bc68d43a6f8feb0da9cae24d5ec9bbd/repl/src/main/scala/ammonite/repl/Util.scala#L41)) as the exit code (giving it to `sys.exit`),\r\n- allow the predef to exit this way (it seemed to me that it doesn't really handle exits).\r\n\r\nI'm new to `load.module` that predef seems to use, so I don't know if the second point is straightforward.\r\n\r\nElse, it wouldn't be that much a problem for me not to unit test the plugin, but then I think I'd prefer to to recommend it as the default way of using Ammonite from SBT (as I did in the last commit of the PR). Unless some expert SBT eyes can validate what the plugin does."}}