mirror of https://github.com/buggins/dlangide.git
new DUB version package location support - close #91
This commit is contained in:
parent
3645c29fb6
commit
28b699e824
|
@ -91,6 +91,14 @@ class Builder : BackgroundOperationWatcher {
|
|||
} else if (_buildOp == BuildOperation.Upgrade) {
|
||||
params ~= "upgrade".dup;
|
||||
params ~= "--force-remove".dup;
|
||||
import std.path;
|
||||
import std.file;
|
||||
string projectFile = project.filename;
|
||||
string selectionsFile = projectFile.stripExtension ~ ".selections.json";
|
||||
if (selectionsFile.exists && selectionsFile.isFile) {
|
||||
Log.i("Removing file ", selectionsFile);
|
||||
remove(selectionsFile);
|
||||
}
|
||||
}
|
||||
|
||||
if (_buildOp != BuildOperation.Clean && _buildOp != BuildOperation.Upgrade) {
|
||||
|
|
|
@ -1246,6 +1246,10 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
|
|||
}
|
||||
}
|
||||
|
||||
void refreshProject(Project project) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void buildProject(BuildOperation buildOp, Project project, BuildResultListener listener = null) {
|
||||
if (!currentWorkspace) {
|
||||
_logPanel.logLine("No workspace is opened");
|
||||
|
@ -1257,6 +1261,16 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
|
|||
_logPanel.logLine("No project is opened");
|
||||
return;
|
||||
}
|
||||
if (!listener) {
|
||||
if (buildOp == BuildOperation.Upgrade || buildOp == BuildOperation.Build || buildOp == BuildOperation.Rebuild) {
|
||||
listener = delegate(int result) {
|
||||
if (!result) {
|
||||
// success: update workspace
|
||||
refreshProject(project);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
ProjectSettings projectSettings = project.settings;
|
||||
string toolchain = projectSettings.getToolchain(_settings);
|
||||
string arch = projectSettings.getArch(_settings);
|
||||
|
|
|
@ -704,6 +704,13 @@ class DubPackageFinder {
|
|||
fn = buildNormalizedPath(pathName, "package.json");
|
||||
if (fn.exists && fn.isFile)
|
||||
return fn;
|
||||
// new DUB support - with package subdirectory
|
||||
fn = buildNormalizedPath(pathName, packageName, "dub.json");
|
||||
if (fn.exists && fn.isFile)
|
||||
return fn;
|
||||
fn = buildNormalizedPath(pathName, packageName, "package.json");
|
||||
if (fn.exists && fn.isFile)
|
||||
return fn;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue