{"id":15984665,"url":"https://github.com/aappddeevv/sbt-cli-codegen","last_synced_at":"2025-04-04T20:46:03.637Z","repository":{"id":97609890,"uuid":"242370268","full_name":"aappddeevv/sbt-cli-codegen","owner":"aappddeevv","description":"Generate scala sources using a sbt plugin, slightly easier than writing your own.","archived":false,"fork":false,"pushed_at":"2020-03-17T19:05:07.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T05:25:56.240Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"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/aappddeevv.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":"2020-02-22T16:06:36.000Z","updated_at":"2020-03-17T19:05:07.000Z","dependencies_parsed_at":"2023-04-20T19:32:18.838Z","dependency_job_id":null,"html_url":"https://github.com/aappddeevv/sbt-cli-codegen","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fsbt-cli-codegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fsbt-cli-codegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fsbt-cli-codegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aappddeevv%2Fsbt-cli-codegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aappddeevv","download_url":"https://codeload.github.com/aappddeevv/sbt-cli-codegen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249601,"owners_count":20908211,"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-10-08T02:10:02.039Z","updated_at":"2025-04-04T20:46:03.618Z","avatar_url":"https://github.com/aappddeevv.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Bintray](https://img.shields.io/bintray/v/aappddeevv/sbt-plugins/sbt-cli-codegen)\n\n# sbt-cli-codgen\n\nThis sbt plugin generates scala source artifacts. Sbt by default does not\ncache source generated artifacts. The manual recommends optimizing code\ngeneration. This plugin implements that pattern so you can \nmore easily generate artifacts with sbt caching.\n\n## Usage\n\nGenerate scala source artifacts more easily than writing your\nown tasks. While it is easy to generate your own scala sources\nif you read sbt manual on this topic, once you want to start\ntracking input and output files so that the build is optimized\na bit more than running the generator on every compile, you encounter\na little bit of boilerplate.\n\nThis plugin removes that boilerplate for simple cases but does\nrequire you to be specific about your inputs and outputs so that\nthey can be manager by sbt.\n\nsbt uses the `\u003cproject dir\u003e/target/scala-\u003cscala version\u003e/src_managed/main`\ndirectory by default for managed sources that you generate. To make\nthe plugin easier to configure, you should arrange for cli to \nplace its outputs into that location.\n\nTo use, add the following:\n\n```scala\n// plugins.sbt\nresolvers += Resolver.bintrayIvyRepo(\"aappddeevv\", \"sbt-plugins\")\n\naddSbtPlugin(\"ttg\" % \"sbt-cli-codegen\" % \"\u003clatest version here\u003e\")\n```\n\nThen in your build.sbt:\n\n```scala\n// build.sbt\n\n// you must be a bit more specific since it uses a more general plugin\nval cli_command = (input_files: Seq[String]) =\u003e\n   (Seq(\"awesome-cli\", \"--param\", \"1\", \n           \"--output\", \"mysubproject/target/scala-2.13/src_managed/main/cli_codgen/awesome.scala\"),\n    Seq(\"awesome.scala\"))\n\nlazy val subproject = project.in(file(\"subproject\"))\n  .enablePlugin(CLICodegenPlugin)\n  .setting(\n        codegenCommand := cli_command,\n  \tcodegenInputSources := Seq(sourceDirectory.value.toGlob / \"mysubproject/src/main/awesome/*.awesome\")\n   )\n```\n\nThere are some other ways to specify input and output files so that sbt can manage the run\nprocess. Please check the source as the plugin is only 20-30 lines.\nYou can also dynamically generate an output file that has the list of output files that\nwere generated into the src_managed directory and the plugin will ensures that they exist.\n\n## License\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)](https://raw.githubusercontent.com/aappddeevv/sbt-cli-codegen/master/LICENSE)\n\nMIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fsbt-cli-codegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faappddeevv%2Fsbt-cli-codegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faappddeevv%2Fsbt-cli-codegen/lists"}