support targetPath parameter in dub.json; use project dir if not specified; close #173

This commit is contained in:
Vadim Lopatin 2016-10-13 09:46:58 +03:00
parent b1ece5d64f
commit 7a8b03109c
2 changed files with 7 additions and 3 deletions

View File

@ -12,7 +12,7 @@
"stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"],
"dependencies": {
"dlangui": "==0.9.16",
"dlangui": "==0.9.18",
"dcd": "~>0.9.0-alpha4"
},

View File

@ -488,8 +488,12 @@ class Project : WorkspaceItem {
version (Windows) {
exename = exename ~ ".exe";
}
// TODO: use targetPath
string exePath = buildNormalizedPath(_filename.dirName, "bin", exename);
string targetPath = _projectFile.getString("targetPath", null);
string exePath;
if (targetPath.length)
exePath = buildNormalizedPath(_filename.dirName, targetPath, exename); // int $targetPath directory
else
exePath = buildNormalizedPath(_filename.dirName, exename); // in project directory
return exePath;
}