{"id":13568720,"url":"https://github.com/clj-commons/virgil","last_synced_at":"2025-12-12T01:10:04.654Z","repository":{"id":57714096,"uuid":"46469742","full_name":"clj-commons/virgil","owner":"clj-commons","description":"Recompile Java code without restarting the REPL","archived":false,"fork":false,"pushed_at":"2025-03-27T21:35:22.000Z","size":561,"stargazers_count":327,"open_issues_count":5,"forks_count":22,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-05T19:07:32.516Z","etag":null,"topics":["clojure","java","javac","repl"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clj-commons.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-19T05:27:19.000Z","updated_at":"2025-03-28T21:01:00.000Z","dependencies_parsed_at":"2024-11-05T00:31:55.373Z","dependency_job_id":"1bf42a12-248c-4ac1-9e5a-9be9bdb4ee47","html_url":"https://github.com/clj-commons/virgil","commit_stats":null,"previous_names":["clj-commons/virgil","ztellman/virgil"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj-commons%2Fvirgil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj-commons%2Fvirgil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj-commons%2Fvirgil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clj-commons%2Fvirgil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clj-commons","download_url":"https://codeload.github.com/clj-commons/virgil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631668,"owners_count":21136554,"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":["clojure","java","javac","repl"],"created_at":"2024-08-01T14:00:30.833Z","updated_at":"2025-12-12T01:09:59.602Z","avatar_url":"https://github.com/clj-commons.png","language":"Clojure","funding_links":[],"categories":["Clojure"],"sub_categories":[],"readme":"\u003cimg src=\"docs/cocytus.jpg\" align=\"right\" width=\"400\"/\u003e\n\nDo you tarnish your Clojure with the occasional hint of Java? Have you become\nindescribably tired of reloading your REPL every time you change anything with a\n`.java` suffix? Look no further.\n\nVirgil is a library for live-recompiling Java classes from the REPL. This can be\ndone either manually or by starting a process that watches your source\ndirectories for changes in Java files and triggering recompilation when that\nhappens.\n\n### Usage\n\nAdd `virgil/virgil` dependency to your `project.clj` or `deps.edn`. If you plan\nto use Virgil just as a devtime dependency, then you probably want to add it to\na profile/alias which you enable only during development.\n\n[![](https://clojars.org/virgil/virgil/latest-version.svg)](https://clojars.org/virgil/virgil)\n\n```clj\n(require 'virgil)\n;; To recompile once, manually:\n(virgil/compile-java [\"src\"])\n\n;; To recompile automatically when files change:\n(virgil/watch-and-recompile [\"src\"])\n```\n\nThe main argument to these functions is a list of directories where Java source\nfiles are located. Both functions can accept a list of string `:options` that is\npassed to Java compiler, e.g. `:options [\"-Xlint:all\"]` to print compilation\nwarnings, and a `:verbose` flag to print all classnames that got compiled.\n\n`watch-and-recompile` accepts an optional `:post-hook` function. You can use it\nto, e.g., trigger `tools.namespace` refresh after the classes get recompiled.\n\nCheck [example](example) directory for a sample project.\n\nHappy tarnishing.\n\n### Can I use Virgil in production?\n\nVirgil can compile Java classes at runtime in a production environment the same\nway as it does during the development, so the answer is yes. However, when you\ndo a release build, it is advised to build real Java classes explicitly during\nyour build step using *javac* task of your build tool. There are multiple\narguments for it:\n  * You get extra reliability and assurance that the compiled Java classes will\n    be correctly discoverable by other code.\n  * You get one fewer runtime dependency.\n  * You won't have to rely on JDK-specific tools like `javax.tools` package that\n    might not be available in your production environment (e.g., if it runs on\n    JRE).\n\n### Migration from 0.1.9\n\nFrom version 0.3.0, Virgil no longer provides `lein-virgil` plugin for\nLeiningen. Instead, you should add `virgil` as a regular dependency to your\nproject and call its functions from the REPL.\n\n### Supported versions\n\nVirgil makes sure to support Clojure 1.10+ and JDK 8, 11, 17, 21, 24 (see [CI\njob](https://app.circleci.com/pipelines/github/clj-commons/virgil)). Supporting\nfuture versions of Java so far required only bumping ASM library dependency, so\nthat shouldn't take long. Please, create an issue if you run into any\ncompatibility problems.\n\n## Publishing new releases\n\nReleases are handled by CircleCI. All you need to do is to tag a commit with a\n`x.y.z` and push the tag.\n\n### License\n\nCopyright © 2016-2019 Zachary Tellman, 2022-2025 Oleksandr Yakushev\n\nDistributed under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclj-commons%2Fvirgil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclj-commons%2Fvirgil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclj-commons%2Fvirgil/lists"}