diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c5c6af..14e3ee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ### Features and improvements ### + - Dependencies can now be specified per-configuration in addition to globally + - Version numbers are now handled according to [SemVer](http://semver.org/) - Library packages are now only built when running "dub" instead of trying to execute them - partially [pull #66][issue66] by Vadim Lopatin and [issue #53][issue53] - Add support for optional dependencies (picked up only if already installed) - [issue #5][issue5] - Compiles on DMD 2.063 @@ -29,6 +31,7 @@ - Fixed the linker workaround in the build script to work on non-Ubuntu systems - [issue #71][issue71] - Fixed handling of Windows UNC paths (by Lutger Blijdestijn) - [pull #75][issue75] - Fixed a possible infinite update loop - [issue #72][issue72] + - Fixed handling of multiple compiler/linker arguments with the same content (e.g. "--framework A --framework B" on OS X) [issue5]: https://github.com/rejectedsoftware/dub/issues/5 [issue53]: https://github.com/rejectedsoftware/dub/issues/53 diff --git a/examples/app/package.json b/examples/app/package.json new file mode 100644 index 0000000..7265230 --- /dev/null +++ b/examples/app/package.json @@ -0,0 +1,4 @@ +{ + "name": "app-example", + "description": "A simple D application" +} diff --git a/examples/app/source/app.d b/examples/app/source/app.d new file mode 100644 index 0000000..ba308f1 --- /dev/null +++ b/examples/app/source/app.d @@ -0,0 +1,6 @@ +import std.stdio; + +void main() +{ + writeln("Hello, World."); +} diff --git a/examples/header-lib/import/mylib.d b/examples/header-lib/import/mylib.d new file mode 100644 index 0000000..4536a0b --- /dev/null +++ b/examples/header-lib/import/mylib.d @@ -0,0 +1,3 @@ +module mylib; + +extern(C) void test(); diff --git a/examples/header-lib/package.json b/examples/header-lib/package.json new file mode 100644 index 0000000..b3e7dc2 --- /dev/null +++ b/examples/header-lib/package.json @@ -0,0 +1,6 @@ +{ + "name": "header-lib-example", + "description": "A simple D header library (C binding to libmylib.so)", + "targetType": "sourceLibrary", + "libs": "mylib" +} diff --git a/examples/lib-user/package.json b/examples/lib-user/package.json new file mode 100644 index 0000000..0f358eb --- /dev/null +++ b/examples/lib-user/package.json @@ -0,0 +1,7 @@ +{ + "name": "lib-user-example", + "description": "An application using a local library dependency", + "dependencies": { + "lib-example": {"version": "~master", "path": "../lib"} + } +} diff --git a/examples/lib-user/source/app.d b/examples/lib-user/source/app.d new file mode 100644 index 0000000..e2714a0 --- /dev/null +++ b/examples/lib-user/source/app.d @@ -0,0 +1,6 @@ +import lib; + +void main() +{ + test(); +} diff --git a/examples/lib/package.json b/examples/lib/package.json new file mode 100644 index 0000000..7fb63c3 --- /dev/null +++ b/examples/lib/package.json @@ -0,0 +1,5 @@ +{ + "name": "lib-example", + "description": "A simple D library", + "targetType": "library" +} diff --git a/examples/lib/source/lib.d b/examples/lib/source/lib.d new file mode 100644 index 0000000..345d027 --- /dev/null +++ b/examples/lib/source/lib.d @@ -0,0 +1,8 @@ +module lib; + +import std.stdio; + +void test() +{ + writeln("Hello, World."); +} diff --git a/examples/mixed/package.json b/examples/mixed/package.json new file mode 100644 index 0000000..234ffd1 --- /dev/null +++ b/examples/mixed/package.json @@ -0,0 +1,4 @@ +{ + "name": "mixed-example", + "description": "A package usable as both, an application and a library" +} diff --git a/examples/mixed/source/app.d b/examples/mixed/source/app.d new file mode 100644 index 0000000..c558c9e --- /dev/null +++ b/examples/mixed/source/app.d @@ -0,0 +1,8 @@ +module app; + +import lib; + +void main() +{ + test(); +} diff --git a/examples/mixed/source/lib.d b/examples/mixed/source/lib.d new file mode 100644 index 0000000..bb7e819 --- /dev/null +++ b/examples/mixed/source/lib.d @@ -0,0 +1,8 @@ +module lib; + +import std.stdio; + +void test() +{ + writeln("Hello, World!"); +} \ No newline at end of file diff --git a/examples/vibed-main/package.json b/examples/vibed-main/package.json new file mode 100644 index 0000000..5c1042b --- /dev/null +++ b/examples/vibed-main/package.json @@ -0,0 +1,8 @@ +{ + "name": "vibed-main-example", + "description": "A project using vibe.d and a custom main() function", + "dependencies": { + "vibe-d": "~master" + }, + "versions": ["VibeCustomMain"] +} diff --git a/examples/vibed-main/source/app.d b/examples/vibed-main/source/app.d new file mode 100644 index 0000000..30fd3e8 --- /dev/null +++ b/examples/vibed-main/source/app.d @@ -0,0 +1,13 @@ +import vibe.vibe; + +void main() +{ + listenHTTP(new HTTPServerSettings, &handleRequest); + lowerPrivileges(); + runEventLoop(); +} + +void handleRequest(HTTPServerRequest req, HTTPServerResponse res) +{ + res.writeBody("Hello, World!"); +} \ No newline at end of file diff --git a/examples/vibed/package.json b/examples/vibed/package.json new file mode 100644 index 0000000..befdb65 --- /dev/null +++ b/examples/vibed/package.json @@ -0,0 +1,7 @@ +{ + "name": "vibed-example", + "description": "A project using vibe.d", + "dependencies": { + "vibe-d": "~master" + } +} diff --git a/examples/vibed/source/app.d b/examples/vibed/source/app.d new file mode 100644 index 0000000..1a7d8de --- /dev/null +++ b/examples/vibed/source/app.d @@ -0,0 +1,11 @@ +import vibe.d; + +shared static this() +{ + listenHTTP(new HTTPServerSettings, &handleRequest); +} + +void handleRequest(HTTPServerRequest req, HTTPServerResponse res) +{ + res.writeBody("Hello, World!"); +} \ No newline at end of file diff --git a/source/dub/compilers/dmd.d b/source/dub/compilers/dmd.d index 9e20622..4d3916d 100644 --- a/source/dub/compilers/dmd.d +++ b/source/dub/compilers/dmd.d @@ -111,7 +111,7 @@ { import std.string; auto tpath = Path(settings.targetPath) ~ getTargetFileName(settings, platform); - auto args = ["dmd", "-of"~tpath.toNativeString()] ~ objects ~ settings.lflags.map!(l => "-L"~l)().array() ~ settings.sourceFiles; + auto args = [platform.compiler, "-of"~tpath.toNativeString()] ~ objects ~ settings.lflags.map!(l => "-L"~l)().array() ~ settings.sourceFiles; args ~= settings.dflags.filter!(f => f == "-g" || f == "-gc")().array(); logDebug("%s", args.join(" ")); auto res = spawnProcess(args).wait();