www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12629] New: Adjust search path according to module name


          Issue ID: 12629
           Summary: Adjust search path according to module name
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

Consider a project with the following structure:

    module a.b.foo;

    module a.b.bar;
    import a.b.foo;

If you run:
    ~ $ cd a/b
    ~/a/b $ dmd bar.d

DMD will fail to compile, because it will not look for "a/b/foo.d" from the
project root.

I propose the following enhancement:

Implicitly add the package root, according to the module declaration, to the
search path.

For example, if the file contains the line "module a.b.foo;", add "../.." to
the search path.

This will allow to compile modules or run D programs located in packages by
simply associating .d files with the compiler, with no further configuration.

Apr 23 2014