Thread overview
Release RDUB v1
Apr 27, 2017
JamesD
Apr 27, 2017
Mike Parker
Apr 27, 2017
JamesD
April 27, 2017
RDUB is a front end for DUB, a D language build tool. It's designed to build a single source file specified on the command line, without having to edit the dub files: dub.json, dub.sdl, src/app.d, source/app.d

https://github.com/jasc2v8/rdub

https://code.dlang.org/packages/rdub

This tool is great for running examples and building/testing small projects! It's used in my other projects, dlang-beginners and dwtlib.

$ rdmd rdub -h

rdub is a front end for DUB - a D language build tool

    rdub                 = run dub with defaults \src or \source\app.d

    rdub C:\path\foo.d   = run dub as follows:

    1. Copy C:\path\foo.d to src\foo.d
    2. Ask before deleting all other files in \src - avoids more than 1 main().
    2. Run dub to build and run src\app.d
    3. Pass all args to dub, except: -h or --help

    Requires: dub.json or dub.sdl must have name "exename" and targetType "executable"

Console Example

$ cd examples

examples-$ rdmd rdub -y console\hello

Performing "debug" build using dmd for x86.
example ~master: building configuration "application"...
Linking...
Running .\example.exe
Hello World.

April 27, 2017
On Thursday, 27 April 2017 at 02:59:16 UTC, JamesD wrote:
> RDUB is a front end for DUB, a D language build tool. It's designed to build a single source file specified on the command line, without having to edit the dub files: dub.json, dub.sdl, src/app.d, source/app.d
>

What advantage does this have over `dub --single`?
April 27, 2017
On Thursday, 27 April 2017 at 03:12:19 UTC, Mike Parker wrote:
> On Thursday, 27 April 2017 at 02:59:16 UTC, JamesD wrote:
>> RDUB is a front end for DUB, a D language build tool. It's designed to build a single source file specified on the command line, without having to edit the dub files: dub.json, dub.sdl, src/app.d, source/app.d
>>
>
> What advantage does this have over `dub --single`?

Great question, Mike!

The advantage is that rdub does not require a recipe comment in the source file.
Many projects have standalone examples, few with recipe comments.
With rdub, you just enter the command and it runs, no need to edit the source or dub.sdl

I'm still learning D, so if there is a different way to use --single, please let me know!

Ref: https://code.dlang.org/getting_started

From what I can tell, the --single requires a recipe comment in the source file:
/+ dub.sdl:
	name "hello"
+/

Here is what I get without the recipe comment in the source file:
  dub --version
  DUB version 1.2.0, built on Jan 22 2017
  dub run --single hello.d
  The source file must start with a recipe comment.