https://github.com/nickclark2016/premake-scoped
Scoped configuration API for Premake 5
https://github.com/nickclark2016/premake-scoped
premake premake5
Last synced: 3 months ago
JSON representation
Scoped configuration API for Premake 5
- Host: GitHub
- URL: https://github.com/nickclark2016/premake-scoped
- Owner: nickclark2016
- License: mit
- Created: 2024-11-29T19:52:08.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-04T14:16:13.000Z (4 months ago)
- Last Synced: 2025-03-04T15:25:49.915Z (4 months ago)
- Topics: premake, premake5
- Language: Lua
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Premake Scoped
Provides function-scoped utilities for Premake 5, rather than relying on the implicit scoping mechanisms.
### Installation
Clone the repository somewhere along the Premake search paths ([See Here](https://premake.github.io/docs/Locating-Scripts)). In your top level build file, add:```lua
scoped = require('premake-scoped')
```### API and Usage
This library provides direct replacements for the premake `workspace`, `project`, `usage`, `group`, and `filter` APIs.```lua
scoped.workspace('My Workspace', function(wks)
scoped.group('My Group', function()
scoped.group('My Subgroup', function()
scoped.project('My Project', function(prj)
scoped.filter({ 'configuration:Debug' }, function()
end)scoped.usage('MyUsage', function(usg)
end)
end)
end)
end)
end)
```When each function is exited, the scope is reset to no longer apply to that function. This eliminates the need to perform things like `filter {}` or `workspace "*"` to reset your scope. In addition, this allows the ability to define groups inside of groups implicitly, rather than explicitly needing to add `"/"` to create subgroups.