{"id":14959685,"url":"https://github.com/unity-technologies/conditionalcompilationutility","last_synced_at":"2025-08-22T11:04:05.000Z","repository":{"id":66531543,"uuid":"116886468","full_name":"Unity-Technologies/ConditionalCompilationUtility","owner":"Unity-Technologies","description":"Automatically add defines upon the detection of predicate classes","archived":false,"fork":false,"pushed_at":"2023-02-08T22:48:34.000Z","size":10,"stargazers_count":125,"open_issues_count":4,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-05T05:33:31.850Z","etag":null,"topics":["unity","unity-editor"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Unity-Technologies.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":"2018-01-10T00:21:20.000Z","updated_at":"2025-02-18T02:43:41.000Z","dependencies_parsed_at":"2023-03-17T22:00:32.110Z","dependency_job_id":null,"html_url":"https://github.com/Unity-Technologies/ConditionalCompilationUtility","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.11111111111111116","last_synced_commit":"f364090bbda3728e1662074c969c2b7c3c34199b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Unity-Technologies/ConditionalCompilationUtility","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unity-Technologies%2FConditionalCompilationUtility","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unity-Technologies%2FConditionalCompilationUtility/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unity-Technologies%2FConditionalCompilationUtility/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unity-Technologies%2FConditionalCompilationUtility/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Unity-Technologies","download_url":"https://codeload.github.com/Unity-Technologies/ConditionalCompilationUtility/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unity-Technologies%2FConditionalCompilationUtility/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271628166,"owners_count":24792821,"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-08-22T02:00:08.480Z","response_time":65,"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":["unity","unity-editor"],"created_at":"2024-09-24T13:20:35.946Z","updated_at":"2025-08-22T11:04:04.543Z","avatar_url":"https://github.com/Unity-Technologies.png","language":"C#","readme":"# ConditionalCompilationUtility\nThe Conditional Compilation Utility (CCU) will add defines to the build settings once dependendent classes have been detected. \nA goal of the CCU was to not require the CCU itself for other libraries to specify optional dependencies. So, it relies on \nthe specification of at least one custom attribute in a project that makes use of it. Here is an example:\n\n```\n[Conditional(UNITY_CCU)]                                    // | This is necessary for CCU to pick up the right attributes\npublic class OptionalDependencyAttribute : Attribute        // | Must derive from System.Attribute\n{\n    public string dependentClass;                           // | Required field specifying the fully qualified dependent class\n    public string define;                                   // | Required field specifying the define to add\n}\n```\n\nThen, simply specify the assembly attribute(s) you created in any of your C# files:\n```\n[assembly: OptionalDependency(\"UnityEngine.InputNew.InputSystem\", \"USE_NEW_INPUT\")]\n[assembly: OptionalDependency(\"Valve.VR.IVRSystem\", \"ENABLE_STEAMVR_INPUT\")]\n\nnamespace Foo\n{\n...\n}\n```\n\nThis allows a separate project on GitHub, for example, to define optional dependencies independently. And if CCU is present, then \nthe defines will automatically be added upon detection of dependent classes. If the CCU is not present, then the project would \nstill work, but may require the developer to add defines manually.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funity-technologies%2Fconditionalcompilationutility","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funity-technologies%2Fconditionalcompilationutility","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funity-technologies%2Fconditionalcompilationutility/lists"}