File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 9090
9191 -- now we can post process the projects for 'uses' entries and apply the
9292 -- corresponding 'usage' block to the project.
93- oven .bakeUsages ()
93+ oven .applyUsages ()
9494 end
9595
9696---
894894-- Post-process the projects for 'uses' entries and apply the corresponding
895895-- 'usage' block to the project.
896896--
897- function oven .bakeUsages ()
897+ function oven .applyUsages ()
898898 local function fetchConfigSetBlocks (cfg )
899899 return cfg ._cfgset .blocks
900900 end
981981 local uses = {}
982982
983983 for _ , use in ipairs (cfg .uses or {}) do
984+ if p .usage .isSpecialName (use ) then
985+ -- Explicitly providing special names is not allowed
986+ p .error (" Special names are not allowed in 'uses' list. Found '%s' requested in project '%s'" , use , cfg .project .name )
987+ end
988+
984989 -- Find a usage block that matches the usage name
985990 local namematch = p .usage .findglobal (use )
986991 for i = 1 , # namematch do
Original file line number Diff line number Diff line change 3333 end
3434
3535
36+ ---
37+ -- Checks if a usage name is a magic name (PUBLIC, PRIVATE, INTERFACE)
38+ --
39+ -- @param name
40+ -- The name of the usage.
41+ -- @return
42+ -- True if the usage is a special usage.
43+ ---
44+
45+ function usage .isSpecialName (name )
46+ return name == usage .PUBLIC or name == usage .PRIVATE or name == usage .INTERFACE
47+ end
48+
49+
3650---
3751-- Check if the usage has a magic name (PUBLIC, PRIVATE, INTERFACE)
3852--
4155-- @return
4256-- True if the usage is a special usage.
4357 function usage .isSpecial (self )
44- return self . name == usage .PUBLIC or self .name == usage . PRIVATE or self . name == usage . INTERFACE
58+ return usage .isSpecialName ( self .name )
4559 end
4660
4761
You can’t perform that action at this time.
0 commit comments