Skip to content

Commit 04943ab

Browse files
committed
Address next round of review comments
1 parent 9817874 commit 04943ab

File tree

4 files changed

+6
-63
lines changed

4 files changed

+6
-63
lines changed

src/base/oven.lua

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -899,62 +899,6 @@
899899
return cfg._cfgset.blocks
900900
end
901901

902-
local function buildAppliedPropertyTable(prj, cfg)
903-
local blocks = fetchConfigSetBlocks(cfg)
904-
905-
local properties = {}
906-
907-
local srcprj = cfg.project
908-
909-
for _, blk in ipairs(blocks) do
910-
if blk._isusage then
911-
for key, value in pairs(blk) do
912-
local field = p.field.get(key)
913-
if field then
914-
if field.paths then
915-
-- Translate the paths to be relative to the project's location
916-
-- Get the absolute path of the field values
917-
local absPaths = {}
918-
if type(value) == 'table' then
919-
for i, v in ipairs(value) do
920-
absPaths[i] = path.getabsolute(path.join(srcprj.location, v))
921-
end
922-
else
923-
absPaths = path.getabsolute(path.join(srcprj.location, value))
924-
end
925-
926-
-- Translate the absolute paths to be relative to the target project's location
927-
local relPaths = {}
928-
if type(absPaths) == 'table' then
929-
for i, v in ipairs(absPaths) do
930-
relPaths[i] = path.getrelative(prj.location, v)
931-
end
932-
else
933-
relPaths = path.getrelative(prj.location, absPaths)
934-
end
935-
936-
if type(relPaths) == 'table' then
937-
verbosef('Translated paths - %s = %s', key, table.concat(relPaths, ","))
938-
else
939-
verbosef('Translated paths - %s = %s', key, relPaths)
940-
end
941-
else
942-
properties[key] = p.field.store(field, properties[key], value)
943-
end
944-
end
945-
end
946-
end
947-
end
948-
949-
for key, value in pairs(properties) do
950-
if type(value) == 'table' then
951-
verbosef('%s = %s', key, table.concat(value, ","))
952-
else
953-
verbosef('%s = %s', key, value)
954-
end
955-
end
956-
end
957-
958902
local function fetchPropertiesToApply(src, tgt)
959903
local properties = {}
960904
local srcprj = src.project

src/base/project.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,8 @@
573573

574574

575575
function project.findusage(self, name)
576-
name = name:lower()
577-
578576
for _, usage in ipairs(self.usages or self.project.usages) do
579-
if name == usage.name:lower() then
577+
if name == usage.name then
580578
return usage
581579
end
582580
end

tests/oven/test_usages.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
-- Order is important here, as the test treats different order as a failure
8686
-- However, the order of the defines is not important in the actual implementation
87-
test.isequal({ "PROJECT_3", "PROJECT_1_PUBLIC", "PROJECT_1_INTERFACE", "PROJECT_2_PUBLIC", "PROJECT_2_INTERFACE" }, cfg.defines) -- Interface defines should not be included
87+
test.isequal({ "PROJECT_3", "PROJECT_1_PUBLIC", "PROJECT_1_INTERFACE", "PROJECT_2_PUBLIC", "PROJECT_2_INTERFACE" }, cfg.defines)
8888
end
8989

9090
---
@@ -102,7 +102,7 @@
102102

103103
-- Order is important here, as the test treats different order as a failure
104104
-- However, the order of the defines is not important in the actual implementation
105-
test.isequal({ "MY_CUSTOM_USAGE" }, cfg.defines) -- Interface defines should not be included
105+
test.isequal({ "MY_CUSTOM_USAGE" }, cfg.defines)
106106
end
107107

108108

website/docs/uses.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ Specifies which usage blocks a project should consume.
44
uses { "ProjectA" }
55
```
66

7-
The `uses` API is used to consume `usage` blocks from within a project.
7+
The `uses` API is used to consume `usage` blocks from within a project. The `usage` blocks are case sensitive.
88

99
### Usage resolve priority ###
1010

1111
1. `PUBLIC` and `INTERFACE` usage scopes within a project of the corresponding name.
1212
2. `usage` blocks with the corresponding name in any scopes.
1313

14-
Note: If there are duplicate usage blocks with the same resolved name, the selected usage block is unspecified. `usage` blocks should have unique names if they are not specified as `PUBLIC`, `PRIVATE`, or `INTERFACE`.
14+
Note: If there are duplicate usage blocks with the same resolved name, the selected usage block is unspecified. `usage` blocks should have unique names if they are not specified as `PUBLIC`, `PRIVATE`, or `INTERFACE`. If `links` or `linkoptions` are defined within a usage block, it is recommended that `linkgroups` is also turned on.
1515

1616
### Applies To ###
1717

1818
Projects and usage configurations.
1919

2020
### See Also ###
2121

22+
* [linkgroups](linkgroups.md)
2223
* [usage](usage.md)

0 commit comments

Comments
 (0)