{"id":20455550,"url":"https://github.com/xcoo/metabill","last_synced_at":"2025-12-12T01:10:40.346Z","repository":{"id":42635222,"uuid":"249652541","full_name":"xcoo/metabill","owner":"xcoo","description":"A minimal library to read build timestamp from JAR/WAR manifests.","archived":false,"fork":false,"pushed_at":"2023-02-08T05:50:26.000Z","size":113,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-26T20:51:30.745Z","etag":null,"topics":["clojure","jar"],"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/xcoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-24T08:28:43.000Z","updated_at":"2022-01-04T04:21:39.000Z","dependencies_parsed_at":"2023-02-18T04:31:20.048Z","dependency_job_id":null,"html_url":"https://github.com/xcoo/metabill","commit_stats":null,"previous_names":["xcoo/clj-build-date"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcoo%2Fmetabill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcoo%2Fmetabill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcoo%2Fmetabill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xcoo%2Fmetabill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xcoo","download_url":"https://codeload.github.com/xcoo/metabill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247926491,"owners_count":21019501,"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","jar"],"created_at":"2024-11-15T11:19:11.208Z","updated_at":"2025-12-12T01:10:40.295Z","avatar_url":"https://github.com/xcoo.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# metabill\n\n[![Clojars Project](https://img.shields.io/clojars/v/jp.xcoo/metabill.svg)](https://clojars.org/jp.xcoo/metabill)\n\n[![Clojars Project](https://img.shields.io/clojars/v/jp.xcoo/lein-metabill.svg)](https://clojars.org/jp.xcoo/lein-metabill)\n\nA tiny library to handle the build meta information.\n\n## Prepare\n\nPut `jp.xcoo/metabill` into the `dependencies` and `jp.xcoo/lein-metabill` into the `plugins` of your leiningen's `project.clj`.\nAnd run `lein metabill` before building for production, then it automatically generates `resources/metabill.edn`, which has some build metadata.\n\nThe default configuration of leiningen includes the `resources` directory as the classpath, so you don't need to do more.\nNote that if you have modified `resource-paths`, you need to add `metabill.edn` to the classpath.\n\n## Usage\n\n### Avoid browser's caching\n\nYou can prevent browsers from caching old JS and CSS files using `with-build-time`:\n\n```clojure\n(ns hello-world.view\n  (:require [hiccup.page :refer [html5 include-css include-js]]\n            [metabill.core :refer [with-build-time]]))\n\n(defn frame\n  [req]\n  (html5\n   [:head\n    [:title \"Hello World!\"]\n    [:meta {:charset \"utf-8\"}]\n    (include-css (with-build-time \"/css/main.css\"))]\n   [:body\n    [:div#app]\n    (include-js (with-build-time \"/js/main.js\"))]))\n```\n\n![network](img/network.png)\n\nYou can also use commit hash:\n\n```clojure\n(ns hello-world.view\n  (:require [hiccup.page :refer [html5 include-css include-js]]\n            [metabill.core :refer [with-build-commit-hash]]))\n\n(defn frame\n  [req]\n  (html5\n   [:head\n    [:title \"Hello World!\"]\n    [:meta {:charset \"utf-8\"}]\n    (include-css (with-build-commit-hash \"/css/main.css\"))]\n   [:body\n    [:div#app]\n    (include-js (with-build-commit-hash \"/js/main.js\"))]))\n```\n\n### Embed meta information of the build\n\nIf you want to handle only the build metadata, you can use it as follows:\n\n```clojure\n(ns hello-world.core\n  (:require [metabill.core :refer [get-build-time get-build-commit-hash]]))\n\n(defn print-build-info\n  []\n  (println \"This system is built on\" (get-build-commit-hash) \"commit at\" (get-build-time) \"unix epoc.\"))\n```\n\n## License\n\nCopyright [Xcoo, Inc.][xcoo]\n\nLicensed under the [Apache License, Version 2.0][apache-license-2.0].\n\n[xcoo]: https://xcoo.jp/\n[apache-license-2.0]: http://www.apache.org/licenses/LICENSE-2.0.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcoo%2Fmetabill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxcoo%2Fmetabill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxcoo%2Fmetabill/lists"}