{"id":31144257,"url":"https://github.com/outfoxx/swiftpoet","last_synced_at":"2025-09-18T14:38:11.106Z","repository":{"id":37961511,"uuid":"137284784","full_name":"outfoxx/swiftpoet","owner":"outfoxx","description":"Kotlin and Java API for generating .swift source files.","archived":false,"fork":false,"pushed_at":"2024-02-21T11:24:29.000Z","size":6546,"stargazers_count":274,"open_issues_count":4,"forks_count":26,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-02T06:06:06.461Z","etag":null,"topics":["generator","javapoet","swift"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/outfoxx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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-06-14T00:09:54.000Z","updated_at":"2024-04-17T20:54:09.000Z","dependencies_parsed_at":"2023-11-06T11:25:58.770Z","dependency_job_id":"30ed0667-dd22-461c-9637-9e5c201ad590","html_url":"https://github.com/outfoxx/swiftpoet","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/outfoxx/swiftpoet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outfoxx%2Fswiftpoet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outfoxx%2Fswiftpoet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outfoxx%2Fswiftpoet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outfoxx%2Fswiftpoet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outfoxx","download_url":"https://codeload.github.com/outfoxx/swiftpoet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outfoxx%2Fswiftpoet/sbom","scorecard":{"id":714897,"data":{"date":"2025-08-11","repo":{"name":"github.com/outfoxx/swiftpoet","commit":"81b8aa79fcf87b53bbe6e3376669af1dc5e86c7d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":8,"reason":"Found 14/16 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: topLevel 'contents' permission set to 'write': .github/workflows/publish-release.yml:8","Warn: topLevel 'contents' permission set to 'write': .github/workflows/publish-snapshot.yml:8","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-release.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-release.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-release.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-release.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-release.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-snapshot.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-snapshot.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-snapshot.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-snapshot.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-snapshot.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-snapshot.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-snapshot.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-snapshot.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-snapshot.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/outfoxx/swiftpoet/publish-snapshot.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   8 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.6.6 not signed: https://api.github.com/repos/outfoxx/swiftpoet/releases/182519361","Warn: release artifact 1.6.5 not signed: https://api.github.com/repos/outfoxx/swiftpoet/releases/142949048","Warn: release artifact 1.6.4 not signed: https://api.github.com/repos/outfoxx/swiftpoet/releases/137254845","Warn: release artifact 1.6.3 not signed: https://api.github.com/repos/outfoxx/swiftpoet/releases/134593129","Warn: release artifact 1.6.2 not signed: https://api.github.com/repos/outfoxx/swiftpoet/releases/134513708","Warn: release artifact 1.6.6 does not have provenance: https://api.github.com/repos/outfoxx/swiftpoet/releases/182519361","Warn: release artifact 1.6.5 does not have provenance: https://api.github.com/repos/outfoxx/swiftpoet/releases/142949048","Warn: release artifact 1.6.4 does not have provenance: https://api.github.com/repos/outfoxx/swiftpoet/releases/137254845","Warn: release artifact 1.6.3 does not have provenance: https://api.github.com/repos/outfoxx/swiftpoet/releases/134593129","Warn: release artifact 1.6.2 does not have provenance: https://api.github.com/repos/outfoxx/swiftpoet/releases/134513708"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":1,"reason":"branch protection is not maximal on development and all release branches","details":["Warn: branch protection not enabled for branch 'develop'","Warn: branch protection not enabled for branch '1.3.x'","Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'main'","Warn: 'stale review dismissal' is disabled on branch 'main'","Warn: required approving review count is 1 on branch 'main'","Warn: codeowners review is not required on branch 'main'","Warn: 'last push approval' is disabled on branch 'main'","Info: 'up-to-date branches' is required to merge on branch 'main'","Info: status check found to merge onto on branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T09:18:18.582Z","repository_id":37961511,"created_at":"2025-08-22T09:18:18.583Z","updated_at":"2025-08-22T09:18:18.583Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275781961,"owners_count":25527496,"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","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["generator","javapoet","swift"],"created_at":"2025-09-18T14:38:10.089Z","updated_at":"2025-09-18T14:38:11.089Z","avatar_url":"https://github.com/outfoxx.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nSwiftPoet\n==========\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/outfoxx/swiftpoet/ci.yml?branch=main)][action]\n[![Maven Central](https://img.shields.io/maven-central/v/io.outfoxx/swiftpoet.svg)][dl]\n[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/oss.sonatype.org/io.outfoxx/swiftpoet.svg)][snap]\n[![codebeat badge](https://codebeat.co/badges/b6f3870d-84b8-4149-9fbd-b328bfb0302b)](https://codebeat.co/projects/github-com-outfoxx-swiftpoet-develop)\n\n`SwiftPoet` is a Kotlin and Java API for generating `.swift` source files.\n\nSource file generation can be useful when doing things such as annotation processing or interacting\nwith metadata files (e.g., database schemas, protocol formats). By generating code, you eliminate\nthe need to write boilerplate while also keeping a single source of truth for the metadata.\n\n\n### Example\n\nHere's a `HelloWorld` file:\n\n```swift\nimport RxSwift\n\n\nclass Greeter {\n\n  private let name: String\n\n  init(name: String) {\n    self.name = name\n  }\n\n  func greet() -\u003e Observable\u003cString\u003e {\n    return Observable.from(\"Hello \\(name)\")\n  }\n\n}\n```\n\nAnd this is the code to generate it with SwiftPoet:\n\n```kotlin\nval observableTypeName = DeclaredTypeName.typeName(\"RxSwift.Observable\")\n\nval testClass = TypeSpec.classBuilder(\"Greeter\")\n   .addProperty(\"name\", STRING, Modifier.PRIVATE)\n   .addFunction(\n      FunctionSpec.constructorBuilder()\n         .addParameter(\"name\", STRING)\n         .addCode(\"self.name = name\\n\")\n         .build()\n   )\n   .addFunction(\n      FunctionSpec.builder(\"greet\")\n         .returns(observableTypeName.parameterizedBy(STRING))\n         .addCode(\"return %T.from(\\\"Hello \\\\(name)\\\")\\n\", observableTypeName)\n         .build()\n   )\n   .build()\n\nval file = FileSpec.builder(\"Greeter\")\n   .addType(testClass)\n   .build()\n\nval out = StringWriter()\nfile.writeTo(out)\n```\n\nThe [KDoc][kdoc] catalogs the complete SwiftPoet API, which is inspired by [JavaPoet][javapoet].\n\n\nDownload\n--------\n\nDownload [the latest .jar][dl] or depend via Maven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.outfoxx\u003c/groupId\u003e\n  \u003cartifactId\u003eswiftpoet\u003c/artifactId\u003e\n  \u003cversion\u003e1.6.6\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nor Gradle:\n\n```groovy\nimplementation 'io.outfoxx:swiftpoet:1.6.6'\n```\n\nSnapshots of the development version are available in [Sonatype's `snapshots` repository][snap].\n\n\nLicense\n-------\n\n    Copyright 2017 Outfox, Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n [action]: https://github.com/outfoxx/swiftpoet/actions?query=branch%3Adevelop\n [dl]: https://search.maven.org/remote_content?g=io.outfoxx\u0026a=swiftpoet\u0026v=LATEST\n [snap]: https://oss.sonatype.org/content/repositories/snapshots/io/outfoxx/swiftpoet/\n [kdoc]: https://outfoxx.github.io/swiftpoet/1.6.5/swiftpoet/io.outfoxx.swiftpoet/\n [javapoet]: https://github.com/square/javapoet/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutfoxx%2Fswiftpoet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutfoxx%2Fswiftpoet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutfoxx%2Fswiftpoet/lists"}