{"id":13496680,"url":"https://github.com/DimaRU/PackageBuildInfo","last_synced_at":"2025-03-28T19:30:47.827Z","repository":{"id":63908390,"uuid":"466515777","full_name":"DimaRU/PackageBuildInfo","owner":"DimaRU","description":" Automated Swift Package version and build numbering via Git. A Swift Package Manager build plugin.","archived":false,"fork":false,"pushed_at":"2024-11-14T12:56:49.000Z","size":42,"stargazers_count":21,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T21:04:23.692Z","etag":null,"topics":["git","manager","package","plugin","spm","swift","xcode-plugin"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/DimaRU.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}},"created_at":"2022-03-05T17:02:51.000Z","updated_at":"2025-03-15T02:44:00.000Z","dependencies_parsed_at":"2024-03-13T21:47:09.778Z","dependency_job_id":null,"html_url":"https://github.com/DimaRU/PackageBuildInfo","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"7fe63ad12b50bad5d86e6abaef5a944f931ce765"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaRU%2FPackageBuildInfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaRU%2FPackageBuildInfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaRU%2FPackageBuildInfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimaRU%2FPackageBuildInfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DimaRU","download_url":"https://codeload.github.com/DimaRU/PackageBuildInfo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246088379,"owners_count":20721675,"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":["git","manager","package","plugin","spm","swift","xcode-plugin"],"created_at":"2024-07-31T19:01:56.605Z","updated_at":"2025-03-28T19:30:47.572Z","avatar_url":"https://github.com/DimaRU.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"![swift-version](https://img.shields.io/badge/swift-5.6-brightgreen.svg?style=for-the-badge)\n![Mac OS](https://img.shields.io/badge/-platform-gray?style=for-the-badge)![Mac OS](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge\u0026logo=Apple\u0026logoColor=F0F0F0)![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge\u0026logo=linux\u0026logoColor=black)![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge\u0026logo=windows\u0026logoColor=white)\n[![License](https://img.shields.io/github/license/DimaRU/PackageBuildInfo.svg?style=for-the-badge)](LICENSE)\n\n# PackageBuildInfo\n\n#### Automated Swift Package version and build numbering via Git. A Swift Package Manager plugin.\n\nWouldn't it be great if your Swift Package-based projects just take their version and build number automatically from git? Well, now it can!\n\nUsing a new amazing feature - Swift Package Manager prebuild plugin, you can generate .swift file with current build info from git. It will never modify your local project.\n\n## Requirements\n\n* SwiftPM 5.6 or later.\n* git\n* bash\n\n## Usage\n\n* Add to package dependencies:\n\n```\n.package(url: \"https://github.com/DimaRU/PackageBuildInfo\", branch: \"master\")\n```\n\n* Add to target:\n\n```\nplugins: [\n    .plugin(name: \"PackageBuildInfoPlugin\", package: \"PackageBuildInfo\")\n]\n```\n\n## Sample project\n\nSample project here:\n[https://github.com/DimaRU/PackageBuildInfoExample](https://github.com/DimaRU/PackageBuildInfoExample)\n\n## Generated file example:\n\n```swift\n/////\n//// Package Build info\n///  Code generated by PackageBuildInfo. DO NOT EDIT.\n//\nimport Foundation\n\npublic struct PackageBuild {\n    public let isDirty: Bool       // Dirty build - git directory is't clean.\n    public let timeStamp: Date     // Time of last commit\n    public let timeZone: TimeZone  // Time Zone\n    public let count: Int          // Total commit count\n    public let tag: String?        // Tag, if exist\n    public let countSinceTag: Int  // Commit count since tag\n    public let branch: String?     // Git branch name\n    public let digest: [UInt8]     // Latest commit sha1 digest (20 bytes)\n\n    public var commit: String {\n        digest.reduce(\"\") { $0 + String(format: \"%02x\", $1) }\n    }\n    public static let info = PackageBuild(\n                              isDirty: false,\n                              timeStamp: Date(timeIntervalSince1970: 1728751843),\n                              timeZone: TimeZone(secondsFromGMT: 10800) ?? TimeZone.current,\n                              count: 10,\n                              tag: \"1.0.0\",\n                              countSinceTag: 6,\n                              branch: \"master\",\n                              digest: [0xa3, 0xf9, 0xa7, 0x1a, 0xab, 0x55, 0x20, 0x91, 0xc3, 0x7f, 0x32, 0x60, 0x11, 0x70, 0xa9, 0x97, 0xd9, 0xf5, 0x21, 0x91])\n}\n```\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDimaRU%2FPackageBuildInfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDimaRU%2FPackageBuildInfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDimaRU%2FPackageBuildInfo/lists"}