|
899 | 899 | return cfg._cfgset.blocks |
900 | 900 | end |
901 | 901 |
|
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 | | - |
958 | 902 | local function fetchPropertiesToApply(src, tgt) |
959 | 903 | local properties = {} |
960 | 904 | local srcprj = src.project |
|
0 commit comments