diff --git a/source/app.d b/source/app.d index 40c581d..f4ec8c5 100644 --- a/source/app.d +++ b/source/app.d @@ -179,6 +179,7 @@ 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"); @@ -187,10 +188,12 @@ } 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"); } } @@ -206,7 +209,7 @@ 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; @@ -249,7 +252,8 @@ 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' diff --git a/source/dub/dub.d b/source/dub/dub.d index 2b7f8f3..350f777 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -667,6 +667,7 @@ 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 diff --git a/source/dub/package_.d b/source/dub/package_.d index 344fe86..cd50563 100644 --- a/source/dub/package_.d +++ b/source/dub/package_.d @@ -26,6 +26,7 @@ string[] dflags; string[] lflags; string[] libs; + string[] files; string[] versions; string[] importPath; string[] stringImportPath; @@ -35,6 +36,7 @@ addDFlags(getPlatformField(root, "dflags", platform)); addLFlags(getPlatformField(root, "lflags", platform)); addLibs(getPlatformField(root, "libs", platform)); + addFiles(getPlatformField(root, "files", platform)); addVersions(getPlatformField(root, "versions", platform)); addImportDirs(getPlatformField(root, "importPath", platform)); addStringImportDirs(getPlatformField(root, "stringImportPath", platform)); @@ -43,6 +45,7 @@ void addDFlags(string[] value) { add(dflags, value); } void addLFlags(string[] value) { add(lflags, value); } void addLibs(string[] value) { add(libs, value); } + void addFiles(string[] value) { add(files, value); } void addVersions(string[] value) { add(versions, value); } void addImportDirs(string[] value) { add(importPath, value); } void addStringImportDirs(string[] value) { add(stringImportPath, value); } @@ -76,6 +79,10 @@ foreach( j; json[name~"-"~p~"-"~a~"-"~c].opt!(Json[]) ) ret.put(j.get!string); } } + foreach( a; platform.architecture ){ + foreach( j; json[name~"-"~a].opt!(Json[]) ) ret.put(j.get!string); + foreach( j; json[name~"-"~a~"-"~c].opt!(Json[]) ) ret.put(j.get!string); + } return ret.data; } diff --git a/source/dub/registry.d b/source/dub/registry.d index 63454c7..5548382 100644 --- a/source/dub/registry.d +++ b/source/dub/registry.d Binary files differ