{"id":13628778,"url":"https://github.com/pekspro/BuildInformationGenerator","last_synced_at":"2025-04-17T04:32:24.717Z","repository":{"id":245001494,"uuid":"816961470","full_name":"pekspro/BuildInformationGenerator","owner":"pekspro","description":"Simplifies the process of adding build information to your .NET projects, build time, commit ID, branch etc with a source generator","archived":false,"fork":false,"pushed_at":"2024-07-27T19:18:15.000Z","size":85,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T10:36:26.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/pekspro.png","metadata":{"files":{"readme":"README-NuGet.md","changelog":"CHANGELOG.md","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":"2024-06-18T18:24:43.000Z","updated_at":"2025-03-22T05:21:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"07cdd4e0-cec1-475c-be3b-3b8eb37f3c3a","html_url":"https://github.com/pekspro/BuildInformationGenerator","commit_stats":null,"previous_names":["pekspro/buildinformationgenerator"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pekspro%2FBuildInformationGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pekspro%2FBuildInformationGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pekspro%2FBuildInformationGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pekspro%2FBuildInformationGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pekspro","download_url":"https://codeload.github.com/pekspro/BuildInformationGenerator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249315988,"owners_count":21249868,"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-08-01T22:00:57.403Z","updated_at":"2025-04-17T04:32:19.706Z","avatar_url":"https://github.com/pekspro.png","language":"C#","readme":"This project simplifies the process of adding build information to your .NET projects. It uses a source generator to embed details like build time, commit ID and branch directly into your code.\n\nBy default, the values are faked in debug mode. This can be changed in the `[BuildInformation]` attribute with the `FakeIfDebug` property.\n\n## Usage\n\nCreate a new partial class in your project and add the `[BuildInformation]` (from the `Pekspro.BuildInformationGenerator` namespace) attribute and define which information you want. For example:\n\n```csharp\n[BuildInformation(AddBuildTime = true, AddGitCommitId = true)]\npartial class MyBuildInformation\n{\n\n}\n```\n\nConstants will automatically be added to this class that you can use like this:\n\n```csharp\nConsole.WriteLine($\"Build time: {MyBuildInformation.BuildTime}\");\nConsole.WriteLine($\"Commit id: {MyBuildInformation.Git.CommitId}\");\n```\n\n## Installation\n\nAdd the package to your application with:\n\n```bash\ndotnet add package Pekspro.BuildInformationGenerator\n```\n\nThis adds a `\u003cPackageReference\u003e` to your project. It's recommended that you also add the attributes `PrivateAssets` and `ExcludeAssets` like below to exclude the source generator to your final assembly:\n\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n\n  \u003cPropertyGroup\u003e\n    \u003cOutputType\u003eExe\u003c/OutputType\u003e\n    \u003cTargetFramework\u003enet8.0\u003c/TargetFramework\u003e\n  \u003c/PropertyGroup\u003e\n\n  \u003cItemGroup\u003e\n      \u003cPackageReference Include=\"Pekspro.BuildInformationGenerator\" Version=\"0.2.0\" \n        PrivateAssets=\"all\" ExcludeAssets=\"runtime\" /\u003e\n  \u003c/ItemGroup\u003e\n\n\u003c/Project\u003e\n```\n\nSetting `PrivateAssets=\"all\"` means any projects referencing this one won't get a reference to the _Pekspro.BuildInformationGenerator_ package.\n\nSetting `ExcludeAssets=\"runtime\"` ensures the _Pekspro.BuildInformationGenerator.Attributes.dll_ file is not copied to your build output (it is not required at runtime).\n\n## Links\n\nYou can find more information and can report issues on [GitHub](https://github.com/pekspro/BuildInformationGenerator).\n","funding_links":[],"categories":["Source Generators","Content"],"sub_categories":["Other","149. [Pekspro.BuildInformationGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Pekspro.BuildInformationGenerator) , in the [EnhancementProject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) category"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpekspro%2FBuildInformationGenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpekspro%2FBuildInformationGenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpekspro%2FBuildInformationGenerator/lists"}