Various additions and fixes.
- Added build types "plain" and "docs"
 - Added a build field "files" for package.json
 - Fixed some possible causes for InvalidMemoryOperationErrors.
 - Build options can now be of the form "dflags-x86" and "dflags-x86-dmd"
1 parent 799ed9a commit 57d6d532fb205ec7ba58cca747adf50f7fa714a6
@Sönke Ludwig Sönke Ludwig authored on 12 Jan 2013
Showing 4 changed files
View
9
source/app.d
flags ~= settings.lflags.map!(f => "-L"~f)().array();
flags ~= settings.importPath.map!(f => "-I"~f)().array();
flags ~= settings.stringImportPath.map!(f => "-J"~f)().array();
flags ~= settings.versions.map!(f => "-version="~f)().array();
flags ~= settings.files;
flags ~= (mainsrc).toNativeString();
 
string dflags = environment.get("DFLAGS");
if( dflags ){
build_type = "$DFLAGS";
} else {
switch( build_type ){
default: throw new Exception("Unknown build configuration: "~build_type);
case "plain": dflags = ""; break;
case "debug": dflags = "-g -debug"; break;
case "release": dflags = "-release -O -inline"; break;
case "unittest": dflags = "-g -unittest"; break;
case "profile": dflags = "-g -O -inline -profile"; break;
case "docs": assert(false, "docgen not implemented");
}
}
 
if( build_config.length ) logInfo("Building configuration "~build_config~", build type "~build_type);
if( cmd == "run" ){
auto prg_pid = spawnProcess(run_exe_file, args[1 .. $]);
result = prg_pid.wait();
remove(run_exe_file);
enforce(result == 0, "Program exited with code "~to!string("result"));
enforce(result == 0, "Program exited with code "~to!string(result));
}
 
break;
case "upgrade":
upgrade Forces an upgrade of all dependencies
 
Options:
--build=NAME Specifies the type of build to perform. Valid names:
debug (default), release, unittest, profile, docgen
debug (default), release, unittest, profile, docs,
plain
--config=NAME Builds the specified configuration. Configurations can
be defined in package.json
--nodeps Do not check dependencies for 'run' or 'build'
--annotate Do not execute dependency installations, just print
View
1
■■■■
source/dub/dub.d
{
dst.addDFlags(processVars(project_path, settings.dflags));
dst.addLFlags(processVars(project_path, settings.lflags));
dst.addLibs(processVars(project_path, settings.libs));
dst.addFiles(processVars(project_path, settings.libs)); // TODO: resolve folders to a recursive search?
dst.addVersions(processVars(project_path, settings.versions));
dst.addImportDirs(processVars(project_path, settings.importPath)); // TODO: prepend project_path to relative paths here
dst.addStringImportDirs(processVars(project_path, settings.stringImportPath)); // TODO: prepend project_path to relative paths here
}
View
source/dub/package_.d
View
source/dub/registry.d