{"id":19733176,"url":"https://github.com/thoughtworksinc/sbt-ammonite-classpath","last_synced_at":"2025-04-30T02:33:16.806Z","repository":{"id":34844407,"uuid":"129676943","full_name":"ThoughtWorksInc/sbt-ammonite-classpath","owner":"ThoughtWorksInc","description":"Export the classpath for Ammonite and Almond","archived":false,"fork":false,"pushed_at":"2024-08-19T21:13:47.000Z","size":227,"stargazers_count":28,"open_issues_count":11,"forks_count":3,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-05T21:51:13.793Z","etag":null,"topics":["ammonite","classpath","sbt","sbt-plugin","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThoughtWorksInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-16T03:03:25.000Z","updated_at":"2024-03-07T19:06:54.000Z","dependencies_parsed_at":"2024-06-19T02:46:19.844Z","dependency_job_id":"073f4567-751c-438e-8f8c-c92a83efc4a6","html_url":"https://github.com/ThoughtWorksInc/sbt-ammonite-classpath","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThoughtWorksInc%2Fsbt-ammonite-classpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThoughtWorksInc%2Fsbt-ammonite-classpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThoughtWorksInc%2Fsbt-ammonite-classpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThoughtWorksInc%2Fsbt-ammonite-classpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThoughtWorksInc","download_url":"https://codeload.github.com/ThoughtWorksInc/sbt-ammonite-classpath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251629415,"owners_count":21618164,"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":["ammonite","classpath","sbt","sbt-plugin","scala"],"created_at":"2024-11-12T00:29:31.904Z","updated_at":"2025-04-30T02:33:16.562Z","avatar_url":"https://github.com/ThoughtWorksInc.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sbt-ammonite-classpath\n\n**sbt-ammonite-classpath** is an sbt plug-in to export classpath of an sbt project to Ammonite Script, which can be then used in [Ammonite](https://ammonite.io/) or [Almond](http://almond.sh/). Also supports running Ammonite REPL directly with desired classpath.\n\n## Usage\n\n``` sbt\n// project/plugins.sbt\naddSbtPlugin(\"com.thoughtworks.deeplearning\" % \"sbt-ammonite-classpath\" % \"latest.release\")\n```\n\n``` scala\n// src/main/scala/mypackage/MyObject.scala\npackage mypackage\n\nobject MyObject {\n  def hello() = println(\"Hello, World!\")\n}\n```\n\n### Exporting Classpath for Almond or Ammonite\n\n``` bash\n$ sbt Compile/fullClasspath/exportToAmmoniteScript \u0026\u0026 amm --predef target/scala-2.12/fullClasspath-Compile.sc\n...\n...\n...\n[success] Total time: 1 s, completed Apr 17, 2018 10:11:08 AM\nLoading...\nCompiling /private/tmp/example/target/scala-2.12/fullClasspath-Compile.sc\nWelcome to the Ammonite Repl 1.1.0\n(Scala 2.12.4 Java 1.8.0_162)\nIf you like Ammonite, please support our development at www.patreon.com/lihaoyi\n@ mypackage.MyObject.hello() \nHello, World!\n```\n\nAlternatively the classpath can be dynamically loaded by an `import $file` statement, too:\n\n``` bash\n$ amm\n```\n\n```\nLoading...\nWelcome to the Ammonite Repl 1.1.0\n(Scala 2.12.4 Java 1.8.0_162)\nIf you like Ammonite, please support our development at www.patreon.com/lihaoyi\n@ import $file.target.`scala-2.12`.`fullClasspath-Compile` \nCompiling /private/tmp/example/target/scala-2.12/fullClasspath-Compile.sc\nimport $file.$                                          \n\n@ mypackage.MyObject.hello() \nHello, World!\n```\n\n### Launching Ammonite REPL\n\nThis plugin also supports directly running Ammonite REPL from sbt. Similar to using above scopes you may launch the Ammonite REPL with desired classpath and compile scope as follows:\n\n``` bash\nsbt \"{scope}:{classpath}::launchAmmoniteRepl\"\n```\n\nWhere **`scope`** can be one of `compile`, `test` and `runtime`, while **`classpath`** can be one of `fullClasspath`, `dependencyClasspath`, `managedClasspath`, `unmanagedClasspath`.\n\nExample:\n\n``` bash\nsbt \"test:dependencyClasspath::launchAmmoniteRepl\"\n```\n\nIf you would like to run Ammonite REPL with full classpath, you can simply use `launchAmmoniteRepl` task within `compile` (or any other) scope without having to specify classpath task scope:\n\n``` bash\nsbt \"compile:launchAmmoniteRepl\" \n# or simply (without scope, compile will be implied)\nsbt launchAmmoniteRepl\n```\n\n`initialCommands` setting is also supported. If your `initialCommands` or `launchAmmoniteRepl / initialCommands` setting is not appropriate for a given scope, you can override it in one of this plugin's scopes. For example if you would like to only have `import ammonite.ops._` in your Ammonite REPL but not Scala REPL, you can do as follows:\n``` scala\n...\n\nconsole / initialCommands := \"println(\\\"Hello Console\\\")\",\n\nCompile / launchAmmoniteRepl / initialCommands += \"\\nimport ammonite.ops._\"\n\n// or simply launchAmmoniteRepl / initialCommands\n...\n```\n\nWhen you run `sbt launchAmmoniteRepl`, both commands will be in effect:\n\n``` bash\nsbt launchAmmoniteRepl\n...\n[info] running ammonite.Main --predef /private/tmp/example/target/scala-2.13/fullClasspath-Compile.sc --predef-code \"println(\"Hello Console\")\n[info] import ammonite.ops._\"\nLoading...\nHello Console\nWelcome to the Ammonite Repl 2.2.0-4-4bd225e (Scala 2.13.3 Java 1.8.0_252)\n@ ls! pwd \nres2: LsSeq = \n\".bloop\"          \".gitignore\"      \".vscode\"         \"build.sbt\"       'target\n\".git\"            \".metals\"         'LICENCE          'project          'test\n\".github\"         \".scalafmt.conf\"  \"README.md\"       'src\n\n@\n```\n\nBy default it will use the `\"latest.release\"` version of Ammonite, but if you would like to change it, you can override `ammoniteVersion` setting, e.g.:\n\n``` scala\nammoniteVersion := \"2.1.4\"\nTest / ammoniteVersion := \"2.2.0\"\n```\n\n## Related work\n\n[sbt-ammonite](https://github.com/alexarchambault/sbt-ammonite) is an sbt 0.13 plug-in to launch Ammonite. It automatically passes the classpath instead of creating a `sc` file. However, it does not support Almond.\n\n## Requirements\n\n* Sbt 1.x\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtworksinc%2Fsbt-ammonite-classpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtworksinc%2Fsbt-ammonite-classpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtworksinc%2Fsbt-ammonite-classpath/lists"}