Skip to content

Commit

Permalink
Merge pull request #1089 from TurkeyMan/translate_imp_paths
Browse files Browse the repository at this point in the history
Import paths weren't translated properly
  • Loading branch information
TurkeyMan authored May 19, 2018
2 parents 4e14522 + 8dac762 commit bfcf22b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions modules/d/_preload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@
api.register {
name = "importdirs",
scope = "config",
kind = "list:string",
kind = "list:path",
tokens = true,
}

api.register {
name = "stringimportdirs",
scope = "config",
kind = "list:string",
kind = "list:path",
tokens = true,
}

Expand Down Expand Up @@ -173,14 +173,14 @@
api.register {
name = "dependenciesfile",
scope = "config",
kind = "string",
kind = "path",
tokens = true,
}

api.register {
name = "jsonfile",
scope = "config",
kind = "string",
kind = "path",
tokens = true,
}

Expand Down
12 changes: 8 additions & 4 deletions modules/d/actions/vcxproj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,20 @@

function m.dImportPaths(cfg, condition)
if cfg.importdirs and #cfg.importdirs > 0 then
local importdirs = table.concat(cfg.importdirs, ";") .. ";%%(ImportPaths)"
vc2010.element("ImportPaths", condition, importdirs)
local dirs = vstudio.path(cfg, cfg.importdirs)
if #dirs > 0 then
vc2010.element("ImportPaths", condition, "%s;%%(ImportPaths)", table.concat(dirs, ";"))
end
end
end


function m.dStringImportPaths(cfg, condition)
if cfg.stringimportdirs and #cfg.stringimportdirs > 0 then
local stringimportdirs = table.concat(cfg.stringimportdirs, ";") .. ";%%(StringImportPaths)"
vc2010.element("StringImportPaths", condition, stringimportdirs)
local dirs = vstudio.path(cfg, cfg.stringimportdirs)
if #dirs > 0 then
vc2010.element("StringImportPaths", condition, "%s;%%(StringImportPaths)", table.concat(dirs, ";"))
end
end
end

Expand Down
6 changes: 5 additions & 1 deletion modules/d/actions/visuald.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@
m.visuald.element(2, "otherDMD", '0')
m.visuald.element(2, "program", '$(DMDInstallDir)windows\\bin\\dmd.exe')

m.visuald.element(2, "imppath", cfg.includedirs)
local impdirs
if #cfg.importdirs > 0 then
impdirs = vstudio.path(cfg, cfg.importdirs)
end
m.visuald.element(2, "imppath", impdirs)

m.visuald.element(2, "fileImppath")
m.visuald.element(2, "outdir", path.translate(project.getrelative(cfg.project, cfg.buildtarget.directory)))
Expand Down

0 comments on commit bfcf22b

Please sign in to comment.